Public report of antiwork/gumroad, published 25 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). 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, 25 October 2026, 21:31 UTC · Survey ID cd_15e1a9d4eb3c4358aaf4384dad6da4e5

antiwork/gumroad

Measured 25 October 2026, 21:17 UTC, at code version d132525

No regression since the last survey Code coverage: not measured

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).

CAI score 41out of 100 At risk No change 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: 323,528 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 5.2 person-years · Weakest lens: Production Readiness, 32

Findings by how serious they are

351 critical 2014 serious 179 minor

8 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks 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

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
25 October 2026, 21:17 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 Watchdog. It is open to any tool that implements it, and today Watchdog is the only one that does.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. Watchdog works 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 ▸

94of 94 dimensions measured by tools.
2519of 2544 findings point to an exact file and line, so you can open each one in the code. The other 25 concern the repository as a whole, such as missing documentation.
94dimensions across 8 lenses, read from 323,528 lines of product code in 3 projects.
Chapters

Executive summary

antiwork/gumroad is rated At risk because critical security findings are open. Its score is held back in part because nine passwords or keys sit in the current code. It scores 41 out of 100, which the At risk rating leaves unchanged.

Production Readiness, at 32, is the weakest lens and counts most in the score. The best first steps are replacing the nine exposed passwords or keys and switching the old ones off and replacing the three packages under a banned licence, each worth about 8 points. Raising Production Readiness to 70 would lift the score to about 49.

Seventy-four pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Fifty weaknesses in the code could be used by an attacker, and thirty-nine known security holes in the packages the code depends on can be used by attackers. Pinning each tool to an exact version, fixing the weaknesses the scanner points to and updating the vulnerable packages would close these risks. Limiting each secret to its own step would fix the 21 secrets exposed to more of the pipeline than needed, and the 13 unsafe settings in infrastructure or container files need changing to safe values. The 40 pieces of business logic tied to the database or web code need separating from the database and web code.

The product code is 323,528 lines, about €750,000 to rebuild.

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

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 32 · counts for 45%Accessibility 43 · counts for 25%Domain Modelling 50 · counts for 14%Security and Compliance 52 · counts for 8%Code Health 59 · counts for 4%Architecture 62 · counts for 2%Maturity 62 · counts for 1%Performance 100 · counts for 1%

If Production Readiness rose from 32 to 70, the lowest score rated Strong, the score would rise from 41 to about 49.

Code composition: what the lines of code are
Product code 37%Tests 63%
New since the last survey: 212 findings

These 212 critical or serious findings weren't in the previous survey, on 11 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

Watchdog compares 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: 532 findings

These 532 critical or serious findings were in the previous survey, on 11 October 2026, and are gone from this one. The first 100 are listed here.

  • Cyclomatic Complexity · payment.reduceCheckoutState (cyclomatic 154) app/javascript/components/Checkout/payment.ts
  • Cyclomatic Complexity · CreatorHomePresenter.creator_home_props (cyclomatic 21) app/presenters/creator_home_presenter.rb
  • Cyclomatic Complexity · Subscription.record_indian_card_mandate_presentment! (cyclomatic 19) REDACTED
  • Cyclomatic Complexity · Mcp.handle_message (cyclomatic 19) app/services/muse/mcp.rb
  • Cyclomatic Complexity · CustomerMailer.abandoned_cart (cyclomatic 17) app/mailers/customer_mailer.rb
  • Cognitive Complexity · payment.reduceCheckoutState (cognitive 203) app/javascript/components/Checkout/payment.ts
  • Cognitive Complexity · Subscription.record_indian_card_mandate_presentment! (cognitive 19) REDACTED
  • Cognitive Complexity · CreatorHomePresenter.creator_home_props (cognitive 18) app/presenters/creator_home_presenter.rb
  • God Classes · FunctionTooLong: index.Checkout app/javascript/components/Checkout/index.tsx
  • God Classes · FunctionTooLong: index.CartItemComponent app/javascript/components/Checkout/index.tsx
  • God Classes · FunctionTooLong: ContactSupportModal.ContactSupportModal app/javascript/components/Support/ContactSupportModal.tsx
  • God Classes · FunctionTooLong: DateRangePicker.DateRangePicker app/javascript/components/DateRangePicker.tsx
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/models/credit.rb
  • Code Duplication · Duplicated block (121 lines × 2) .agents/skills/gumroad-prod-console/scripts/prod_runner_loop.rb
  • Code Duplication · Duplicated block (17 lines × 2) .agents/skills/gumroad-prod-console/scripts/redis_command_guard.rb
  • Cohesion (LCOM4) · Low cohesion: User (LCOM4 127) REDACTED
  • Cohesion (LCOM4) · Low cohesion: Link (LCOM4 118) app/models/link.rb
  • Cohesion (LCOM4) · Low cohesion: Purchase (LCOM4 99) app/models/purchase.rb
  • Churn × Complexity Hotspots · Hotspot: app/services/exports/purchase_export_service.rb app/services/exports/purchase_export_service.rb
  • Churn × Complexity Hotspots · Hotspot: app/business/payments/charging/implementations/paypal/paypal_charge_processor.rb app/business/payments/charging/implementations/paypal/paypal_charge_processor.rb
  • Churn × Complexity Hotspots · Hotspot: app/services/charge/create_service.rb app/services/charge/create_service.rb
  • Churn × Complexity Hotspots · Hotspot: app/presenters/creator_home_presenter.rb app/presenters/creator_home_presenter.rb
  • Churn × Complexity Hotspots · Hotspot: app/models/concerns/with_filtering.rb app/models/concerns/with_filtering.rb
  • Churn × Complexity Hotspots · Hotspot: app/javascript/components/Analytics/SalesChart.tsx app/javascript/components/Analytics/SalesChart.tsx
  • Churn × Complexity Hotspots · Hotspot: app/models/concerns/charge/refundable.rb app/models/concerns/charge/refundable.rb
  • Churn × Complexity Hotspots · Hotspot: app/controllers/purchases/invoices_controller.rb app/controllers/purchases/invoices_controller.rb
  • Churn × Complexity Hotspots · Hotspot: app/models/concerns/product/as_json.rb app/models/concerns/product/as_json.rb
  • Churn × Complexity Hotspots · Hotspot: app/sidekiq/generate_sales_report_job.rb app/sidekiq/generate_sales_report_job.rb
  • Churn × Complexity Hotspots · Hotspot: app/javascript/pages/Settings/Password/Show.tsx app/javascript/pages/Settings/Password/Show.tsx
  • Churn × Complexity Hotspots · Hotspot: app/javascript/data/google_analytics.ts app/javascript/data/google_analytics.ts
  • Churn × Complexity Hotspots · Hotspot: app/javascript/components/Profile/EditPage.tsx app/javascript/components/Profile/EditPage.tsx
  • Churn × Complexity Hotspots · Hotspot: app/sidekiq/create_us_states_sales_summary_report_job.rb app/sidekiq/create_us_states_sales_summary_report_job.rb
  • Churn × Complexity Hotspots · Hotspot: app/javascript/components/BundleEdit/Layout.tsx app/javascript/components/BundleEdit/Layout.tsx
  • Churn × Complexity Hotspots · Hotspot: app/javascript/components/ProductEdit/ProductTab/CoverEditor.tsx app/javascript/components/ProductEdit/ProductTab/CoverEditor.tsx
  • Churn × Complexity Hotspots · Hotspot: app/controllers/followers_controller.rb app/controllers/followers_controller.rb
  • Churn × Complexity Hotspots · Hotspot: app/javascript/components/ProductsPage/MembershipsTable.tsx app/javascript/components/ProductsPage/MembershipsTable.tsx
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · High: REDACTED REDACTED
  • Static Analysis (SAST) · Medium: REDACTED app/controllers/confirmations_controller.rb
  • Dependency Vulnerabilities · Critical CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · Medium CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · Medium CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · Medium CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · Medium vulnerability: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · Medium CVE: REDACTED REDACTED
  • IaC & Container Security · Medium IaC: REDACTED REDACTED
  • IaC & Container Security · Medium IaC: REDACTED REDACTED
  • IaC & Container Security · Medium IaC: REDACTED REDACTED
  • Change Coupling · Change coupling: REDACTED ↔ user_pages_controller.rb REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Code Duplication · Duplication concentrated across 27 sibling directories (71 clone groups) app/javascript/components/Download/RichContent.tsx
  • Code Duplication · Duplicated block (53 lines × 2 locations) app/javascript/pages/Settings/Payments/Show.tsx
  • Code Duplication · Duplicated block with local edits (33 matched lines × 2 locations) app/javascript/components/Product/Card.tsx
  • Code Duplication · Duplicated block with local edits (29 matched lines × 2 locations) app/javascript/components/CheckoutDashboard/PayPalConnectSection.tsx
  • Code Duplication · Duplicated block (27 lines × 2 locations) app/javascript/components/ProductEdit/ProductTab/DescriptionEditor.tsx
  • Code Duplication · Duplicated block (27 lines × 2 locations) app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx
  • Code Duplication · Duplicated block (24 lines × 2 locations) app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx
  • Code Duplication · Duplicated block (24 lines × 2 locations) app/javascript/data/upsells.ts
  • Code Duplication · Duplicated block (23 lines × 2 locations) app/javascript/data/order.ts
  • Code Duplication · Duplicated block with local edits (23 matched lines × 2 locations) app/javascript/pages/Logins/New.tsx
  • Code Duplication · Duplicated block (22 lines × 2 locations) app/javascript/components/Settings/PaymentsPage/LegalGuardianSection.tsx
  • Code Duplication · Duplicated block (22 lines × 2 locations) app/javascript/data/order.ts
  • Code Duplication · Duplicated block (22 lines × 2 locations) app/javascript/pages/Purchases/DisputeEvidence/Show.tsx
  • Code Duplication · Duplicated block with local edits (21 matched lines × 2 locations) app/javascript/components/ProductsPage/Collabs/ProductsTable.tsx
  • Code Duplication · Duplicated block (21 lines × 2 locations) app/javascript/data/discord_integration.ts
  • Code Duplication · Duplicated block (21 lines × 2 locations) app/javascript/data/payment_method_result.ts
  • Code Duplication · Duplicated block with local edits (20 matched lines × 2 locations) app/javascript/components/Audience/CustomerDetailPage.tsx
  • Code Duplication · Duplicated block (20 lines × 2 locations) app/javascript/components/BundleEdit/Layout.tsx
  • Code Duplication · Duplicated block with local edits (20 matched lines × 2 locations) app/javascript/components/Product/Covers/Embed.tsx
  • Code Duplication · Duplicated block (20 lines × 2 locations) app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx
  • Code Duplication · Duplicated block (19 lines × 6 locations) app/javascript/components/ApiDocumentation/Endpoints/CustomFields.tsx
  • Code Duplication · Duplicated block (19 lines × 2 locations) app/javascript/components/Checkout/CustomFields.tsx
  • Code Duplication · Duplicated block (19 lines × 2 locations) app/javascript/components/CheckoutDashboard/DiscountsPage.tsx
  • Code Duplication · Duplicated block (19 lines × 3 locations) app/javascript/components/ProductEdit/ProductTab/DurationsEditor.tsx
  • Code Duplication · Duplicated block (19 lines × 2 locations) app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx
  • Code Duplication · Duplicated block (19 lines × 10 locations) app/javascript/components/icons/getting-started/CustomizeProfileIcon.tsx
  • Code Duplication · Duplicated block (19 lines × 2 locations) app/javascript/data/charge.ts
  • Code Duplication · Duplicated block (18 lines × 2 locations) app/javascript/components/ApiDocumentation/Endpoints/Variants.tsx
  • Code Duplication · Duplicated block (18 lines × 2 locations) app/javascript/components/CheckoutDashboard/DiscountsPage.tsx
Rebuild cost: about €750,000 · Estimate
Cost to rebuild€250,000 to €1,300,000, for 4,164 to 13,209 hours of work, about 5.2 person-years for 3 to 10 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 41. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 323,528 lines of product code

How the estimate is made: Watchdog prices 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 9 Leaked secret finding(s) in Secret Scanning — start with REDACTED (4), REDACTED (2), REDACTED.
Raises the score by about 8 points · Low effort · Secret Scanning
2
Resolve the 3 Banned license finding(s) in License Compliance.
Raises the score by about 8 points · Low effort · License Compliance
3
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
Raises the score by about 5 points · Medium effort · DR & Backup

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €750,000 to build again, about 5.2 person-years of work. Its weakest lens is Production Readiness, at 32 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 9 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 8 points for low effort, because it clears the 9 Secret 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.3 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 10% on every change. The history of the code shows how much it changes: about 451,538 lines over the last 90 days, which is about 1,831,237 lines a year. At that pace, the extra work comes to an estimated 195.3 to 1171.7 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 Watchdog's 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; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

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

541 modules, with 220 dependencies between them. One loop runs through 12 of the modules, marked above the diagonal.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 BasePrice2 ConfirmedFollowerEvent3 Link4 app.javascript.pages.HelpCenter.Articles.Show5 app.javascript.parsers.checkout6 app.javascript.utils.request7 Charge8 CreatorAnalytics9 Order10 PageMeta11 Purchase12 Purchase.Searchable13 ReceiptPresenter14 Sellers15 app.javascript.components16 app.javascript.components.Checkout17 app.javascript.components.Product18 Product19 (global)20 Bundles21 AffiliateRequests22 Api.Internal23 Api.V224 Checkout25 Checkout.Upsells26 Integrations27 Muse28 Oauth29 Onetime30 Payouts31 Products32 Purchases33 Settings34 User35 app.javascript.components.WorkflowsPage36 app.javascript.data37 app.javascript.utils38 Api.Internal.Admin39 Api.V2.Workflows40 Settings.Team
1 BasePrice
2 ConfirmedFollowerEvent
3 Link
4 app.javascript.pages.HelpCenter.Articles.Show
5 app.javascript.parsers.checkout
6 app.javascript.utils.request
7 Charge4
8 CreatorAnalytics1
9 Order3
10 PageMeta1
11 Purchase3
12 Purchase.Searchable1
13 ReceiptPresenter311
14 Sellers2
15 app.javascript.components18
16 app.javascript.components.Checkout1
17 app.javascript.components.Product32
18 Product113
19 (global)31641821312420
20 Bundles11
21 AffiliateRequests11
22 Api.Internal13
23 Api.V23
24 Checkout312
25 Checkout.Upsells12
26 Integrations13
27 Muse1
28 Oauth19
29 Onetime12
30 Payouts22
31 Products88
32 Purchases23
33 Settings310
34 User216
35 app.javascript.components.WorkflowsPage1
36 app.javascript.data13
37 app.javascript.utils24
38 Api.Internal.Admin21
39 Api.V2.Workflows11
40 Settings.Team231
Uses a module listed above itPart of a loopThe module itself
1 BasePrice2 ConfirmedFollowerEvent3 Link4 app.javascript.pages.HelpCenter.Articles.Show5 app.javascript.parsers.checkout6 app.javascript.utils.request7 Charge8 CreatorAnalytics9 Order10 PageMeta11 Purchase12 Purchase.Searchable13 ReceiptPresenter14 Sellers15 app.javascript.components16 app.javascript.components.Checkout17 app.javascript.components.Product18 Product19 (global)20 Bundles21 AffiliateRequests22 Api.Internal23 Api.V224 Checkout25 Checkout.Upsells26 Integrations27 Muse28 Oauth29 Onetime30 Payouts31 Products32 Purchases33 Settings34 User35 app.javascript.components.WorkflowsPage36 app.javascript.data37 app.javascript.utils38 Api.Internal.Admin39 Api.V2.Workflows40 Settings.TeamBasePrice1ConfirmedFollowerEvent2Link3app.javascript.pages.HelpCenter.Articles.Show4app.javascript.parsers.checkout5app.javascript.utils.request6Charge7CreatorAnalytics8Order9PageMeta10Purchase11Purchase.Searchable12ReceiptPresenter13Sellers14app.javascript.components15app.javascript.components.Checkout16app.javascript.components.Product17Product18(global)19Bundles20AffiliateRequests21Api.Internal22Api.V223Checkout24Checkout.Upsells25Integrations26Muse27Oauth28Onetime29Payouts30Products31Purchases32Settings33User34app.javascript.components.WorkflowsPage35app.javascript.data36app.javascript.utils37Api.Internal.Admin38Api.V2.Workflows39Settings.Team40413131311218132113316418213124201111133312121311912228823310216113242111231+501 more modules (most-connected shown)

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

At a glance — Architecture · 62% · Adequate · gated by D26, R9 ·

At a glance — Maturity · 62% · Adequate · gated by M2 ·

At a glance — Readiness · 32% · Weak · gated by D13, R5, P3, P5, P7 ·

At a glance — Security · 52% · Adequate · gated by D29, D30, D31, D32, D36, C1 ·

At a glance — Domain Modelling · 50% · Adequate ·

At a glance — Accessibility · 43% · Weak · gated by AC1, AC4 ·

At a glance — Performance · 100% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection246High / Critical
A03:2025 — Software Supply Chain Failures73High / Critical
A02:2025 — Security Misconfiguration35High / Critical
A01:2025 — Broken Access Control14High / Critical
A07:2025 — Authentication Failures9High / Critical

Roadmap

Immediately resolve the nine leaked secrets and three banned license violations to secure the codebase and ensure compliance. Strengthen operational resilience by codifying backups and geo-recovery in infrastructure as code while documenting recovery procedures. Finally, update outdated dependencies to reduce technical debt and fix keyboard accessibility issues in custom controls to improve usability.

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

Do thisHelpsEffortDimension
Resolve the 9 Leaked secret finding(s) in Secret Scanning — start with REDACTED (4), REDACTED (2), REDACTED.+8.0 ptsLowSecret Scanning
Resolve the 3 Banned license finding(s) in License Compliance.+7.7 ptsLowLicense Compliance
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.+5.0 ptsMediumDR & Backup
Bump outdated dependencies to current versions to limit upgrade debt.+2.3 ptsMediumDependency Freshness
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+2.3 ptsMediumKeyboard semantics
Add a SAST step to CI running what this repository's stack ships: brakeman for Rails apps, otherwise `semgrep --config=auto` or CodeQL's ruby pack — so a security regression fails the build instead of landing.+2.0 ptsMediumSecurity & performance tooling
Set `open_timeout` and `read_timeout` explicitly on every client (Net::HTTP, Faraday `request: { timeout: }`, HTTParty `timeout:`), add Faraday's `:retry` middleware (faraday-retry) or `retriable`, and a breaker (`circuitbox`, `stoplight`) around dependencies that fail.+2.0 ptsMediumOutbound HTTP resilience
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.+1.9 ptsMediumText alternatives

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.0SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED0.3SlopData Compliance (PII/GDPR): High: REDACTED
REDACTED0.7SlopIaC & Container Security: Critical IaC: REDACTED
REDACTED2.0SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.2SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopIaC & Container Security: Critical IaC: REDACTED
REDACTED2.9SlopData Compliance (PII/GDPR): High: REDACTED
REDACTED2.9SlopSecret Scanning: Leaked secret: REDACTED
REDACTED3.1SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.3SlopSecret Scanning: Leaked secret: REDACTED
REDACTED3.3SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.6SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.6SlopStatic Analysis (SAST): High: REDACTED
app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb3.7SlopChange Coupling: Boundary-crossing change coupling: stripe_beneficial_owners_manager.rb ↔ update_user_compliance_info.rb
REDACTED3.7SlopIaC & Container Security: Critical IaC: REDACTED
REDACTED3.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED

How the grades work

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

Critical — 351

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

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

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

Could not be resolved — 8

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

Watchdog 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. 94 of 94 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three 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; ◐ Advisory — an LLM prose judgement. 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; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 94 dimensions across the health lenses
D1D2D3D4D5D6D9D10D12D13D14D15D16D17D19D20D26D29D30D31D32D34D35D36D37D43D44AC1AC2AC3AC4AC5AC6AC7AX10AX2AX3AX4AX6C1C2C3C4C5DM6GD1IC1M1M2M3M4P1P10P2P3P4P5P7P8PF3R1R10R11R2R3R4R5R6R7R8R9S1X1X12X13X14X15X16X17X18X19X2X21X22X23X24X25X26X27X28X29X3X30X5

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

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

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurement—◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a174ec-c711-7fcc-8aac-f927ee228cc3.

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

Run transparency — what happened this run

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

  • D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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,567 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 2,558 test source file(s) (.rb) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite 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 — Watchdog 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 reliability not included — the JavaScript/TypeScript suite (vitest via `npm ci --ignore-scripts` in the repository root (2969 tests)) did not finish re-running within its budget: too large to re-run within its budget.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares REDACTED, but the licence verdict published here was taken over its gem dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Go module (REDACTED/go.sum), but the licence verdict published here was taken over its gem dependencies. Nothing was read about its Go dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — Watchdog 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: it declares a published package (REDACTED), but 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 — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — Watchdog 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D28 Secrets (history) — not measured this run — Watchdog 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. `gitleaks` TIMED OUT after 105.9s against a 105.9s budget, so we killed its process tree. The budget is ours; the work may simply be larger than it allows. Nothing about this repository is asserted by the absence of a result; the budget is ours to raise, and raising it is our backlog item, not an action for this repository's owner.
  • D31 IaC & Container Security — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. Docker/web/Dockerfile.dockerignore carries no `FROM` instruction, so it declares no build stage and every REDACTED rule this engine owns — the runtime-hardening, key-material, mutable-clone, no-op-shim, build-context, trust-anchor, install-guard, setuid and world-writable-path rules — is outside its own premise there and returned nothing. That silence is deliberate and correct: with no base image there is no image to reason about. It is reported here because it is NOT the same fact as a clean file, and coverage is stated as 10 of 11 Infrastructure-as-Code manifest(s) fully judged rather than as 100%. The vendor scanners (trivy, checkov) do read these files and their findings above stand; only this engine's own stage-keyed rules are absent. No owner action: a build file with no FROM is a legitimate include fragment.
  • D32 Data Compliance (PII/GDPR) — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. `app/javascript/components/Audience/AudienceChart.tsx`, `app/javascript/components/Download/Interactions.tsx`, `app/javascript/components/ui/Alert.tsx`, `app/javascript/data/purchase/dispute_evidence_data.ts`, `app/javascript/types/epubjs-internals.d.ts`, … (+1 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.
  • AC1 Text alternatives — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 13 script file(s) building 54 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. app/javascript/pages/Subscriptions/Manage.tsx, app/javascript/pages/Settings/ThirdPartyAnalytics/Show.tsx, app/javascript/pages/Pages/Edit.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 906 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC2 Forms & labels — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 13 script file(s) building 54 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. app/javascript/pages/Subscriptions/Manage.tsx, app/javascript/pages/Settings/ThirdPartyAnalytics/Show.tsx, app/javascript/pages/Pages/Edit.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 906 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC2 Forms & labels — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 3 further occurrence(s) are not listed individually; the score already reflects all 43.
  • AC3 Page structure — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 13 script file(s) building 54 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. app/javascript/pages/Subscriptions/Manage.tsx, app/javascript/pages/Settings/ThirdPartyAnalytics/Show.tsx, app/javascript/pages/Pages/Edit.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 906 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC3 Page structure — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 52 further occurrence(s) are not listed individually; the score already reflects all 92.
  • AC4 Keyboard semantics — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 13 script file(s) building 54 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. app/javascript/pages/Subscriptions/Manage.tsx, app/javascript/pages/Settings/ThirdPartyAnalytics/Show.tsx, app/javascript/pages/Pages/Edit.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 906 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC5 ARIA correctness — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 13 script file(s) building 54 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. app/javascript/pages/Subscriptions/Manage.tsx, app/javascript/pages/Settings/ThirdPartyAnalytics/Show.tsx, app/javascript/pages/Pages/Edit.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 906 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AC6 Visual & motion safety — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS — 13 script file(s) building 54 markup element(s) as HTML strings, carrying 0 role/aria/tabindex attribute(s) (e.g. app/javascript/pages/Subscriptions/Manage.tsx, app/javascript/pages/Settings/ThirdPartyAnalytics/Show.tsx, app/javascript/pages/Pages/Edit.tsx) — that this run could NOT read, and the accessibility cards beside it were measured over the 906 parsed markup document(s) only. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates and DOM-assigned HTML strings in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, .astro/.templ/.pug/.jade/.haml/.slim, and the kotlinx.html/Compose HTML/kotlin-react, Giraffe/Falco/Fable.React/Feliz/Bolero and Jaspr builder DSLs; the runs counted here are the ones its producer could not take — an element whose TAG NAME is a concatenated expression has no statically knowable identity, and a string-built run inside a .jsx/.tsx file is already read as JSX — so they were not merely unparsed but unenumerated: not one of their elements entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
  • AXR1 Runtime accessibility — not measured this run — Watchdog 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. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — ------ REDACTED:1 -------------------- 1 | >>> FROM golang:1.26.2-bookworm AS build 2 | 3 | WORKDIR -------------------- ERROR: failed to solve: golang:1.26.2-bookworm: failed to resolve source metadata for docker.io/library/golang:1.26.2-bookworm: failed to do request: Head "https://registry-1.docker.io/v2/library/golang/manifests/1.26.2-bookworm": Forbidden; runtime evidence skipped.
  • DM6 Domain ↔ infrastructure boundary — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 23 further occurrence(s) are not listed individually; the score already reflects all 63.
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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). 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 — Watchdog measured this, but not all of it. What it 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. 304 further occurrence(s) are not listed individually; the score already reflects all 344.
  • R3 Large Files — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 30 further occurrence(s) are not listed individually; the score already reflects all 70.
  • X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 44 further occurrence(s) are not listed individually; the score already reflects all 84.

Repo exclusion declarations: 13 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does 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.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • 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 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • 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.
  • 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.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D32 Data Compliance (PII/GDPR): PII/GDPR signals are heuristic pattern matches in code — they flag likely handling concerns, not legal compliance, and cannot trace where data actually flows at runtime.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • 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.
  • C3 Audit Trail: This control is scored from in-repo evidence only — a working control configured outside the repository leaves no signal a static scan can credit.
  • C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
  • C5 Data-Subject Rights: This control is scored from in-repo evidence only — absence of evidence here means the scan found no in-repo trace, not that the control does not exist.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.

Dimensions

D1 · Cyclomatic Complexity5.2 / 10Adequate✓ Tool-verified

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

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

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

381 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was BankAccountSection.BankAccountSection at 218. A further 9 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 Country.payout_currency at 89 — they are counted neither in the figure above nor in this dimension's score. 7 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: app/models/country.rb (Country.payout_currency at 89), app/models/user_compliance_info_request.rb (UserComplianceInfoRequest.verification_error_message at 48), REDACTED (Searchable.build_search_property at 37), app/services/order/response_helpers.rb (ResponseHelpers.error_response at 20), app/sidekiq/create_canada_monthly_sales_report_job.rb (CreateCanadaMonthlySalesReportJob.perform at 18), and 2 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.

Show.PaymentsPage::validateBankAccountFields (cyclomatic 180) · ×2app/javascript/pages/Settings/Payments/Show.tsx:532
BankAccountSection.BankAccountSection (cyclomatic 218)app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx:773
AccountDetailsSection.AccountDetailsSection (cyclomatic 191)app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:50
index.Product (cyclomatic 159)REDACTED:297
payment.applyCheckoutAction (cyclomatic 154)app/javascript/components/Checkout/payment.ts:1492

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

What to do

  1. Bring the 8 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with BankAccountSection.BankAccountSection (cyclomatic 218), AccountDetailsSection.AccountDetailsSection (cyclomatic 191), Show.PaymentsPage::validateBankAccountFields (cyclomatic 180). — 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 8 together lifts Cyclomatic Complexity from 5.2 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

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

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

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

448 method(s) exceeded the cognitive complexity threshold of 15; the worst was BankAccountSection.BankAccountSection at 4622.

Show.PaymentsPage::validateBankAccountFields (cognitive 184) · ×2app/javascript/pages/Settings/Payments/Show.tsx:532
AgentChat.AgentChat::send (cognitive 35) · ×2app/javascript/components/Agent/AgentChat.tsx:724
BankAccountSection.BankAccountSection (cognitive 4622)app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx:773
AccountDetailsSection.AccountDetailsSection (cognitive 277)app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:50
EmailForm.EmailForm (cognitive 255)app/javascript/components/EmailsPage/EmailForm.tsx:221

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

What to do

  1. Bring the 3 bodies over 240 down to 240 or less in Cognitive Complexity — start with BankAccountSection.BankAccountSection (cognitive 4622), AccountDetailsSection.AccountDetailsSection (cognitive 277), EmailForm.EmailForm (cognitive 255). — 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 2.0 to about 4.9/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

266 god class(es) detected.

FunctionTooLong: AccountDetailsSection.AccountDetailsSection · ×138app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:50
FileTooLong: models/purchase.rb · ×64app/models/purchase.rb
TooManyMethods: Purchase · ×55app/models/purchase.rb:3
ClassTooLong: BankAccountSection · ×9app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx:1

What to do

  1. Resolve the 138 FunctionTooLong finding(s) in God Classes — start with REDACTED (14), REDACTED (13), REDACTED (8). — One of this dimension's main actionable groups (138 warning-level).
  2. Resolve the 64 FileTooLong finding(s) in God Classes — start with REDACTED (4), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (64 warning-level).
  3. Resolve the 55 TooManyMethods finding(s) in God Classes — start with REDACTED (2), purchase.rb, link.rb. — One of this dimension's main actionable groups (55 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.8 / 10Stronggated by 119 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

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

115 duplicated block group(s) detected. A further 4 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 7 of the 119 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. Measured on part of this repository only: .tsx (30% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Duplicated block (11 lines × 2) · ×12app/controllers/api/internal/agent_messages_controller.rb:61
Duplicated block (7 lines × 2) · ×10app/services/checkout/buyer_currency_quote.rb:347
Duplicated block (5 lines × 2) · ×10app/services/creator_analytics/churn/elasticsearch_fetcher.rb:34
Duplicated block (8 lines × 2) · ×8app/controllers/api/internal/admin/purchases_controller.rb:109
Duplicated block (6 lines × 2) · ×7app/controllers/checkout/discounts_controller.rb:72

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

What to do

  1. Resolve the 12 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with agent_messages_controller.rb, sales_controller.rb, REDACTED. — One of this dimension's main actionable groups (12 warning-level).
  2. Resolve the 10 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with post_resend_api_preview.rb (3), buyer_currency_quote.rb, 20190427212700_remove_unused_tables.rb. — One of this dimension's main actionable groups (10 warning-level).
  3. Resolve the 10 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with taxonomy_create.rb (2), elasticsearch_fetcher.rb, post_resend_api.rb. — One of this dimension's main actionable groups (10 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

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

3 production modules (npm+Go+RubyGems), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 2 of the 3 (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).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)8.2 / 10Strong✓ Tool-verified

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

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

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

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

72 of 470 classes have LCOM4 above 3.

Low cohesion: User (LCOM4 131) · ×72REDACTED:3

What to do

  1. Resolve the 72 Low cohesion finding(s) in Cohesion (LCOM4) — start with public_api_props.rb (2), REDACTED, link.rb. — One of this dimension's main actionable groups (72 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

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

2605 test methods: 2605 unit, 0 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 2567 `it`/`test` case(s) across 263 test file(s) declaring at least one; its tier split is read from package names and paths only. The Python suite contributes 11 test function(s) across 1 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only. The Go suite contributes 27 test case(s) across 5 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 0 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality10.0 / 10Exemplary✓ 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.

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

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 2567 tests. Measured on the JavaScript/TypeScript suite only — at least 2,558 test source file(s) (.rb) went unread, so its test quality is unmeasured and is not in these counts.

Mock-dominated test: reports an authorization exchange failure once · ×38app/javascript/utils/oauth.test.ts:55

✓ On the Gold path — maintain.

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

D12 · Dependency Hygiene10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

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

0 outdated, 0 author-deprecated direct Go module(s), 0 pinning or checksum defect(s). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.

✓ On the Gold path — maintain.

Detailed fixes: d12_recommendation.md.

D13 · Secret Scanning0.0 / 10Critical✓ Tool-verified

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

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

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

7 secret(s) detected.

REDACTED

What to do

  1. Resolve the 9 Leaked secret finding(s) in Secret Scanning — start with REDACTED (4), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (9 issue-level).
  2. Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D14 · License Compliance4.0 / 10Weak✓ Tool-verified

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.

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

3 of 341 shipped gem(s) use a banned license. Licences were resolved from rubygems.org over the 341 gem(s) a consumer installs — this repository's runtime declarations closed transitively over its committed REDACTED. Development-group and `add_development_dependency` gems are excluded: they are not distributed with this repository. 7 of them publish no licence on rubygems.org; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's gem dependencies and nothing else. The repository also declares REDACTED and a Go module (REDACTED/go.sum), and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

Banned license: colorize · ×3

What to do

  1. Resolve the 3 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (3 issue-level).
  2. Enforce License Compliance in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D15 · Churn × Complexity Hotspots9.3 / 10Stronggated by 166 serious findings✓ Tool-verified

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

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

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

Top hotspots: app/javascript/pages/Settings/Payments/Show.tsx (35×401=14035); REDACTED (34×159=5406); app/javascript/components/Checkout/payment.ts (35×154=5390) Repeated repair below the complexity floor: app/services/purchase/base_service.rb (3 of 5 changes were fixes); app/services/save_content_upsells_service.rb (3 of 4 changes were fixes)

Hotspot: app/javascript/pages/Settings/Payments/Show.tsx · ×164app/javascript/pages/Settings/Payments/Show.tsx:259
Repeated repair: app/services/purchase/base_service.rb · ×2app/services/purchase/base_service.rb:51

What to do

  1. Resolve the 164 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (10), REDACTED (5), REDACTED (5). — One of this dimension's main actionable groups (164 warning-level).
  2. Resolve the 2 Repeated repair finding(s) in Churn × Complexity Hotspots — start with base_service.rb, save_content_upsells_service.rb. — One of this dimension's main actionable groups (2 warning-level).

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

D16 · Bus Factor8.2 / 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.

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

219 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is app/services/checkout/buyer_currency_quote.rb. Counted over 1209 of the 4058 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1 · ×3
Further sole-owners (lower concentration)

What to do

  1. Resolve the 3 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (3 recommendation-level).
  2. 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.

D17 · Explicit Debt9.9 / 10Stronggated by 84 serious findings✓ Tool-verified

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

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

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

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

TodoComment · ×77spec/support/aria_extensions.rb:72
FixmeComment · ×3spec/lib/js_error_reporter_spec.rb:110
HackComment · ×3app/modules/purchase/ping_notification.rb:71
XxxCommentapp/models/jordan_bank_account.rb:6

What to do

  1. Resolve the 77 TodoComment finding(s) in Explicit Debt — start with aria_extensions.rb (3), create_service.rb (3), shared.rb (3). — One of this dimension's main actionable groups (77 warning-level).
  2. Resolve the 3 FixmeComment finding(s) in Explicit Debt — start with payment_method_result.ts (2), js_error_reporter_spec.rb. — One of this dimension's main actionable groups (3 warning-level).
  3. Resolve the 3 HackComment finding(s) in Explicit Debt — start with ping_notification.rb, purchase.rb, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
  4. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

1 of 1 documentation facets pass in full. 29 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

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

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — 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.

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

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

1 of 2 build units (Go, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. 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.

D29 · Static Analysis (SAST)0.0 / 10Critical✓ Tool-verified

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

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

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

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

247 finding(s): 0 critical, 151 high, 91 medium, 5 low. 74 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 39 file(s) — `app/javascript/components/Agent/AgentChat.test.tsx` (line 456, lines 457–464), `app/javascript/components/Audience/AudienceChart.tsx` (line 47), `app/javascript/components/Checkout/Receipt.test.tsx` (line 42), `app/javascript/components/Download/Interactions.tsx` (line 79), `app/javascript/components/Support/ContactSupportModal.test.tsx` (line 79), … (+34 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 3 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

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

What to do

  1. Resolve the 17 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (10), REDACTED (5), REDACTED (2). — One of this dimension's main actionable groups (17 issue-level).
  2. Resolve the 11 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (11). — One of this dimension's main actionable groups (11 issue-level).
  3. No action in Static Analysis (SAST) — all 74 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (74 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

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 REDACTED 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.

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

65 finding(s): 3 critical, 36 high, 20 medium, 6 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 36 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (24), REDACTED (12). — One of this dimension's main actionable groups (36 issue-level).
  2. Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  3. Resolve the 1 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D31 · IaC & Container Security2.7 2.4 / 10Critical✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 2.4 / 10 · rule-coverage 91% · ceiling Documented

35 finding(s): 3 critical, 10 high, 19 medium, 3 low.

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 19 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (9), REDACTED (4), REDACTED (4). — One of this dimension's main actionable groups (19 warning-level).
  2. Resolve the 10 High IaC finding(s) in IaC & Container Security — start with REDACTED (6), REDACTED (3), REDACTED. — One of this dimension's main actionable groups (10 issue-level).
  3. Resolve the 3 Critical IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).

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

D32 · Data Compliance (PII/GDPR)0.1 / 10Critical✓ Tool-verified

What it measures: Likely personal-data (PII / GDPR) handling concerns — logging or storing data without safeguards.

Method: Heuristic PII/GDPR LEAK scan via semgrep across the repo, using Watchdog's own ruleset: personal data crossing a boundary it should not — reaching a log/console sink, a URL or query string, or unprotected browser storage. Matches map to severity and a 0-10 wide normalizer. A clean sweep is unscored rather than an unearned 10, and is a statement about the leak paths checked only — this dimension does not inventory the personal data a repository holds (the personal-data map and the C1-C5 compliance cards do that), so it never reports that a repository has no personal-data surface. Reported LOUDLY as a measurement gap if the ruleset is missing from the analyzer image. Exhaustive over the leak paths, advisory-leaning; degrades on parse failure.

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

14 finding(s): 0 critical, 12 high, 2 medium, 0 low. semgrep could not parse 6 file(s) — `app/javascript/components/Audience/AudienceChart.tsx`, `app/javascript/components/Download/Interactions.tsx`, `app/javascript/components/ui/Alert.tsx`, `app/javascript/data/purchase/dispute_evidence_data.ts`, `app/javascript/types/epubjs-internals.d.ts`, … (+1 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.

REDACTED
REDACTED

What to do

  1. Resolve the 12 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED (3), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (12 issue-level).
  2. Resolve the 2 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).

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

D34 · Knowledge Freshness9.6 / 10Adequategated by 1 critical finding✓ Tool-verified

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.

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

43 of 1209 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is app/javascript/pages/Affiliates/Index.tsx. Counted over 1209 of the 4058 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledgeapp/javascript/pages/Affiliates/Index.tsx:1
Orphaned file · ×42app/javascript/components/ApiDocumentation/Endpoints/Payouts.tsx:1
Further orphaned files (smaller)

What to do

  1. Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 42 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED (2), Payouts.tsx, FirstSaleIcon.tsx. — One of this dimension's main actionable groups (42 recommendation-level).
  3. 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.

D35 · Change Coupling9.9 / 10Adequategated by 3 critical findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: stripe_beneficial_owners_manager.rb↔AccountDetailsSection.tsx 90%; stripe_beneficial_owners_manager.rb↔BeneficialOwnersSection.tsx 90%; post_resend_api.rb↔post_sendgrid_api.rb 90%

Boundary-crossing change coupling: stripe_beneficial_owners_manager.rb ↔ update_user_compliance_info.rb · ×3app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb:1
Change coupling: post_resend_api.rb ↔ post_sendgrid_api.rb · ×14app/services/post_resend_api.rb:1
Change-coupling hub: stripe_beneficial_owners_manager.rb → AccountDetailsSection.tsx, BeneficialOwnersSection.tsx, REDACTEDapp/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb

What to do

  1. Resolve the 3 Boundary-crossing change coupling finding(s) in Change Coupling — start with stripe_beneficial_owners_manager.rb, REDACTED, healthcheck_controller.rb. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 14 Change coupling finding(s) in Change Coupling — start with balance_controller.rb (2), post_resend_api.rb, state.ts. — One of this dimension's main actionable groups (14 warning-level).
  3. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with stripe_beneficial_owners_manager.rb. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

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.

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

0/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. 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).
  3. 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).

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

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

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. Scored 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. SCORED, not informational.

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

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

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

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 3 platform declaration(s) and 213 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives3.4 / 10Weak✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×37) — REDACTED:44, app/javascript/components/Communities/CommunityList.tsx:46, app/javascript/components/Download/FileList.tsx:280, …
  • Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). — app/javascript/components/ReviewForm/ReviewVideoRecorderClientOnly.tsx:273

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels7.5 / 10Strong✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×11) — app/javascript/components/Audience/CustomersPage.tsx:622, app/javascript/components/CheckoutDashboard/FormPage.tsx:277, app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:808, …
  • This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×10) — app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:1274, app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:1328, app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:1527, …
  • This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×5) — app/javascript/components/ProductEdit/ContentTab/index.tsx:857, app/javascript/components/Settings/AdvancedPage/ApplicationForm.tsx:140, app/javascript/components/TiptapExtensions/Image.tsx:323, …
  • A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one. (×2) — app/javascript/components/ProductEdit/ShareTab/ShareYourLaunchCard.tsx:355, app/javascript/components/TiptapExtensions/TextInputNodeView.tsx:31
  • A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×6) — app/javascript/components/ReviewForm/ReviewVideoRecorderClientOnly.tsx:69, app/javascript/components/ReviewForm/ReviewVideoRecorderClientOnly.tsx:86, app/views/home/features.html.erb:171, …
  • This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. — app/javascript/components/TiptapExtensions/CodeBlock.tsx:69
  • This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. — app/views/doorkeeper/authorizations/new.html.erb:44
  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. — app/views/home/shared/_footer.html.erb:8
  • A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. (×3) — app/views/home/shared/_footer.html.erb:38, app/views/home/shared/_footer.html.erb:43, app/views/home/shared/_footer.html.erb:48

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure6.5 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. (×36) — app/javascript/components/Audience/CustomerDetailPage.tsx:384, app/javascript/components/Audience/CustomerDetailPage.tsx:510, app/javascript/components/Audience/CustomerDetailPage.tsx:552, …
  • An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative. (×3) — REDACTED:41, REDACTED:34, REDACTED:57
  • An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label. — app/javascript/components/Product/Covers/Embed.tsx:47

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics1.9 / 10Critical✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×2) — app/javascript/components/Checkout/PaymentForm.tsx:1186, app/javascript/pages/Discover/Index.tsx:87
  • A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}. (×2) — app/javascript/components/Communities/ChatMessage.tsx:107, app/javascript/components/Communities/ChatMessage.tsx:313
  • An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action. (×2) — app/javascript/components/DashboardPage.tsx:440, app/javascript/components/DashboardPage.tsx:456
  • This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. (×4) — app/javascript/components/NestedMenu.tsx:276, app/javascript/components/NestedMenu.tsx:297, app/javascript/components/ProductEdit/Layout.tsx:79, …
  • This <div> announces itself as a role="tab" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="tab" or point aria-activedescendant at it. — app/javascript/components/Product/Covers/index.tsx:129
  • This <span> announces itself as a role="radio" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="radio" or point aria-activedescendant at it. — app/javascript/components/RatingSelector.tsx:18
  • This <span> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. — app/javascript/components/RichTextEditor.tsx:124

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness7.9 / 10Strong✓ Tool-verified

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This role is not a valid WAI-ARIA role, so assistive tech ignores it. Use a valid role (or the native element). — app/javascript/components/Discover/Nav.tsx:49

What to do

  • Use valid, non-abstract roles, supply the ARIA state each role requires, and never put aria-hidden on a focusable element.
AC6 · Visual & motion safety7.1 / 10Strong✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • <button> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator. — app/javascript/components/Download/FileList.tsx:562
  • <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — app/javascript/components/LoadingSpinner.tsx:6
  • <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — app/javascript/components/ProductEdit/ProductTab/PriceChecker/index.tsx:180
  • <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — app/javascript/components/ui/Input.tsx:23
  • <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — app/javascript/components/ui/Textarea.tsx:9
  • `.gr-slider::-webkit-slider-thumb` moves (`transition: box-shadow 0.08s, transform 0.08s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — app/views/home/saas.html.erb:35
  • `.gr-slider::-moz-range-thumb` moves (`transition: box-shadow 0.08s, transform 0.08s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — app/views/home/saas.html.erb:44
  • `.gr-slider` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — app/views/home/saas.html.erb:8
  • <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — public/cloudflare_wait.html:0
  • `.parallax-up` moves (`transition: transform 0.1s linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — app/javascript/stylesheets/tailwind.css:111
  • `.parallax-up` moves (`animation: parallax-scroll linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — app/javascript/stylesheets/tailwind.css:113

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.

Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.

Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.

  • No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 906 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
AX10 · Code composition8.4 / 10Strong✓ Tool-verified

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

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

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

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX2 · Stateful singletons10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.

Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

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.

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

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

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

C1 · Data Protection3.5 / 10Weak✓ Tool-verified

Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.

Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.

What to do

  • Strengthen data-at-rest protection: vault your keys (AWS KMS / Secrets Manager, GCP KMS / Secret Manager, HashiCorp Vault — kms_encrypted or vault-rails, not only the master key beside credentials.yml.enc) and encrypt the most sensitive columns (encrypts, lockbox) — partial coverage still leaves gaps.
  • Enforce HTTPS (config.force_ssl = true in config/environments/production.rb, or Rack::SSL in a Rack application) so data in transit is always encrypted.
C2 · Access Controls10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

C3 · Audit Trail10.0 / 10Exemplary✓ Tool-verified

Other · Security — Whether changes to sensitive data are recorded (who, what, when) for compliance + incident response.

Method: Roslyn scan: audit-trail mechanism graded (SaveChanges interceptor/immutable AuditLog/[Audited] strong; bare IAuditable/AddAuditing weak). Deterministic.

C4 · Data Retention10.0 / 10Exemplary✓ Tool-verified

Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).

Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.

C5 · Data-Subject Rights4.0 / 10Weak✓ Tool-verified

Other · Security — Whether GDPR data-subject requests are supported in code — erasure, export/portability, consent.

Method: Roslyn scan: GDPR data-subject-rights corroboration (erasure/export/consent vocabulary co-occurring with subject-id store crossing or explicit GDPR pattern). Deterministic, gated by PII.

  • Corroborated rights: erasure ✓ · export ✗ · consent ✗. Each tick means this scan found code in the repository implementing that right — a deletion/anonymisation path for erasure, a data-export or portability path for export, and consent state recorded alongside the personal data it authorises. A ✗ therefore means no such code was recognised HERE, not that the right is unsupported: a capability provided by a platform, a manual runbook, or code spelled in a way this scan does not match is not visible to it. Confirm before treating a cross as a gap; where it is one, the right has to be fulfilled manually.

What to do

  • Implement data export/portability for a data subject (a machine-readable export of their personal data).
  • Track GDPR consent (lawful basis) alongside the personal data it authorises.
DM6 · Domain ↔ infrastructure boundary5.0 / 10Adequate✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (ActiveRecord/Sequel/ROM) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

  • `AdminApiToken` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — REDACTED:3
  • `AffiliateRequest` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/affiliate_request.rb:3
  • `Balance` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/balance.rb:3
  • `BalanceTransaction` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/balance_transaction.rb:6
  • `BankAccount` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/bank_account.rb:3
  • `BlockedCustomerObject` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/blocked_customer_object.rb:3
  • `Charge` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/charge.rb:3
  • `CollaboratorInvitation` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/collaborator_invitation.rb:3
  • `Commission` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/commission.rb:3
  • `CommunityChatRecapRun` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/community_chat_recap_run.rb:3
  • `Credit` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/credit.rb:3
  • `CreditCard` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — REDACTED:3
  • `CustomDomain` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/custom_domain.rb:5
  • `Dispute` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/dispute.rb:3
  • `DropboxFile` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/dropbox_file.rb:3
  • `EmailInfo` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/email_info.rb:3
  • `FailedRefundException` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/failed_refund_exception.rb:6
  • `FeatureAnnouncementCampaign` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — REDACTED:6
  • `FeatureAnnouncementDelivery` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/feature_announcement_delivery.rb:6
  • `Follower` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/follower.rb:3
  • `Gift` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/gift.rb:3
  • `Guardian` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/guardian.rb:20
  • `Installment` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/installment.rb:5
  • `InstallmentRule` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/installment_rule.rb:3
  • `Invite` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/invite.rb:3
  • `License` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/license.rb:3
  • `Link` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/link.rb:5
  • `Action` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/marketing/action.rb:3
  • `MerchantAccount` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/merchant_account.rb:3
  • `OauthDeviceAuthorization` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/oauth_device_authorization.rb:5
  • `Order` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/order.rb:3
  • `Payment` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/payment.rb:3
  • `PiracyReport` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/piracy_report.rb:3
  • `PlatformBlock` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/platform_block.rb:3
  • `Preorder` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/preorder.rb:3
  • `PreorderLink` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/preorder_link.rb:3
  • `ProductCachedValue` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/product_cached_value.rb:3
  • `ProductFile` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/product_file.rb:3
  • `ProductFilesArchive` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — REDACTED:3
  • `ProductInstallmentPlan` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository). — app/models/product_installment_plan.rb:3

What to do

  • Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).
GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's Ruby: methods whose whole body still raises NotImplementedError where nothing overrides them, or a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

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

IC1 · Incompleteness & stubs10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Ruby: methods that only raise NotImplementedError or a "not implemented" error where nothing overrides them, methods that take inputs and return a constant or do nothing, dead `if false` branches, and skeleton classes most of whose methods are holes.

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

  • `braintree_device_data` has an empty body — confirm it's an intentional no-op and not an unfinished method. — app/business/payments/charging/implementations/braintree/braintree_chargeable_credit_card.rb:33
  • A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×3) — spec/config/test_redis_isolation_spec.rb:81, spec/requests/products/collabs_spec.rb:138, spec/requests/products/collabs_spec.rb:159

What to do

  • Clear the softer debt: re-enable or delete `xit`/`skip`ped tests, decide whether each empty method or NotImplementedError refusal is deliberate (and say so in a comment), and replace `# rubocop:disable all` with targeted, justified disables.
M1 · Documentation (README)7.3 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

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

What to do

  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 1 of 1 project(s) that lack one — worth up to 2 pts.
M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

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

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

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

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

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

M4 · Documentation accuracy8.0 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • CONTRIBUTING.md links to `./before.png`, but `before.png` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — CONTRIBUTING.md:67

What to do

  • Reconcile the README with reality: CONTRIBUTING.md links to `./before.png`, but `before.png` does not exist.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

P3 · Security & performance tooling3.0 / 10Weak✓ Tool-verified

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

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

  • No static application security testing detected. For this repository's stack, add brakeman for Rails apps, otherwise `semgrep --config=auto` or CodeQL's ruby pack as a CI step. What was searched, so you can tell an absence from a miss: the 144542 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.

What to do

  • Add a SAST step to CI running what this repository's stack ships: brakeman for Rails apps, otherwise `semgrep --config=auto` or CodeQL's ruby pack — so a security regression fails the build instead of landing.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

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.

P5 · DR & Backup0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

  • A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.

What to do

  • Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `HTTParty` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×9) — app/business/payments/integrations/paypal_integration_rest_api.rb:4, app/business/payments/integrations/paypal_partner_rest_credentials.rb:10, app/services/circle_api.rb:4, …
  • `HTTParty.post` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×12) — app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:353, app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:394, app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:604, …
  • `Net::HTTP.start` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — app/business/payments/reports/stripe_balance_summaries_report.rb:103, app/sidekiq/transcode_video_for_streaming_worker.rb:175
  • `HTTParty.get` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — app/models/dropbox_file.rb:104, app/services/stripe_tax_forms_api.rb:21, db/migrate/20120501233604_migrate_preview_images_on_links.rb:73
  • `RestClient::` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — app/models/google_calendar_integration.rb:18
  • `Net::HTTP.new` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — app/modules/multipart_transfer.rb:32
  • `HTTParty.head` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — app/modules/multipart_transfer.rb:50
  • `Net::HTTP.get` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — lib/utilities/sidekiq_utility.rb:79

What to do

  • Set `open_timeout` and `read_timeout` explicitly on every client (Net::HTTP, Faraday `request: { timeout: }`, HTTParty `timeout:`), add Faraday's `:retry` middleware (faraday-retry) or `retriable`, and a breaker (`circuitbox`, `stoplight`) around dependencies that fail.
P8 · Schema migrations10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.

Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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 the language 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.

R1 · Type Safety10.0 / 10Exemplary✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

R10 · Code Duplication8.7 / 10Strong✓ Tool-verified

React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): 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. Deterministic.

  • 69 duplicated blocks under app/javascript/components/ have copies in at least two of the sibling directories Agent, Analytics, ApiDocumentation, Audience, BundleEdit, Checkout (+20 more sibling(s) not listed) — 35 of them are reported below, and 34 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 69 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 69 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 69 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — app/javascript/components/Download/RichContent.tsx:367
  • 50 duplicated blocks under app/javascript/ have copies in at least two of the sibling directories components, data, entrypoints, packs, pages, parsers (+1 more sibling(s) not listed) — 26 of them are reported below, and 24 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 50 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 50 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 50 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — app/javascript/entrypoints/mobile_tracking.ts:1
  • 24 duplicated blocks under app/javascript/pages/ have copies in at least two of the sibling directories Affiliates, Audience, Collaborators, Customers, Dashboard, Emails (+18 more sibling(s) not listed) — 12 of them are reported below, and 12 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 24 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 24 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 24 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — app/javascript/pages/Collaborators/Index.tsx:77
  • 5 duplicated blocks under app/javascript/pages/Bundles/ have copies in at least two of the sibling directories Content, Product, Share — 1 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — app/javascript/pages/Bundles/Content/Edit.tsx:46
  • app/javascript/components/ProductEdit/ProductTab/DurationsEditor.tsx:22 · app/javascript/components/ProductEdit/ProductTab/VersionsEditor.tsx:23 — the two spans are one implementation copied and then locally edited — 1130 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. — app/javascript/components/ProductEdit/ProductTab/DurationsEditor.tsx:22
  • app/javascript/components/ProductEdit/ProductTab/TiersEditor.tsx:54 · app/javascript/components/ProductEdit/ProductTab/VersionsEditor.tsx:34 — the two spans are one implementation copied and then locally edited — 1129 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. — app/javascript/components/ProductEdit/ProductTab/TiersEditor.tsx:54
  • app/javascript/components/ProductsPage/MembershipsTable.tsx:27 · app/javascript/components/ProductsPage/ProductsTable.tsx:51 — the two spans are one implementation copied and then locally edited — 1010 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. — app/javascript/components/ProductsPage/MembershipsTable.tsx:27
  • app/javascript/pages/Affiliates/Edit.tsx:29 · app/javascript/pages/Affiliates/New.tsx:21 — the two spans are one implementation copied and then locally edited — 676 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. — app/javascript/pages/Affiliates/Edit.tsx:29
  • app/javascript/components/ProductsPage/Collabs/MembershipsTable.tsx:24 · app/javascript/components/ProductsPage/Collabs/ProductsTable.tsx:24 — the two spans are one implementation copied and then locally edited — 657 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. — app/javascript/components/ProductsPage/Collabs/MembershipsTable.tsx:24
  • app/javascript/components/Audience/CustomerDetailPage.tsx:1082 · app/javascript/components/Audience/CustomerDetailPage.tsx:1502 — the two spans are one implementation copied and then locally edited — 499 tokens are still identical, in the same order in both spans, 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. — app/javascript/components/Audience/CustomerDetailPage.tsx:1082
  • app/javascript/components/Profile/FollowForm.tsx:22 · app/javascript/components/Profile/FollowUserForm.tsx:22 — the two spans are one implementation copied and then locally edited — 418 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. — app/javascript/components/Profile/FollowForm.tsx:22
  • app/javascript/entrypoints/mobile_tracking.ts:1 · app/javascript/packs/mobile_tracking.ts:1 — these 2 files are line-for-line copies of one another — 70 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. — app/javascript/entrypoints/mobile_tracking.ts:1
  • app/javascript/components/ApiDocumentation/Endpoints/Licenses.tsx:25 · app/javascript/components/ApiDocumentation/Endpoints/Licenses.tsx:95 · app/javascript/components/ApiDocumentation/Endpoints/Licenses.tsx:165 · app/javascript/components/ApiDocumentation/Endpoints/Licenses.tsx:235 — all 4 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — app/javascript/components/ApiDocumentation/Endpoints/Licenses.tsx:25
  • app/javascript/pages/Collaborators/Index.tsx:77 · app/javascript/pages/UtmLinks/Index.tsx:191 — the two spans are one implementation copied and then locally edited — 312 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. — app/javascript/pages/Collaborators/Index.tsx:77
  • app/javascript/components/ProductEdit/ProductTab/CircleIntegrationEditor.tsx:96 · app/javascript/components/ProductEdit/ProductTab/DiscordIntegrationEditor.tsx:44 — the two spans are one implementation copied and then locally edited — 301 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. — app/javascript/components/ProductEdit/ProductTab/CircleIntegrationEditor.tsx:96
  • app/javascript/components/TiptapExtensions/LicenseKey.tsx:32 · app/javascript/components/TiptapExtensions/Posts.tsx:34 — the two spans are one implementation copied and then locally edited — 302 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. — app/javascript/components/TiptapExtensions/LicenseKey.tsx:32
  • app/javascript/pages/Settings/Payments/Show.tsx:849 · app/javascript/pages/Settings/Payments/Show.tsx:1082 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — app/javascript/pages/Settings/Payments/Show.tsx:849
  • app/javascript/pages/Emails/Drafts.tsx:96 · app/javascript/pages/Emails/Scheduled.tsx:117 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — app/javascript/pages/Emails/Drafts.tsx:96
  • app/javascript/components/ConfirmBalanceForfeitOnPayoutMethodChangeModal.tsx:28 · app/javascript/components/UpdateCountryConfirmationModal.tsx:16 — the two spans are one implementation copied and then locally edited — 241 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. — app/javascript/components/ConfirmBalanceForfeitOnPayoutMethodChangeModal.tsx:28
  • app/javascript/pages/Wishlists/Following/Index.tsx:60 · app/javascript/pages/Wishlists/Index.tsx:76 — the two spans are one implementation copied and then locally edited — 256 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. — app/javascript/pages/Wishlists/Following/Index.tsx:60
  • app/javascript/components/CurrentSeller.ts:24 · app/javascript/components/LoggedInUser.ts:99 — the two spans are one implementation copied and then locally edited — 227 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. — app/javascript/components/CurrentSeller.ts:24
  • app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:765 · app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:819 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:765
  • app/javascript/components/ApiDocumentation/Endpoints/Emails.tsx:118 · app/javascript/components/ApiDocumentation/Endpoints/Emails.tsx:336 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — app/javascript/components/ApiDocumentation/Endpoints/Emails.tsx:118
  • app/javascript/pages/User/Passwords/Edit.tsx:24 · app/javascript/pages/User/Passwords/New.tsx:29 — the two spans are one implementation copied and then locally edited — 222 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. — app/javascript/pages/User/Passwords/Edit.tsx:24
  • app/javascript/components/Product/Card.tsx:44 · app/javascript/components/Product/Card.tsx:109 — the two spans are one implementation copied and then locally edited — 220 tokens are still identical, in the same order in both spans, 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. — app/javascript/components/Product/Card.tsx:44
  • app/javascript/components/ProductEdit/ProductTab/SuggestedAmountsEditor.tsx:13 · app/javascript/components/ProductEdit/ProductTab/VersionsEditor.tsx:25 — the two spans are one implementation copied and then locally edited — 257 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. — app/javascript/components/ProductEdit/ProductTab/SuggestedAmountsEditor.tsx:13
  • app/javascript/components/Download/RichContent.tsx:367 · app/javascript/components/ProductEdit/ContentTab/FileEmbedGroup.tsx:269 — the two spans are one implementation copied and then locally edited — 166 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. — app/javascript/components/Download/RichContent.tsx:367
  • app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:742 · app/javascript/components/TiptapExtensions/PublicFileEmbed.tsx:96 — the two spans are one implementation copied and then locally edited — 196 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. — app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:742
  • app/javascript/components/ProductsPage/Collabs/MembershipsTable.tsx:64 · app/javascript/components/ProductsPage/MembershipsTable.tsx:100 — 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. — app/javascript/components/ProductsPage/Collabs/MembershipsTable.tsx:64
  • app/javascript/components/Profile/SectionsForm.tsx:368 · app/javascript/components/Profile/SectionsForm.tsx:619 — the two spans are one implementation copied and then locally edited — 174 tokens are still identical, in the same order in both spans, 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. — app/javascript/components/Profile/SectionsForm.tsx:368
  • app/javascript/components/DashboardPage.tsx:379 · app/javascript/components/ProductEdit/Layout.tsx:274 — the two spans are one implementation copied and then locally edited — 150 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. — app/javascript/components/DashboardPage.tsx:379
  • app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:737 · app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:1274 — all 2 copies are in the same file, 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. — app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:737
  • app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:842 · app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:972 · app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:1002 · app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:1032 — all 4 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:842
  • app/javascript/pages/UrlRedirects/Read.tsx:414 · app/javascript/pages/UrlRedirects/Read.tsx:821 — all 2 copies are in the same file, 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. — app/javascript/pages/UrlRedirects/Read.tsx:414
  • app/javascript/components/ProductEdit/ProductTab/DescriptionEditor.tsx:294 · app/javascript/components/server-components/ProductEditPage.tsx:918 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — app/javascript/components/ProductEdit/ProductTab/DescriptionEditor.tsx:294
  • app/javascript/pages/Checkout/Show.tsx:1213 · app/javascript/pages/Checkout/Show.tsx:1262 — the two spans are one implementation copied and then locally edited — 94 tokens are still identical, in the same order in both spans, 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. — app/javascript/pages/Checkout/Show.tsx:1213
  • app/javascript/pages/Emails/Drafts.tsx:65 · app/javascript/pages/Emails/Scheduled.tsx:81 — 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. — app/javascript/pages/Emails/Drafts.tsx:65
  • app/javascript/components/Analytics/LocationsTable.tsx:102 · app/javascript/components/Analytics/ReferrersTable.tsx:48 — the two spans are one implementation copied and then locally edited — 181 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. — app/javascript/components/Analytics/LocationsTable.tsx:102
  • app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:227 · app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:227
  • app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:782 · app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:876 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:782

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.
R11 · Import Boundaries9.9 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).

Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.

  • app/javascript/types/epubjs-internals.d.ts:84 imports epubjs/src/utils/queue, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — app/javascript/types/epubjs-internals.d.ts:84

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity8.0 / 10Strong✓ Tool-verified

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.

  • BankAccountSection has cyclomatic complexity 202 and cognitive complexity 200; 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. — app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx:773
  • validateBankAccountFields has cyclomatic complexity 180 and cognitive complexity 184; 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. — app/javascript/pages/Settings/Payments/Show.tsx:532
  • applyCheckoutAction has cyclomatic complexity 161 and cognitive complexity 244; 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. — app/javascript/components/Checkout/payment.ts:1492
  • AccountDetailsSection has cyclomatic complexity 154 and cognitive complexity 145; 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. — app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:50
  • Product has cyclomatic complexity 122 and cognitive complexity 109; 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:297
  • FileEmbedNodeView has cyclomatic complexity 101 and cognitive complexity 93; 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. — app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:84
  • validateComplianceInfoFields has cyclomatic complexity 98 and cognitive complexity 126; 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. — app/javascript/pages/Settings/Payments/Show.tsx:832
  • Checkout has cyclomatic complexity 97 and cognitive complexity 89; 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. — app/javascript/components/Checkout/index.tsx:258
  • EmailForm has cyclomatic complexity 96 and cognitive complexity 91; 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. — app/javascript/components/EmailsPage/EmailForm.tsx:221
  • CustomerDetailPage has cyclomatic complexity 78 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 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. — app/javascript/components/Audience/CustomerDetailPage.tsx:135
  • (anonymous) has cyclomatic complexity 76 and cognitive complexity 159; 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. — app/javascript/data/order.ts:162
  • SubscriptionsManage has cyclomatic complexity 74 and cognitive complexity 66; 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. — app/javascript/pages/Subscriptions/Manage.tsx:117
  • Form has cyclomatic complexity 69 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 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. — app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:894
  • FileRow has cyclomatic complexity 54 and cognitive complexity 52; 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. — app/javascript/components/Download/FileList.tsx:169
  • PaymentsPage has cyclomatic complexity 54 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 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. — app/javascript/pages/Settings/Payments/Show.tsx:259
  • applyCanonicalIds has cyclomatic complexity 52 and cognitive complexity 68; 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. — app/javascript/components/server-components/ProductEditPage.tsx:293
  • pay has cyclomatic complexity 49 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. — app/javascript/pages/Checkout/Show.tsx:540
  • Form has cyclomatic complexity 49 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 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. — app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:523
  • handleSubmit has cyclomatic complexity 49 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 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. — app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:1089
  • (anonymous) has cyclomatic complexity 48 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. — app/javascript/components/Checkout/PaymentForm.tsx:902

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files6.4 / 10Adequate✓ 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.

  • app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx has 2645 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx:1
  • app/javascript/components/Audience/CustomerDetailPage.tsx has 2344 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/Audience/CustomerDetailPage.tsx:1
  • app/javascript/components/Checkout/payment.ts has 2024 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/Checkout/payment.ts:1
  • app/javascript/components/Checkout/PaymentForm.tsx has 2006 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/Checkout/PaymentForm.tsx:1
  • app/javascript/pages/Settings/Payments/Show.tsx has 1684 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/pages/Settings/Payments/Show.tsx:1
  • app/javascript/components/CheckoutDashboard/DiscountsPage.tsx has 1654 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:1
  • app/javascript/components/ProductEdit/ContentTab/index.tsx has 1631 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/ProductEdit/ContentTab/index.tsx:1
  • app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx has 1364 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:1
  • app/javascript/components/EmailsPage/EmailForm.tsx has 1322 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/EmailsPage/EmailForm.tsx:1
  • app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx has 1317 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:1
  • app/javascript/components/Checkout/index.tsx has 1277 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/Checkout/index.tsx:1
  • REDACTED has 1266 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • app/javascript/pages/Checkout/Show.tsx has 1257 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/pages/Checkout/Show.tsx:1
  • app/javascript/components/Agent/AgentChat.tsx has 1198 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/Agent/AgentChat.tsx:1
  • app/javascript/components/server-components/ProductEditPage.tsx has 1155 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/server-components/ProductEditPage.tsx:1
  • app/javascript/components/Product/ConfigurationSelector.tsx has 1028 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/Product/ConfigurationSelector.tsx:1
  • app/javascript/components/CheckoutDashboard/UpsellsPage.tsx has 989 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:1
  • app/javascript/components/ApiDocumentation/responseFieldDefinitions.ts has 975 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/ApiDocumentation/responseFieldDefinitions.ts:1
  • app/javascript/components/Profile/SectionsForm.tsx has 952 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/Profile/SectionsForm.tsx:1
  • app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx has 942 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:1
  • app/javascript/pages/UrlRedirects/Read.tsx has 900 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/pages/UrlRedirects/Read.tsx:1
  • app/javascript/pages/Payouts/Index.tsx has 851 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/pages/Payouts/Index.tsx:1
  • app/javascript/components/Download/FileList.tsx has 849 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/Download/FileList.tsx:1
  • app/javascript/data/order.ts has 848 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/data/order.ts:1
  • app/javascript/components/RichTextEditor.tsx has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/RichTextEditor.tsx:1
  • app/javascript/components/ApiDocumentation/Endpoints/Products.tsx has 787 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/ApiDocumentation/Endpoints/Products.tsx:1
  • app/javascript/components/Profile/EditSections.tsx has 765 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/Profile/EditSections.tsx:1
  • app/javascript/components/WorkflowsPage/WorkflowEmails.tsx has 756 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/WorkflowsPage/WorkflowEmails.tsx:1
  • app/javascript/pages/Communities/Index.tsx has 751 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/pages/Communities/Index.tsx:1
  • app/javascript/data/product_edit.ts has 689 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/data/product_edit.ts:1
  • app/javascript/pages/Settings/Profile/Show.tsx has 670 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/pages/Settings/Profile/Show.tsx:1
  • app/javascript/components/WorkflowsPage/WorkflowForm.tsx has 660 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/WorkflowsPage/WorkflowForm.tsx:1
  • app/javascript/pages/Settings/Main/Show.tsx has 655 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/pages/Settings/Main/Show.tsx:1
  • app/javascript/utils/mimetypes.ts has 632 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/utils/mimetypes.ts:1
  • app/javascript/components/Audience/CustomersPage.tsx has 629 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/Audience/CustomersPage.tsx:1
  • app/javascript/pages/Library/Index.tsx has 584 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/pages/Library/Index.tsx:1
  • app/javascript/pages/Products/New.tsx has 572 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/pages/Products/New.tsx:1
  • app/javascript/pages/Discover/Index.tsx has 541 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/pages/Discover/Index.tsx:1
  • app/javascript/pages/Purchases/DisputeEvidence/Show.tsx has 536 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/pages/Purchases/DisputeEvidence/Show.tsx:1
  • app/javascript/components/ProductEdit/ProductTab/TiersEditor.tsx has 533 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — app/javascript/components/ProductEdit/ProductTab/TiersEditor.tsx:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage9.8 / 10Exemplary✓ 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. (×13) — app/javascript/hooks/useLazyFetch.ts:1, app/javascript/widget/overlay.ts:1, app/javascript/entrypoints/mobile_tracking.ts:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness2.5 / 10Weak✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

  • 75 outdated package(s); JS/npm CVEs scored in D30

What to do

  • Bump outdated dependencies to current versions to limit upgrade debt.
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code8.8 / 10Strong✓ 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 7 application, 18 tooling and 265 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (7 application, 18 tooling, 265 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 (×13) — app/javascript/hooks/useLazyFetch.ts, app/javascript/entrypoints/mobile_tracking.ts, app/javascript/packs/mobile_tracking.ts, …
  • Nothing imports this binding — it is safe to review for removal. (×22) — app/javascript/components/ConfirmBalanceForfeitOnPayoutMethodChangeModal.tsx:112, app/javascript/components/CountrySelectionModal.tsx:125, app/javascript/components/DesignSettings.tsx:17, …

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene4.0 / 10Weak✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Imported but not declared in any reachable REDACTED — installs work only by hoisting accident. (×3) — app/javascript/components/Communities/ChatMessageInput.tsx:2, app/javascript/inertia/prefetch_rejection.test.ts:16, app/javascript/pages/UrlRedirects/epubjs-patch.test.ts:9

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports0.0 / 10Critical✓ Tool-verified

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.

  • app/javascript/components/Analytics/ProductsPopover.tsx → app/javascript/components/Analytics/index.tsx → app/javascript/components/Analytics/ProductsPopover.tsx (one verified cycle inside a mutually-dependent group of 6 files) — app/javascript/components/Analytics/ProductsPopover.tsx:4
  • app/javascript/pages/Communities/Index.tsx → app/javascript/components/Communities/ChatMessageInput.tsx → app/javascript/pages/Communities/Index.tsx (one verified cycle inside a mutually-dependent group of 5 files) — app/javascript/pages/Communities/Index.tsx:21
  • app/javascript/components/DownloadPage/WithContent.tsx → app/javascript/components/Download/FileList.tsx → app/javascript/components/DownloadPage/AudioPlayerContainer.tsx → app/javascript/components/DownloadPage/WithContent.tsx (one verified cycle inside a mutually-dependent group of 11 files) — app/javascript/components/DownloadPage/WithContent.tsx:21
  • app/javascript/components/Product/Covers/Embed.tsx → app/javascript/components/Product/Covers/index.tsx → app/javascript/components/Product/Covers/Embed.tsx (one verified cycle inside a mutually-dependent group of 4 files) — app/javascript/components/Product/Covers/Embed.tsx:5
  • app/javascript/components/Product/CtaButton.tsx → REDACTED → app/javascript/components/Product/PurchaseButton.tsx → app/javascript/components/Product/CtaButton.tsx — app/javascript/components/Product/CtaButton.tsx:12
  • app/javascript/components/ProductEdit/ContentTab/index.tsx → app/javascript/data/product_edit.ts → app/javascript/components/ProductEdit/ContentTab/index.tsx — app/javascript/components/ProductEdit/ContentTab/index.tsx:36
  • app/javascript/components/Profile/EditSections.tsx → app/javascript/components/Profile/EditSections/WishlistsSectionView.tsx → app/javascript/components/Profile/EditSections.tsx — app/javascript/components/Profile/EditSections.tsx:43
  • app/javascript/components/RichTextEditor.tsx → app/javascript/components/TiptapExtensions/Image.tsx → app/javascript/components/RichTextEditor.tsx (one verified cycle inside a mutually-dependent group of 4 files) — app/javascript/components/RichTextEditor.tsx:43
  • app/javascript/components/client-components/Nav/footer.tsx → app/javascript/components/client-components/Nav/index.tsx → app/javascript/components/client-components/Nav/footer.tsx — app/javascript/components/client-components/Nav/footer.tsx:5
  • app/javascript/data/google_analytics.ts → app/javascript/utils/user_analytics.ts → app/javascript/data/google_analytics.ts — app/javascript/data/google_analytics.ts:3
  • app/javascript/utils/currency.ts → app/javascript/utils/price.ts → app/javascript/utils/currency.ts — app/javascript/utils/currency.ts:1

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture4.5 / 10Weak✓ Tool-verified

Other · Security — Read from this repository's Ruby source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. Markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin. This repository commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. The server controls — HTTPS enforcement, HSTS, cookie flags, input validation — are NOT assessed for Ruby: this reading covers the code's own cryptography and the TLS connections it opens as a client, and a Rails, Rack or Sinatra application's transport, header and validation settings are not modelled. Their absence here is not a finding about this repository.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. (×13) — REDACTED:80, REDACTED:89, REDACTED:67, …
  • `https://www.dropbox.com/static/api/2/dropins.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 8 such include(s) across the repository's markup. — app/views/shared/_load_dropbox_dropins_js.html.erb:2

What to do

  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 13 sites, not one: `REDACTED:80` (Digest::MD5.hexdigest), `REDACTED:89` (Digest::MD5.hexdigest), `REDACTED:67` (OpenSSL::Digest::SHA1.new), `REDACTED:112` (Digest::SHA1.hexdigest), `REDACTED:22` (Digest::SHA1.hexdigest), `REDACTED:1629` (Digest::SHA1.hexdigest), `REDACTED:23` (Digest::MD5.hexdigest), `app/modules/utilities.rb:11` (OpenSSL::Digest.new("sha1")), and 5 further site(s). Each is a separate decision — fixing only the line this row cites leaves the others in place.
  • Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

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

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

X17 · Uncapped recursion over a caller-supplied document1.6 / 10Critical✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `redact` is public and takes `value` — which it walks as a `Hash` — from its caller, and it calls itself at line 20 (`self.redact`) with a piece of `value` (and at line 23) — and nowhere in `redact` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends stack per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A walk like this one raises `SystemStackError` past about 3,800 levels on the main thread and about 1,000 on a `Thread` — where Puma serves requests and Sidekiq runs jobs (MRI 3.3 and 4.0). `JSON.parse` stops at 100 levels by default, but the other parsers a caller may use do not: `YAML.safe_load` builds 1,400 levels from 2.8 KB, `Oj.load` 100,000, REXML 200,000, and `JSON.load` on json 2.7 (Ruby 3.3's default) or `JSON.parse(…, max_nesting: false)` 58,000. `SystemStackError` is not a `StandardError`: a bare `rescue` or `rescue => e` around the call does not stop it. Thread a depth argument through `redact` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — lib/utilities/log_redactor.rb:20
  • `normalize_description` is public and takes `description` — which it walks as a `Hash` — from its caller, and it calls itself at line 148 (`self.normalize_description`) with a piece of `description` (and at line 149) — and nowhere in `normalize_description` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends stack per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A walk like this one raises `SystemStackError` past about 3,800 levels on the main thread and about 1,000 on a `Thread` — where Puma serves requests and Sidekiq runs jobs (MRI 3.3 and 4.0). `JSON.parse` stops at 100 levels by default, but the other parsers a caller may use do not: `YAML.safe_load` builds 1,400 levels from 2.8 KB, `Oj.load` 100,000, REXML 200,000, and `JSON.load` on json 2.7 (Ruby 3.3's default) or `JSON.parse(…, max_nesting: false)` 58,000. `SystemStackError` is not a `StandardError`: a bare `rescue` or `rescue => e` around the call does not stop it. Thread a depth argument through `normalize_description` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — app/services/product/rich_content_deletion_guard.rb:148
  • `applyFileIdMappingsToRichContent` is exported, takes a document from its caller (line 379) and hands it to `applyFileIdMappings`, which calls itself at line 363 (`applyFileIdMappings`) with a piece of `value` (and at line 375) — and nowhere in `applyFileIdMappings` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `applyFileIdMappings` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — app/javascript/data/product_edit.ts:363
  • `removeFileEmbedsFromRichContent` is exported, takes a document from its caller (line 430) and hands it to `removeFileEmbeds`, which calls itself at line 389 (`removeFileEmbeds`) with a piece of `value` (and at line 404) — and nowhere in `removeFileEmbeds` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `removeFileEmbeds` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — app/javascript/data/product_edit.ts:389
  • `rawDocContainsNode` is exported and takes `value: unknown` from its caller, and it calls itself at line 141 (`rawDocContainsNode`) with a piece of `value` (and at line 144) — and nowhere in `rawDocContainsNode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `rawDocContainsNode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — app/javascript/components/ProductEdit/ContentTab/index.tsx:141
  • `submitted_field_names` is public and takes `sent_attributes` — which it walks as a `Hash` — from its caller, and it calls itself at line 1508 (`self.submitted_field_names`) with a piece of `sent_attributes` — and nowhere in `submitted_field_names` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends stack per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A walk like this one raises `SystemStackError` past about 3,800 levels on the main thread and about 1,000 on a `Thread` — where Puma serves requests and Sidekiq runs jobs (MRI 3.3 and 4.0). `JSON.parse` stops at 100 levels by default, but the other parsers a caller may use do not: `YAML.safe_load` builds 1,400 levels from 2.8 KB, `Oj.load` 100,000, REXML 200,000, and `JSON.load` on json 2.7 (Ruby 3.3's default) or `JSON.parse(…, max_nesting: false)` 58,000. `SystemStackError` is not a `StandardError`: a bare `rescue` or `rescue => e` around the call does not stop it. Thread a depth argument through `submitted_field_names` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:1508
  • `force_utf8_encoding` is public and takes `value` — which it walks as a `Hash` — from its caller, and it calls itself at line 2836 (`self.force_utf8_encoding`) with a piece of `value` (and at line 2838) — and nowhere in `force_utf8_encoding` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends stack per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A walk like this one raises `SystemStackError` past about 3,800 levels on the main thread and about 1,000 on a `Thread` — where Puma serves requests and Sidekiq runs jobs (MRI 3.3 and 4.0). `JSON.parse` stops at 100 levels by default, but the other parsers a caller may use do not: `YAML.safe_load` builds 1,400 levels from 2.8 KB, `Oj.load` 100,000, REXML 200,000, and `JSON.load` on json 2.7 (Ruby 3.3's default) or `JSON.parse(…, max_nesting: false)` 58,000. `SystemStackError` is not a `StandardError`: a bare `rescue` or `rescue => e` around the call does not stop it. Thread a depth argument through `force_utf8_encoding` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:2836

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness5.3 / 10Adequate✓ Tool-verified

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

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

  • `File.new` is called here without a block, so it hands back an open descriptor the caller must close — and it is held in `file`, and every later use of `file` in `log_mail_debug_info` reads a member through it — it is never closed, returned, passed, yielded or stored. Nothing closes it: it stays open until the garbage collector happens to finalize it, which is one leaked descriptor per call (a child process too, for `IO.popen`), `Errno::EMFILE` under load, and for a written file data that is not flushed when the program next reads it. Use the block form, which closes on every path including a raise (`File.new(…) { |io| … }`), or the one-call reader/writer (`File.read`, `File.write`, `File.foreach`). (×2) — app/services/post_resend_api.rb:281, app/services/post_sendgrid_api.rb:294
  • `Tempfile.new` is called here without a block, so it hands back an open descriptor the caller must close — and it is held in `temp_file`, and every later use of `temp_file` in `send_to_kindle` reads a member through it — it is never closed, returned, passed, yielded or stored. Nothing closes it: it stays open until the garbage collector happens to finalize it, which is one leaked descriptor per call (a child process too, for `IO.popen`), `Errno::EMFILE` under load, and for a written file data that is not flushed when the program next reads it. Use the block form, which closes on every path including a raise (`Tempfile.new(…) { |io| … }`), or the one-call reader/writer (`File.read`, `File.write`, `File.foreach`). — app/mailers/customer_mailer.rb:253

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

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

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

X2 · Cancellation propagation8.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 2/3 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `fetchWithOneRetry` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — app/javascript/utils/lazy_chunk.ts:8

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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

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

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped5.1 / 10Adequate✓ Tool-verified

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

  • `thumbnail_url` carries text this program read out of a document — an attribute or a text node, which the DOM hands back already decoded, so an entity its author wrote is a live character again — and it is written straight into the `src` attribute of markup built here with nothing escaping it on the way. The value is chosen by whoever authored that document, not by this program, so it can close the attribute or element it sits in and open another — a crafted document becomes markup in what this code renders. Escape `thumbnail_url` at this site, or validate it against the shape the position accepts before interpolating it. — app/models/installment.rb:379
  • `alt_title` carries text this program read out of a document — an attribute or a text node, which the DOM hands back already decoded, so an entity its author wrote is a live character again — and it is written straight into the `alt` attribute of markup built here with nothing escaping it on the way. The value is chosen by whoever authored that document, not by this program, so it can close the attribute or element it sits in and open another — a crafted document becomes markup in what this code renders. Escape `alt_title` at this site, or validate it against the shape the position accepts before interpolating it. — app/models/installment.rb:379
  • `target_url` carries text this program read out of a document — an attribute or a text node, which the DOM hands back already decoded, so an entity its author wrote is a live character again — and it is written straight into the `href` attribute of markup built here with nothing escaping it on the way. The value is chosen by whoever authored that document, not by this program, so it can close the attribute or element it sits in and open another — a crafted document becomes markup in what this code renders. Escape `target_url` at this site, or validate it against the shape the position accepts before interpolating it. — app/models/installment.rb:380
  • `content` carries text this program read out of a document — an attribute or a text node, which the DOM hands back already decoded, so an entity its author wrote is a live character again — and it is written straight into the text of an element of markup built here with nothing escaping it on the way. The value is chosen by whoever authored that document, not by this program, so it can close the attribute or element it sits in and open another — a crafted document becomes markup in what this code renders. Escape `content` at this site, or validate it against the shape the position accepts before interpolating it. — app/models/installment.rb:380
  • `crossSell.description` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:41
  • `message` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:86
  • `upsell.description` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:34
  • `styles` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — app/javascript/components/Developer/FollowFormEmbed.tsx:42
  • `comment.content.formatted` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:301
  • `product.description_html` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:57
  • `html??""` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:19
  • `refundPolicy.fine_print` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:1306
  • `html` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:81
  • `listItem.innerHTML.replace(/<\/?p>/gu,"")` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — app/javascript/components/RichTextEditor.tsx:257
  • `initialValue` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — app/javascript/components/RichTextEditor.tsx:364
  • `setupData.qr_svg` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — app/javascript/components/Settings/PasswordPage/AuthenticatorSetup.tsx:109
  • `stripeConnect.supported_countries_help_text` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:109
  • `dom instanceof Element?dom.innerHTML:""` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:55
  • `alert.message` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — app/javascript/components/server-components/Alert.tsx:103
  • `stringifiedInnerContent` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — app/javascript/layouts/components/MetaTags.tsx:39
  • `headerText` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:60
  • `text.replace(regex,(match)=>`<mark class="highlight rounded-xs bg-pink">${match}</mark>`)` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:34
  • `article.content` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — app/javascript/pages/HelpCenter/Articles/Show.tsx:291
  • `params.toString()` is text this program did not author, and it is written into a URL attribute through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — app/javascript/utils/widgetCodeToCopyBuilders.ts:49

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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

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

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

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.

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

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a walk over a `Hash` or `Set` (`each`, `each_pair`, `map`, `for … in` and the other block walks) leaves it alone — Ruby refuses `rehash`, `replace`, `compare_by_identity` and `transform_keys!` on a Hash, and `reset`, `replace`, `compare_by_identity` and `map!` on a Set, while it is being iterated: the call raises `RuntimeError` at once and the remaining entries are never seen.

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

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

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

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

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

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

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

X3 · Exception handling6.7 / 10Adequate✓ Tool-verified

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

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

  • `if err != nil` 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. — resend_callbacks/ruby.go:48
  • `… rescue nil` 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. (×10) — lib/utilities/geo_ip.rb:19, db/migrate/20150114194817_add_scopes_to_oauth_applications.rb:5, config/initializers/005_apple.rb:66, …
  • `rescue StandardError` 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. (×17) — lib/utilities/o_embed_finder.rb:13, REDACTED:45, config/initializers/pt_osc_leftover_check.rb:97, …
  • 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. — config/vite/stale-module-guard.ts:61
  • `… rescue {}` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — config/initializers/005_apple.rb:74, config/initializers/rack_attack.rb:26
  • `rescue` 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. (×9) — app/sidekiq/post_to_ping_endpoints_worker.rb:54, app/sidekiq/verify_finance_reports_delivery_job.rb:135, app/services/tip_options_service.rb:11, …

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

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

Other · Code Health — Whether Ruby's type checker checks nil and is not undermined by assertions — a file Sorbet reads at `# typed: true` or above, or a Steep target `check`s under its default or strict diagnostics, is one where a method call on a `T.nilable(String)` / `String?` is an error, and each `T.must`, `#: as !nil` or `# steep:ignore NoMethod` is the author telling the checker a value cannot be nil.

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

  • This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 3271 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.

What to do

  • Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

Reference — by lens

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

LensScoreRatingImpact
Code Health59%Adequate — gated by D2, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture62%Adequate — gated by D26, R9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity62%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness32%Weak — gated by D13, R5, P3, P5, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security52%Adequate — gated by D29, D30, D31, D32, D36, C1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling50%AdequateAcceptable, with room to improve.
Accessibility43%Weak — gated by AC1, AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance100%ExemplaryStrongest area.
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 — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 14 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.

  • P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
Not included — 34 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.

  • AX1 Captive dependencies — Not applicable: this repository's Go imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Ruby imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — docker build failed (exit 1) — ------ REDACTED:1 -------------------- 1 | >>> FROM golang:1.26.2-bookworm AS build 2 | 3 | WORKDIR -------------------- ERROR: failed to solve: golang:1.26.2-bookworm: failed to resolve source metadata for docker.io/library/golang:1.26.2-bookworm: failed to do request: Head "https://registry-1.docker.io/v2/library/golang/manifests/1.26.2-bookworm": Forbidden; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • D11 Test Reliability — Test reliability not included
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency is measured on C# only; Go, JavaScript, Python, Ruby, TypeScript not measured.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Aggregate roots were found in only one source directory (models), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .go, .py, .rb, .ts, .tsx, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rb), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D28 Secrets (history) — gitleaks killed before it finished — this repository's working tree not scanned
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • 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.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the repository root runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • P12 CI test-gate honesty — 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'.
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (SimpleCov — `require "simplecov"` in your `spec_helper.rb`/`test_helper.rb`, which writes `coverage/.resultset.json` (or lcov via `simplecov-lcov`)) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `x.report(…)` entries in a `Benchmark.ips`/`bm`/`bmbm`/`benchmark`/`memory` block, `benchmark:` entries in a benchmark-driver YAML under a bench* directory, rspec-benchmark `perform_*` expectations where the gem is installed, or benchmark-ips, benchmark-memory, rspec-benchmark or benchmark-driver in a Gemfile or gemspec, 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 applicable: allocation awareness is rated where code engineers for it — at least 400 production lines that ship benchmarks or already use allocation-aware idioms (8 or more). This repository's Go code has 914 production line(s), 1 such use(s) and no benchmarks, so there is no allocation work to rate. The card is reward-only: its absence costs nothing.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Ruby was read, and it logs through none: the standard library's Logger, which Rails.logger is, takes one finished message and no template arguments or fields (as log4net does in C#), so an interpolated message there loses nothing the API could have kept. The console gem (`Console.info`), SemanticLogger, Ougai and dry-logger would be judged.
  • 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 — 351 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 49 more in this group — see findings.md.
DM6 · Domain ↔ infrastructure boundary · Domain fused to persistence infrastructure · ×40
  • Domain fused to persistence infrastructure: AdminApiToken REDACTED:3 — `AdminApiToken` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: AffiliateRequest app/models/affiliate_request.rb:3 — `AffiliateRequest` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: Balance app/models/balance.rb:3 — `Balance` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: BalanceTransaction app/models/balance_transaction.rb:6 — `BalanceTransaction` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: BankAccount app/models/bank_account.rb:3 — `BankAccount` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: BlockedCustomerObject app/models/blocked_customer_object.rb:3 — `BlockedCustomerObject` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: Charge app/models/charge.rb:3 — `Charge` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: CollaboratorInvitation app/models/collaborator_invitation.rb:3 — `CollaboratorInvitation` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: Commission app/models/commission.rb:3 — `Commission` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: CommunityChatRecapRun app/models/community_chat_recap_run.rb:3 — `CommunityChatRecapRun` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: Credit app/models/credit.rb:3 — `Credit` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: CreditCard REDACTED:3 — `CreditCard` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: CustomDomain app/models/custom_domain.rb:5 — `CustomDomain` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: Dispute app/models/dispute.rb:3 — `Dispute` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: DropboxFile app/models/dropbox_file.rb:3 — `DropboxFile` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: EmailInfo app/models/email_info.rb:3 — `EmailInfo` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: FailedRefundException app/models/failed_refund_exception.rb:6 — `FailedRefundException` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: FeatureAnnouncementCampaign REDACTED:6 — `FeatureAnnouncementCampaign` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: FeatureAnnouncementDelivery app/models/feature_announcement_delivery.rb:6 — `FeatureAnnouncementDelivery` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: Follower app/models/follower.rb:3 — `Follower` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: Gift app/models/gift.rb:3 — `Gift` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: Guardian app/models/guardian.rb:20 — `Guardian` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: Installment app/models/installment.rb:5 — `Installment` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: InstallmentRule app/models/installment_rule.rb:3 — `InstallmentRule` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • Domain fused to persistence infrastructure: Invite app/models/invite.rb:3 — `Invite` is a domain concept fused to persistence ON ITS OWN DECLARATION (Rails ActiveRecord — `ApplicationRecord`) — the domain entity IS the ActiveRecord row (active-record), and it carries domain behaviour on the persistence type. A schema/persistence change ripples straight into the domain. Keep the ORM/table mapping on a boundary data-model + a mapper, and the domain entity framework-free (map row↔domain through a repository).
  • + 15 more in this group — see findings.md.
AC1 · Text alternatives · <img> without a text alternative · ×37
  • <img> without a text alternative REDACTED:44 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/Communities/CommunityList.tsx:46 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/Download/FileList.tsx:280 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/Download/FileList.tsx:800 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/NestedMenu.tsx:441 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:555 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:630 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/ProductEdit/ProductTab/CoverEditor.tsx:353 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/ReviewVideoPlayer.tsx:53 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/Settings/AdvancedPage/ApplicationForm.tsx:154 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/Settings/AdvancedPage/ApplicationsSection.tsx:64 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/WorkflowsPage/WorkflowForm.tsx:289 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/WorkflowsPage/WorkflowForm.tsx:377 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/WorkflowsPage/WorkflowForm.tsx:392 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/WorkflowsPage/WorkflowForm.tsx:406 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/WorkflowsPage/WorkflowForm.tsx:420 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/components/WorkflowsPage/WorkflowForm.tsx:440 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/javascript/pages/Churn/Show.tsx:334 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/views/affiliate_mailer/collaboration_ended_by_affiliate_user.html.erb:2 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/views/affiliate_mailer/collaboration_ended_by_seller.html.erb:2 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/views/affiliate_mailer/collaborator/_heading.html.erb:2 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/views/affiliate_mailer/collaborator_creation.html.erb:2 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/views/affiliate_mailer/collaborator_invitation_accepted.html.erb:2 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/views/affiliate_mailer/collaborator_invitation_declined.html.erb:2 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative app/views/affiliate_mailer/collaborator_invited.html.erb:2 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • + 12 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · High CVE · ×36
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 11 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D32 · Data Compliance (PII/GDPR) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D13 · Secret Scanning · Leaked secret · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R9 · Circular Imports · Import cycle (2 files) · ×9
  • Import cycle (2 files) app/javascript/components/Analytics/ProductsPopover.tsx:4 — app/javascript/components/Analytics/ProductsPopover.tsx → app/javascript/components/Analytics/index.tsx → app/javascript/components/Analytics/ProductsPopover.tsx (one verified cycle inside a mutually-dependent group of 6 files)
  • Import cycle (2 files) app/javascript/pages/Communities/Index.tsx:21 — app/javascript/pages/Communities/Index.tsx → app/javascript/components/Communities/ChatMessageInput.tsx → app/javascript/pages/Communities/Index.tsx (one verified cycle inside a mutually-dependent group of 5 files)
  • Import cycle (2 files) app/javascript/components/Product/Covers/Embed.tsx:5 — app/javascript/components/Product/Covers/Embed.tsx → app/javascript/components/Product/Covers/index.tsx → app/javascript/components/Product/Covers/Embed.tsx (one verified cycle inside a mutually-dependent group of 4 files)
  • Import cycle (2 files) app/javascript/components/ProductEdit/ContentTab/index.tsx:36 — app/javascript/components/ProductEdit/ContentTab/index.tsx → app/javascript/data/product_edit.ts → app/javascript/components/ProductEdit/ContentTab/index.tsx
  • Import cycle (2 files) app/javascript/components/Profile/EditSections.tsx:43 — app/javascript/components/Profile/EditSections.tsx → app/javascript/components/Profile/EditSections/WishlistsSectionView.tsx → app/javascript/components/Profile/EditSections.tsx
  • Import cycle (2 files) app/javascript/components/RichTextEditor.tsx:43 — app/javascript/components/RichTextEditor.tsx → app/javascript/components/TiptapExtensions/Image.tsx → app/javascript/components/RichTextEditor.tsx (one verified cycle inside a mutually-dependent group of 4 files)
  • Import cycle (2 files) app/javascript/components/client-components/Nav/footer.tsx:5 — app/javascript/components/client-components/Nav/footer.tsx → app/javascript/components/client-components/Nav/index.tsx → app/javascript/components/client-components/Nav/footer.tsx
  • Import cycle (2 files) app/javascript/data/google_analytics.ts:3 — app/javascript/data/google_analytics.ts → app/javascript/utils/user_analytics.ts → app/javascript/data/google_analytics.ts
  • Import cycle (2 files) app/javascript/utils/currency.ts:1 — app/javascript/utils/currency.ts → app/javascript/utils/price.ts → app/javascript/utils/currency.ts
D29 · Static Analysis (SAST) · REDACTED · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <input> without a programmatic label · ×6
  • <input> without a programmatic label app/javascript/components/ProductEdit/ContentTab/index.tsx:857 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label app/javascript/components/Settings/AdvancedPage/ApplicationForm.tsx:140 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label app/javascript/components/TiptapExtensions/Image.tsx:323 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label app/javascript/components/TiptapExtensions/PublicFileEmbed.tsx:166 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label app/javascript/pages/Purchases/DisputeEvidence/Show.tsx:419 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label app/views/home/shared/_footer.html.erb:8 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AC2 · Forms & labels · <button> with no accessible text · ×6
  • <button> with no accessible text app/javascript/components/ReviewForm/ReviewVideoRecorderClientOnly.tsx:69 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text app/javascript/components/ReviewForm/ReviewVideoRecorderClientOnly.tsx:86 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text app/views/home/features.html.erb:171 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text app/views/home/features.html.erb:172 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text app/views/home/features.html.erb:173 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text app/views/home/features.html.erb:174 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×4
  • Click handler on a non-interactive <div> app/javascript/components/Checkout/PaymentForm.tsx:1186 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> app/javascript/components/Communities/ChatMessage.tsx:107 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> app/javascript/components/Communities/ChatMessage.tsx:313 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> app/javascript/pages/Discover/Index.tsx:87 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics · Hover-only interaction on <div> · ×4
  • Hover-only interaction on <div> app/javascript/components/NestedMenu.tsx:276 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
  • Hover-only interaction on <div> app/javascript/components/NestedMenu.tsx:297 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
  • Hover-only interaction on <div> app/javascript/components/ProductEdit/Layout.tsx:79 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
  • Hover-only interaction on <div> app/javascript/components/server-components/Alert.tsx:79 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
AC2 · Forms & labels · Link with no accessible name · ×3
  • Link with no accessible name app/views/home/shared/_footer.html.erb:38 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name app/views/home/shared/_footer.html.erb:43 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name app/views/home/shared/_footer.html.erb:48 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
D14 · License Compliance · Banned license · ×3
  • Banned license: colorize — `colorize` 1.1.0 is published on rubygems.org under GPL-2.0, which this policy bans, and it is in the RUNTIME closure of this repository's Bundler manifests — so it is installed by everything that installs this repository, not just by its test harness. Replace it, or record an accepted exception.
  • Banned license: epub-cfi — `epub-cfi` 0.1.3 is published on rubygems.org under LGPL-3.0-or-later, which this policy bans, and it is in the RUNTIME closure of this repository's Bundler manifests — so it is installed by everything that installs this repository, not just by its test harness. Replace it, or record an accepted exception.
  • Banned license: sidekiq — `sidekiq` 7.3.4 is published on rubygems.org under LGPL-3.0, which this policy bans, and it is in the RUNTIME closure of this repository's Bundler manifests — so it is installed by everything that installs this repository, not just by its test harness. Replace it, or record an accepted exception.
D31 · IaC & Container Security · Critical IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×3
  • Boundary-crossing change coupling: stripe_beneficial_owners_manager.rb ↔ update_user_compliance_info.rb app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb:1 — `app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb` (context business) and `app/services/update_user_compliance_info.rb` (context services) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `0ae3a8a4` Preserve complete Pakistani CNIC input and saved grouping (#8625); `124bd348` Validate the PK CNIC by digit count instead of a character cap (#8585); `99458827` Validate Dominican Republic CIE before payout updates (#8341) — run `git show` on any of them.
  • Boundary-crossing change coupling: REDACTED ↔ link_policy.rb REDACTED:1 — `REDACTED` (context controllers) and `app/policies/link_policy.rb` (context policies) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `43abedde` Add a one-click "disable downloads for all files" action to the produ…; `5c4ca632` Stop stale cross-product file embeds from blocking product saves (#6432); `0b42172d` Reject stale product-editor saves with optimistic concurrency (#6245) — run `git show` on any of them.
  • Boundary-crossing change coupling: healthcheck_controller.rb ↔ routes.rb app/controllers/healthcheck_controller.rb:1 — `app/controllers/healthcheck_controller.rb` (context controllers) and `config/routes.rb` (context config) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9398c307` Alert when abandoned-cart email stops going out (#7443); `755e0a67` Replace the overnight deploy block with a long-running-job healthchec…; `505eebae` Deploy freeze from payout-batch state: /healthcheck/payouts + deploy-… — run `git show` on any of them.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×2
  • REDACTED
  • REDACTED
R9 · Circular Imports · Import cycle (3 files) · ×2
  • Import cycle (3 files) app/javascript/components/DownloadPage/WithContent.tsx:21 — app/javascript/components/DownloadPage/WithContent.tsx → app/javascript/components/Download/FileList.tsx → app/javascript/components/DownloadPage/AudioPlayerContainer.tsx → app/javascript/components/DownloadPage/WithContent.tsx (one verified cycle inside a mutually-dependent group of 11 files)
  • Import cycle (3 files) app/javascript/components/Product/CtaButton.tsx:12 — app/javascript/components/Product/CtaButton.tsx → REDACTED → app/javascript/components/Product/PurchaseButton.tsx → app/javascript/components/Product/CtaButton.tsx
AC2 · Forms & labels · <label> that labels no control · ×1
  • <label> that labels no control app/views/doorkeeper/authorizations/new.html.erb:44 — This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC3 · Page structure · <iframe> without a title · ×1
  • <iframe> without a title app/javascript/components/Product/Covers/Embed.tsx:47 — An iframe with no title (or an empty one) is announced only as "frame". Add a non-empty title describing its content, or an aria-label.
AC4 · Keyboard semantics · Clickable role="tab" that no keyboard user can reach · ×1
  • Clickable role="tab" that no keyboard user can reach app/javascript/components/Product/Covers/index.tsx:129 — This <div> announces itself as a role="tab" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="tab" or point aria-activedescendant at it.
AC4 · Keyboard semantics · Clickable role="radio" that no keyboard user can reach · ×1
  • Clickable role="radio" that no keyboard user can reach app/javascript/components/RatingSelector.tsx:18 — This <span> announces itself as a role="radio" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="radio" or point aria-activedescendant at it.
AC4 · Keyboard semantics · Hover-only interaction on <span> · ×1
  • Hover-only interaction on <span> app/javascript/components/RichTextEditor.tsx:124 — This <span> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
AC5 · ARIA correctness · Invalid ARIA role "nav" · ×1
  • Invalid ARIA role "nav" app/javascript/components/Discover/Nav.tsx:49 — This role is not a valid WAI-ARIA role, so assistive tech ignores it. Use a valid role (or the native element).
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical vulnerability · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×1
  • Orphaned knowledge app/javascript/pages/Affiliates/Index.tsx: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.
R8 · Dependency Hygiene · Unlisted import '@inertiajs/core' · ×1
  • Unlisted import '@inertiajs/core' app/javascript/components/Communities/ChatMessageInput.tsx:2 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'axios' · ×1
  • Unlisted import 'axios' app/javascript/inertia/prefetch_rejection.test.ts:16 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'jszip' · ×1
  • Unlisted import 'jszip' app/javascript/pages/UrlRedirects/epubjs-patch.test.ts:9 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
Serious — 2014 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×164
  • Hotspot: app/javascript/pages/Settings/Payments/Show.tsx app/javascript/pages/Settings/Payments/Show.tsx:259 — app/javascript/pages/Settings/Payments/Show.tsx changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 401 in Show.PaymentsPage at line 259. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/pages/Settings/Payments/Show.tsx`: 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: REDACTED REDACTED:297 — REDACTED changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 159 in index.Product at line 297. 4 of those changes were fix/bug commits, and the other 30 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/javascript/components/Checkout/payment.ts app/javascript/components/Checkout/payment.ts:1492 — app/javascript/components/Checkout/payment.ts changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 154 in payment.applyCheckoutAction at line 1492. 5 of those changes were fix/bug commits, and the other 30 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/components/Checkout/payment.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/javascript/pages/Checkout/Show.tsx app/javascript/pages/Checkout/Show.tsx:185 — app/javascript/pages/Checkout/Show.tsx changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 148 in Show.CheckoutIndexPage at line 185. 5 of those changes were fix/bug commits, and the other 29 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/pages/Checkout/Show.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx:773 — app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 218 in BankAccountSection.BankAccountSection at line 773. 1 of those changes was a fix/bug commit, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/models/purchase.rb app/models/purchase.rb:1014 — app/models/purchase.rb changed 83 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in Purchase.as_json at line 1014. 10 of those changes were fix/bug commits, and the other 73 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/models/purchase.rb`: 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: REDACTED REDACTED:442 — REDACTED changed 58 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in LinksController.update at line 442. 2 of those changes were fix/bug commits, and the other 56 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:50 — app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 191 in AccountDetailsSection.AccountDetailsSection at line 50. 1 of those changes was a fix/bug commit, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx`: 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: REDACTED REDACTED:3245 — REDACTED changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in StripeMerchantAccountManager.handle_stripe_info_requirements at line 3245. 2 of those changes were fix/bug commits, and the other 39 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/javascript/components/ProductEdit/ContentTab/index.tsx app/javascript/components/ProductEdit/ContentTab/index.tsx:207 — app/javascript/components/ProductEdit/ContentTab/index.tsx changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 135 in index.ContentTabContent at line 207. 1 of those changes was a fix/bug commit, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/components/ProductEdit/ContentTab/index.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/controllers/api/v2/links_controller.rb app/controllers/api/v2/links_controller.rb:303 — app/controllers/api/v2/links_controller.rb changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 113 in LinksController.update at line 303. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/controllers/api/v2/links_controller.rb`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/javascript/components/Checkout/index.tsx app/javascript/components/Checkout/index.tsx:258 — app/javascript/components/Checkout/index.tsx changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 94 in index.Checkout at line 258. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/components/Checkout/index.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/javascript/components/Checkout/PaymentForm.tsx app/javascript/components/Checkout/PaymentForm.tsx:694 — app/javascript/components/Checkout/PaymentForm.tsx changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 87 in PaymentForm.CreditCardContent at line 694. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/components/Checkout/PaymentForm.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:84 — app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 153 in FileEmbed.FileEmbedNodeView at line 84. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:423 — app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 126 in BeneficialOwnersSection.BeneficialOwnersSection at line 423. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx`: 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: REDACTED REDACTED:448 — REDACTED changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in SettingsPresenter.account_status_details at line 448. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- REDACTED`: 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: REDACTED REDACTED:27 — REDACTED changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in PaymentsController.update at line 27. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/javascript/pages/Subscriptions/Manage.tsx app/javascript/pages/Subscriptions/Manage.tsx:117 — app/javascript/pages/Subscriptions/Manage.tsx changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in Manage.SubscriptionsManage at line 117. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/pages/Subscriptions/Manage.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/models/link.rb app/models/link.rb:1572 — app/models/link.rb changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in Link.cart_item at line 1572. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/models/link.rb`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/javascript/components/server-components/ProductEditPage.tsx app/javascript/components/server-components/ProductEditPage.tsx:525 — app/javascript/components/server-components/ProductEditPage.tsx changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in ProductEditPage.ProductEditPage at line 525. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/components/server-components/ProductEditPage.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/javascript/components/CheckoutDashboard/DiscountsPage.tsx app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:894 — app/javascript/components/CheckoutDashboard/DiscountsPage.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 144 in DiscountsPage.Form at line 894. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/components/CheckoutDashboard/DiscountsPage.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/services/purchase/create_service.rb app/services/purchase/create_service.rb:30 — app/services/purchase/create_service.rb changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in CreateService.perform at line 30. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/services/purchase/create_service.rb`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/services/ai/store_agent_service.rb app/services/ai/store_agent_service.rb:1713 — app/services/ai/store_agent_service.rb changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in StoreAgentService.write_fields at line 1713. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/services/ai/store_agent_service.rb`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/business/payments/payouts/processor/stripe/stripe_payout_processor.rb app/business/payments/payouts/processor/stripe/stripe_payout_processor.rb:346 — app/business/payments/payouts/processor/stripe/stripe_payout_processor.rb changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in StripePayoutProcessor.prepare_payment_and_set_amount at line 346. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/business/payments/payouts/processor/stripe/stripe_payout_processor.rb`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/javascript/components/Agent/AgentChat.tsx app/javascript/components/Agent/AgentChat.tsx:467 — app/javascript/components/Agent/AgentChat.tsx changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 146 in AgentChat.AgentChat at line 467. 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-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/javascript/components/Agent/AgentChat.tsx`: 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.
  • + 139 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×138
  • FunctionTooLong: AccountDetailsSection.AccountDetailsSection app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:50 — FunctionTooLong — AccountDetailsSection runs 1199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1099 over it, 11.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: Show.PaymentsPage app/javascript/pages/Settings/Payments/Show.tsx:259 — FunctionTooLong — PaymentsPage runs 1121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1021 over it, 11.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.ContentTabContent app/javascript/components/ProductEdit/ContentTab/index.tsx:207 — FunctionTooLong — ContentTabContent runs 1004 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 904 over it, 10.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: EmailForm.EmailForm app/javascript/components/EmailsPage/EmailForm.tsx:221 — FunctionTooLong — EmailForm runs 976 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 876 over it, 9.76× 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.
  • FunctionTooLong: BeneficialOwnersSection.BeneficialOwnersSection app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:423 — FunctionTooLong — BeneficialOwnersSection runs 890 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 790 over it, 8.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: DiscountsPage.Form app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:894 — FunctionTooLong — Form runs 733 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 633 over it, 7.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.
  • FunctionTooLong: FileEmbed.FileEmbedNodeView app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:84 — FunctionTooLong — FileEmbedNodeView runs 695 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 595 over it, 6.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: CustomerDetailPage.CustomerDetailPage app/javascript/components/Audience/CustomerDetailPage.tsx:135 — FunctionTooLong — CustomerDetailPage runs 688 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 588 over it, 6.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: DiscountsPage.DiscountsPage app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:227 — FunctionTooLong — DiscountsPage runs 560 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 460 over it, 5.60× 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.
  • FunctionTooLong: WorkflowForm.WorkflowForm app/javascript/components/WorkflowsPage/WorkflowForm.tsx:97 — FunctionTooLong — WorkflowForm runs 528 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 428 over it, 5.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.
  • FunctionTooLong: Show.SettingsPage app/javascript/pages/Settings/Profile/Show.tsx:102 — FunctionTooLong — SettingsPage runs 490 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 390 over it, 4.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: Show.MainPage app/javascript/pages/Settings/Main/Show.tsx:85 — FunctionTooLong — MainPage runs 480 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 380 over it, 4.80× 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.
  • FunctionTooLong: CustomersPage.CustomersPage app/javascript/components/Audience/CustomersPage.tsx:66 — FunctionTooLong — CustomersPage runs 479 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 379 over it, 4.79× 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.
  • FunctionTooLong: UpsellsPage.Form app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:523 — FunctionTooLong — Form runs 450 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 350 over it, 4.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.
  • FunctionTooLong: index.ProductTab app/javascript/components/ProductEdit/ProductTab/index.tsx:53 — FunctionTooLong — ProductTab runs 438 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 338 over it, 4.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.
  • FunctionTooLong: Index.CommunitiesIndex app/javascript/pages/Communities/Index.tsx:87 — FunctionTooLong — CommunitiesIndex 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.
  • FunctionTooLong: FormPage.FormPage app/javascript/components/CheckoutDashboard/FormPage.tsx:77 — FunctionTooLong — FormPage runs 381 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 281 over it, 3.81× 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.
  • FunctionTooLong: Index.PayoutsIndex app/javascript/pages/Payouts/Index.tsx:470 — FunctionTooLong — PayoutsIndex runs 371 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 271 over it, 3.71× 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.
  • FunctionTooLong: Manage.SubscriptionsManage app/javascript/pages/Subscriptions/Manage.tsx:117 — FunctionTooLong — SubscriptionsManage runs 348 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 248 over it, 3.48× 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.
  • FunctionTooLong: UtmLinkForm.UtmLinkForm app/javascript/components/UtmLinks/UtmLinkForm.tsx:94 — FunctionTooLong — UtmLinkForm runs 344 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 244 over it, 3.44× 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.
  • FunctionTooLong: Edit.BundlesProductEdit app/javascript/pages/Bundles/Product/Edit.tsx:110 — FunctionTooLong — BundlesProductEdit runs 339 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 239 over it, 3.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: New.NewProductPage app/javascript/pages/Products/New.tsx:113 — FunctionTooLong — NewProductPage runs 330 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 230 over it, 3.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.
  • FunctionTooLong: Show.Show app/javascript/pages/Purchases/DisputeEvidence/Show.tsx:106 — FunctionTooLong — Show runs 330 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 230 over it, 3.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.
  • FunctionTooLong: Index.LibraryPage app/javascript/pages/Library/Index.tsx:228 — FunctionTooLong — LibraryPage runs 320 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 220 over it, 3.20× 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.
  • FunctionTooLong: Form.CollaboratorForm app/javascript/components/Collaborators/Form.tsx:34 — FunctionTooLong — CollaboratorForm runs 309 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 209 over it, 3.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 113 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×77
  • TodoComment spec/support/aria_extensions.rb:72 — # TODO: Remove once incorrect locator_type raises an error instead of just logging a warning — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/support/aria_extensions.rb:84 — # TODO: Remove once incorrect locator_type raises an error instead of just logging a warning — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/support/aria_extensions.rb:216 — # TODO: This appears not to work - see the empty header workaround in ProductsTable and MembershipsTable. We should investigate and fix the XPath. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/requests/purchases/product/installment_plan_spec.rb:355 — # TODO: This is a display-only issue that we include the full tax amount — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/requests/purchases/product/upsell_spec.rb:737 — # TODO (sm17p): This is a bug. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/requests/products/collabs_spec.rb:137 — # TODO (shan) Re-enable once server-side sorting properly works for all columns (may need additional tweaks) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/requests/products/edit/integrations/discord_integrations_spec.rb:28 — # TODO: enable shared context (and remove before block), and investigate failure of specs on Buildkite — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/presenters/creator_home_presenter_spec.rb:193 — # TODO(tech debt): Remove the top-level travel_to. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/presenters/settings/team_presenter/member_info/invitation_info_spec.rb:58 — # TODO: update once marketing role is no longer WIP — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/presenters/settings/team_presenter/member_info/membership_info_spec.rb:91 — # TODO: update once marketing role is no longer WIP — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/modules/integrations_spec.rb:8 — # TODO: Change one of the integrations to have a different type after newer ones are added — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/modules/integrations_spec.rb:18 — # TODO: Change one of the integrations to have a different type after newer ones are added — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/lib/js_error_reporter_spec.rb:115 — # TODO see above — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/lib/js_error_reporter_spec.rb:164 — # TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/controllers/comments_controller_spec.rb:90 — # TODO: investigate how to make this work. CommentContext new object from controller doesn't match the object — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment spec/controllers/comments_controller_spec.rb:92 — # TODO :once figured out, add a spec for all other controller actions — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment lib/utilities/sidekiq_utility.rb:33 — # TODO: Remove this once we fix the root cause of the stuck jobs — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment db/migrate/20200721210221_record_tiered_pricing_migration.rb:4 — # TODO(helen): remove these columns when confident that tiered pricing data — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment db/migrate/20200830200804_add_base_tier_price_to_prices.rb:4 — # TODO(helen): remove this column when confident that tiered pricing data — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment config/boot.rb:13 — # TODO remove this when `suo` is updated — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment config/routes.rb:655 — # TODO: Keeping both routes for now to support legacy GET requests until all logout links are migrated to DELETE(inertia). — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment config/routes.rb:860 — # TODO: Remove when `:react_customers_page` is enabled — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment config/initializers/001_twitter.rb:5 — # TODO (sharang): Change the gem or approach to twitter signup/connection and remove this patch — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment config/initializers/mail_encodings.rb:3 — # TODO (vishal): Remove this initializer when we start relying on a Rails — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment config/initializers/mime_types.rb:12 — # TODO remove this when rack is updated to v3 — 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.
  • + 52 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×72
  • Low cohesion: User (LCOM4 131) REDACTED:3 — User's methods fall into 131 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 131 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: Link (LCOM4 121) app/models/link.rb:5 — Link's methods fall into 121 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 121 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: Purchase (LCOM4 97) app/models/purchase.rb:3 — Purchase's methods fall into 97 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 97 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: ApplicationController (LCOM4 34) app/controllers/application_controller.rb:3 — ApplicationController's methods fall into 34 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 34 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: Installment (LCOM4 31) app/models/installment.rb:5 — Installment's methods fall into 31 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 31 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: OfferCode (LCOM4 25) app/models/offer_code.rb:3 — OfferCode's methods fall into 25 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 25 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: LoginsController (LCOM4 17) REDACTED:3 — LoginsController's methods fall into 17 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 17 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: Subscription (LCOM4 17) REDACTED:3 — Subscription's methods fall into 17 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 17 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: CheckoutPresenter (LCOM4 14) app/presenters/checkout_presenter.rb:3 — CheckoutPresenter's methods fall into 14 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 14 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: ProductPresenter (LCOM4 14) app/presenters/product_presenter.rb:3 — ProductPresenter's methods fall into 14 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 14 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: PublicApiProps (LCOM4 13) app/presenters/product_presenter/public_api_props.rb:17 — PublicApiProps's methods fall into 13 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 13 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: PurchasesController (LCOM4 12) REDACTED:3 — PurchasesController's methods fall into 12 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 12 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: SignupController (LCOM4 12) REDACTED:3 — SignupController's methods fall into 12 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 12 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: HomeController (LCOM4 11) app/controllers/home_controller.rb:3 — HomeController's methods fall into 11 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 11 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ItemInfo (LCOM4 11) app/presenters/receipt_presenter/item_info.rb:3 — ItemInfo's methods fall into 11 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 11 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Card (LCOM4 10) app/presenters/product_presenter/card.rb:3 — Card's methods fall into 10 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 10 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: ProductProps (LCOM4 10) app/presenters/product_presenter/product_props.rb:3 — ProductProps's methods fall into 10 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 10 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: OrdersController (LCOM4 9) app/controllers/orders_controller.rb:3 — OrdersController's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: UserPagesController (LCOM4 9) app/controllers/user_pages_controller.rb:16 — UserPagesController's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DashboardProductsPagePresenter (LCOM4 9) app/presenters/dashboard_products_page_presenter.rb:3 — DashboardProductsPagePresenter's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: UrlRedirectPresenter (LCOM4 8) app/presenters/url_redirect_presenter.rb:3 — UrlRedirectPresenter'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: CachingProxy (LCOM4 8) app/services/creator_analytics/caching_proxy.rb:3 — CachingProxy'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: AffiliateRequestsController (LCOM4 7) REDACTED:3 — AffiliateRequestsController'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: AccountingMailer (LCOM4 7) app/mailers/accounting_mailer.rb:4 — AccountingMailer'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: CustomerLowPriorityMailer (LCOM4 7) REDACTED:3 — CustomerLowPriorityMailer'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.
  • + 47 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×64
  • FileTooLong: models/purchase.rb app/models/purchase.rb — FileTooLong — 4462 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3962 over it, 8.92× 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: PaymentsPage/BankAccountSection.tsx app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx — FileTooLong — 2514 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: BankAccountSection (773-2660). The bar is 500 significant lines; this is 2014 over it, 5.03× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2301 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1801 over it, 4.60× 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: Audience/CustomerDetailPage.tsx app/javascript/components/Audience/CustomerDetailPage.tsx — FileTooLong — 2135 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1635 over it, 4.27× 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: REDACTED REDACTED — FileTooLong — 1710 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1210 over it, 3.42× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: models/link.rb app/models/link.rb — FileTooLong — 1608 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1108 over it, 3.22× 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: REDACTED REDACTED — FileTooLong — 1598 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1098 over it, 3.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Checkout/PaymentForm.tsx app/javascript/components/Checkout/PaymentForm.tsx — FileTooLong — 1536 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1036 over it, 3.07× 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: CheckoutDashboard/DiscountsPage.tsx app/javascript/components/CheckoutDashboard/DiscountsPage.tsx — FileTooLong — 1507 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1007 over it, 3.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1425 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 925 over it, 2.85× 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: ai/store_agent_service.rb app/services/ai/store_agent_service.rb — FileTooLong — 1422 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 922 over it, 2.84× 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: stripe/stripe_charge_processor.rb app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb — FileTooLong — 1371 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 871 over it, 2.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ContentTab/index.tsx app/javascript/components/ProductEdit/ContentTab/index.tsx — FileTooLong — 1367 significant lines (blank, comment-only and punctuation-only lines excluded), about 73% of them inside a single declaration: ContentTabContent (207-1446). The bar is 500 significant lines; this is 867 over it, 2.73× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Payments/Show.tsx app/javascript/pages/Settings/Payments/Show.tsx — FileTooLong — 1320 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: PaymentsPage (259-1760). The bar is 500 significant lines; this is 820 over it, 2.64× 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: Checkout/payment.ts app/javascript/components/Checkout/payment.ts — FileTooLong — 1271 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 771 over it, 2.54× 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: PaymentsPage/BeneficialOwnersSection.tsx app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx — FileTooLong — 1246 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: BeneficialOwnersSection (423-1422). The bar is 500 significant lines; this is 746 over it, 2.49× 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: PaymentsPage/AccountDetailsSection.tsx app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx — FileTooLong — 1238 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: AccountDetailsSection (50-1343). The bar is 500 significant lines; this is 738 over it, 2.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: EmailsPage/EmailForm.tsx app/javascript/components/EmailsPage/EmailForm.tsx — FileTooLong — 1146 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: EmailForm (221-1388). The bar is 500 significant lines; this is 646 over it, 2.29× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1132 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 632 over it, 2.26× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Checkout/index.tsx app/javascript/components/Checkout/index.tsx — FileTooLong — 1056 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 556 over it, 2.11× 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: v2/links_controller.rb app/controllers/api/v2/links_controller.rb — FileTooLong — 996 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 496 over it, 1.99× 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: models/installment.rb app/models/installment.rb — FileTooLong — 943 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 443 over it, 1.89× 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: Product/ConfigurationSelector.tsx app/javascript/components/Product/ConfigurationSelector.tsx — FileTooLong — 911 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 411 over it, 1.82× 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: CheckoutDashboard/UpsellsPage.tsx app/javascript/components/CheckoutDashboard/UpsellsPage.tsx — FileTooLong — 903 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 403 over it, 1.81× 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: Checkout/Show.tsx app/javascript/pages/Checkout/Show.tsx — FileTooLong — 899 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: CheckoutIndexPage (185-1298). The bar is 500 significant lines; this is 399 over it, 1.80× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • + 39 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×55
  • TooManyMethods: Purchase app/models/purchase.rb:3 — TooManyMethods — 421 methods. The bar is 30 methods; this is 391 over it, 14.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Link app/models/link.rb:5 — TooManyMethods — 198 methods. The bar is 30 methods; this is 168 over it, 6.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: User REDACTED:3 — TooManyMethods — 187 methods. The bar is 30 methods; this is 157 over it, 6.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Subscription REDACTED:3 — TooManyMethods — 154 methods. The bar is 30 methods; this is 124 over it, 5.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: StripeMerchantAccountManager REDACTED:3 — TooManyMethods — 146 methods. The bar is 30 methods; this is 116 over it, 4.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RedisKey app/services/redis_key.rb:3 — TooManyMethods — 120 methods. The bar is 30 methods; this is 90 over it, 4.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LinksController REDACTED:3 — TooManyMethods — 117 methods. The bar is 30 methods; this is 87 over it, 3.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Installment app/models/installment.rb:5 — TooManyMethods — 94 methods. The bar is 30 methods; this is 64 over it, 3.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Stats app/modules/user/stats.rb:6 — TooManyMethods — 93 methods. The bar is 30 methods; this is 63 over it, 3.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PreparePaymentIntentService app/services/order/prepare_payment_intent_service.rb:5 — TooManyMethods — 88 methods. The bar is 30 methods; this is 58 over it, 2.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: StripeChargeProcessor app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:3 — TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OfferCode app/models/offer_code.rb:3 — TooManyMethods — 75 methods. The bar is 30 methods; this is 45 over it, 2.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UsersController app/controllers/api/internal/admin/users_controller.rb:3 — TooManyMethods — 74 methods. The bar is 30 methods; this is 44 over it, 2.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: ContactingCreatorMailer app/mailers/contacting_creator_mailer.rb:3 — 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: StoreAgentService app/services/ai/store_agent_service.rb:13 — TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PaypalChargeProcessor app/business/payments/charging/implementations/paypal/paypal_charge_processor.rb:3 — TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Prices app/modules/product/prices.rb:3 — TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ContactingCreatorMailerPreview lib/mailer_previews/contacting_creator_mailer_preview.rb:3 — 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: ProductFile app/models/product_file.rb:3 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UrlRedirect app/models/url_redirect.rb:3 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UpdateUserComplianceInfo app/services/update_user_compliance_info.rb:3 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PurchaseSearchService app/services/purchase_search_service.rb:3 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ApplicationController app/controllers/application_controller.rb:3 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Blockable app/models/concerns/purchase/blockable.rb:3 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Charge app/models/charge.rb:3 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× 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.
  • + 30 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×39
  • Swallowed exception (caught, then discarded) resend_callbacks/ruby.go:48 — `if err != nil` 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) lib/utilities/geo_ip.rb:19 — `… rescue nil` 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) lib/utilities/o_embed_finder.rb:13 — `rescue StandardError` 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) db/migrate/20150114194817_add_scopes_to_oauth_applications.rb:5 — `… rescue nil` 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) config/initializers/005_apple.rb:66 — `… rescue nil` 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) config/initializers/005_apple.rb:74 — `… rescue {}` 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) REDACTED:45 — `rescue StandardError` 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) config/initializers/pt_osc_leftover_check.rb:97 — `rescue StandardError` 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) config/initializers/rack_attack.rb:26 — `… rescue {}` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/sidekiq/generate_canada_sales_report_job.rb:356 — `… rescue nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/sidekiq/post_to_ping_endpoints_worker.rb:54 — `rescue` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/sidekiq/verify_finance_reports_delivery_job.rb:135 — `rescue` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/services/audit_correlation_id.rb:82 — `rescue StandardError` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/services/tip_options_service.rb:11 — `rescue` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/services/undeliverable_ping_subscription_notifier.rb:132 — `rescue` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/services/undelivered_receipt_notifier.rb:149 — `rescue` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/services/vat_validation_service.rb:27 — `… rescue nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/services/purchase/create_service.rb:705 — `rescue StandardError` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/services/product/save_contract.rb:148 — `rescue StandardError` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/services/product/save_contract.rb:189 — `rescue StandardError` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/services/product/save_contract.rb:205 — `rescue StandardError` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/services/product/save_contract.rb:223 — `rescue StandardError` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/services/product/save_contract.rb:243 — `rescue StandardError` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/services/product/save_contract.rb:262 — `rescue StandardError` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/services/product/save_contract.rb:278 — `rescue StandardError` 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.
  • + 14 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×32
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 7 more in this group — see findings.md.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×30
  • Outbound HTTP without resilience app/business/payments/integrations/paypal_integration_rest_api.rb:4 — `HTTParty` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/business/payments/integrations/paypal_partner_rest_credentials.rb:10 — `HTTParty` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:353 — `HTTParty.post` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:394 — `HTTParty.post` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:604 — `HTTParty.post` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:625 — `HTTParty.post` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:628 — `HTTParty.post` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:682 — `HTTParty.post` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:704 — `HTTParty.post` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/business/payments/reports/stripe_balance_summaries_report.rb:103 — `Net::HTTP.start` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/models/dropbox_file.rb:104 — `HTTParty.get` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/models/google_calendar_integration.rb:18 — `RestClient::` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/modules/multipart_transfer.rb:32 — `Net::HTTP.new` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/modules/multipart_transfer.rb:50 — `HTTParty.head` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/services/circle_api.rb:4 — `HTTParty` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/services/discord_api.rb:15 — `HTTParty.post` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/services/google_calendar_api.rb:4 — `HTTParty` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/services/google_calendar_api.rb:18 — `HTTParty.post` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/services/google_calendar_api.rb:30 — `HTTParty.post` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/services/google_calendar_api.rb:41 — `HTTParty.post` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/services/notion_api.rb:4 — `HTTParty` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/services/regional_vat_id_validation_service.rb:39 — `HTTParty` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/services/stripe_tax_forms_api.rb:4 — `HTTParty` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/services/stripe_tax_forms_api.rb:21 — `HTTParty.get` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/services/stripe_tax_forms_api.rb:27 — `HTTParty` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • + 5 more in this group — see findings.md.
AC3 · Page structure · Heading level jumps from h3 to h5 · ×22
  • Heading level jumps from h3 to h5 app/javascript/components/Audience/CustomerDetailPage.tsx:384 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/Audience/CustomerDetailPage.tsx:510 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/Audience/CustomerDetailPage.tsx:552 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/Audience/CustomerDetailPage.tsx:788 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/Audience/CustomerDetailPage.tsx:869 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/Audience/CustomerDetailPage.tsx:1227 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/Audience/CustomerDetailPage.tsx:1388 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/Audience/CustomerDetailPage.tsx:1512 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/Audience/CustomerDetailPage.tsx:1629 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/Audience/CustomerDetailPage.tsx:1735 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:595 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:682 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:716 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:395 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:445 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:468 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:480 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:498 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/pages/Affiliates/Index.tsx:505 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/pages/PiracyReports/Show.tsx:292 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/pages/UtmLinks/Index.tsx:384 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h3 to h5 app/javascript/pages/UtmLinks/Index.tsx:431 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×20
  • Untrusted text written into markup unescaped REDACTED:41 — `crossSell.description` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:86 — `message` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:34 — `upsell.description` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped app/javascript/components/Developer/FollowFormEmbed.tsx:42 — `styles` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:301 — `comment.content.formatted` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:57 — `product.description_html` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:19 — `html??""` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:1306 — `refundPolicy.fine_print` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:81 — `html` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped app/javascript/components/RichTextEditor.tsx:257 — `listItem.innerHTML.replace(/<\/?p>/gu,"")` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped app/javascript/components/RichTextEditor.tsx:364 — `initialValue` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped app/javascript/components/Settings/PasswordPage/AuthenticatorSetup.tsx:109 — `setupData.qr_svg` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:109 — `stripeConnect.supported_countries_help_text` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:55 — `dom instanceof Element?dom.innerHTML:""` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped app/javascript/components/server-components/Alert.tsx:103 — `alert.message` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped app/javascript/layouts/components/MetaTags.tsx:39 — `stringifiedInnerContent` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:60 — `headerText` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:34 — `text.replace(regex,(match)=>`<mark class="highlight rounded-xs bg-pink">${match}</mark>`)` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped app/javascript/pages/HelpCenter/Articles/Show.tsx:291 — `article.content` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped app/javascript/utils/widgetCodeToCopyBuilders.ts:49 — `params.toString()` is text this program did not author, and it is written into a URL attribute through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
D30 · Dependency Vulnerabilities · Medium CVE · ×19
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Medium IaC · ×19
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <Select> field component without a label · ×17
  • <Select> field component without a label app/javascript/components/Audience/CustomersPage.tsx:622 — This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:1274 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:1328 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:1527 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/CheckoutDashboard/FormPage.tsx:277 — This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:808 — This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:832 — This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:854 — This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:903 — This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/ProductEdit/RefundPolicy.tsx:101 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/ProductEdit/ShareTab/TaxonomyEditor.tsx:34 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/TiptapExtensions/CodeBlock.tsx:69 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/UpsellSelectModal.tsx:152 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/UtmLinks/UtmLinkForm.tsx:329 — This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/components/UtmLinks/UtmLinkForm.tsx:543 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/pages/Settings/Team/Show.tsx:175 — This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label app/javascript/pages/Settings/Team/Show.tsx:338 — This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
D29 · Static Analysis (SAST) · REDACTED · ×14
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×14
  • Change coupling: post_resend_api.rb ↔ post_sendgrid_api.rb app/services/post_resend_api.rb:1 — `app/services/post_resend_api.rb` and `app/services/post_sendgrid_api.rb` change together 90% of the time (9 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `f3ef06a6` Honor follower opt-outs at the email handoff (#8557); `2ee49706` Say "got" instead of "downloaded" in the free-purchase post footer (#…; `827a9207` Remove dead Mongo EmailEvent model and its write-only call sites (#7252) — run `git show` on any of them.
  • Change coupling: state.ts ↔ link_policy.rb app/javascript/components/ProductEdit/state.ts:1 — `app/javascript/components/ProductEdit/state.ts` and `app/policies/link_policy.rb` change together 83% of the time (10 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) 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 10 shared commits counted here, the most recent 3 are `5c4ca632` Stop stale cross-product file embeds from blocking product saves (#6432); `0b42172d` Reject stale product-editor saves with optimistic concurrency (#6245); `326baf36` Add per-file setting to hide Send to Kindle and Read buttons (#6069) — run `git show` on any of them.
  • Change coupling: MembershipsTable.tsx ↔ ProductsTable.tsx app/javascript/components/ProductsPage/MembershipsTable.tsx:1 — `app/javascript/components/ProductsPage/MembershipsTable.tsx` and `app/javascript/components/ProductsPage/ProductsTable.tsx` 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `82f1bc00` Make clicking a product in the Products list actually feel like a cli…; `33ff66d3` RTL: dir=auto on Products dashboard tables and product name editor in…; `e8e08865` fix(products): keep search active and URL query in sync (#3452) — run `git show` on any of them.
  • Change coupling: AccountStatusSection.tsx ↔ REDACTED app/javascript/components/Settings/PaymentsPage/AccountStatusSection.tsx:1 — `app/javascript/components/Settings/PaymentsPage/AccountStatusSection.tsx` and `REDACTED` 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 `1bf1ada0` Let a seller under a chargeback-rate hold operate their own pause swi…; `15896946` Offer optional social connections during account review (#7539); `9c87a143` Pay 75% of a chargeback-volume hold as a rolling reserve (#7495) — run `git show` on any of them.
  • Change coupling: REDACTED ↔ product_edit.ts REDACTED:1 — `REDACTED` and `app/javascript/data/product_edit.ts` change together 69% of the time (11 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) 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 11 shared commits counted here, the most recent 3 are `e5c7d022` Never clear a seller's installment plan from a stale product-editor s…; `354bd7d8` Omit a blank product description unless the editor marked it changed …; `ecb0c548` Answer a wedged editor save with a retryable 409 instead of a refresh… — run `git show` on any of them.
  • Change coupling: user_pages_controller.rb ↔ REDACTED app/controllers/user_pages_controller.rb:1 — `app/controllers/user_pages_controller.rb` and `REDACTED` change together 67% of the time (10 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `7c8051fc` Keep a seller's slugged storefront pages out of Google until they are…; `430ed40b` Serve the seller's share card on slugged custom-HTML pages (#8494); `84487b5d` Pin custom-domain URLs to PROTOCOL and add the missing head tags (#8000) — run `git show` on any of them.
  • Change coupling: PaymentForm.tsx ↔ CheckoutPreview.tsx app/javascript/components/Checkout/PaymentForm.tsx:1 — `app/javascript/components/Checkout/PaymentForm.tsx` and `app/javascript/components/CheckoutDashboard/CheckoutPreview.tsx` change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `8b45c3f8` Keep the checkout payment form still while content loads on phones (#…; `66ec0d8e` Point the buyer at the first unmet required field when Pay is refused…; `d0de02ce` Fix npm run typecheck: restore vite/client and unmasked type errors (… — run `git show` on any of them.
  • Change coupling: Api.tsx ↔ routes.rb app/javascript/pages/Public/Api.tsx:1 — `app/javascript/pages/Public/Api.tsx` and `config/routes.rb` change together 63% of the time (12 of the 19 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 12 shared commits counted here, the most recent 3 are `ce301fb2` Manage automatic sales through the API and store agent (#8436); `dd8cf2be` Add Sales API v2 revoke_access and undo_revoke_access (#7388); `c2198f5a` Add schedule/unschedule operations to the emails API (gp#2153) (#7249) — run `git show` on any of them.
  • Change coupling: orders_controller.rb ↔ purchase.ts app/controllers/orders_controller.rb:1 — `app/controllers/orders_controller.rb` and `app/javascript/data/purchase.ts` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 `7db2ddf5` Block unintended membership charges from saved cart lines (#8130); `3e5111db` Let gift buyers stay anonymous to the recipient (#7833); `8e8fd797` Restore a scoped CardElement lane for the confirm surfaces broken by … — run `git show` on any of them.
  • Change coupling: agent_message_streams_controller.rb ↔ AgentChat.tsx app/controllers/api/internal/agent_message_streams_controller.rb:1 — `app/controllers/api/internal/agent_message_streams_controller.rb` and `app/javascript/components/Agent/AgentChat.tsx` 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) 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 6 shared commits counted here, the most recent 3 are `ca66ac72` Fix store-agent reply and stream reliability (#7592); `24fb1c15` Bind Store Agent confirmations to proposals (#6570); `f944a395` Tell sellers when they hit the agent rate limit instead of "I ran int… — run `git show` on any of them.
  • Change coupling: ProductEditPage.tsx ↔ link_policy.rb app/javascript/components/server-components/ProductEditPage.tsx:1 — `app/javascript/components/server-components/ProductEditPage.tsx` and `app/policies/link_policy.rb` 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) 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 7 shared commits counted here, the most recent 3 are `5c4ca632` Stop stale cross-product file embeds from blocking product saves (#6432); `0b42172d` Reject stale product-editor saves with optimistic concurrency (#6245); `26ba4dcd` Swap product edit to Inertia and remove React on Rails artifacts (#3897) — run `git show` on any of them.
  • Change coupling: REDACTED ↔ REDACTED REDACTED:1 — `REDACTED` and `REDACTED` change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `21cf95d4` Point Discover canonical at /discover and qualify signup SERP fees (#…; `f250ed6e` Tell a visitor a deleted account is holding their email, instead of a…; `e0f306f4` Give buyers actionable guidance when checkout CAPTCHA fails or is blo… — run `git show` on any of them.
  • Change coupling: balance_controller.rb ↔ REDACTED app/controllers/balance_controller.rb:1 — `app/controllers/balance_controller.rb` and `app/javascript/components/Payouts/index.tsx` 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) 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 6 shared commits counted here, the most recent 3 are `9c87a143` Pay 75% of a chargeback-volume hold as a rolling reserve (#7495); `c98af4f5` Fix scheduled payout banner messages for sellers (#4522); `df492b93` Scheduled payouts for suspended users (#4397) — run `git show` on any of them.
  • Change coupling: balance_controller.rb ↔ REDACTED app/controllers/balance_controller.rb:1 — `app/controllers/balance_controller.rb` and `app/javascript/pages/Payouts/Index.tsx` 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) 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 6 shared commits counted here, the most recent 3 are `9c87a143` Pay 75% of a chargeback-volume hold as a rolling reserve (#7495); `c98af4f5` Fix scheduled payout banner messages for sellers (#4522); `df492b93` Scheduled payouts for suspended users (#4397) — run `git show` on any of them.
R4 · Test Coverage · No test reaches this file · ×13
  • No test reaches this file app/javascript/hooks/useLazyFetch.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 app/javascript/widget/overlay.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 app/javascript/entrypoints/mobile_tracking.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 app/javascript/packs/mobile_tracking.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 app/javascript/entrypoints/custom_html_analytics.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 app/javascript/widget/embed.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 scripts/mcp-review-video.mjs: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 app/javascript/components/useIsIntersecting.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 app/javascript/entrypoints/api.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 app/javascript/packs/api.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 app/javascript/entrypoints/overlay.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 app/javascript/entrypoints/design.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 app/javascript/entrypoints/email.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.
S1 · Web-Security Posture · Weak hash algorithm · ×13
  • Weak hash algorithm REDACTED:80 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:89 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:67 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:112 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:22 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:1629 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:23 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm app/modules/utilities.rb:11 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:252 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:255 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:228 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:124 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
  • Weak hash algorithm REDACTED:129 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`Digest::SHA256` or `OpenSSL::Digest.new("SHA256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×12
  • Duplicated block (11 lines × 2) app/controllers/api/internal/agent_messages_controller.rb:61 — app/controllers/api/internal/agent_messages_controller.rb:61-71 | app/controllers/api/mobile/agent_controller.rb:130-140 — before extracting anything, compare `app/controllers/api/internal/agent_messages_controller.rb` and `app/controllers/api/mobile/agent_controller.rb` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/controllers/api/internal/agent_messages_controller.rb:61` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/controllers/api/mobile/sales_controller.rb:319 — app/controllers/api/mobile/sales_controller.rb:319-329 | app/controllers/customers_controller.rb:258-268 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/controllers/api/mobile/sales_controller.rb:319` 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) app/controllers/api/v2/links_controller.rb:689 — app/controllers/api/v2/links_controller.rb:689-699 | app/controllers/api/v2/users_controller.rb:140-150 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/controllers/api/v2/links_controller.rb:688` calls `render_response` and `app/controllers/api/v2/users_controller.rb:139` 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) app/models/link.rb:1390 — app/models/link.rb:1390-1400 | app/models/link.rb:1407-1417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) app/services/creator_analytics/product_page_views.rb:43 — app/services/creator_analytics/product_page_views.rb:43-53 | app/services/creator_analytics/sales.rb:46-56 — 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) app/services/onetime/backfill_april_tax_remittances.rb:122 — app/services/onetime/backfill_april_tax_remittances.rb:122-132 | app/services/onetime/backfill_q2_2026_tax_remittances.rb:116-126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/services/onetime/backfill_april_tax_remittances.rb:122` 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 (11 lines × 2) app/services/onetime/backfill_price_checker_index_fields.rb:17 — app/services/onetime/backfill_price_checker_index_fields.rb:17-27 | app/services/onetime/backfill_product_name_raw.rb:25-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/services/onetime/backfill_price_checker_index_fields.rb:17` 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) db/migrate/20201001091435_create_link_view_events.rb:43 — db/migrate/20201001091435_create_link_view_events.rb:43-53 | db/migrate/20230404182723_remove_link_view_events.rb:45-55 — 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) db/migrate/20210510195127_create_audience_landing_page_view_events.rb:20 — db/migrate/20210510195127_create_audience_landing_page_view_events.rb:20-30 | db/migrate/20211110051320_create_signup_events.rb:17-27 — 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) db/migrate/20261130000000_create_walks_app_attest_keys.rb:5 — db/migrate/20261130000000_create_walks_app_attest_keys.rb:5-15 | db/migrate/20261215090000_drop_walks_tables.rb:10-20 — 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) app/services/installment_search_service.rb:114 — app/services/installment_search_service.rb:114-124 | app/services/purchase_search_service.rb:528-538 — 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) app/services/onetime/backfill_self_affiliate_dropped_proceeds.rb:240 — app/services/onetime/backfill_self_affiliate_dropped_proceeds.rb:240-250 | app/services/onetime/rebuilds_seller_settlement_amounts.rb:26-36 — 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.
AC3 · Page structure · Heading level jumps from h2 to h4 · ×11
  • Heading level jumps from h2 to h4 REDACTED:190 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h2 to h4 REDACTED:627 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h2 to h4 app/javascript/components/WorkflowsPage/WorkflowList.tsx:128 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h2 to h4 app/javascript/pages/Collaborators/Incomings/Index.tsx:80 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h2 to h4 app/javascript/pages/Collaborators/Index.tsx:181 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h2 to h4 app/javascript/pages/Payouts/Index.tsx:121 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h2 to h4 app/javascript/pages/PiracyReports/Index.tsx:67 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h2 to h4 app/javascript/pages/Purchases/DisputeEvidence/Show.tsx:518 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h2 to h4 app/javascript/pages/Reviews/Index.tsx:221 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h2 to h4 app/javascript/pages/Settings/Profile/Show.tsx:542 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h2 to h4 app/javascript/pages/UtmLinks/Index.tsx:303 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×10
  • Duplicated block (7 lines × 2) app/services/checkout/buyer_currency_quote.rb:347 — app/services/checkout/buyer_currency_quote.rb:347-353 | app/services/checkout/buyer_currency_quote.rb:367-373 — both copies are in the same file, so extract the 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) db/migrate/20190427212700_remove_unused_tables.rb:192 — db/migrate/20190427212700_remove_unused_tables.rb:192-198 | db/migrate/20190427212700_remove_unused_tables.rb:212-218 — both copies are in the same file, so extract the 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) lib/mailer_previews/post_resend_api_preview.rb:5 — lib/mailer_previews/post_resend_api_preview.rb:5-11 | lib/mailer_previews/post_sendgrid_api_preview.rb:5-11 — before extracting anything, compare `lib/mailer_previews/post_resend_api_preview.rb` and `lib/mailer_previews/post_sendgrid_api_preview.rb` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 70 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) lib/mailer_previews/post_resend_api_preview.rb:60 — lib/mailer_previews/post_resend_api_preview.rb:60-66 | lib/mailer_previews/post_sendgrid_api_preview.rb:60-66 — before extracting anything, compare `lib/mailer_previews/post_resend_api_preview.rb` and `lib/mailer_previews/post_sendgrid_api_preview.rb` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 70 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) lib/mailer_previews/post_resend_api_preview.rb:71 — lib/mailer_previews/post_resend_api_preview.rb:71-77 | lib/mailer_previews/post_sendgrid_api_preview.rb:71-77 — before extracting anything, compare `lib/mailer_previews/post_resend_api_preview.rb` and `lib/mailer_previews/post_sendgrid_api_preview.rb` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 70 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) app/controllers/api/mobile/sales_controller.rb:295 — app/controllers/api/mobile/sales_controller.rb:295-301 | app/controllers/customers_controller.rb:234-240 — 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) app/services/creator_analytics/product_page_views.rb:77 — app/services/creator_analytics/product_page_views.rb:77-83 | app/services/creator_analytics/sales.rb: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 both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) app/services/onetime/backfill_membership_advance_renewal_reminders.rb:115 — app/services/onetime/backfill_membership_advance_renewal_reminders.rb:115-121 | app/services/onetime/backfill_membership_renewal_reminders.rb:85-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) app/services/risk/stranded_buyer_scan_service.rb:135 — app/services/risk/stranded_buyer_scan_service.rb:135-141 | app/sidekiq/alert_on_stale_blocks_holding_established_buyers_job.rb:518-524 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) app/models/asset_preview.rb:388 — app/models/asset_preview.rb:388-394 | app/models/thumbnail.rb:50-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×10
  • Duplicated block (5 lines × 2) app/services/creator_analytics/churn/elasticsearch_fetcher.rb:34 — app/services/creator_analytics/churn/elasticsearch_fetcher.rb:34-38 | app/services/creator_analytics/churn/elasticsearch_fetcher.rb:62-66 — both copies are in the same file, so extract the 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) app/services/post_resend_api.rb:212 — app/services/post_resend_api.rb:212-216 | app/services/post_sendgrid_api.rb:264-268 — before extracting anything, compare `app/services/post_resend_api.rb` and `app/services/post_sendgrid_api.rb` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 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 (5 lines × 2) app/sidekiq/send_workflow_installment_worker.rb:299 — app/sidekiq/send_workflow_installment_worker.rb:299-303 | app/sidekiq/send_workflow_installment_worker.rb:327-331 — both copies are in the same file, so extract the 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 (5 lines × 2) app/controllers/orders_controller.rb:496 — app/controllers/orders_controller.rb:496-500 | REDACTED:482-488 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) app/services/notion_api.rb:22 — app/services/notion_api.rb:22-29 | app/services/zoom_api.rb:25-29 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) app/services/tax_remittances/quarterly_liability_calculator.rb:248 — app/services/tax_remittances/quarterly_liability_calculator.rb:248-252 | app/sidekiq/create_global_sales_tax_summary_report_job.rb:470-474 — 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) app/sidekiq/generate_video_poster_worker.rb:13 — app/sidekiq/generate_video_poster_worker.rb:13-21 | app/sidekiq/process_asset_preview_retina_worker.rb:9-13 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) app/business/payments/reports/deferred_refunds_reports.rb:23 — app/business/payments/reports/deferred_refunds_reports.rb:23-27 | app/business/payments/reports/funds_received_reports.rb:14-18 — 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) db/seeds/010_development_staging_test/taxonomy_create.rb:11 — db/seeds/010_development_staging_test/taxonomy_create.rb:11-15 | db/seeds/010_development_staging_test/taxonomy_create.rb:112-116 — both copies are in the same file, so extract the 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) db/seeds/010_development_staging_test/taxonomy_create.rb:289 — db/seeds/010_development_staging_test/taxonomy_create.rb:289-293 | db/seeds/010_development_staging_test/taxonomy_create.rb:295-299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D3 · God Classes · ClassTooLong · ×9
  • ClassTooLong: BankAccountSection app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx:1 — ClassTooLong — 1850 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 1450 over it, 4.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: AccountDetailsSection app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:1 — ClassTooLong — 1199 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 799 over it, 3.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: EmailForm app/javascript/components/EmailsPage/EmailForm.tsx:1 — ClassTooLong — 976 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 576 over it, 2.44× 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: BeneficialOwnersSection app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:1 — ClassTooLong — 890 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 490 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CustomerDetailPage app/javascript/components/Audience/CustomerDetailPage.tsx:1 — ClassTooLong — 688 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 288 over it, 1.72× 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: DiscountsPage app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:1 — ClassTooLong — 560 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 160 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WorkflowForm app/javascript/components/WorkflowsPage/WorkflowForm.tsx:1 — ClassTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 128 over it, 1.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ProductEditPage app/javascript/components/server-components/ProductEditPage.tsx:1 — ClassTooLong — 483 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 83 over it, 1.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: CustomersPage app/javascript/components/Audience/CustomersPage.tsx:1 — ClassTooLong — 479 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 79 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×8
  • Duplicated block (8 lines × 2) app/controllers/api/internal/admin/purchases_controller.rb:109 — app/controllers/api/internal/admin/purchases_controller.rb:109-116 | app/controllers/api/internal/admin/purchases_controller.rb:159-166 — both copies are in the same file, so extract the 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 (8 lines × 2) app/controllers/api/internal/admin/purchases_controller.rb:166 — app/controllers/api/internal/admin/purchases_controller.rb:166-173 | app/controllers/api/internal/admin/purchases_controller.rb:394-401 — both copies are in the same file, so extract the 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 (8 lines × 2) app/controllers/api/internal/admin/users_controller.rb:526 — app/controllers/api/internal/admin/users_controller.rb:526-533 | app/controllers/api/internal/admin/users_controller.rb:556-563 — both copies are in the same file, so extract the 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 (8 lines × 2) db/migrate/20230707223804_remove_category_tables.rb:15 — db/migrate/20230707223804_remove_category_tables.rb:15-22 | db/migrate/20230707223804_remove_category_tables.rb:24-31 — both copies are in the same file, so extract the 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) db/migrate/20250211173413_increase_utm_link_param_char_limits.rb:5 — db/migrate/20250211173413_increase_utm_link_param_char_limits.rb:5-12 | db/migrate/20250211173413_increase_utm_link_param_char_limits.rb:19-26 — both copies are in the same file, so extract the 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) app/services/admin/related_users_service.rb:159 — app/services/admin/related_users_service.rb:159-166 | app/services/admin/scheduled_payout_enrichment_service.rb:40-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) db/migrate/20111109223341_create_assets.rb:5 — db/migrate/20111109223341_create_assets.rb:5-13 | db/migrate/20111116194231_remove_assets.rb:9-16 — 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) lib/mailer_previews/post_resend_api_preview.rb:99 — lib/mailer_previews/post_resend_api_preview.rb:99-106 | lib/mailer_previews/post_sendgrid_api_preview.rb:99-106 — before extracting anything, compare `lib/mailer_previews/post_resend_api_preview.rb` and `lib/mailer_previews/post_sendgrid_api_preview.rb` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 70 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.
D29 · Static Analysis (SAST) · REDACTED · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×7
  • Duplicated block (6 lines × 2) app/controllers/checkout/discounts_controller.rb:72 — app/controllers/checkout/discounts_controller.rb:72-77 | app/controllers/checkout/discounts_controller.rb: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.
  • Duplicated block (6 lines × 2) REDACTED:194 — REDACTED:194-199 | REDACTED:229-234 — both copies are in the same file, so extract the 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) app/services/exports/payouts/base.rb:189 — app/services/exports/payouts/base.rb:189-194 | app/services/exports/payouts/base.rb:235-240 — both copies are in the same file, so extract the 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) db/migrate/20240616210250_remove_sales_stats_tables.rb:60 — db/migrate/20240616210250_remove_sales_stats_tables.rb:60-65 | db/migrate/20240616210250_remove_sales_stats_tables.rb:235-240 — both copies are in the same file, so extract the 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) app/models/purchase.rb:3441 — app/models/purchase.rb:3441-3446 | app/models/service_charge.rb:146-151 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) app/sidekiq/refresh_merchant_account_products_recommendation_eligibility_job.rb:15 — app/sidekiq/refresh_merchant_account_products_recommendation_eligibility_job.rb:15-20 | app/sidekiq/refresh_user_products_recommendation_eligibility_job.rb:16-21 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) app/controllers/api/mobile/sales_controller.rb:67 — app/controllers/api/mobile/sales_controller.rb:67-72 | REDACTED:238-243 — 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.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×7
  • Recursive walk over a caller-supplied document has no depth cap lib/utilities/log_redactor.rb:20 — `redact` is public and takes `value` — which it walks as a `Hash` — from its caller, and it calls itself at line 20 (`self.redact`) with a piece of `value` (and at line 23) — and nowhere in `redact` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends stack per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A walk like this one raises `SystemStackError` past about 3,800 levels on the main thread and about 1,000 on a `Thread` — where Puma serves requests and Sidekiq runs jobs (MRI 3.3 and 4.0). `JSON.parse` stops at 100 levels by default, but the other parsers a caller may use do not: `YAML.safe_load` builds 1,400 levels from 2.8 KB, `Oj.load` 100,000, REXML 200,000, and `JSON.load` on json 2.7 (Ruby 3.3's default) or `JSON.parse(…, max_nesting: false)` 58,000. `SystemStackError` is not a `StandardError`: a bare `rescue` or `rescue => e` around the call does not stop it. Thread a depth argument through `redact` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap app/services/product/rich_content_deletion_guard.rb:148 — `normalize_description` is public and takes `description` — which it walks as a `Hash` — from its caller, and it calls itself at line 148 (`self.normalize_description`) with a piece of `description` (and at line 149) — and nowhere in `normalize_description` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends stack per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A walk like this one raises `SystemStackError` past about 3,800 levels on the main thread and about 1,000 on a `Thread` — where Puma serves requests and Sidekiq runs jobs (MRI 3.3 and 4.0). `JSON.parse` stops at 100 levels by default, but the other parsers a caller may use do not: `YAML.safe_load` builds 1,400 levels from 2.8 KB, `Oj.load` 100,000, REXML 200,000, and `JSON.load` on json 2.7 (Ruby 3.3's default) or `JSON.parse(…, max_nesting: false)` 58,000. `SystemStackError` is not a `StandardError`: a bare `rescue` or `rescue => e` around the call does not stop it. Thread a depth argument through `normalize_description` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap app/javascript/data/product_edit.ts:363 — `applyFileIdMappingsToRichContent` is exported, takes a document from its caller (line 379) and hands it to `applyFileIdMappings`, which calls itself at line 363 (`applyFileIdMappings`) with a piece of `value` (and at line 375) — and nowhere in `applyFileIdMappings` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `applyFileIdMappings` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap app/javascript/data/product_edit.ts:389 — `removeFileEmbedsFromRichContent` is exported, takes a document from its caller (line 430) and hands it to `removeFileEmbeds`, which calls itself at line 389 (`removeFileEmbeds`) with a piece of `value` (and at line 404) — and nowhere in `removeFileEmbeds` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `removeFileEmbeds` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap app/javascript/components/ProductEdit/ContentTab/index.tsx:141 — `rawDocContainsNode` is exported and takes `value: unknown` from its caller, and it calls itself at line 141 (`rawDocContainsNode`) with a piece of `value` (and at line 144) — and nowhere in `rawDocContainsNode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `rawDocContainsNode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap REDACTED:1508 — `submitted_field_names` is public and takes `sent_attributes` — which it walks as a `Hash` — from its caller, and it calls itself at line 1508 (`self.submitted_field_names`) with a piece of `sent_attributes` — and nowhere in `submitted_field_names` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends stack per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A walk like this one raises `SystemStackError` past about 3,800 levels on the main thread and about 1,000 on a `Thread` — where Puma serves requests and Sidekiq runs jobs (MRI 3.3 and 4.0). `JSON.parse` stops at 100 levels by default, but the other parsers a caller may use do not: `YAML.safe_load` builds 1,400 levels from 2.8 KB, `Oj.load` 100,000, REXML 200,000, and `JSON.load` on json 2.7 (Ruby 3.3's default) or `JSON.parse(…, max_nesting: false)` 58,000. `SystemStackError` is not a `StandardError`: a bare `rescue` or `rescue => e` around the call does not stop it. Thread a depth argument through `submitted_field_names` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap REDACTED:2836 — `force_utf8_encoding` is public and takes `value` — which it walks as a `Hash` — from its caller, and it calls itself at line 2836 (`self.force_utf8_encoding`) with a piece of `value` (and at line 2838) — and nowhere in `force_utf8_encoding` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends stack per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. A walk like this one raises `SystemStackError` past about 3,800 levels on the main thread and about 1,000 on a `Thread` — where Puma serves requests and Sidekiq runs jobs (MRI 3.3 and 4.0). `JSON.parse` stops at 100 levels by default, but the other parsers a caller may use do not: `YAML.safe_load` builds 1,400 levels from 2.8 KB, `Oj.load` 100,000, REXML 200,000, and `JSON.load` on json 2.7 (Ruby 3.3's default) or `JSON.parse(…, max_nesting: false)` 58,000. `SystemStackError` is not a `StandardError`: a bare `rescue` or `rescue => e` around the call does not stop it. Thread a depth argument through `force_utf8_encoding` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×6
  • Animation without a prefers-reduced-motion guard app/javascript/components/LoadingSpinner.tsx:6 — <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard app/views/home/saas.html.erb:35 — `.gr-slider::-webkit-slider-thumb` moves (`transition: box-shadow 0.08s, transform 0.08s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard app/views/home/saas.html.erb:44 — `.gr-slider::-moz-range-thumb` moves (`transition: box-shadow 0.08s, transform 0.08s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard public/cloudflare_wait.html — <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard app/javascript/stylesheets/tailwind.css:111 — `.parallax-up` moves (`transition: transform 0.1s linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard app/javascript/stylesheets/tailwind.css:113 — `.parallax-up` moves (`animation: parallax-scroll linear`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D29 · Static Analysis (SAST) · REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×6
  • Duplicated block (12 lines × 2) app/policies/comment_context_policy.rb:22 — app/policies/comment_context_policy.rb:22-33 | app/policies/comment_context_policy.rb:38-49 — both copies are in the same file, so extract the 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 (12 lines × 2) db/migrate/20190427212700_remove_unused_tables.rb:25 — db/migrate/20190427212700_remove_unused_tables.rb:25-36 | db/migrate/20190427212700_remove_unused_tables.rb:136-147 — both copies are in the same file, so extract the 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) lib/mailer_previews/post_resend_api_preview.rb:28 — lib/mailer_previews/post_resend_api_preview.rb:28-39 | lib/mailer_previews/post_sendgrid_api_preview.rb:28-39 — before extracting anything, compare `lib/mailer_previews/post_resend_api_preview.rb` and `lib/mailer_previews/post_sendgrid_api_preview.rb` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 70 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 (12 lines × 2) lib/mailer_previews/post_resend_api_preview.rb:44 — lib/mailer_previews/post_resend_api_preview.rb:44-55 | lib/mailer_previews/post_sendgrid_api_preview.rb:44-55 — before extracting anything, compare `lib/mailer_previews/post_resend_api_preview.rb` and `lib/mailer_previews/post_sendgrid_api_preview.rb` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 70 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 (12 lines × 2) app/models/cote_d_ivoire_bank_account.rb:43 — app/models/cote_d_ivoire_bank_account.rb:43-54 | app/models/niger_bank_account.rb:46-57 — 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 (12 lines × 2) app/services/instagram_profile_fetcher.rb:37 — app/services/instagram_profile_fetcher.rb:37-48 | app/services/youtube_channel_fetcher.rb:54-65 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×5
  • Duplicated block (10 lines × 2) REDACTED:11 — REDACTED:11-20 | REDACTED:32-41 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) app/services/onetime/backfill_price_checker_index_fields.rb:32 — app/services/onetime/backfill_price_checker_index_fields.rb:32-41 | app/services/onetime/backfill_product_name_raw.rb:42-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/services/onetime/backfill_price_checker_index_fields.rb:32` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/services/tax_remittances/quarterly_liability_calculator.rb:193 — app/services/tax_remittances/quarterly_liability_calculator.rb:193-202 | app/sidekiq/create_global_sales_tax_summary_report_job.rb:404-413 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/services/tax_remittances/quarterly_liability_calculator.rb:193` 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) lib/mailer_previews/post_resend_api_preview.rb:86 — lib/mailer_previews/post_resend_api_preview.rb:86-95 | lib/mailer_previews/post_sendgrid_api_preview.rb:86-95 — before extracting anything, compare `lib/mailer_previews/post_resend_api_preview.rb` and `lib/mailer_previews/post_sendgrid_api_preview.rb` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) app/services/post_resend_api.rb:13 — app/services/post_resend_api.rb:13-22 | app/services/post_sendgrid_api.rb:19-28 — before extracting anything, compare `app/services/post_resend_api.rb` and `app/services/post_sendgrid_api.rb` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 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.
AC6 · Visual & motion safety · Focus outline removed inline · ×4
  • Focus outline removed inline app/javascript/components/Download/FileList.tsx:562 — <button> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
  • Focus outline removed inline app/javascript/components/ProductEdit/ProductTab/PriceChecker/index.tsx:180 — <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline app/javascript/components/ui/Input.tsx:23 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline app/javascript/components/ui/Textarea.tsx:9 — <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
X24 · Document value interpolated into markup unescaped · Document value reaches a markup attribute unescaped · ×4
  • Document value reaches a markup attribute unescaped app/models/installment.rb:379 — `thumbnail_url` carries text this program read out of a document — an attribute or a text node, which the DOM hands back already decoded, so an entity its author wrote is a live character again — and it is written straight into the `src` attribute of markup built here with nothing escaping it on the way. The value is chosen by whoever authored that document, not by this program, so it can close the attribute or element it sits in and open another — a crafted document becomes markup in what this code renders. Escape `thumbnail_url` at this site, or validate it against the shape the position accepts before interpolating it.
  • Document value reaches a markup attribute unescaped app/models/installment.rb:379 — `alt_title` carries text this program read out of a document — an attribute or a text node, which the DOM hands back already decoded, so an entity its author wrote is a live character again — and it is written straight into the `alt` attribute of markup built here with nothing escaping it on the way. The value is chosen by whoever authored that document, not by this program, so it can close the attribute or element it sits in and open another — a crafted document becomes markup in what this code renders. Escape `alt_title` at this site, or validate it against the shape the position accepts before interpolating it.
  • Document value reaches a markup attribute unescaped app/models/installment.rb:380 — `target_url` carries text this program read out of a document — an attribute or a text node, which the DOM hands back already decoded, so an entity its author wrote is a live character again — and it is written straight into the `href` attribute of markup built here with nothing escaping it on the way. The value is chosen by whoever authored that document, not by this program, so it can close the attribute or element it sits in and open another — a crafted document becomes markup in what this code renders. Escape `target_url` at this site, or validate it against the shape the position accepts before interpolating it.
  • Document value reaches a markup attribute unescaped app/models/installment.rb:380 — `content` carries text this program read out of a document — an attribute or a text node, which the DOM hands back already decoded, so an entity its author wrote is a live character again — and it is written straight into the text of an element of markup built here with nothing escaping it on the way. The value is chosen by whoever authored that document, not by this program, so it can close the attribute or element it sits in and open another — a crafted document becomes markup in what this code renders. Escape `content` at this site, or validate it against the shape the position accepts before interpolating it.
AC2 · Forms & labels · <Textarea> field component without a label · ×3
  • <Textarea> field component without a label app/javascript/components/Communities/ChatMessage.tsx:297 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Textarea> field component without a label app/javascript/components/Communities/ChatMessageInput.tsx:54 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Textarea> field component without a label app/javascript/components/ReviewResponseForm.tsx:70 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
D17 · Explicit Debt · FixmeComment · ×3
  • FixmeComment spec/lib/js_error_reporter_spec.rb:110 — # FIXME nested objects - can't format properly because Chrome WebDriver log data does not include properties for this level of nesting — 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.
  • FixmeComment app/javascript/data/payment_method_result.ts:130 — // FIXME: overloads will not properly type the cases where an argument is a union — 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.
  • FixmeComment app/javascript/data/payment_method_result.ts:238 — // FIXME: see above — 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.
D17 · Explicit Debt · HackComment · ×3
  • HackComment app/modules/purchase/ping_notification.rb:71 — # Hack for printful (hackful?) — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment app/models/purchase.rb:3343 — # hack to get around the `i.send_emails?` check below — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment app/javascript/components/ProductEdit/ContentTab/index.tsx:760 — // hack for use in E2E tests — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×3
  • Duplicated block (20 lines × 2) app/models/credit.rb:137 — app/models/credit.rb:137-156 | app/models/credit.rb:197-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. Read the line range as the matched WINDOW rather than a finished unit: at `app/models/credit.rb:137` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) db/migrate/20120216022958_change_yen_to_jpy.rb:5 — db/migrate/20120216022958_change_yen_to_jpy.rb:5-24 | db/migrate/20120216022958_change_yen_to_jpy.rb:28-47 — both copies are in the same file, so extract the 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 (20 lines × 2) db/migrate/20190504212349_sync_dev_columns_lengths_and_positions.rb:5 — db/migrate/20190504212349_sync_dev_columns_lengths_and_positions.rb:5-24 | db/migrate/20190504212349_sync_dev_columns_lengths_and_positions.rb:41-60 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×3
  • Duplicated block (14 lines × 2) app/controllers/api/v2/covers_controller.rb:10 — app/controllers/api/v2/covers_controller.rb:10-23 | app/controllers/api/v2/thumbnails_controller.rb:12-25 — 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 (14 lines × 2) app/controllers/api/v2/links_controller.rb:733 — app/controllers/api/v2/links_controller.rb:733-746 | app/controllers/api/v2/users_controller.rb:113-126 — 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, `app/controllers/api/v2/users_controller.rb:111` calls `render_response` and `app/controllers/api/v2/links_controller.rb:732` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) app/services/community_chat_recap_generator_service.rb:122 — app/services/community_chat_recap_generator_service.rb:122-135 | app/services/community_chat_recap_generator_service.rb:151-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/services/community_chat_recap_generator_service.rb:122` 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 · Duplicated block (9 lines × 2) · ×3
  • Duplicated block (9 lines × 2) app/controllers/api/internal/agent_messages_controller.rb:74 — app/controllers/api/internal/agent_messages_controller.rb:74-82 | app/controllers/api/mobile/agent_controller.rb:143-151 — before extracting anything, compare `app/controllers/api/internal/agent_messages_controller.rb` and `app/controllers/api/mobile/agent_controller.rb` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) db/migrate/20201001091435_create_link_view_events.rb:13 — db/migrate/20201001091435_create_link_view_events.rb:13-21 | db/migrate/20210510195127_create_audience_landing_page_view_events.rb:11-19 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) db/migrate/20201001091435_create_link_view_events.rb:12 — db/migrate/20201001091435_create_link_view_events.rb:12-20 | db/migrate/20211110051320_create_signup_events.rb:8-16 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×3
  • Duplicated block (6 lines × 3) db/migrate/20190427212700_remove_unused_tables.rb:110 — db/migrate/20190427212700_remove_unused_tables.rb:110-115 | db/migrate/20190427212700_remove_unused_tables.rb:193-198 | db/migrate/20190427212700_remove_unused_tables.rb:213-218 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) db/migrate/20240616210250_remove_sales_stats_tables.rb:16 — db/migrate/20240616210250_remove_sales_stats_tables.rb:16-21 | db/migrate/20240616210250_remove_sales_stats_tables.rb:103-108 | db/migrate/20240616210250_remove_sales_stats_tables.rb:189-194 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 3) app/services/api/v2/sales_summary.rb:132 — app/services/api/v2/sales_summary.rb:132-138 | app/services/creator_analytics/product_page_views.rb:87-92 | app/services/creator_analytics/sales.rb:101-107 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×3
  • Duplicated block (7 lines × 3) app/services/circle_api.rb:40 — app/services/circle_api.rb:40-46 | app/services/google_calendar_api.rb:61-67 | app/services/zoom_api.rb:37-43 — 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.
  • Duplicated block (7 lines × 3) lib/omni_auth/strategies/instagram.rb:62 — lib/omni_auth/strategies/instagram.rb:62-68 | lib/omni_auth/strategies/tiktok.rb:76-82 | lib/omni_auth/strategies/youtube.rb:47-53 — 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. 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) app/modules/shipping_destination/destinations.rb:25 — app/modules/shipping_destination/destinations.rb:25-31 | app/modules/shipping_destination/destinations.rb:35-41 | app/modules/shipping_destination/destinations.rb:45-51 — 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.
R10 · Code Duplication · Duplicated block with local edits (30 matched lines × 2 locations) · ×3
  • Duplicated block with local edits (30 matched lines × 2 locations) app/javascript/components/Download/RichContent.tsx:367 — app/javascript/components/Download/RichContent.tsx:367 · app/javascript/components/ProductEdit/ContentTab/FileEmbedGroup.tsx:269 — the two spans are one implementation copied and then locally edited — 166 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 with local edits (30 matched lines × 2 locations) app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:742 — app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:742 · app/javascript/components/TiptapExtensions/PublicFileEmbed.tsx:96 — the two spans are one implementation copied and then locally edited — 196 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 with local edits (30 matched lines × 2 locations) app/javascript/components/Profile/SectionsForm.tsx:368 — app/javascript/components/Profile/SectionsForm.tsx:368 · app/javascript/components/Profile/SectionsForm.tsx:619 — the two spans are one implementation copied and then locally edited — 174 tokens are still identical, in the same order in both spans, 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.
R7 · Dead Code · Dead file (~1 LoC) · ×3
  • Dead file (~1 LoC) app/javascript/entrypoints/design.ts — no import path from any entry point (7 application, 18 tooling, 265 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 (~1 LoC) app/javascript/entrypoints/email.ts — no import path from any entry point (7 application, 18 tooling, 265 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 (~1 LoC) app/javascript/entrypoints/embed.ts — no import path from any entry point (7 application, 18 tooling, 265 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
X18 · Disposal-pattern correctness · Disposable created and abandoned in the function that made it · ×3
  • Disposable created and abandoned in the function that made it app/services/post_resend_api.rb:281 — `File.new` is called here without a block, so it hands back an open descriptor the caller must close — and it is held in `file`, and every later use of `file` in `log_mail_debug_info` reads a member through it — it is never closed, returned, passed, yielded or stored. Nothing closes it: it stays open until the garbage collector happens to finalize it, which is one leaked descriptor per call (a child process too, for `IO.popen`), `Errno::EMFILE` under load, and for a written file data that is not flushed when the program next reads it. Use the block form, which closes on every path including a raise (`File.new(…) { |io| … }`), or the one-call reader/writer (`File.read`, `File.write`, `File.foreach`).
  • Disposable created and abandoned in the function that made it app/services/post_sendgrid_api.rb:294 — `File.new` is called here without a block, so it hands back an open descriptor the caller must close — and it is held in `file`, and every later use of `file` in `log_mail_debug_info` reads a member through it — it is never closed, returned, passed, yielded or stored. Nothing closes it: it stays open until the garbage collector happens to finalize it, which is one leaked descriptor per call (a child process too, for `IO.popen`), `Errno::EMFILE` under load, and for a written file data that is not flushed when the program next reads it. Use the block form, which closes on every path including a raise (`File.new(…) { |io| … }`), or the one-call reader/writer (`File.read`, `File.write`, `File.foreach`).
  • Disposable created and abandoned in the function that made it app/mailers/customer_mailer.rb:253 — `Tempfile.new` is called here without a block, so it hands back an open descriptor the caller must close — and it is held in `temp_file`, and every later use of `temp_file` in `send_to_kindle` reads a member through it — it is never closed, returned, passed, yielded or stored. Nothing closes it: it stays open until the garbage collector happens to finalize it, which is one leaked descriptor per call (a child process too, for `IO.popen`), `Errno::EMFILE` under load, and for a written file data that is not flushed when the program next reads it. Use the block form, which closes on every path including a raise (`Tempfile.new(…) { |io| … }`), or the one-call reader/writer (`File.read`, `File.write`, `File.foreach`).
AC2 · Forms & labels · <ComboBox> field component without a label · ×2
  • <ComboBox> field component without a label app/javascript/components/Discover/Search.tsx:71 — This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <ComboBox> field component without a label app/javascript/components/Product/ShareSection.tsx:98 — This UI-library field component has no label / aria-label / aria-labelledby / id — and neither does anything it renders (a name prop is the form-submission key, not a label) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels · <fieldset> without a <legend> · ×2
  • <fieldset> without a <legend> app/javascript/components/ProductEdit/ShareTab/ShareYourLaunchCard.tsx:355 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> app/javascript/components/TiptapExtensions/TextInputNodeView.tsx:31 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
AC3 · Page structure · Empty <h4> heading · ×2
  • Empty <h4> heading REDACTED:41 — An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative.
  • Empty <h4> heading REDACTED:34 — An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative.
AC3 · Page structure · Heading level jumps from h1 to h3 · ×2
  • Heading level jumps from h1 to h3 REDACTED:57 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
  • Heading level jumps from h1 to h3 app/javascript/pages/UrlRedirects/Read.tsx:957 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC4 · Keyboard semantics · Link used as a button (placeholder href) · ×2
  • Link used as a button (placeholder href) app/javascript/components/DashboardPage.tsx:440 — An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action.
  • Link used as a button (placeholder href) app/javascript/components/DashboardPage.tsx:456 — An <a href="#"> (or javascript:) with a click handler is a button dressed as a link — it announces the wrong role and stops working without JS. Use a <button> for an action.
D1 · Cyclomatic Complexity · Show.PaymentsPage · ×2
  • Show.PaymentsPage::validateBankAccountFields (cyclomatic 180) app/javascript/pages/Settings/Payments/Show.tsx:532 — Show.PaymentsPage::validateBankAccountFields has cyclomatic complexity 180 (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. This shape REPEATS in the file: 2 other methods here (Show.PaymentsPage, Show.PaymentsPage::validateComplianceInfoFields) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • Show.PaymentsPage::validateComplianceInfoFields (cyclomatic 95) app/javascript/pages/Settings/Payments/Show.tsx:832 — Show.PaymentsPage::validateComplianceInfoFields has cyclomatic complexity 95 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (Show.PaymentsPage, Show.PaymentsPage::validateBankAccountFields) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×2
  • Repeated repair: app/services/purchase/base_service.rb app/services/purchase/base_service.rb:51 — app/services/purchase/base_service.rb changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is BaseService.create_subscription at line 51), 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 Indian card mandate renewals (#7239)”; “Add UPI Autopay for fixed-INR memberships (#6738)”; “Store the fixed buyer-currency amount for every later-charge product type (#6495)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/services/purchase/base_service.rb`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/services/save_content_upsells_service.rb app/services/save_content_upsells_service.rb:128 — app/services/save_content_upsells_service.rb changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is SaveContentUpsellsService.parse_discount at line 128), 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 crash on malformed upsellCard nodes missing attrs (follow-up to #7012) (#7132)”; “Fix main: accept ActionController::Parameters in collect_upsell_nodes (#7026)”; “Fix nested upsell card ID leaking into duplicated sections (follow-up to #6871) (#7012)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-27..2026-10-25, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-27 15:31:44 -04:00' --until='2026-10-25 15:31:44 -04:00' --full-history --no-merges -- app/services/save_content_upsells_service.rb`: 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.
D2 · Cognitive Complexity · Show.PaymentsPage · ×2
  • Show.PaymentsPage::validateBankAccountFields (cognitive 184) app/javascript/pages/Settings/Payments/Show.tsx:532 — Show.PaymentsPage::validateBankAccountFields has cognitive complexity 184 (threshold 15). Drivers by points: if/else 97 (101 pts), boolean chains 83 (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. This shape REPEATS in the file: 2 other methods here (Show.PaymentsPage, Show.PaymentsPage::validateComplianceInfoFields) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • Show.PaymentsPage::validateComplianceInfoFields (cognitive 118) app/javascript/pages/Settings/Payments/Show.tsx:832 — Show.PaymentsPage::validateComplianceInfoFields has cognitive complexity 118 (threshold 15). Drivers by points: if/else 52 (91 pts), boolean chains 26, ternaries 1 (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. This shape REPEATS in the file: 2 other methods here (Show.PaymentsPage, Show.PaymentsPage::validateBankAccountFields) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · AgentChat.AgentChat · ×2
  • AgentChat.AgentChat::send (cognitive 35) app/javascript/components/Agent/AgentChat.tsx:724 — AgentChat.AgentChat::send has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 2 (6 pts), boolean chains 4, 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. This shape REPEATS in the file: 2 other methods here (AgentChat.AgentChat, AgentChat.AgentChat::confirmAction) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • AgentChat.AgentChat::confirmAction (cognitive 19) app/javascript/components/Agent/AgentChat.tsx:986 — AgentChat.AgentChat::confirmAction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (6 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. This shape REPEATS in the file: 2 other methods here (AgentChat.AgentChat, AgentChat.AgentChat::send) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D32 · Data Compliance (PII/GDPR) · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/models/credit.rb:131 — app/models/credit.rb:131-161 | app/models/credit.rb:180-221 | app/models/credit.rb:360-444 | app/models/credit.rb:459-482 — 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) lib/mailer_previews/post_resend_api_preview.rb:27 — lib/mailer_previews/post_resend_api_preview.rb:27-39 | lib/mailer_previews/post_resend_api_preview.rb:43-55 | lib/mailer_previews/post_sendgrid_api_preview.rb:27-39 | lib/mailer_previews/post_sendgrid_api_preview.rb:43-55 — 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 · Duplicated block (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) app/services/exports/payouts/base.rb:387 — app/services/exports/payouts/base.rb:387-401 | app/services/exports/payouts/base.rb:405-419 — both copies are in the same file, so extract the 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) app/services/product/variant_category_updater_service.rb:56 — app/services/product/variant_category_updater_service.rb:56-70 | app/services/product/variants_updater_service.rb:45-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×2
  • Duplicated block (13 lines × 2) app/controllers/api/mobile/sales_controller.rb:305 — app/controllers/api/mobile/sales_controller.rb:305-317 | app/controllers/customers_controller.rb:244-256 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/controllers/api/mobile/sales_controller.rb:305` 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) app/policies/audience/follower_policy.rb:5 — app/policies/audience/follower_policy.rb:5-17 | app/policies/audience/purchase_policy.rb:5-50 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×2
  • Duplicated block (8 lines × 3) db/migrate/20190427212700_remove_unused_tables.rb:70 — db/migrate/20190427212700_remove_unused_tables.rb:70-77 | db/migrate/20190427212700_remove_unused_tables.rb:113-120 | db/migrate/20190427212700_remove_unused_tables.rb:197-204 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) lib/omni_auth/strategies/instagram.rb:47 — lib/omni_auth/strategies/instagram.rb:47-54 | lib/omni_auth/strategies/tiktok.rb:61-68 | lib/omni_auth/strategies/youtube.rb:30-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 all 3 call sites, so a change lands once.
R10 · Code Duplication · Duplicated block with local edits (34 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (34 matched lines × 2 locations) app/javascript/components/Product/Card.tsx:44 — app/javascript/components/Product/Card.tsx:44 · app/javascript/components/Product/Card.tsx:109 — the two spans are one implementation copied and then locally edited — 220 tokens are still identical, in the same order in both spans, 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 with local edits (34 matched lines × 2 locations) app/javascript/components/ProductEdit/ProductTab/SuggestedAmountsEditor.tsx:13 — app/javascript/components/ProductEdit/ProductTab/SuggestedAmountsEditor.tsx:13 · app/javascript/components/ProductEdit/ProductTab/VersionsEditor.tsx:25 — the two spans are one implementation copied and then locally edited — 257 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 (27 lines × 2 locations) · ×2
  • Duplicated block (27 lines × 2 locations) app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:737 — app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:737 · app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:1274 — all 2 copies are in the same file, 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 (27 lines × 2 locations) app/javascript/pages/UrlRedirects/Read.tsx:414 — app/javascript/pages/UrlRedirects/Read.tsx:414 · app/javascript/pages/UrlRedirects/Read.tsx:821 — all 2 copies are in the same file, 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.
R10 · Code Duplication · Duplicated block (26 lines × 2 locations) · ×2
  • Duplicated block (26 lines × 2 locations) app/javascript/components/ProductEdit/ProductTab/DescriptionEditor.tsx:294 — app/javascript/components/ProductEdit/ProductTab/DescriptionEditor.tsx:294 · app/javascript/components/server-components/ProductEditPage.tsx:918 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (26 lines × 2 locations) app/javascript/pages/Emails/Drafts.tsx:65 — app/javascript/pages/Emails/Drafts.tsx:65 · app/javascript/pages/Emails/Scheduled.tsx:81 — 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.
R7 · Dead Code · Dead file (~97 LoC) · ×2
  • Dead file (~97 LoC) app/javascript/entrypoints/mobile_tracking.ts — no import path from any entry point (7 application, 18 tooling, 265 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 (~97 LoC) app/javascript/packs/mobile_tracking.ts — no import path from any entry point (7 application, 18 tooling, 265 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
R7 · Dead Code · Dead file (~3 LoC) · ×2
  • Dead file (~3 LoC) app/javascript/entrypoints/api.ts — no import path from any entry point (7 application, 18 tooling, 265 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 (~3 LoC) app/javascript/packs/api.ts — no import path from any entry point (7 application, 18 tooling, 265 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
AC1 · Text alternatives · <video> without a captions track · ×1
  • <video> without a captions track app/javascript/components/ReviewForm/ReviewVideoRecorderClientOnly.tsx:273 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
AC3 · Page structure · Empty <h3> heading · ×1
  • Empty <h3> heading REDACTED:57 — An empty heading appears in the document outline announced with no text. Give the heading text, or remove it if it's decorative.
AC3 · Page structure · Heading level jumps from h1 to h5 · ×1
  • Heading level jumps from h1 to h5 REDACTED:913 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×1
  • Focus outline removed in CSS without a :focus replacement app/views/home/saas.html.erb:8 — `.gr-slider` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 906 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · BankAccountSection.BankAccountSection (cyclomatic 218) · ×1
  • BankAccountSection.BankAccountSection (cyclomatic 218) app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx:773 — BankAccountSection.BankAccountSection has cyclomatic complexity 218 (threshold 15). Of this number, 199 points are the body's own statements and 19 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.
D1 · Cyclomatic Complexity · AccountDetailsSection.AccountDetailsSection (cyclomatic 191) · ×1
  • AccountDetailsSection.AccountDetailsSection (cyclomatic 191) app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:50 — AccountDetailsSection.AccountDetailsSection has cyclomatic complexity 191 (threshold 15). Of this number, 152 points are the body's own statements and 39 belong to 13 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.
D1 · Cyclomatic Complexity · index.Product (cyclomatic 159) · ×1
  • index.Product (cyclomatic 159) REDACTED:297 — index.Product has cyclomatic complexity 159 (threshold 15). Of this number, 124 points are the body's own statements and 35 belong to 13 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.
D1 · Cyclomatic Complexity · payment.applyCheckoutAction (cyclomatic 154) · ×1
  • payment.applyCheckoutAction (cyclomatic 154) app/javascript/components/Checkout/payment.ts:1492 — payment.applyCheckoutAction has cyclomatic complexity 154 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FileEmbed.FileEmbedNodeView (cyclomatic 153) · ×1
  • FileEmbed.FileEmbedNodeView (cyclomatic 153) app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:84 — FileEmbed.FileEmbedNodeView has cyclomatic complexity 153 (threshold 15). Of this number, 97 points are the body's own statements and 56 belong to 33 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.
D1 · Cyclomatic Complexity · index.ContentTabContent (cyclomatic 135) · ×1
  • index.ContentTabContent (cyclomatic 135) app/javascript/components/ProductEdit/ContentTab/index.tsx:207 — index.ContentTabContent has cyclomatic complexity 135 (threshold 15). Of this number, 35 points are the body's own statements and 100 belong to 56 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.
D1 · Cyclomatic Complexity · BeneficialOwnersSection.BeneficialOwnersSection (cyclomatic 126) · ×1
  • BeneficialOwnersSection.BeneficialOwnersSection (cyclomatic 126) app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:423 — BeneficialOwnersSection.BeneficialOwnersSection has cyclomatic complexity 126 (threshold 15). Of this number, 38 points are the body's own statements and 88 belong to 18 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.
D1 · Cyclomatic Complexity · LinksController.update (cyclomatic 113) · ×1
  • LinksController.update (cyclomatic 113) app/controllers/api/v2/links_controller.rb:303 — LinksController.update has cyclomatic complexity 113 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CustomerDetailPage.CustomerDetailPage (cyclomatic 99) · ×1
  • CustomerDetailPage.CustomerDetailPage (cyclomatic 99) app/javascript/components/Audience/CustomerDetailPage.tsx:135 — CustomerDetailPage.CustomerDetailPage has cyclomatic complexity 99 (threshold 15). Of this number, 75 points are the body's own statements and 24 belong to 11 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.
D1 · Cyclomatic Complexity · UpdaterService.perform (cyclomatic 96) · ×1
  • UpdaterService.perform (cyclomatic 96) app/services/subscription/updater_service.rb:45 — UpdaterService.perform has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.Checkout (cyclomatic 94) · ×1
  • index.Checkout (cyclomatic 94) app/javascript/components/Checkout/index.tsx:258 — index.Checkout has cyclomatic complexity 94 (threshold 15). Of this number, 72 points are the body's own statements and 22 belong to 16 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.
D1 · Cyclomatic Complexity · PaymentForm.CreditCardContent (cyclomatic 87) · ×1
  • PaymentForm.CreditCardContent (cyclomatic 87) app/javascript/components/Checkout/PaymentForm.tsx:694 — PaymentForm.CreditCardContent has cyclomatic complexity 87 (threshold 15). Of this number, 20 points are the body's own statements and 67 belong to 10 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.
D1 · Cyclomatic Complexity · WorkflowForm.WorkflowForm (cyclomatic 84) · ×1
  • WorkflowForm.WorkflowForm (cyclomatic 84) app/javascript/components/WorkflowsPage/WorkflowForm.tsx:97 — WorkflowForm.WorkflowForm has cyclomatic complexity 84 (threshold 15). Of this number, 44 points are the body's own statements and 40 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.
D1 · Cyclomatic Complexity · Manage.SubscriptionsManage (cyclomatic 84) · ×1
  • Manage.SubscriptionsManage (cyclomatic 84) app/javascript/pages/Subscriptions/Manage.tsx:117 — Manage.SubscriptionsManage has cyclomatic complexity 84 (threshold 15). Of this number, 69 points are the body's own statements and 15 belong to 4 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.
D1 · Cyclomatic Complexity · PaymentsController.update (cyclomatic 78) · ×1
  • PaymentsController.update (cyclomatic 78) REDACTED:27 — PaymentsController.update has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiscountsPage.DiscountsPage (cyclomatic 78) · ×1
  • DiscountsPage.DiscountsPage (cyclomatic 78) app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:227 — DiscountsPage.DiscountsPage has cyclomatic complexity 78 (threshold 15). Of this number, 32 points are the body's own statements and 46 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.
D1 · Cyclomatic Complexity · EmailForm.EmailForm (cyclomatic 77) · ×1
  • EmailForm.EmailForm (cyclomatic 77) app/javascript/components/EmailsPage/EmailForm.tsx:221 — EmailForm.EmailForm has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent 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 (EmailForm.EmailForm::validate) 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.
D1 · Cyclomatic Complexity · order.startOrderCreation (cyclomatic 77) · ×1
  • order.startOrderCreation (cyclomatic 77) app/javascript/data/order.ts:159 — order.startOrderCreation has cyclomatic complexity 77 (threshold 15). Of this number, 67 points are the body's own statements and 10 belong to 4 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.
D1 · Cyclomatic Complexity · StripeMerchantAccountManager.handle_stripe_info_requirements (cyclomatic 75) · ×1
  • StripeMerchantAccountManager.handle_stripe_info_requirements (cyclomatic 75) REDACTED:3245 — StripeMerchantAccountManager.handle_stripe_info_requirements has cyclomatic complexity 75 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Index.CommunitiesIndex (cyclomatic 72) · ×1
  • Index.CommunitiesIndex (cyclomatic 72) app/javascript/pages/Communities/Index.tsx:87 — Index.CommunitiesIndex has cyclomatic complexity 72 (threshold 15). Most of this is not in the body itself: 12 of the 72 points are its own statements and the rest belongs to 26 function items inside it that branch (a function literal at line 388, a function literal at line 421, a function literal at line 148, …). 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.
D1 · Cyclomatic Complexity · AudienceMember.filter (cyclomatic 71) · ×1
  • AudienceMember.filter (cyclomatic 71) REDACTED:52 — AudienceMember.filter has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChargeService.create_charge_for_seller_purchases (cyclomatic 69) · ×1
  • ChargeService.create_charge_for_seller_purchases (cyclomatic 69) app/services/order/charge_service.rb:534 — ChargeService.create_charge_for_seller_purchases has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StripeMerchantAccountManager.update_account (cyclomatic 68) · ×1
  • StripeMerchantAccountManager.update_account (cyclomatic 68) REDACTED:456 — StripeMerchantAccountManager.update_account has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Layout.Layout (cyclomatic 67) · ×1
  • Layout.Layout (cyclomatic 67) app/javascript/components/ProductEdit/Layout.tsx:121 — Layout.Layout has cyclomatic complexity 67 (threshold 15). Of this number, 48 points are the body's own statements and 19 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.
D1 · Cyclomatic Complexity · Show.SettingsPage (cyclomatic 66) · ×1
  • Show.SettingsPage (cyclomatic 66) app/javascript/pages/Settings/Profile/Show.tsx:102 — Show.SettingsPage has cyclomatic complexity 66 (threshold 15). Of this number, 29 points are the body's own statements and 37 belong to 16 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.
D1 · Cyclomatic Complexity · LinksController.update (cyclomatic 65) · ×1
  • LinksController.update (cyclomatic 65) REDACTED:442 — LinksController.update has cyclomatic complexity 65 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ReviewForm.ReviewForm (cyclomatic 65) · ×1
  • ReviewForm.ReviewForm (cyclomatic 65) app/javascript/components/ReviewForm.tsx:119 — ReviewForm.ReviewForm has cyclomatic complexity 65 (threshold 15). Of this number, 30 points are the body's own statements and 35 belong to 12 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.
D1 · Cyclomatic Complexity · CreateService.perform (cyclomatic 64) · ×1
  • CreateService.perform (cyclomatic 64) app/services/purchase/create_service.rb:30 — CreateService.perform has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CustomersPage.CustomersPage (cyclomatic 64) · ×1
  • CustomersPage.CustomersPage (cyclomatic 64) app/javascript/components/Audience/CustomersPage.tsx:66 — CustomersPage.CustomersPage has cyclomatic complexity 64 (threshold 15). Of this number, 25 points are the body's own statements and 39 belong to 10 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.
D1 · Cyclomatic Complexity · Edit.PagesEdit (cyclomatic 63) · ×1
  • Edit.PagesEdit (cyclomatic 63) app/javascript/pages/Pages/Edit.tsx:70 — Edit.PagesEdit has cyclomatic complexity 63 (threshold 15). Of this number, 46 points are the body's own statements and 17 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.
D1 · Cyclomatic Complexity · Read.EpubReader (cyclomatic 63) · ×1
  • Read.EpubReader (cyclomatic 63) app/javascript/pages/UrlRedirects/Read.tsx:523 — Read.EpubReader has cyclomatic complexity 63 (threshold 15). Most of this is not in the body itself: 4 of the 63 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 639, a function literal at line 716, a function literal at line 809, …). 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.
D1 · Cyclomatic Complexity · PurchaseExportService.purchase_data (cyclomatic 62) · ×1
  • PurchaseExportService.purchase_data (cyclomatic 62) app/services/exports/purchase_export_service.rb:151 — PurchaseExportService.purchase_data has cyclomatic complexity 62 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · UtmLinkForm.UtmLinkForm (cyclomatic 61) · ×1
  • UtmLinkForm.UtmLinkForm (cyclomatic 61) app/javascript/components/UtmLinks/UtmLinkForm.tsx:94 — UtmLinkForm.UtmLinkForm has cyclomatic complexity 61 (threshold 15). Of this number, 31 points are the body's own statements and 30 belong to 9 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.
D1 · Cyclomatic Complexity · StripeMerchantAccountManager.update_bank_account (cyclomatic 58) · ×1
  • StripeMerchantAccountManager.update_bank_account (cyclomatic 58) REDACTED:1534 — StripeMerchantAccountManager.update_bank_account 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.
D1 · Cyclomatic Complexity · OrderInfo.purchase_sales_tax_info_business_vat_id_label (cyclomatic 58) · ×1
  • OrderInfo.purchase_sales_tax_info_business_vat_id_label (cyclomatic 58) app/presenters/invoice_presenter/order_info.rb:163 — OrderInfo.purchase_sales_tax_info_business_vat_id_label has cyclomatic complexity 58 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FileList.FileRow (cyclomatic 58) · ×1
  • FileList.FileRow (cyclomatic 58) app/javascript/components/Download/FileList.tsx:169 — FileList.FileRow has cyclomatic complexity 58 (threshold 15). Of this number, 49 points are the body's own statements and 9 belong to 4 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.
D1 · Cyclomatic Complexity · Index.LibraryPage (cyclomatic 57) · ×1
  • Index.LibraryPage (cyclomatic 57) app/javascript/pages/Library/Index.tsx:228 — Index.LibraryPage has cyclomatic complexity 57 (threshold 15). Of this number, 31 points are the body's own statements and 26 belong to 11 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.
D1 · Cyclomatic Complexity · ConfigurationSelector.ConfigurationSelector (cyclomatic 56) · ×1
  • ConfigurationSelector.ConfigurationSelector (cyclomatic 56) app/javascript/components/Product/ConfigurationSelector.tsx:749 — ConfigurationSelector.ConfigurationSelector has cyclomatic complexity 56 (threshold 15). Of this number, 32 points are the body's own statements and 24 belong to 13 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.
D1 · Cyclomatic Complexity · LinksController.create (cyclomatic 54) · ×1
  • LinksController.create (cyclomatic 54) app/controllers/api/v2/links_controller.rb:81 — LinksController.create has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Refundable.refund_and_save! (cyclomatic 53) · ×1
  • Refundable.refund_and_save! (cyclomatic 53) app/modules/purchase/refundable.rb:49 — Refundable.refund_and_save! has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · New.PurchaseNewInvoicePage (cyclomatic 53) · ×1
  • New.PurchaseNewInvoicePage (cyclomatic 53) app/javascript/pages/Purchases/Invoices/New.tsx:59 — New.PurchaseNewInvoicePage has cyclomatic complexity 53 (threshold 15). Of this number, 37 points are the body's own statements and 16 belong to 9 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.
D1 · Cyclomatic Complexity · PaymentForm.SharedInputs (cyclomatic 52) · ×1
  • PaymentForm.SharedInputs (cyclomatic 52) app/javascript/components/Checkout/PaymentForm.tsx:276 — PaymentForm.SharedInputs has cyclomatic complexity 52 (threshold 15). Of this number, 48 points are the body's own statements and 4 belong to 3 function items inside it that branch. 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.
D1 · Cyclomatic Complexity · DiscountsPage.Form · ×1
  • DiscountsPage.Form::handleSubmit (cyclomatic 52) app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:1089 — DiscountsPage.Form::handleSubmit has cyclomatic complexity 52 (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 shape REPEATS in the file: one other method here (DiscountsPage.Form) 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.
D1 · Cyclomatic Complexity · SyncStatusWithChargeProcessorService.perform (cyclomatic 51) · ×1
  • SyncStatusWithChargeProcessorService.perform (cyclomatic 51) app/services/purchase/sync_status_with_charge_processor_service.rb:22 — SyncStatusWithChargeProcessorService.perform has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiscountsPage.Form (cyclomatic 51) · ×1
  • DiscountsPage.Form (cyclomatic 51) app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:894 — DiscountsPage.Form has cyclomatic complexity 51 (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. This shape REPEATS in the file: one other method here (DiscountsPage.Form::handleSubmit) 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.
D1 · Cyclomatic Complexity · WithContent.WithContent (cyclomatic 51) · ×1
  • WithContent.WithContent (cyclomatic 51) app/javascript/components/DownloadPage/WithContent.tsx:109 — WithContent.WithContent has cyclomatic complexity 51 (threshold 15). Of this number, 30 points are the body's own statements and 21 belong to 10 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.
D1 · Cyclomatic Complexity · WithFiltering.seller_post_passes_filters (cyclomatic 50) · ×1
  • WithFiltering.seller_post_passes_filters (cyclomatic 50) app/models/concerns/with_filtering.rb:150 — WithFiltering.seller_post_passes_filters has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Show.PaymentsPage (cyclomatic 50) · ×1
  • Show.PaymentsPage (cyclomatic 50) app/javascript/pages/Settings/Payments/Show.tsx:259 — Show.PaymentsPage has cyclomatic complexity 50 (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. This shape REPEATS in the file: 2 other methods here (Show.PaymentsPage::validateBankAccountFields, Show.PaymentsPage::validateComplianceInfoFields) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D1 · Cyclomatic Complexity · purchase.createPurchasesRequestData (cyclomatic 49) · ×1
  • purchase.createPurchasesRequestData (cyclomatic 49) app/javascript/data/purchase.ts:269 — purchase.createPurchasesRequestData has cyclomatic complexity 49 (threshold 15). Of this number, 43 points are the body's own statements and 6 belong to one function literal 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.
D1 · Cyclomatic Complexity · SettingsPresenter.account_status_details (cyclomatic 48) · ×1
  • SettingsPresenter.account_status_details (cyclomatic 48) REDACTED:448 — SettingsPresenter.account_status_details 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.
D1 · Cyclomatic Complexity · SendWorkflowInstallmentWorker.perform (cyclomatic 48) · ×1
  • SendWorkflowInstallmentWorker.perform (cyclomatic 48) app/sidekiq/send_workflow_installment_worker.rb:11 — SendWorkflowInstallmentWorker.perform has cyclomatic complexity 48 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · index.CartItemComponent (cyclomatic 48) · ×1
  • index.CartItemComponent (cyclomatic 48) app/javascript/components/Checkout/index.tsx:1043 — index.CartItemComponent has cyclomatic complexity 48 (threshold 15). Of this number, 35 points are the body's own statements and 13 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.
D1 · Cyclomatic Complexity · Show.CheckoutIndexPage · ×1
  • Show.CheckoutIndexPage::pay (cyclomatic 48) app/javascript/pages/Checkout/Show.tsx:540 — Show.CheckoutIndexPage::pay 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. This shape REPEATS in the file: one other method here (Show.CheckoutIndexPage) 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.
D1 · Cyclomatic Complexity · Published.EmailsPublished (cyclomatic 48) · ×1
  • Published.EmailsPublished (cyclomatic 48) app/javascript/pages/Emails/Published.tsx:40 — Published.EmailsPublished has cyclomatic complexity 48 (threshold 15). Of this number, 16 points are the body's own statements and 32 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.
D1 · Cyclomatic Complexity · Index.Period (cyclomatic 48) · ×1
  • Index.Period (cyclomatic 48) app/javascript/pages/Payouts/Index.tsx:48 — Index.Period has cyclomatic complexity 48 (threshold 15). Of this number, 34 points are the body's own statements and 14 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.
D1 · Cyclomatic Complexity · StripeChargeProcessor.handle_stripe_charge_event (cyclomatic 47) · ×1
  • StripeChargeProcessor.handle_stripe_charge_event (cyclomatic 47) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:1375 — StripeChargeProcessor.handle_stripe_charge_event has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChargeService.ensure_all_purchases_processed (cyclomatic 47) · ×1
  • ChargeService.ensure_all_purchases_processed (cyclomatic 47) app/services/order/charge_service.rb:704 — ChargeService.ensure_all_purchases_processed has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateService.perform (cyclomatic 47) · ×1
  • CreateService.perform (cyclomatic 47) app/services/order/create_service.rb:33 — CreateService.perform has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Form.CollaboratorForm (cyclomatic 47) · ×1
  • Form.CollaboratorForm (cyclomatic 47) app/javascript/components/Collaborators/Form.tsx:34 — Form.CollaboratorForm has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 10 of the 47 points are its own statements and the rest belongs to 12 function items inside it that branch (submitForm, a function literal at line 282, a function literal at line 45, …). 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.
D1 · Cyclomatic Complexity · ProductEditPage.applyCanonicalIds (cyclomatic 47) · ×1
  • ProductEditPage.applyCanonicalIds (cyclomatic 47) app/javascript/components/server-components/ProductEditPage.tsx:293 — ProductEditPage.applyCanonicalIds has cyclomatic complexity 47 (threshold 15). Of this number, 43 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.
D1 · Cyclomatic Complexity · Index.PayoutsIndex (cyclomatic 47) · ×1
  • Index.PayoutsIndex (cyclomatic 47) app/javascript/pages/Payouts/Index.tsx:470 — Index.PayoutsIndex has cyclomatic complexity 47 (threshold 15). Of this number, 45 points are the body's own statements and 2 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.
D1 · Cyclomatic Complexity · Show.Show (cyclomatic 47) · ×1
  • Show.Show (cyclomatic 47) app/javascript/pages/Purchases/DisputeEvidence/Show.tsx:106 — Show.Show has cyclomatic complexity 47 (threshold 15). Of this number, 31 points are the body's own statements and 16 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.
D1 · Cyclomatic Complexity · StripeMerchantAccountManager.create_account (cyclomatic 46) · ×1
  • StripeMerchantAccountManager.create_account (cyclomatic 46) REDACTED:214 — StripeMerchantAccountManager.create_account has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Purchase.as_json (cyclomatic 46) · ×1
  • Purchase.as_json (cyclomatic 46) app/models/purchase.rb:1014 — Purchase.as_json has cyclomatic complexity 46 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PaymentForm.useStripePaymentRequest (cyclomatic 45) · ×1
  • PaymentForm.useStripePaymentRequest (cyclomatic 45) app/javascript/components/Checkout/PaymentForm.tsx:1561 — PaymentForm.useStripePaymentRequest has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 6 of the 45 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 1635, a function literal at line 1681, a function literal at line 1699, …). 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.
D1 · Cyclomatic Complexity · Index.DiscoverIndex (cyclomatic 45) · ×1
  • Index.DiscoverIndex (cyclomatic 45) app/javascript/pages/Discover/Index.tsx:244 — Index.DiscoverIndex has cyclomatic complexity 45 (threshold 15). Of this number, 26 points are the body's own statements and 19 belong to 7 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.
D1 · Cyclomatic Complexity · AutoTopUpNegativeDestinationBalancesJob.topup (cyclomatic 44) · ×1
  • AutoTopUpNegativeDestinationBalancesJob.topup (cyclomatic 44) REDACTED:97 — AutoTopUpNegativeDestinationBalancesJob.topup 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.
D1 · Cyclomatic Complexity · Payouts.is_user_payable (cyclomatic 43) · ×1
  • Payouts.is_user_payable (cyclomatic 43) app/business/payments/payouts/payouts.rb:37 — Payouts.is_user_payable has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WithProductFiles.save_files! (cyclomatic 43) · ×1
  • WithProductFiles.save_files! (cyclomatic 43) app/modules/with_product_files.rb:50 — WithProductFiles.save_files! has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UpdateUserComplianceInfo.assign_compliance_params (cyclomatic 43) · ×1
  • UpdateUserComplianceInfo.assign_compliance_params (cyclomatic 43) app/services/update_user_compliance_info.rb:201 — UpdateUserComplianceInfo.assign_compliance_params has cyclomatic complexity 43 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Payouts.create_payments (cyclomatic 42) · ×1
  • Payouts.create_payments (cyclomatic 42) app/business/payments/payouts/payouts.rb:450 — Payouts.create_payments has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StripePayoutProcessor.prepare_payment_and_set_amount (cyclomatic 42) · ×1
  • StripePayoutProcessor.prepare_payment_and_set_amount (cyclomatic 42) app/business/payments/payouts/processor/stripe/stripe_payout_processor.rb:346 — StripePayoutProcessor.prepare_payment_and_set_amount has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CtaButton.CtaButton (cyclomatic 42) · ×1
  • CtaButton.CtaButton (cyclomatic 42) app/javascript/components/Product/CtaButton.tsx:105 — CtaButton.CtaButton has cyclomatic complexity 42 (threshold 15). Of this number, 40 points are the body's own statements and 2 belong to one function literal 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.
D1 · Cyclomatic Complexity · StripeChargeProcessor.create_payment_intent_or_charge! (cyclomatic 41) · ×1
  • StripeChargeProcessor.create_payment_intent_or_charge! (cyclomatic 41) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:396 — StripeChargeProcessor.create_payment_intent_or_charge! has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Purchase.refund_purchase! (cyclomatic 41) · ×1
  • Purchase.refund_purchase! (cyclomatic 41) app/modules/purchase/refundable.rb:288 — Purchase.refund_purchase! has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CheckoutPresenter.checkout_product (cyclomatic 41) · ×1
  • CheckoutPresenter.checkout_product (cyclomatic 41) app/presenters/checkout_presenter.rb:111 — CheckoutPresenter.checkout_product has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LegalGuardianSection.LegalGuardianSection (cyclomatic 41) · ×1
  • LegalGuardianSection.LegalGuardianSection (cyclomatic 41) app/javascript/components/Settings/PaymentsPage/LegalGuardianSection.tsx:88 — LegalGuardianSection.LegalGuardianSection has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 13 of the 41 points are its own statements and the rest belongs to 4 function items inside it that branch (missingRequiredField, handleSubmit, handleKeyDown, …). 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.
D1 · Cyclomatic Complexity · Refundable.handle_event_refund_updated! (cyclomatic 40) · ×1
  • Refundable.handle_event_refund_updated! (cyclomatic 40) app/models/concerns/charge/refundable.rb:42 — Refundable.handle_event_refund_updated! has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BuyerCurrencyEligibility.decision (cyclomatic 40) · ×1
  • BuyerCurrencyEligibility.decision (cyclomatic 40) app/services/checkout/buyer_currency_eligibility.rb:399 — BuyerCurrencyEligibility.decision has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SendWorkflowPostEmailsJob.perform (cyclomatic 40) · ×1
  • SendWorkflowPostEmailsJob.perform (cyclomatic 40) app/sidekiq/send_workflow_post_emails_job.rb:17 — SendWorkflowPostEmailsJob.perform has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SectionsForm.ProfileSectionsForm (cyclomatic 40) · ×1
  • SectionsForm.ProfileSectionsForm (cyclomatic 40) app/javascript/components/Profile/SectionsForm.tsx:683 — SectionsForm.ProfileSectionsForm has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 8 of the 40 points are its own statements and the rest belongs to 18 function items inside it that branch (createSection, removePage, duplicateSection, …). 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.
D1 · Cyclomatic Complexity · DashboardPage.DashboardPage (cyclomatic 39) · ×1
  • DashboardPage.DashboardPage (cyclomatic 39) app/javascript/components/DashboardPage.tsx:310 — DashboardPage.DashboardPage has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CardGrid.CardGrid (cyclomatic 39) · ×1
  • CardGrid.CardGrid (cyclomatic 39) app/javascript/components/Product/CardGrid.tsx:216 — CardGrid.CardGrid has cyclomatic complexity 39 (threshold 15). Of this number, 23 points are the body's own statements and 16 belong to 5 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.
D1 · Cyclomatic Complexity · New.NewProductPage (cyclomatic 39) · ×1
  • New.NewProductPage (cyclomatic 39) app/javascript/pages/Products/New.tsx:113 — New.NewProductPage has cyclomatic complexity 39 (threshold 15). Of this number, 22 points are the body's own statements and 17 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.
D1 · Cyclomatic Complexity · UrlRedirectsController.check_permissions (cyclomatic 38) · ×1
  • UrlRedirectsController.check_permissions (cyclomatic 38) REDACTED:537 — UrlRedirectsController.check_permissions has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CreateService.build_purchase (cyclomatic 38) · ×1
  • CreateService.build_purchase (cyclomatic 38) app/services/purchase/create_service.rb:555 — CreateService.build_purchase has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SaveInstallmentsService.process (cyclomatic 38) · ×1
  • SaveInstallmentsService.process (cyclomatic 38) app/services/workflow/save_installments_service.rb:19 — SaveInstallmentsService.process has cyclomatic complexity 38 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · UserComplianceInfoFieldProperty.name_tag_for_field (cyclomatic 37) · ×1
  • UserComplianceInfoFieldProperty.name_tag_for_field (cyclomatic 37) app/business/payments/merchant_registration/user_compliance_info_field_property.rb:21 — UserComplianceInfoFieldProperty.name_tag_for_field has cyclomatic complexity 37 (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.
D1 · Cyclomatic Complexity · InvoicesController.create (cyclomatic 37) · ×1
  • InvoicesController.create (cyclomatic 37) app/controllers/purchases/invoices_controller.rb:19 — InvoicesController.create has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Compliance.country_supports_iban? (cyclomatic 37) · ×1
  • Compliance.country_supports_iban? (cyclomatic 37) app/modules/user/compliance.rb:229 — Compliance.country_supports_iban? has cyclomatic complexity 37 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Layout.Layout (cyclomatic 37) · ×1
  • Layout.Layout (cyclomatic 37) app/javascript/components/DownloadPage/Layout.tsx:79 — Layout.Layout has cyclomatic complexity 37 (threshold 15). Of this number, 36 points are the body's own statements and 1 belongs to one function literal 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.
D1 · Cyclomatic Complexity · LinksController.show (cyclomatic 36) · ×1
  • LinksController.show (cyclomatic 36) REDACTED:148 — LinksController.show has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GenerateSalesReportJob.perform (cyclomatic 36) · ×1
  • GenerateSalesReportJob.perform (cyclomatic 36) app/sidekiq/generate_sales_report_job.rb:13 — GenerateSalesReportJob.perform has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RecurringChargeWorker.perform (cyclomatic 36) · ×1
  • RecurringChargeWorker.perform (cyclomatic 36) app/sidekiq/recurring_charge_worker.rb:7 — RecurringChargeWorker.perform has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UpsellsPage.Form (cyclomatic 36) · ×1
  • UpsellsPage.Form (cyclomatic 36) app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:523 — UpsellsPage.Form 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. This shape REPEATS in the file: one other method here (UpsellsPage.Form::handleSubmit) 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.
D1 · Cyclomatic Complexity · index.ContentTab (cyclomatic 36) · ×1
  • index.ContentTab (cyclomatic 36) app/javascript/components/ProductEdit/ContentTab/index.tsx:1449 — index.ContentTab has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 7 of the 36 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 1580, a function literal at line 1464, fetchMorePosts, …). 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.
D1 · Cyclomatic Complexity · EditPage.EditProfile (cyclomatic 36) · ×1
  • EditPage.EditProfile (cyclomatic 36) app/javascript/components/Profile/EditPage.tsx:114 — EditPage.EditProfile has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 13 of the 36 points are its own statements and the rest belongs to 11 function items inside it that branch (dispatch, a function literal at line 274, saveTabs, …). 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.
D1 · Cyclomatic Complexity · ApplicationForm.ApplicationForm (cyclomatic 36) · ×1
  • ApplicationForm.ApplicationForm (cyclomatic 36) app/javascript/components/Settings/AdvancedPage/ApplicationForm.tsx:32 — ApplicationForm.ApplicationForm has cyclomatic complexity 36 (threshold 15). Of this number, 17 points are the body's own statements and 19 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.
D1 · Cyclomatic Complexity · UrlRedirectsController.send_to_kindle (cyclomatic 35) · ×1
  • UrlRedirectsController.send_to_kindle (cyclomatic 35) REDACTED:330 — UrlRedirectsController.send_to_kindle has cyclomatic complexity 35 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Purchase.purchase_info (cyclomatic 35) · ×1
  • Purchase.purchase_info (cyclomatic 35) app/models/purchase.rb:1444 — Purchase.purchase_info has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Workflow.schedule_installment (cyclomatic 35) · ×1
  • Workflow.schedule_installment (cyclomatic 35) app/models/workflow.rb:118 — Workflow.schedule_installment has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CustomerPresenter.customer (cyclomatic 35) · ×1
  • CustomerPresenter.customer (cyclomatic 35) app/presenters/customer_presenter.rb:26 — CustomerPresenter.customer has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · index.Analytics (cyclomatic 34) · ×1
  • index.Analytics (cyclomatic 34) app/javascript/components/Analytics/index.tsx:154 — index.Analytics has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 8 of the 34 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 262, 224, 175, …). 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.
D1 · Cyclomatic Complexity · StripeBeneficialOwnersManager.build_person_params (cyclomatic 33) · ×1
  • StripeBeneficialOwnersManager.build_person_params (cyclomatic 33) app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb:333 — StripeBeneficialOwnersManager.build_person_params has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChargeService.perform (cyclomatic 33) · ×1
  • ChargeService.perform (cyclomatic 33) app/services/order/charge_service.rb:16 — ChargeService.perform 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.
D1 · Cyclomatic Complexity · LookupLayout.LookupLayout (cyclomatic 33) · ×1
  • LookupLayout.LookupLayout (cyclomatic 33) app/javascript/components/Public/LookupLayout.tsx:25 — LookupLayout.LookupLayout has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 14 of the 33 points are its own statements and the rest belongs to 3 function items inside it that branch (handleCardLookup, handlePaypalLookup, a function literal at line 119). 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.
D1 · Cyclomatic Complexity · PasskeysSection.PasskeysSection (cyclomatic 33) · ×1
  • PasskeysSection.PasskeysSection (cyclomatic 33) app/javascript/components/Settings/PasswordPage/PasskeysSection.tsx:27 — PasskeysSection.PasskeysSection has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 7 of the 33 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 52, 38, 82, …). 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.
D1 · Cyclomatic Complexity · AccountStatusSection.AccountStatusSection (cyclomatic 33) · ×1
  • AccountStatusSection.AccountStatusSection (cyclomatic 33) app/javascript/components/Settings/PaymentsPage/AccountStatusSection.tsx:43 — AccountStatusSection.AccountStatusSection has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentStreamsController.create (cyclomatic 32) · ×1
  • AgentStreamsController.create (cyclomatic 32) app/controllers/api/mobile/agent_streams_controller.rb:45 — AgentStreamsController.create has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CheckoutPresenter.subscription_manager_props (cyclomatic 32) · ×1
  • CheckoutPresenter.subscription_manager_props (cyclomatic 32) app/presenters/checkout_presenter.rb:229 — CheckoutPresenter.subscription_manager_props 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.
D1 · Cyclomatic Complexity · ConfirmService.charge_setup_confirmed_purchases_locked! (cyclomatic 32) · ×1
  • ConfirmService.charge_setup_confirmed_purchases_locked! (cyclomatic 32) app/services/order/confirm_service.rb:238 — ConfirmService.charge_setup_confirmed_purchases_locked! has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConfirmService.perform (cyclomatic 32) · ×1
  • ConfirmService.perform (cyclomatic 32) app/services/purchase/confirm_service.rb:13 — ConfirmService.perform has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · payment.loadSurcharges (cyclomatic 32) · ×1
  • payment.loadSurcharges (cyclomatic 32) app/javascript/components/Checkout/payment.ts:1237 — payment.loadSurcharges has cyclomatic complexity 32 (threshold 15). Of this number, 20 points are the body's own statements and 12 belong to 2 function literals 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.
D1 · Cyclomatic Complexity · ShareYourLaunchCard.ChannelComposer (cyclomatic 32) · ×1
  • ShareYourLaunchCard.ChannelComposer (cyclomatic 32) app/javascript/components/ProductEdit/ShareTab/ShareYourLaunchCard.tsx:233 — ShareYourLaunchCard.ChannelComposer has cyclomatic complexity 32 (threshold 15). Of this number, 28 points are the body's own statements and 4 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.
D1 · Cyclomatic Complexity · Edit.BundlesContentEdit (cyclomatic 32) · ×1
  • Edit.BundlesContentEdit (cyclomatic 32) app/javascript/pages/Bundles/Content/Edit.tsx:51 — Edit.BundlesContentEdit has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 12 of the 32 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 77, a function literal at line 100, loadMore, …). 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.
D1 · Cyclomatic Complexity · StripeChargeProcessor.debit_stripe_account_for_refund_fee (cyclomatic 31) · ×1
  • StripeChargeProcessor.debit_stripe_account_for_refund_fee (cyclomatic 31) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:822 — StripeChargeProcessor.debit_stripe_account_for_refund_fee has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StripePayoutProcessor.perform_payment (cyclomatic 31) · ×1
  • StripePayoutProcessor.perform_payment (cyclomatic 31) app/business/payments/payouts/processor/stripe/stripe_payout_processor.rb:720 — StripePayoutProcessor.perform_payment has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Link.cart_item (cyclomatic 31) · ×1
  • Link.cart_item (cyclomatic 31) app/models/link.rb:1572 — Link.cart_item has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProductPresenter.edit_props (cyclomatic 31) · ×1
  • ProductPresenter.edit_props (cyclomatic 31) app/presenters/product_presenter.rb:155 — ProductPresenter.edit_props has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · UpdaterService.validate_indian_card_mandate! (cyclomatic 31) · ×1
  • UpdaterService.validate_indian_card_mandate! (cyclomatic 31) app/services/subscription/updater_service.rb:361 — UpdaterService.validate_indian_card_mandate! has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SendWorkflowInstallmentWorker.recipient_matches_current_audience? (cyclomatic 31) · ×1
  • SendWorkflowInstallmentWorker.recipient_matches_current_audience? (cyclomatic 31) app/sidekiq/send_workflow_installment_worker.rb:208 — SendWorkflowInstallmentWorker.recipient_matches_current_audience? has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.ProductTab (cyclomatic 31) · ×1
  • index.ProductTab (cyclomatic 31) app/javascript/components/ProductEdit/ProductTab/index.tsx:53 — index.ProductTab has cyclomatic complexity 31 (threshold 15). Of this number, 29 points are the body's own statements and 2 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.
D1 · Cyclomatic Complexity · RichTextEditor.useRichTextEditor (cyclomatic 31) · ×1
  • RichTextEditor.useRichTextEditor (cyclomatic 31) app/javascript/components/RichTextEditor.tsx:288 — RichTextEditor.useRichTextEditor has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 12 of the 31 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 361, walk, a function literal at line 449, …). 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.
D1 · Cyclomatic Complexity · WorkflowEmails.WorkflowEmails (cyclomatic 31) · ×1
  • WorkflowEmails.WorkflowEmails (cyclomatic 31) app/javascript/components/WorkflowsPage/WorkflowEmails.tsx:102 — WorkflowEmails.WorkflowEmails has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 14 of the 31 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 153, updateEmail, a function literal at line 309, …). 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.
D1 · Cyclomatic Complexity · PaypalMerchantAccountManager.update_merchant_account (cyclomatic 30) · ×1
  • PaypalMerchantAccountManager.update_merchant_account (cyclomatic 30) app/business/payments/merchant_registration/implementations/paypal/paypal_merchant_account_manager.rb:43 — PaypalMerchantAccountManager.update_merchant_account 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.
D1 · Cyclomatic Complexity · StripeBeneficialOwnersManager.validate_required_fields! (cyclomatic 30) · ×1
  • StripeBeneficialOwnersManager.validate_required_fields! (cyclomatic 30) app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb:121 — StripeBeneficialOwnersManager.validate_required_fields! 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.
D1 · Cyclomatic Complexity · AgentMessageStreamsController.create (cyclomatic 30) · ×1
  • AgentMessageStreamsController.create (cyclomatic 30) app/controllers/api/internal/agent_message_streams_controller.rb:49 — AgentMessageStreamsController.create 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.
D1 · Cyclomatic Complexity · CustomerSurchargeController.calculate_all (cyclomatic 30) · ×1
  • CustomerSurchargeController.calculate_all (cyclomatic 30) app/controllers/customer_surcharge_controller.rb:6 — CustomerSurchargeController.calculate_all 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.
D1 · Cyclomatic Complexity · ScheduledPayout.execute! (cyclomatic 30) · ×1
  • ScheduledPayout.execute! (cyclomatic 30) app/models/scheduled_payout.rb:34 — ScheduledPayout.execute! 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.
D1 · Cyclomatic Complexity · StoreAgentObjectFormatter.from_response (cyclomatic 30) · ×1
  • StoreAgentObjectFormatter.from_response (cyclomatic 30) app/services/ai/store_agent_object_formatter.rb:27 — StoreAgentObjectFormatter.from_response has cyclomatic complexity 30 (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.
D1 · Cyclomatic Complexity · BuyerCurrencyQuote.canonical_components_hint (cyclomatic 30) · ×1
  • BuyerCurrencyQuote.canonical_components_hint (cyclomatic 30) app/services/checkout/buyer_currency_quote.rb:366 — BuyerCurrencyQuote.canonical_components_hint 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.
D1 · Cyclomatic Complexity · PaymentForm.PaymentMethodsSection (cyclomatic 30) · ×1
  • PaymentForm.PaymentMethodsSection (cyclomatic 30) app/javascript/components/Checkout/PaymentForm.tsx:1849 — PaymentForm.PaymentMethodsSection 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.
D1 · Cyclomatic Complexity · FormPage.FormPage (cyclomatic 30) · ×1
  • FormPage.FormPage (cyclomatic 30) app/javascript/components/CheckoutDashboard/FormPage.tsx:77 — FormPage.FormPage has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 223, a function literal at line 143, a function literal at line 124, …). 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.
D1 · Cyclomatic Complexity · Index.AffiliatesIndex (cyclomatic 30) · ×1
  • Index.AffiliatesIndex (cyclomatic 30) app/javascript/pages/Affiliates/Index.tsx:214 — Index.AffiliatesIndex has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 10 of the 30 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 386, a function literal at line 228, a function literal at line 225, …). 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.
D1 · Cyclomatic Complexity · WithFiltering.add_and_validate_filters (cyclomatic 29) · ×1
  • WithFiltering.add_and_validate_filters (cyclomatic 29) app/models/concerns/with_filtering.rb:58 — WithFiltering.add_and_validate_filters has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Subscription.update_current_plan! (cyclomatic 29) · ×1
  • Subscription.update_current_plan! (cyclomatic 29) REDACTED:1241 — Subscription.update_current_plan! has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AdminSearchService.search_purchases (cyclomatic 29) · ×1
  • AdminSearchService.search_purchases (cyclomatic 29) app/services/admin_search_service.rb:9 — AdminSearchService.search_purchases has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UpdateUserComplianceInfo.process_locked (cyclomatic 29) · ×1
  • UpdateUserComplianceInfo.process_locked (cyclomatic 29) app/services/update_user_compliance_info.rb:104 — UpdateUserComplianceInfo.process_locked has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Layout.BundleEditLayout (cyclomatic 29) · ×1
  • Layout.BundleEditLayout (cyclomatic 29) app/javascript/components/BundleEdit/Layout.tsx:57 — Layout.BundleEditLayout has cyclomatic complexity 29 (threshold 15). Of this number, 24 points are the body's own statements and 5 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.
D1 · Cyclomatic Complexity · agent.streamAgentMessage (cyclomatic 29) · ×1
  • agent.streamAgentMessage (cyclomatic 29) app/javascript/data/agent.ts:333 — agent.streamAgentMessage has cyclomatic complexity 29 (threshold 15). Of this number, 15 points are the body's own statements and 14 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.
D1 · Cyclomatic Complexity · PingNotification.payload_for_ping_notification (cyclomatic 28) · ×1
  • PingNotification.payload_for_ping_notification (cyclomatic 28) app/modules/purchase/ping_notification.rb:4 — PingNotification.payload_for_ping_notification 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.
D1 · Cyclomatic Complexity · UpdaterService.charge_user! (cyclomatic 28) · ×1
  • UpdaterService.charge_user! (cyclomatic 28) app/services/subscription/updater_service.rb:593 — UpdaterService.charge_user! 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.
D1 · Cyclomatic Complexity · ScheduleWorkflowInstallmentJob.perform (cyclomatic 28) · ×1
  • ScheduleWorkflowInstallmentJob.perform (cyclomatic 28) app/sidekiq/schedule_workflow_installment_job.rb:32 — ScheduleWorkflowInstallmentJob.perform 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.
D1 · Cyclomatic Complexity · index.CurrencyPicker (cyclomatic 28) · ×1
  • index.CurrencyPicker (cyclomatic 28) app/javascript/components/Checkout/index.tsx:139 — index.CurrencyPicker has cyclomatic complexity 28 (threshold 15). Of this number, 22 points are the body's own statements and 6 belong to 3 function literals 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.
D1 · Cyclomatic Complexity · ChatMessageList.ChatMessageList (cyclomatic 28) · ×1
  • ChatMessageList.ChatMessageList (cyclomatic 28) app/javascript/components/Communities/ChatMessageList.tsx:19 — ChatMessageList.ChatMessageList has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 104, 47, 167, …). 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.
D1 · Cyclomatic Complexity · Show.PiracyReportsShow (cyclomatic 28) · ×1
  • Show.PiracyReportsShow (cyclomatic 28) app/javascript/pages/PiracyReports/Show.tsx:92 — Show.PiracyReportsShow 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StripeMerchantAccountManager.update_person (cyclomatic 27) · ×1
  • StripeMerchantAccountManager.update_person (cyclomatic 27) REDACTED:1065 — StripeMerchantAccountManager.update_person 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.
D1 · Cyclomatic Complexity · LinksController.search (cyclomatic 27) · ×1
  • LinksController.search (cyclomatic 27) REDACTED:278 — LinksController.search 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.
D1 · Cyclomatic Complexity · ProfileController.update (cyclomatic 27) · ×1
  • ProfileController.update (cyclomatic 27) app/controllers/settings/profile_controller.rb:18 — ProfileController.update 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.
D1 · Cyclomatic Complexity · Purchase.later_charge_presentment_processor_args (cyclomatic 27) · ×1
  • Purchase.later_charge_presentment_processor_args (cyclomatic 27) app/models/purchase.rb:5077 — Purchase.later_charge_presentment_processor_args 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.
D1 · Cyclomatic Complexity · StoreAgentService.write_fields (cyclomatic 27) · ×1
  • StoreAgentService.write_fields (cyclomatic 27) app/services/ai/store_agent_service.rb:1713 — StoreAgentService.write_fields has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BuyerCurrencyQuote.charge_quote_for (cyclomatic 27) · ×1
  • BuyerCurrencyQuote.charge_quote_for (cyclomatic 27) app/services/checkout/buyer_currency_quote.rb:683 — BuyerCurrencyQuote.charge_quote_for has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SalesChart.SalesChart (cyclomatic 27) · ×1
  • SalesChart.SalesChart (cyclomatic 27) app/javascript/components/Analytics/SalesChart.tsx:139 — SalesChart.SalesChart has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 161, 192, 235, …). 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.
D1 · Cyclomatic Complexity · UpsellsPage.UpsellsPage (cyclomatic 27) · ×1
  • UpsellsPage.UpsellsPage (cyclomatic 27) app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:107 — UpsellsPage.UpsellsPage has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 10 of the 27 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 127, 215, 273, …). 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.
D1 · Cyclomatic Complexity · UpsellsPage.Form · ×1
  • UpsellsPage.Form::handleSubmit (cyclomatic 27) app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:611 — UpsellsPage.Form::handleSubmit 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. This shape REPEATS in the file: one other method here (UpsellsPage.Form) 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.
D1 · Cyclomatic Complexity · FileList.MobileAppAudioFileRow (cyclomatic 27) · ×1
  • FileList.MobileAppAudioFileRow (cyclomatic 27) app/javascript/components/Download/FileList.tsx:512 — FileList.MobileAppAudioFileRow has cyclomatic complexity 27 (threshold 15). Of this number, 22 points are the body's own statements and 5 belong to 2 function literals 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.
D1 · Cyclomatic Complexity · ConfigurationSelector.CallDateAndTimeSelector (cyclomatic 27) · ×1
  • ConfigurationSelector.CallDateAndTimeSelector (cyclomatic 27) app/javascript/components/Product/ConfigurationSelector.tsx:436 — ConfigurationSelector.CallDateAndTimeSelector has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 456, getAvailableStartTimesByDate, a function literal at line 584, …). 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.
D1 · Cyclomatic Complexity · CircleIntegrationEditor.CircleIntegrationEditor (cyclomatic 27) · ×1
  • CircleIntegrationEditor.CircleIntegrationEditor (cyclomatic 27) app/javascript/components/ProductEdit/ProductTab/CircleIntegrationEditor.tsx:29 — CircleIntegrationEditor.CircleIntegrationEditor has cyclomatic complexity 27 (threshold 15). Of this number, 16 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.
D1 · Cyclomatic Complexity · New.LoginPage (cyclomatic 27) · ×1
  • New.LoginPage (cyclomatic 27) app/javascript/pages/Logins/New.tsx:46 — New.LoginPage has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 81, 148, 152). 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.
D1 · Cyclomatic Complexity · Read.PdfReader (cyclomatic 27) · ×1
  • Read.PdfReader (cyclomatic 27) app/javascript/pages/UrlRedirects/Read.tsx:200 — Read.PdfReader has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 6 of the 27 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 273, a function literal at line 218, a function literal at line 292, …). 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.
D1 · Cyclomatic Complexity · ProductController.update (cyclomatic 26) · ×1
  • ProductController.update (cyclomatic 26) REDACTED:12 — ProductController.update 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.
D1 · Cyclomatic Complexity · BalanceTransaction.find_or_create_balance (cyclomatic 26) · ×1
  • BalanceTransaction.find_or_create_balance (cyclomatic 26) app/models/balance_transaction.rb:252 — BalanceTransaction.find_or_create_balance 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.
D1 · Cyclomatic Complexity · ChargeEventsHandler.promote_confirmed_setup_intents_for_client_confirmed_charge! (cyclomatic 26) · ×1
  • ChargeEventsHandler.promote_confirmed_setup_intents_for_client_confirmed_charge! (cyclomatic 26) app/models/concerns/purchase/charge_events_handler.rb:234 — ChargeEventsHandler.promote_confirmed_setup_intents_for_client_confirmed_charge! has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Link.description_scrubber (cyclomatic 26) · ×1
  • Link.description_scrubber (cyclomatic 26) app/models/link.rb:2227 — Link.description_scrubber has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Purchase.process_without_charging! (cyclomatic 26) · ×1
  • Purchase.process_without_charging! (cyclomatic 26) app/models/purchase.rb:4730 — Purchase.process_without_charging! has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnthropicClient.stream_messages (cyclomatic 26) · ×1
  • AnthropicClient.stream_messages (cyclomatic 26) app/services/ai/anthropic_client.rb:213 — AnthropicClient.stream_messages has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TriageUnlinkedStripeBankAccounts.classify (cyclomatic 26) · ×1
  • TriageUnlinkedStripeBankAccounts.classify (cyclomatic 26) app/services/onetime/triage_unlinked_stripe_bank_accounts.rb:139 — TriageUnlinkedStripeBankAccounts.classify 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.
D1 · Cyclomatic Complexity · ChargeService.register_india_mandate_for_off_session_cart! (cyclomatic 26) · ×1
  • ChargeService.register_india_mandate_for_off_session_cart! (cyclomatic 26) app/services/order/charge_service.rb:339 — ChargeService.register_india_mandate_for_off_session_cart! has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReassignByEmailService.perform (cyclomatic 26) · ×1
  • ReassignByEmailService.perform (cyclomatic 26) app/services/purchase/reassign_by_email_service.rb:20 — ReassignByEmailService.perform has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FileEmbedGroup.FileEmbedGroupNodeView (cyclomatic 26) · ×1
  • FileEmbedGroup.FileEmbedGroupNodeView (cyclomatic 26) app/javascript/components/ProductEdit/ContentTab/FileEmbedGroup.tsx:60 — FileEmbedGroup.FileEmbedGroupNodeView has cyclomatic complexity 26 (threshold 15). Of this number, 16 points are the body's own statements and 10 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.
D1 · Cyclomatic Complexity · product_edit.applyRichContentPageSaveResponse (cyclomatic 26) · ×1
  • product_edit.applyRichContentPageSaveResponse (cyclomatic 26) app/javascript/data/product_edit.ts:282 — product_edit.applyRichContentPageSaveResponse 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.
D1 · Cyclomatic Complexity · prepareImageForUpload.prepareImageForUpload (cyclomatic 26) · ×1
  • prepareImageForUpload.prepareImageForUpload (cyclomatic 26) app/javascript/utils/prepareImageForUpload.ts:107 — prepareImageForUpload.prepareImageForUpload 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.
D1 · Cyclomatic Complexity · AffiliatesController.process_affiliate_params (cyclomatic 25) · ×1
  • AffiliatesController.process_affiliate_params (cyclomatic 25) app/controllers/affiliates_controller.rb:148 — AffiliatesController.process_affiliate_params 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.
D1 · Cyclomatic Complexity · PurchasesController.refund (cyclomatic 25) · ×1
  • PurchasesController.refund (cyclomatic 25) app/controllers/api/internal/admin/purchases_controller.rb:151 — PurchasesController.refund has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CheckoutController.update (cyclomatic 25) · ×1
  • CheckoutController.update (cyclomatic 25) app/controllers/checkout_controller.rb:28 — CheckoutController.update 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.
D1 · Cyclomatic Complexity · Purchase.minimum_paid_price_cents (cyclomatic 25) · ×1
  • Purchase.minimum_paid_price_cents (cyclomatic 25) app/models/purchase.rb:1939 — Purchase.minimum_paid_price_cents has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PostSendgridApi.build_personalization_for_recipient (cyclomatic 25) · ×1
  • PostSendgridApi.build_personalization_for_recipient (cyclomatic 25) app/services/post_sendgrid_api.rb:131 — PostSendgridApi.build_personalization_for_recipient has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReconcileClientConfirmedChargeJob.promote_confirmed_setup_intents! (cyclomatic 25) · ×1
  • ReconcileClientConfirmedChargeJob.promote_confirmed_setup_intents! (cyclomatic 25) app/sidekiq/reconcile_client_confirmed_charge_job.rb:89 — ReconcileClientConfirmedChargeJob.promote_confirmed_setup_intents! has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProductPreview.ProductPreview (cyclomatic 25) · ×1
  • ProductPreview.ProductPreview (cyclomatic 25) app/javascript/components/ProductEdit/ProductPreview.tsx:14 — ProductPreview.ProductPreview has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 belong to 4 function literals 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.
D1 · Cyclomatic Complexity · ProductEditPage.ProductEditPage · ×1
  • ProductEditPage.ProductEditPage::performSave (cyclomatic 25) app/javascript/components/server-components/ProductEditPage.tsx:617 — ProductEditPage.ProductEditPage::performSave 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. This shape REPEATS in the file: one other method here (ProductEditPage.ProductEditPage) 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.
D1 · Cyclomatic Complexity · Edit.AffiliatesEdit (cyclomatic 25) · ×1
  • Edit.AffiliatesEdit (cyclomatic 25) app/javascript/pages/Affiliates/Edit.tsx:33 — Edit.AffiliatesEdit has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 8 function items inside it that branch (handleSubmit, a function literal at line 119, a function literal at line 51, …). 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.
D1 · Cyclomatic Complexity · Show.CheckoutIndexPage (cyclomatic 25) · ×1
  • Show.CheckoutIndexPage (cyclomatic 25) app/javascript/pages/Checkout/Show.tsx:185 — Show.CheckoutIndexPage 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. This shape REPEATS in the file: one other method here (Show.CheckoutIndexPage::pay) 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.
D1 · Cyclomatic Complexity · Show.PasswordPage (cyclomatic 25) · ×1
  • Show.PasswordPage (cyclomatic 25) app/javascript/pages/Settings/Password/Show.tsx:31 — Show.PasswordPage has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 belong to 4 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.
D1 · Cyclomatic Complexity · ContactingCreatorMailer.notify (cyclomatic 24) · ×1
  • ContactingCreatorMailer.notify (cyclomatic 24) app/mailers/contacting_creator_mailer.rb:34 — ContactingCreatorMailer.notify 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.
D1 · Cyclomatic Complexity · Subscription.resume_held_indian_card_mandate! (cyclomatic 24) · ×1
  • Subscription.resume_held_indian_card_mandate! (cyclomatic 24) REDACTED:603 — Subscription.resume_held_indian_card_mandate! has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Subscription.indian_card_mandate_terms (cyclomatic 24) · ×1
  • Subscription.indian_card_mandate_terms (cyclomatic 24) REDACTED:733 — Subscription.indian_card_mandate_terms has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PreparePaymentIntentService.create_unconfirmed_intent (cyclomatic 24) · ×1
  • PreparePaymentIntentService.create_unconfirmed_intent (cyclomatic 24) app/services/order/prepare_payment_intent_service.rb:924 — PreparePaymentIntentService.create_unconfirmed_intent has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UpdateProductFilesArchiveWorker.build_archive (cyclomatic 24) · ×1
  • UpdateProductFilesArchiveWorker.build_archive (cyclomatic 24) app/sidekiq/update_product_files_archive_worker.rb:99 — UpdateProductFilesArchiveWorker.build_archive has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Show.MainPage (cyclomatic 24) · ×1
  • Show.MainPage (cyclomatic 24) app/javascript/pages/Settings/Main/Show.tsx:85 — Show.MainPage has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 3 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.
D1 · Cyclomatic Complexity · Show.TwoFactorAuthentication (cyclomatic 24) · ×1
  • Show.TwoFactorAuthentication (cyclomatic 24) app/javascript/pages/TwoFactorAuthentication/Show.tsx:26 — Show.TwoFactorAuthentication has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 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.
D1 · Cyclomatic Complexity · StripeChargeProcessor.debit_stripe_account_for_australia_backtaxes (cyclomatic 23) · ×1
  • StripeChargeProcessor.debit_stripe_account_for_australia_backtaxes (cyclomatic 23) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:1046 — StripeChargeProcessor.debit_stripe_account_for_australia_backtaxes has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SearchProducts.normalize_search_param_values! (cyclomatic 23) · ×1
  • SearchProducts.normalize_search_param_values! (cyclomatic 23) app/controllers/concerns/search_products.rb:47 — SearchProducts.normalize_search_param_values! has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CreditCard.create_from_client_confirmed_intent! (cyclomatic 23) · ×1
  • CreditCard.create_from_client_confirmed_intent! (cyclomatic 23) REDACTED:106 — CreditCard.create_from_client_confirmed_intent! has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Installment.download_url (cyclomatic 23) · ×1
  • Installment.download_url (cyclomatic 23) app/models/installment.rb:614 — Installment.download_url has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Purchase.refund_gumroad_taxes! (cyclomatic 23) · ×1
  • Purchase.refund_gumroad_taxes! (cyclomatic 23) app/modules/purchase/refundable.rb:440 — Purchase.refund_gumroad_taxes! has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Posts.visible_posts_for (cyclomatic 23) · ×1
  • Posts.visible_posts_for (cyclomatic 23) app/modules/user/posts.rb:4 — Posts.visible_posts_for has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BuyerCurrencyEligibility.direct_listed_line_items_eligible? (cyclomatic 23) · ×1
  • BuyerCurrencyEligibility.direct_listed_line_items_eligible? (cyclomatic 23) app/services/checkout/buyer_currency_eligibility.rb:152 — BuyerCurrencyEligibility.direct_listed_line_items_eligible? has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ClassifierStrategy.perform (cyclomatic 23) · ×1
  • ClassifierStrategy.perform (cyclomatic 23) app/services/content_moderation/strategies/classifier_strategy.rb:82 — ClassifierStrategy.perform has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentChat.AgentChat · ×1
  • AgentChat.AgentChat::send (cyclomatic 23) app/javascript/components/Agent/AgentChat.tsx:724 — AgentChat.AgentChat::send 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. This shape REPEATS in the file: one other method here (AgentChat.AgentChat) 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.
D1 · Cyclomatic Complexity · payment.validatePaymentMethodIndependentFields (cyclomatic 23) · ×1
  • payment.validatePaymentMethodIndependentFields (cyclomatic 23) app/javascript/components/Checkout/payment.ts:1335 — payment.validatePaymentMethodIndependentFields 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.
D1 · Cyclomatic Complexity · ChatMessage.ChatMessage (cyclomatic 23) · ×1
  • ChatMessage.ChatMessage (cyclomatic 23) app/javascript/components/Communities/ChatMessage.tsx:24 — ChatMessage.ChatMessage has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 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.
D1 · Cyclomatic Complexity · EmailForm.EmailForm · ×1
  • EmailForm.EmailForm::validate (cyclomatic 23) app/javascript/components/EmailsPage/EmailForm.tsx:610 — EmailForm.EmailForm::validate 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. This shape REPEATS in the file: one other method here (EmailForm.EmailForm) 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.
D1 · Cyclomatic Complexity · ActionsPopover.ActionsPopover (cyclomatic 23) · ×1
  • ActionsPopover.ActionsPopover (cyclomatic 23) app/javascript/components/ProductsPage/ActionsPopover.tsx:15 — ActionsPopover.ActionsPopover has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 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.
D1 · Cyclomatic Complexity · ReviewVideoRecorderClientOnly.ReviewVideoRecorderClientOnly (cyclomatic 23) · ×1
  • ReviewVideoRecorderClientOnly.ReviewVideoRecorderClientOnly (cyclomatic 23) app/javascript/components/ReviewForm/ReviewVideoRecorderClientOnly.tsx:132 — ReviewVideoRecorderClientOnly.ReviewVideoRecorderClientOnly has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 8 function items inside it that branch (renderUiState, a function literal at line 210, a function literal at line 223, …). 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.
D1 · Cyclomatic Complexity · RichTextEditor.RichTextEditorToolbar (cyclomatic 23) · ×1
  • RichTextEditor.RichTextEditorToolbar (cyclomatic 23) app/javascript/components/RichTextEditor.tsx:487 — RichTextEditor.RichTextEditorToolbar has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 7 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.
D1 · Cyclomatic Complexity · Posts.PostsNodeView (cyclomatic 23) · ×1
  • Posts.PostsNodeView (cyclomatic 23) app/javascript/components/TiptapExtensions/Posts.tsx:48 — Posts.PostsNodeView has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 belong to 3 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.
D1 · Cyclomatic Complexity · Edit.BundlesProductEdit (cyclomatic 23) · ×1
  • Edit.BundlesProductEdit (cyclomatic 23) app/javascript/pages/Bundles/Product/Edit.tsx:110 — Edit.BundlesProductEdit has cyclomatic complexity 23 (threshold 15). Of this number, 14 points are the body's own statements and 9 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.
D1 · Cyclomatic Complexity · AsJson.as_json_for_api (cyclomatic 22) · ×1
  • AsJson.as_json_for_api (cyclomatic 22) app/models/concerns/product/as_json.rb:76 — AsJson.as_json_for_api has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Purchase.json_data_for_mobile (cyclomatic 22) · ×1
  • Purchase.json_data_for_mobile (cyclomatic 22) app/models/purchase.rb:2968 — Purchase.json_data_for_mobile has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Purchase.indian_card_charge_intent_matches_subscription_terms? (cyclomatic 22) · ×1
  • Purchase.indian_card_charge_intent_matches_subscription_terms? (cyclomatic 22) app/models/purchase.rb:4024 — Purchase.indian_card_charge_intent_matches_subscription_terms? 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.
D1 · Cyclomatic Complexity · Purchase.calculate_taxes (cyclomatic 22) · ×1
  • Purchase.calculate_taxes (cyclomatic 22) app/models/purchase.rb:5568 — Purchase.calculate_taxes has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Subscription.update_renewal_for_indian_card_mandate! (cyclomatic 22) · ×1
  • Subscription.update_renewal_for_indian_card_mandate! (cyclomatic 22) REDACTED:460 — Subscription.update_renewal_for_indian_card_mandate! has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProductProps.props (cyclomatic 22) · ×1
  • ProductProps.props (cyclomatic 22) app/presenters/product_presenter/product_props.rb:16 — ProductProps.props has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StoreAgentService.respond_streaming (cyclomatic 22) · ×1
  • StoreAgentService.respond_streaming (cyclomatic 22) app/services/ai/store_agent_service.rb:859 — StoreAgentService.respond_streaming has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BackfillLegacyFeatureAnnouncementPreferences.process (cyclomatic 22) · ×1
  • BackfillLegacyFeatureAnnouncementPreferences.process (cyclomatic 22) app/services/onetime/backfill_legacy_feature_announcement_preferences.rb:15 — BackfillLegacyFeatureAnnouncementPreferences.process has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BackfillSelfAffiliateDroppedProceeds.check_eligibility (cyclomatic 22) · ×1
  • BackfillSelfAffiliateDroppedProceeds.check_eligibility (cyclomatic 22) app/services/onetime/backfill_self_affiliate_dropped_proceeds.rb:163 — BackfillSelfAffiliateDroppedProceeds.check_eligibility has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChargeService.setup_for_future_charges_without_charging (cyclomatic 22) · ×1
  • ChargeService.setup_for_future_charges_without_charging (cyclomatic 22) app/services/order/charge_service.rb:199 — ChargeService.setup_for_future_charges_without_charging has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateUsStateMonthlySalesReportsJob.perform (cyclomatic 22) · ×1
  • CreateUsStateMonthlySalesReportsJob.perform (cyclomatic 22) app/sidekiq/create_us_state_monthly_sales_reports_job.rb:13 — CreateUsStateMonthlySalesReportsJob.perform has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SendWorkflowEmailsToPastCanceledMembersJob.perform (cyclomatic 22) · ×1
  • SendWorkflowEmailsToPastCanceledMembersJob.perform (cyclomatic 22) app/sidekiq/send_workflow_emails_to_past_canceled_members_job.rb:11 — SendWorkflowEmailsToPastCanceledMembersJob.perform 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.
D1 · Cyclomatic Complexity · AgentChat.ProposedActionCard (cyclomatic 22) · ×1
  • AgentChat.ProposedActionCard (cyclomatic 22) app/javascript/components/Agent/AgentChat.tsx:335 — AgentChat.ProposedActionCard has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PaymentForm.PaymentForm (cyclomatic 22) · ×1
  • PaymentForm.PaymentForm (cyclomatic 22) app/javascript/components/Checkout/PaymentForm.tsx:1999 — PaymentForm.PaymentForm has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 2053, 2035, 2065). 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.
D1 · Cyclomatic Complexity · index.TipSelector (cyclomatic 22) · ×1
  • index.TipSelector (cyclomatic 22) app/javascript/components/Checkout/index.tsx:875 — index.TipSelector has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 belong to 3 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.
D1 · Cyclomatic Complexity · PostCommentsSection.CommentContainer (cyclomatic 22) · ×1
  • PostCommentsSection.CommentContainer (cyclomatic 22) REDACTED:203 — PostCommentsSection.CommentContainer has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 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.
D1 · Cyclomatic Complexity · Layout.CtaBar (cyclomatic 22) · ×1
  • Layout.CtaBar (cyclomatic 22) app/javascript/components/Product/Layout.tsx:142 — Layout.CtaBar has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 belong to 4 function literals 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.
D1 · Cyclomatic Complexity · Index.UtmLinksIndex (cyclomatic 22) · ×1
  • Index.UtmLinksIndex (cyclomatic 22) app/javascript/pages/UtmLinks/Index.tsx:82 — Index.UtmLinksIndex has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 109, 143, 196, …). 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.
D1 · Cyclomatic Complexity · StripePayoutProcessor.handle_stripe_event (cyclomatic 21) · ×1
  • StripePayoutProcessor.handle_stripe_event (cyclomatic 21) app/business/payments/payouts/processor/stripe/stripe_payout_processor.rb:993 — StripePayoutProcessor.handle_stripe_event 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.
D1 · Cyclomatic Complexity · SalesController.update (cyclomatic 21) · ×1
  • SalesController.update (cyclomatic 21) app/controllers/api/mobile/sales_controller.rb:66 — SalesController.update 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.
D1 · Cyclomatic Complexity · LinksController.update_sections (cyclomatic 21) · ×1
  • LinksController.update_sections (cyclomatic 21) app/controllers/api/v2/links_controller.rb:621 — LinksController.update_sections 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.
D1 · Cyclomatic Complexity · LinksController.sanitized_price_check_overrides (cyclomatic 21) · ×1
  • LinksController.sanitized_price_check_overrides (cyclomatic 21) REDACTED:931 — LinksController.sanitized_price_check_overrides has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Purchase.not_double_charged (cyclomatic 21) · ×1
  • Purchase.not_double_charged (cyclomatic 21) app/models/purchase.rb:6001 — Purchase.not_double_charged 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.
D1 · Cyclomatic Complexity · Subscription.unsubscribe_and_fail! (cyclomatic 21) · ×1
  • Subscription.unsubscribe_and_fail! (cyclomatic 21) REDACTED:1120 — Subscription.unsubscribe_and_fail! has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EmailAttachments.filesReducer (cyclomatic 21) · ×1
  • EmailAttachments.filesReducer (cyclomatic 21) app/javascript/components/EmailAttachments.tsx:403 — EmailAttachments.filesReducer has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body's own statements and 10 belong to 10 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.
D1 · Cyclomatic Complexity · ConfigurationSelector.applySelection (cyclomatic 21) · ×1
  • ConfigurationSelector.applySelection (cyclomatic 21) app/javascript/components/Product/ConfigurationSelector.tsx:260 — ConfigurationSelector.applySelection 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.
D1 · Cyclomatic Complexity · PurchaseButton.PurchaseButton (cyclomatic 21) · ×1
  • PurchaseButton.PurchaseButton (cyclomatic 21) app/javascript/components/Product/PurchaseButton.tsx:22 — PurchaseButton.PurchaseButton has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (validate, a function literal at line 73). 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.
D1 · Cyclomatic Complexity · selectionDiscounts.useSelectionDiscounts (cyclomatic 21) · ×1
  • selectionDiscounts.useSelectionDiscounts (cyclomatic 21) app/javascript/components/Product/selectionDiscounts.ts:49 — selectionDiscounts.useSelectionDiscounts has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to 4 function literals 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.
D1 · Cyclomatic Complexity · CartRecoveryCard.CartRecoveryCard (cyclomatic 21) · ×1
  • CartRecoveryCard.CartRecoveryCard (cyclomatic 21) app/javascript/components/ProductEdit/ShareTab/CartRecoveryCard.tsx:43 — CartRecoveryCard.CartRecoveryCard has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 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.
D1 · Cyclomatic Complexity · PublicFileEmbed.NodeView (cyclomatic 21) · ×1
  • PublicFileEmbed.NodeView (cyclomatic 21) app/javascript/components/TiptapExtensions/PublicFileEmbed.tsx:47 — PublicFileEmbed.NodeView 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.
D1 · Cyclomatic Complexity · Show.Churn (cyclomatic 21) · ×1
  • Show.Churn (cyclomatic 21) app/javascript/pages/Churn/Show.tsx:140 — Show.Churn has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 222, 250, 188, …). 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.
D1 · Cyclomatic Complexity · Show.HelpCenterArticle (cyclomatic 21) · ×1
  • Show.HelpCenterArticle (cyclomatic 21) app/javascript/pages/HelpCenter/Articles/Show.tsx:143 — Show.HelpCenterArticle has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 152, 210, 237, …). 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.
D1 · Cyclomatic Complexity · Show.SocialConnectionsPage (cyclomatic 21) · ×1
  • Show.SocialConnectionsPage (cyclomatic 21) app/javascript/pages/Settings/SocialConnections/Show.tsx:59 — Show.SocialConnectionsPage has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 belong to 3 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.
D1 · Cyclomatic Complexity · Show.TeamMembersSection (cyclomatic 21) · ×1
  • Show.TeamMembersSection (cyclomatic 21) app/javascript/pages/Settings/Team/Show.tsx:205 — Show.TeamMembersSection has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 4 function items inside it that branch (handleOptionChange, a function literal at line 306, a function literal at line 278, …). 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.
D1 · Cyclomatic Complexity · StripeChargeProcessor.refund! (cyclomatic 20) · ×1
  • StripeChargeProcessor.refund! (cyclomatic 20) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:662 — StripeChargeProcessor.refund! has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PaypalPayoutProcessor.topup_amount_in_transit (cyclomatic 20) · ×1
  • PaypalPayoutProcessor.topup_amount_in_transit (cyclomatic 20) app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:691 — PaypalPayoutProcessor.topup_amount_in_transit has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentCustomHtmlPreviewsController.resulting_custom_html (cyclomatic 20) · ×1
  • AgentCustomHtmlPreviewsController.resulting_custom_html (cyclomatic 20) app/controllers/api/internal/agent_custom_html_previews_controller.rb:170 — AgentCustomHtmlPreviewsController.resulting_custom_html has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Risk.add_user_comment (cyclomatic 20) · ×1
  • Risk.add_user_comment (cyclomatic 20) REDACTED:356 — Risk.add_user_comment has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SettingsPresenter.billing_props (cyclomatic 20) · ×1
  • SettingsPresenter.billing_props (cyclomatic 20) REDACTED:134 — SettingsPresenter.billing_props has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · UrlRedirectPresenter.download_page_layout_props (cyclomatic 20) · ×1
  • UrlRedirectPresenter.download_page_layout_props (cyclomatic 20) app/presenters/url_redirect_presenter.rb:89 — UrlRedirectPresenter.download_page_layout_props has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnthropicClient.parse_buffered_fallback (cyclomatic 20) · ×1
  • AnthropicClient.parse_buffered_fallback (cyclomatic 20) app/services/ai/anthropic_client.rb:352 — AnthropicClient.parse_buffered_fallback has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ManageService.process (cyclomatic 20) · ×1
  • ManageService.process (cyclomatic 20) app/services/workflow/manage_service.rb:16 — ManageService.process has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SubmitPaypalDisputeEvidenceJob.perform (cyclomatic 20) · ×1
  • SubmitPaypalDisputeEvidenceJob.perform (cyclomatic 20) app/sidekiq/submit_paypal_dispute_evidence_job.rb:46 — SubmitPaypalDisputeEvidenceJob.perform has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ComboBox.ComboBox (cyclomatic 20) · ×1
  • ComboBox.ComboBox (cyclomatic 20) app/javascript/components/ComboBox.tsx:24 — ComboBox.ComboBox has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 68, toggle, moveCursor, …). 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.
D1 · Cyclomatic Complexity · PostCommentsSection.PostCommentsSection (cyclomatic 20) · ×1
  • PostCommentsSection.PostCommentsSection (cyclomatic 20) REDACTED:51 — PostCommentsSection.PostCommentsSection has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 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.
D1 · Cyclomatic Complexity · WorkflowEmails.EmailRow (cyclomatic 20) · ×1
  • WorkflowEmails.EmailRow (cyclomatic 20) app/javascript/components/WorkflowsPage/WorkflowEmails.tsx:402 — WorkflowEmails.EmailRow has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 3 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.
D1 · Cyclomatic Complexity · manual-chunks.manualChunks (cyclomatic 20) · ×1
  • manual-chunks.manualChunks (cyclomatic 20) config/vite/manual-chunks.ts:31 — manual-chunks.manualChunks has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PaypalPayoutProcessor.is_user_payable (cyclomatic 19) · ×1
  • PaypalPayoutProcessor.is_user_payable (cyclomatic 19) app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:48 — PaypalPayoutProcessor.is_user_payable has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SalesTaxCalculator.calculate_with_lookup_table (cyclomatic 19) · ×1
  • SalesTaxCalculator.calculate_with_lookup_table (cyclomatic 19) app/business/sales_tax/sales_tax_calculator.rb:146 — SalesTaxCalculator.calculate_with_lookup_table has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SalesController.index (cyclomatic 19) · ×1
  • SalesController.index (cyclomatic 19) app/controllers/api/v2/sales_controller.rb:39 — SalesController.index has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PayoutsHelper.payout_method_details (cyclomatic 19) · ×1
  • PayoutsHelper.payout_method_details (cyclomatic 19) app/helpers/payouts_helper.rb:218 — PayoutsHelper.payout_method_details has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AbandonedCartProducts.abandoned_cart_products (cyclomatic 19) · ×1
  • AbandonedCartProducts.abandoned_cart_products (cyclomatic 19) app/models/concerns/workflow/abandoned_cart_products.rb:11 — AbandonedCartProducts.abandoned_cart_products has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Purchase.set_price_and_rate (cyclomatic 19) · ×1
  • Purchase.set_price_and_rate (cyclomatic 19) app/models/purchase.rb:2555 — Purchase.set_price_and_rate has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Purchase.mandate_options_for_stripe (cyclomatic 19) · ×1
  • Purchase.mandate_options_for_stripe (cyclomatic 19) app/models/purchase.rb:4127 — Purchase.mandate_options_for_stripe has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Subscription.build_purchase (cyclomatic 19) · ×1
  • Subscription.build_purchase (cyclomatic 19) REDACTED:271 — Subscription.build_purchase has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Subscription.process_purchase! (cyclomatic 19) · ×1
  • Subscription.process_purchase! (cyclomatic 19) REDACTED:362 — Subscription.process_purchase! has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Purchase.reverse_excess_amount_from_stripe_transfer (cyclomatic 19) · ×1
  • Purchase.reverse_excess_amount_from_stripe_transfer (cyclomatic 19) app/modules/purchase/refundable.rb:782 — Purchase.reverse_excess_amount_from_stripe_transfer has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StripePaymentPresenter.client_confirm_props (cyclomatic 19) · ×1
  • StripePaymentPresenter.client_confirm_props (cyclomatic 19) app/presenters/checkout/stripe_payment_presenter.rb:269 — StripePaymentPresenter.client_confirm_props has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProfileSectionsPresenter.section_props (cyclomatic 19) · ×1
  • ProfileSectionsPresenter.section_props (cyclomatic 19) REDACTED:135 — ProfileSectionsPresenter.section_props has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BuyerCurrencyEligibility.method_forced_decision (cyclomatic 19) · ×1
  • BuyerCurrencyEligibility.method_forced_decision (cyclomatic 19) app/services/checkout/buyer_currency_eligibility.rb:522 — BuyerCurrencyEligibility.method_forced_decision has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ContentExtractor.self_contained_svg? (cyclomatic 19) · ×1
  • ContentExtractor.self_contained_svg? (cyclomatic 19) app/services/content_moderation/content_extractor.rb:268 — ContentExtractor.self_contained_svg? has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Base.payout_data (cyclomatic 19) · ×1
  • Base.payout_data (cyclomatic 19) app/services/exports/payouts/base.rb:27 — Base.payout_data has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RepairCapitalDeduction.validate_records! (cyclomatic 19) · ×1
  • RepairCapitalDeduction.validate_records! (cyclomatic 19) app/services/onetime/repair_capital_deduction.rb:55 — RepairCapitalDeduction.validate_records! 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.
D1 · Cyclomatic Complexity · PreparePaymentIntentService.recurring_upi_registration_shape_value (cyclomatic 19) · ×1
  • PreparePaymentIntentService.recurring_upi_registration_shape_value (cyclomatic 19) app/services/order/prepare_payment_intent_service.rb:1271 — PreparePaymentIntentService.recurring_upi_registration_shape_value has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PostBlastSending.partition_members_that_left_the_audience (cyclomatic 19) · ×1
  • PostBlastSending.partition_members_that_left_the_audience (cyclomatic 19) app/sidekiq/concerns/post_blast_sending.rb:334 — PostBlastSending.partition_members_that_left_the_audience has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ScheduleMembershipPriceUpdatesJob.perform (cyclomatic 19) · ×1
  • ScheduleMembershipPriceUpdatesJob.perform (cyclomatic 19) app/sidekiq/schedule_membership_price_updates_job.rb:7 — ScheduleMembershipPriceUpdatesJob.perform has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cartState.getDiscountedPriceForItem (cyclomatic 19) · ×1
  • cartState.getDiscountedPriceForItem (cyclomatic 19) app/javascript/components/Checkout/cartState.ts:249 — cartState.getDiscountedPriceForItem has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UpsellsPage.UpsellDrawer (cyclomatic 19) · ×1
  • UpsellsPage.UpsellDrawer (cyclomatic 19) app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:365 — UpsellsPage.UpsellDrawer has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 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.
D1 · Cyclomatic Complexity · CardGrid.useSearchReducer (cyclomatic 19) · ×1
  • CardGrid.useSearchReducer (cyclomatic 19) app/javascript/components/Product/CardGrid.tsx:67 — CardGrid.useSearchReducer has cyclomatic complexity 19 (threshold 15). 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 literals inside it that branch (lines 106, 75). 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.
D1 · Cyclomatic Complexity · DescriptionEditor.DescriptionEditor (cyclomatic 19) · ×1
  • DescriptionEditor.DescriptionEditor (cyclomatic 19) app/javascript/components/ProductEdit/ProductTab/DescriptionEditor.tsx:116 — DescriptionEditor.DescriptionEditor has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 168, 231, 273, …). 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.
D1 · Cyclomatic Complexity · UpsellSelectModal.UpsellSelectModal (cyclomatic 19) · ×1
  • UpsellSelectModal.UpsellSelectModal (cyclomatic 19) app/javascript/components/UpsellSelectModal.tsx:43 — UpsellSelectModal.UpsellSelectModal has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 7 function items inside it that branch (fetchProducts, a function literal at line 156, selectProductOption, …). 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.
D1 · Cyclomatic Complexity · product_save_contract.buildDeletionOperations (cyclomatic 19) · ×1
  • product_save_contract.buildDeletionOperations (cyclomatic 19) app/javascript/data/product_save_contract.ts:103 — product_save_contract.buildDeletionOperations has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 3 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.
D1 · Cyclomatic Complexity · UtmLinkTracking.track_utm_link_visit (cyclomatic 18) · ×1
  • UtmLinkTracking.track_utm_link_visit (cyclomatic 18) REDACTED:7 — UtmLinkTracking.track_utm_link_visit has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SubscriptionsController.check_can_manage (cyclomatic 18) · ×1
  • SubscriptionsController.check_can_manage (cyclomatic 18) REDACTED:50 — SubscriptionsController.check_can_manage 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.
D1 · Cyclomatic Complexity · Purchase.fail_if_payment_intent_failed! (cyclomatic 18) · ×1
  • Purchase.fail_if_payment_intent_failed! (cyclomatic 18) app/models/purchase.rb:2511 — Purchase.fail_if_payment_intent_failed! has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Purchase.retrieve_indian_card_mandate (cyclomatic 18) · ×1
  • Purchase.retrieve_indian_card_mandate (cyclomatic 18) app/models/purchase.rb:3960 — Purchase.retrieve_indian_card_mandate has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Risk.chargeback_payment_identity (cyclomatic 18) · ×1
  • Risk.chargeback_payment_identity (cyclomatic 18) app/modules/purchase/risk.rb:113 — Risk.chargeback_payment_identity 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.
D1 · Cyclomatic Complexity · BuyerCurrencyQuote.verify! (cyclomatic 18) · ×1
  • BuyerCurrencyQuote.verify! (cyclomatic 18) app/services/checkout/buyer_currency_quote.rb:277 — BuyerCurrencyQuote.verify! has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ModerateRecordService.check (cyclomatic 18) · ×1
  • ModerateRecordService.check (cyclomatic 18) app/services/content_moderation/moderate_record_service.rb:163 — ModerateRecordService.check has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MergeCartsService.process (cyclomatic 18) · ×1
  • MergeCartsService.process (cyclomatic 18) app/services/merge_carts_service.rb:14 — MergeCartsService.process has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChargeService.setup_intent_covers_mandate_options? (cyclomatic 18) · ×1
  • ChargeService.setup_intent_covers_mandate_options? (cyclomatic 18) app/services/order/charge_service.rb:424 — ChargeService.setup_intent_covers_mandate_options? 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.
D1 · Cyclomatic Complexity · OfferCodeRecoveryService.sanitize_retry_candidates (cyclomatic 18) · ×1
  • OfferCodeRecoveryService.sanitize_retry_candidates (cyclomatic 18) app/services/order/offer_code_recovery_service.rb:27 — OfferCodeRecoveryService.sanitize_retry_candidates has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VariantCategoryUpdaterService.perform (cyclomatic 18) · ×1
  • VariantCategoryUpdaterService.perform (cyclomatic 18) app/services/product/variant_category_updater_service.rb:174 — VariantCategoryUpdaterService.perform has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CheckoutService.result (cyclomatic 18) · ×1
  • CheckoutService.result (cyclomatic 18) app/services/recommended_products/checkout_service.rb:29 — CheckoutService.result has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · UpdaterService.validate_saved_indian_card_mandate! (cyclomatic 18) · ×1
  • UpdaterService.validate_saved_indian_card_mandate! (cyclomatic 18) app/services/subscription/updater_service.rb:494 — UpdaterService.validate_saved_indian_card_mandate! has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UpdatePayoutMethod.process (cyclomatic 18) · ×1
  • UpdatePayoutMethod.process (cyclomatic 18) REDACTED:122 — UpdatePayoutMethod.process has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CheckIndianCardMandateRegistrationJob.perform (cyclomatic 18) · ×1
  • CheckIndianCardMandateRegistrationJob.perform (cyclomatic 18) app/sidekiq/check_indian_card_mandate_registration_job.rb:10 — CheckIndianCardMandateRegistrationJob.perform has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentChat.AgentChat (cyclomatic 18) · ×1
  • AgentChat.AgentChat (cyclomatic 18) app/javascript/components/Agent/AgentChat.tsx:467 — AgentChat.AgentChat 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. This shape REPEATS in the file: one other method here (AgentChat.AgentChat::send) 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.
D1 · Cyclomatic Complexity · CustomerDetailPage.ColumnLayout (cyclomatic 18) · ×1
  • CustomerDetailPage.ColumnLayout (cyclomatic 18) app/javascript/components/Audience/CustomerDetailPage.tsx:2362 — CustomerDetailPage.ColumnLayout has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 2386, 2363, 2371, …). 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.
D1 · Cyclomatic Complexity · PaymentElementInput.PaymentElementControllerInput (cyclomatic 18) · ×1
  • PaymentElementInput.PaymentElementControllerInput (cyclomatic 18) app/javascript/components/Checkout/PaymentElementInput.tsx:211 — PaymentElementInput.PaymentElementControllerInput has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 283, 265, 270). 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.
D1 · Cyclomatic Complexity · FileList.VideoEmbedPreview (cyclomatic 18) · ×1
  • FileList.VideoEmbedPreview (cyclomatic 18) app/javascript/components/Download/FileList.tsx:669 — FileList.VideoEmbedPreview has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 8 function items inside it that branch (startPlaying, a function literal at line 684, a function literal at line 696, …). 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.
D1 · Cyclomatic Complexity · ShareSection.ShareSection (cyclomatic 18) · ×1
  • ShareSection.ShareSection (cyclomatic 18) app/javascript/components/Product/ShareSection.tsx:24 — ShareSection.ShareSection has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 45, a function literal at line 99, a function literal at line 120, …). 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.
D1 · Cyclomatic Complexity · AttributesEditor.AttributesEditor (cyclomatic 18) · ×1
  • AttributesEditor.AttributesEditor (cyclomatic 18) app/javascript/components/ProductEdit/ProductTab/AttributesEditor.tsx:11 — AttributesEditor.AttributesEditor has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 47, moveCustomAttribute, 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.
D1 · Cyclomatic Complexity · AuthenticatorSetup.AuthenticatorSetup (cyclomatic 18) · ×1
  • AuthenticatorSetup.AuthenticatorSetup (cyclomatic 18) app/javascript/components/Settings/PasswordPage/AuthenticatorSetup.tsx:24 — AuthenticatorSetup.AuthenticatorSetup has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 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.
D1 · Cyclomatic Complexity · TestimonialSelectModal.TestimonialSelectModal (cyclomatic 18) · ×1
  • TestimonialSelectModal.TestimonialSelectModal (cyclomatic 18) app/javascript/components/TestimonialSelectModal.tsx:15 — TestimonialSelectModal.TestimonialSelectModal has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 5 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.
D1 · Cyclomatic Complexity · Link.LinkNodeView (cyclomatic 18) · ×1
  • Link.LinkNodeView (cyclomatic 18) app/javascript/components/TiptapExtensions/Link.tsx:119 — Link.LinkNodeView has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 8 function items inside it that branch (handleSave, a function literal at line 147, handleKeyPress, …). 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.
D1 · Cyclomatic Complexity · index.Wishlist (cyclomatic 18) · ×1
  • index.Wishlist (cyclomatic 18) app/javascript/components/Wishlist/index.tsx:175 — index.Wishlist has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 3 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.
D1 · Cyclomatic Complexity · google_analytics.trackProductEvent (cyclomatic 18) · ×1
  • google_analytics.trackProductEvent (cyclomatic 18) app/javascript/data/google_analytics.ts:64 — google_analytics.trackProductEvent has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Index.FollowersPage (cyclomatic 18) · ×1
  • Index.FollowersPage (cyclomatic 18) app/javascript/pages/Followers/Index.tsx:41 — Index.FollowersPage has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 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.
D1 · Cyclomatic Complexity · Stream.Stream (cyclomatic 18) · ×1
  • Stream.Stream (cyclomatic 18) app/javascript/pages/UrlRedirects/Stream.tsx:42 — Stream.Stream has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 97, 160, 66, …). 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.
D1 · Cyclomatic Complexity · StripeChargeProcessor.handle_stripe_capital_loan_event (cyclomatic 17) · ×1
  • StripeChargeProcessor.handle_stripe_capital_loan_event (cyclomatic 17) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:1295 — StripeChargeProcessor.handle_stripe_capital_loan_event has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PaypalPayoutProcessor.search_payment_on_paypal (cyclomatic 17) · ×1
  • PaypalPayoutProcessor.search_payment_on_paypal (cyclomatic 17) app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:618 — PaypalPayoutProcessor.search_payment_on_paypal has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentController.create (cyclomatic 17) · ×1
  • AgentController.create (cyclomatic 17) app/controllers/api/mobile/agent_controller.rb:92 — AgentController.create has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · EmailsController.valid_write_params? (cyclomatic 17) · ×1
  • EmailsController.valid_write_params? (cyclomatic 17) app/controllers/api/v2/workflows/emails_controller.rb:81 — EmailsController.valid_write_params? has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CustomersController.fetch_sales (cyclomatic 17) · ×1
  • CustomersController.fetch_sales (cyclomatic 17) app/controllers/customers_controller.rb:143 — CustomersController.fetch_sales has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OrdersController.release_failed_client_confirmation (cyclomatic 17) · ×1
  • OrdersController.release_failed_client_confirmation (cyclomatic 17) app/controllers/orders_controller.rb:157 — OrdersController.release_failed_client_confirmation has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OmniauthCallbacksController.failure (cyclomatic 17) · ×1
  • OmniauthCallbacksController.failure (cyclomatic 17) REDACTED:242 — OmniauthCallbacksController.failure has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DashboardNav.earned_items (cyclomatic 17) · ×1
  • DashboardNav.earned_items (cyclomatic 17) app/models/dashboard_nav.rb:82 — DashboardNav.earned_items has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Installment.audience_members_filter_params (cyclomatic 17) · ×1
  • Installment.audience_members_filter_params (cyclomatic 17) app/models/installment.rb:999 — Installment.audience_members_filter_params has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Purchase.product_installments (cyclomatic 17) · ×1
  • Purchase.product_installments (cyclomatic 17) app/models/purchase.rb:3189 — Purchase.product_installments has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Purchase.validate_offer_code (cyclomatic 17) · ×1
  • Purchase.validate_offer_code (cyclomatic 17) app/models/purchase.rb:5716 — Purchase.validate_offer_code has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Refund.collect_pending_fee_retention! (cyclomatic 17) · ×1
  • Refund.collect_pending_fee_retention! (cyclomatic 17) app/models/refund.rb:219 — Refund.collect_pending_fee_retention! has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · UserComplianceInfo.has_completed_compliance_info? (cyclomatic 17) · ×1
  • UserComplianceInfo.has_completed_compliance_info? (cyclomatic 17) app/models/user_compliance_info.rb:102 — UserComplianceInfo.has_completed_compliance_info? has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · StripePaymentPresenter.fallback_reason_for (cyclomatic 17) · ×1
  • StripePaymentPresenter.fallback_reason_for (cyclomatic 17) app/presenters/checkout/stripe_payment_presenter.rb:350 — StripePaymentPresenter.fallback_reason_for has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StripePaymentPresenter.recurring_upi_registration_shape? (cyclomatic 17) · ×1
  • StripePaymentPresenter.recurring_upi_registration_shape? (cyclomatic 17) app/presenters/checkout/stripe_payment_presenter.rb:494 — StripePaymentPresenter.recurring_upi_registration_shape? has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · UrlRedirectPresenter.map_file (cyclomatic 17) · ×1
  • UrlRedirectPresenter.map_file (cyclomatic 17) app/presenters/url_redirect_presenter.rb:263 — UrlRedirectPresenter.map_file has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PageSanitizer.scrub_node (cyclomatic 17) · ×1
  • PageSanitizer.scrub_node (cyclomatic 17) app/services/ai/page_sanitizer.rb:78 — PageSanitizer.scrub_node has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CreatePublicMediaService.process (cyclomatic 17) · ×1
  • CreatePublicMediaService.process (cyclomatic 17) app/services/create_public_media_service.rb:68 — CreatePublicMediaService.process has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ReconcileNonUsRefundFees.process (cyclomatic 17) · ×1
  • ReconcileNonUsRefundFees.process (cyclomatic 17) app/services/onetime/reconcile_non_us_refund_fees.rb:4 — ReconcileNonUsRefundFees.process has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CreateService.handle_existing_subscription (cyclomatic 17) · ×1
  • CreateService.handle_existing_subscription (cyclomatic 17) app/services/purchase/create_service.rb:332 — CreateService.handle_existing_subscription has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LaterChargePresentmentService.perform (cyclomatic 17) · ×1
  • LaterChargePresentmentService.perform (cyclomatic 17) app/services/purchase/later_charge_presentment_service.rb:49 — LaterChargePresentmentService.perform has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AutoTopUpNegativeDestinationBalancesJob.valid_transfer_request? (cyclomatic 17) · ×1
  • AutoTopUpNegativeDestinationBalancesJob.valid_transfer_request? (cyclomatic 17) REDACTED:387 — AutoTopUpNegativeDestinationBalancesJob.valid_transfer_request? has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · FailAbandonedPurchaseWorker.perform (cyclomatic 17) · ×1
  • FailAbandonedPurchaseWorker.perform (cyclomatic 17) app/sidekiq/fail_abandoned_purchase_worker.rb:9 — FailAbandonedPurchaseWorker.perform has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CustomFields.CustomField (cyclomatic 17) · ×1
  • CustomFields.CustomField (cyclomatic 17) app/javascript/components/Checkout/CustomFields.tsx:15 — CustomFields.CustomField has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 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.
D1 · Cyclomatic Complexity · buyerCurrencyDisplay.getCheckoutListedCurrencyDisplay (cyclomatic 17) · ×1
  • buyerCurrencyDisplay.getCheckoutListedCurrencyDisplay (cyclomatic 17) app/javascript/components/Checkout/buyerCurrencyDisplay.ts:147 — buyerCurrencyDisplay.getCheckoutListedCurrencyDisplay has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · payment.createReducer (cyclomatic 17) · ×1
  • payment.createReducer (cyclomatic 17) app/javascript/components/Checkout/payment.ts:1988 — payment.createReducer has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 2094, 2012, 2115, …). 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.
D1 · Cyclomatic Complexity · DateRangePicker.DateRangePicker (cyclomatic 17) · ×1
  • DateRangePicker.DateRangePicker (cyclomatic 17) app/javascript/components/DateRangePicker.tsx:35 — DateRangePicker.DateRangePicker has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 155, 105, 133, …). 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.
D1 · Cyclomatic Complexity · NestedMenu.MenubarItem (cyclomatic 17) · ×1
  • NestedMenu.MenubarItem (cyclomatic 17) app/javascript/components/NestedMenu.tsx:194 — NestedMenu.MenubarItem 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 4 function items inside it that branch (handleToggleMenu, a function literal at line 214, a function literal at line 259, …). 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.
D1 · Cyclomatic Complexity · NestedMenu.ItemsList (cyclomatic 17) · ×1
  • NestedMenu.ItemsList (cyclomatic 17) app/javascript/components/NestedMenu.tsx:365 — NestedMenu.ItemsList has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 394, a function literal at line 427, a function literal at line 423, …). 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.
D1 · Cyclomatic Complexity · ExportPayoutsPopover.ExportPayoutsPopoverContent (cyclomatic 17) · ×1
  • ExportPayoutsPopover.ExportPayoutsPopoverContent (cyclomatic 17) app/javascript/components/Payouts/ExportPayoutsPopover.tsx:18 — ExportPayoutsPopover.ExportPayoutsPopoverContent has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 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.
D1 · Cyclomatic Complexity · CoverEditor.CoverUploader (cyclomatic 17) · ×1
  • CoverEditor.CoverUploader (cyclomatic 17) app/javascript/components/ProductEdit/ProductTab/CoverEditor.tsx:154 — CoverEditor.CoverUploader has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 199, saveCover, a function literal at line 238, …). 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.
D1 · Cyclomatic Complexity · TiersEditor.TierEditor (cyclomatic 17) · ×1
  • TiersEditor.TierEditor (cyclomatic 17) app/javascript/components/ProductEdit/ProductTab/TiersEditor.tsx:164 — TiersEditor.TierEditor has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 5 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.
D1 · Cyclomatic Complexity · FollowForm.FollowForm (cyclomatic 17) · ×1
  • FollowForm.FollowForm (cyclomatic 17) app/javascript/components/Profile/FollowForm.tsx:22 — FollowForm.FollowForm has cyclomatic complexity 17 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Layout.Layout (cyclomatic 17) · ×1
  • Layout.Layout (cyclomatic 17) app/javascript/components/Profile/Layout.tsx:28 — Layout.Layout has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Link.LinkDialog (cyclomatic 17) · ×1
  • Link.LinkDialog (cyclomatic 17) app/javascript/components/TiptapExtensions/Link.tsx:29 — Link.LinkDialog has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (onAddLink, a function literal at line 46, a function literal at line 38, …). 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.
D1 · Cyclomatic Complexity · product_edit.scalarSettingsForSave (cyclomatic 17) · ×1
  • product_edit.scalarSettingsForSave (cyclomatic 17) app/javascript/data/product_edit.ts:532 — product_edit.scalarSettingsForSave has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · price.parseLocaleAwareCurrencyString (cyclomatic 17) · ×1
  • price.parseLocaleAwareCurrencyString (cyclomatic 17) app/javascript/utils/price.ts:32 — price.parseLocaleAwareCurrencyString has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PaypalChargeProcessor.refund_purchase (cyclomatic 16) · ×1
  • PaypalChargeProcessor.refund_purchase (cyclomatic 16) app/business/payments/charging/implementations/paypal/paypal_charge_processor.rb:252 — PaypalChargeProcessor.refund_purchase has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StripePayoutProcessor.destination_balance_drift_error (cyclomatic 16) · ×1
  • StripePayoutProcessor.destination_balance_drift_error (cyclomatic 16) app/business/payments/payouts/processor/stripe/stripe_payout_processor.rb:546 — StripePayoutProcessor.destination_balance_drift_error has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgentConversationPersistence.action_payload_values_match? (cyclomatic 16) · ×1
  • AgentConversationPersistence.action_payload_values_match? (cyclomatic 16) app/controllers/concerns/agent_conversation_persistence.rb:594 — AgentConversationPersistence.action_payload_values_match? 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.
D1 · Cyclomatic Complexity · RecordMediaLocation.record_media_location (cyclomatic 16) · ×1
  • RecordMediaLocation.record_media_location (cyclomatic 16) REDACTED:5 — RecordMediaLocation.record_media_location has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProductEligibilityController.development_product (cyclomatic 16) · ×1
  • ProductEligibilityController.development_product (cyclomatic 16) app/controllers/global_affiliates/product_eligibility_controller.rb:60 — ProductEligibilityController.development_product 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.
D1 · Cyclomatic Complexity · LinksController.increment_views (cyclomatic 16) · ×1
  • LinksController.increment_views (cyclomatic 16) REDACTED:379 — LinksController.increment_views has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PurchasesController.unsubscribe (cyclomatic 16) · ×1
  • PurchasesController.unsubscribe (cyclomatic 16) REDACTED:61 — PurchasesController.unsubscribe has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PurchasesController.update (cyclomatic 16) · ×1
  • PurchasesController.update (cyclomatic 16) REDACTED:235 — PurchasesController.update has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PaymentsController.newly_submitted_details_discarded_by_country_change? (cyclomatic 16) · ×1
  • PaymentsController.newly_submitted_details_discarded_by_country_change? (cyclomatic 16) REDACTED:411 — PaymentsController.newly_submitted_details_discarded_by_country_change? has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · InvitationsController.accept (cyclomatic 16) · ×1
  • InvitationsController.accept (cyclomatic 16) app/controllers/settings/team/invitations_controller.rb:71 — InvitationsController.accept has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PayoutsHelper.current_payout_period_data (cyclomatic 16) · ×1
  • PayoutsHelper.current_payout_period_data (cyclomatic 16) app/helpers/payouts_helper.rb:58 — PayoutsHelper.current_payout_period_data has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Blockable.processor_rule_refusal (cyclomatic 16) · ×1
  • Blockable.processor_rule_refusal (cyclomatic 16) app/models/concerns/purchase/blockable.rb:310 — Blockable.processor_rule_refusal has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FeatureAnnouncementDelivery.ineligibility_reason (cyclomatic 16) · ×1
  • FeatureAnnouncementDelivery.ineligibility_reason (cyclomatic 16) app/models/feature_announcement_delivery.rb:112 — FeatureAnnouncementDelivery.ineligibility_reason has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Preorder.charge! (cyclomatic 16) · ×1
  • Preorder.charge! (cyclomatic 16) app/models/preorder.rb:110 — Preorder.charge! has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Purchase.free_trial_purchase_set_correctly (cyclomatic 16) · ×1
  • Purchase.free_trial_purchase_set_correctly (cyclomatic 16) app/models/purchase.rb:6226 — Purchase.free_trial_purchase_set_correctly has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Purchase.tax_location_valid? (cyclomatic 16) · ×1
  • Purchase.tax_location_valid? (cyclomatic 16) app/models/purchase.rb:6323 — Purchase.tax_location_valid? has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Subscription.indian_card_mandate_for (cyclomatic 16) · ×1
  • Subscription.indian_card_mandate_for (cyclomatic 16) REDACTED:1033 — Subscription.indian_card_mandate_for has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FormInfo.data (cyclomatic 16) · ×1
  • FormInfo.data (cyclomatic 16) app/presenters/invoice_presenter/form_info.rb:43 — FormInfo.data has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateService.with_charge_processor_error_handler (cyclomatic 16) · ×1
  • CreateService.with_charge_processor_error_handler (cyclomatic 16) app/services/charge/create_service.rb:85 — CreateService.with_charge_processor_error_handler 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.
D1 · Cyclomatic Complexity · ApplySourcelessCapitalDeductions.verify_stripe_source_is_absent! (cyclomatic 16) · ×1
  • ApplySourcelessCapitalDeductions.verify_stripe_source_is_absent! (cyclomatic 16) app/services/onetime/apply_sourceless_capital_deductions.rb:140 — ApplySourcelessCapitalDeductions.verify_stripe_source_is_absent! 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.
D1 · Cyclomatic Complexity · BackfillMembershipAdvanceRenewalReminders.process (cyclomatic 16) · ×1
  • BackfillMembershipAdvanceRenewalReminders.process (cyclomatic 16) app/services/onetime/backfill_membership_advance_renewal_reminders.rb:64 — BackfillMembershipAdvanceRenewalReminders.process has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConfirmService.charge_seller_groups_awaiting_setup_confirmation! (cyclomatic 16) · ×1
  • ConfirmService.charge_seller_groups_awaiting_setup_confirmation! (cyclomatic 16) app/services/order/confirm_service.rb:83 — ConfirmService.charge_seller_groups_awaiting_setup_confirmation! has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PreparePaymentIntentService.perform (cyclomatic 16) · ×1
  • PreparePaymentIntentService.perform (cyclomatic 16) app/services/order/prepare_payment_intent_service.rb:43 — PreparePaymentIntentService.perform has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LaterChargePresentmentService.refix_required_currency_presentment (cyclomatic 16) · ×1
  • LaterChargePresentmentService.refix_required_currency_presentment (cyclomatic 16) app/services/purchase/later_charge_presentment_service.rb:142 — LaterChargePresentmentService.refix_required_currency_presentment has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RestoreBankPayoutRail.process (cyclomatic 16) · ×1
  • RestoreBankPayoutRail.process (cyclomatic 16) app/services/restore_bank_payout_rail.rb:12 — RestoreBankPayoutRail.process has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AlertOnStalledPostEmailBlastsJob.resolve_action (cyclomatic 16) · ×1
  • AlertOnStalledPostEmailBlastsJob.resolve_action (cyclomatic 16) app/sidekiq/alert_on_stalled_post_email_blasts_job.rb:182 — AlertOnStalledPostEmailBlastsJob.resolve_action has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ScheduleWorkflowInstallmentJob.reschedule_pending_resubscribed_memberships (cyclomatic 16) · ×1
  • ScheduleWorkflowInstallmentJob.reschedule_pending_resubscribed_memberships (cyclomatic 16) app/sidekiq/schedule_workflow_installment_job.rb:118 — ScheduleWorkflowInstallmentJob.reschedule_pending_resubscribed_memberships has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DateInput.DateInput (cyclomatic 16) · ×1
  • DateInput.DateInput (cyclomatic 16) app/javascript/components/DateInput.tsx:18 — DateInput.DateInput has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (formatDate, a function literal at line 60, a function literal at line 47). 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.
D1 · Cyclomatic Complexity · shared.ResendToNonOpenersButton (cyclomatic 16) · ×1
  • shared.ResendToNonOpenersButton (cyclomatic 16) app/javascript/components/EmailsPage/shared.tsx:112 — shared.ResendToNonOpenersButton has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 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.
D1 · Cyclomatic Complexity · ConfigurationSelector.OptionRadioButton (cyclomatic 16) · ×1
  • ConfigurationSelector.OptionRadioButton (cyclomatic 16) app/javascript/components/Product/ConfigurationSelector.tsx:316 — ConfigurationSelector.OptionRadioButton has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FollowUserForm.FollowUserForm (cyclomatic 16) · ×1
  • FollowUserForm.FollowUserForm (cyclomatic 16) app/javascript/components/Profile/FollowUserForm.tsx:22 — FollowUserForm.FollowUserForm has cyclomatic complexity 16 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useReviewVideoUploader.useReviewVideoUploader (cyclomatic 16) · ×1
  • useReviewVideoUploader.useReviewVideoUploader (cyclomatic 16) app/javascript/components/ReviewForm/useReviewVideoUploader.ts:12 — useReviewVideoUploader.useReviewVideoUploader has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 4 function literals 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.
D1 · Cyclomatic Complexity · ProductEditPage.ProductEditPage (cyclomatic 16) · ×1
  • ProductEditPage.ProductEditPage (cyclomatic 16) app/javascript/components/server-components/ProductEditPage.tsx:525 — ProductEditPage.ProductEditPage 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 (ProductEditPage.ProductEditPage::performSave) 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.
D1 · Cyclomatic Complexity · New.AffiliatesNew · ×1
  • New.AffiliatesNew::handleSubmit (cyclomatic 16) app/javascript/pages/Affiliates/New.tsx:71 — New.AffiliatesNew::handleSubmit 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.
D1 · Cyclomatic Complexity · Index.PeriodBankAccount (cyclomatic 16) · ×1
  • Index.PeriodBankAccount (cyclomatic 16) app/javascript/pages/Payouts/Index.tsx:375 — Index.PeriodBankAccount 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.
D17 · Explicit Debt · XxxComment · ×1
  • XxxComment app/models/jordan_bank_account.rb:6 — # Stripe's JO directory resolves the 8-character BIC or its XXX-padded form, not a branch-number suffix. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D2 · Cognitive Complexity · BankAccountSection.BankAccountSection (cognitive 4622) · ×1
  • BankAccountSection.BankAccountSection (cognitive 4622) app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx:773 — BankAccountSection.BankAccountSection has cognitive complexity 4622 (threshold 15). Drivers by points: ternaries 175 (4594 pts), boolean chains 21, if/else 6, match/switch 1 (nesting depth added 4419). Of this number, 4613 points are the body's own statements and 9 belong to 3 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.
D2 · Cognitive Complexity · AccountDetailsSection.AccountDetailsSection (cognitive 277) · ×1
  • AccountDetailsSection.AccountDetailsSection (cognitive 277) app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:50 — AccountDetailsSection.AccountDetailsSection has cognitive complexity 277 (threshold 15). Drivers by points: ternaries 93 (202 pts), boolean chains 64, if/else 7 (8 pts), match/switch 2, loops 1 (nesting depth added 110). Of this number, 249 points are the body's own statements and 28 belong to 13 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.
D2 · Cognitive Complexity · EmailForm.EmailForm (cognitive 255) · ×1
  • EmailForm.EmailForm (cognitive 255) app/javascript/components/EmailsPage/EmailForm.tsx:221 — EmailForm.EmailForm has cognitive complexity 255 (threshold 15). Drivers by points: ternaries 67 (120 pts), if/else 47 (83 pts), boolean chains 50, error handling 2 (nesting depth added 89). Of this number, 116 points are the body's own statements and 139 belong to 24 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.
D2 · Cognitive Complexity · index.Product (cognitive 225) · ×1
  • index.Product (cognitive 225) REDACTED:297 — index.Product has cognitive complexity 225 (threshold 15). Drivers by points: ternaries 75 (158 pts), boolean chains 56, if/else 11 (nesting depth added 83). Of this number, 189 points are the body's own statements and 36 belong to 13 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.
D2 · Cognitive Complexity · payment.applyCheckoutAction (cognitive 203) · ×1
  • payment.applyCheckoutAction (cognitive 203) app/javascript/components/Checkout/payment.ts:1492 — payment.applyCheckoutAction has cognitive complexity 203 (threshold 15). Drivers by points: if/else 63 (146 pts), boolean chains 35, loops 4 (12 pts), ternaries 4 (9 pts), match/switch 1 (nesting depth added 96). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.ContentTabContent (cognitive 191) · ×1
  • index.ContentTabContent (cognitive 191) app/javascript/components/ProductEdit/ContentTab/index.tsx:207 — index.ContentTabContent has cognitive complexity 191 (threshold 15). Drivers by points: ternaries 47 (95 pts), if/else 56 (65 pts), boolean chains 25, error handling 3 (4 pts), loops 2 (nesting depth added 58). Of this number, 57 points are the body's own statements and 134 belong to 56 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.
D2 · Cognitive Complexity · FileEmbed.FileEmbedNodeView (cognitive 185) · ×1
  • FileEmbed.FileEmbedNodeView (cognitive 185) app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:84 — FileEmbed.FileEmbedNodeView has cognitive complexity 185 (threshold 15). Drivers by points: ternaries 60 (105 pts), boolean chains 43, if/else 31 (36 pts), loops 1 (nesting depth added 50). Of this number, 131 points are the body's own statements and 54 belong to 33 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.
D2 · Cognitive Complexity · index.Checkout (cognitive 176) · ×1
  • index.Checkout (cognitive 176) app/javascript/components/Checkout/index.tsx:258 — index.Checkout has cognitive complexity 176 (threshold 15). Drivers by points: ternaries 47 (133 pts), boolean chains 33, if/else 7 (10 pts) (nesting depth added 89). Of this number, 146 points are the body's own statements and 30 belong to 16 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.
D2 · Cognitive Complexity · DiscountsPage.DiscountsPage (cognitive 172) · ×1
  • DiscountsPage.DiscountsPage (cognitive 172) app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:227 — DiscountsPage.DiscountsPage has cognitive complexity 172 (threshold 15). Drivers by points: ternaries 43 (123 pts), boolean chains 20, if/else 8 (15 pts), error handling 5 (13 pts), loops 1 (nesting depth added 95). Of this number, 72 points are the body's own statements and 100 belong to 14 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.
D2 · Cognitive Complexity · order.startOrderCreation (cognitive 168) · ×1
  • order.startOrderCreation (cognitive 168) app/javascript/data/order.ts:159 — order.startOrderCreation has cognitive complexity 168 (threshold 15). Drivers by points: if/else 39 (107 pts), loops 9 (21 pts), ternaries 6 (19 pts), boolean chains 17, error handling 2 (4 pts) (nesting depth added 95). Of this number, 147 points are the body's own statements and 21 belong to 4 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.
D2 · Cognitive Complexity · LinksController.update (cognitive 164) · ×1
  • LinksController.update (cognitive 164) app/controllers/api/v2/links_controller.rb:303 — LinksController.update has cognitive complexity 164 (threshold 15). Drivers by points: if/else 83 (121 pts), boolean chains 27, error handling 4 (10 pts), ternaries 3 (6 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomerDetailPage.CustomerDetailPage (cognitive 120) · ×1
  • CustomerDetailPage.CustomerDetailPage (cognitive 120) app/javascript/components/Audience/CustomerDetailPage.tsx:135 — CustomerDetailPage.CustomerDetailPage has cognitive complexity 120 (threshold 15). Drivers by points: ternaries 68 (95 pts), boolean chains 17, if/else 5 (7 pts), error handling 1 (nesting depth added 29). Of this number, 77 points are the body's own statements and 43 belong to 11 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.
D2 · Cognitive Complexity · UpdaterService.perform (cognitive 119) · ×1
  • UpdaterService.perform (cognitive 119) app/services/subscription/updater_service.rb:45 — UpdaterService.perform has cognitive complexity 119 (threshold 15). Drivers by points: if/else 49 (70 pts), boolean chains 48, error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AudienceMember.filter (cognitive 117) · ×1
  • AudienceMember.filter (cognitive 117) REDACTED:52 — AudienceMember.filter has cognitive complexity 117 (threshold 15). Drivers by points: if/else 54 (95 pts), boolean chains 17, match/switch 2 (5 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.
D2 · Cognitive Complexity · ChargeService.create_charge_for_seller_purchases (cognitive 116) · ×1
  • ChargeService.create_charge_for_seller_purchases (cognitive 116) app/services/order/charge_service.rb:534 — ChargeService.create_charge_for_seller_purchases has cognitive complexity 116 (threshold 15). Drivers by points: if/else 31 (88 pts), boolean chains 26, ternaries 1 (2 pts) (nesting depth added 58). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · StripeMerchantAccountManager.update_bank_account (cognitive 109) · ×1
  • StripeMerchantAccountManager.update_bank_account (cognitive 109) REDACTED:1534 — StripeMerchantAccountManager.update_bank_account has cognitive complexity 109 (threshold 15). Drivers by points: if/else 32 (80 pts), boolean chains 18, error handling 5 (11 pts) (nesting depth added 54). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · WorkflowForm.WorkflowForm (cognitive 109) · ×1
  • WorkflowForm.WorkflowForm (cognitive 109) app/javascript/components/WorkflowsPage/WorkflowForm.tsx:97 — WorkflowForm.WorkflowForm has cognitive complexity 109 (threshold 15). Drivers by points: ternaries 51 (80 pts), boolean chains 15, if/else 13 (14 pts) (nesting depth added 30). Of this number, 64 points are the body's own statements and 45 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.
D2 · Cognitive Complexity · LinksController.update (cognitive 105) · ×1
  • LinksController.update (cognitive 105) REDACTED:442 — LinksController.update has cognitive complexity 105 (threshold 15). Drivers by points: error handling 9 (38 pts), if/else 28 (36 pts), boolean chains 26, ternaries 2 (5 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Layout.Layout (cognitive 104) · ×1
  • Layout.Layout (cognitive 104) app/javascript/components/DownloadPage/Layout.tsx:79 — Layout.Layout has cognitive complexity 104 (threshold 15). Drivers by points: ternaries 28 (97 pts), boolean chains 6, error handling 1 (nesting depth added 69). Of this number, 103 points are the body's own statements and 1 belongs to one function literal 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.
D2 · Cognitive Complexity · PaymentsController.update (cognitive 102) · ×1
  • PaymentsController.update (cognitive 102) REDACTED:27 — PaymentsController.update has cognitive complexity 102 (threshold 15). Drivers by points: if/else 39 (60 pts), boolean chains 27, error handling 4 (10 pts), ternaries 2 (5 pts) (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.
D2 · Cognitive Complexity · Index.CommunitiesIndex (cognitive 98) · ×1
  • Index.CommunitiesIndex (cognitive 98) app/javascript/pages/Communities/Index.tsx:87 — Index.CommunitiesIndex has cognitive complexity 98 (threshold 15). Drivers by points: if/else 45 (54 pts), ternaries 12 (29 pts), boolean chains 15 (nesting depth added 26). Of this number, 20 points are the body's own statements and 78 belong to 26 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.
D2 · Cognitive Complexity · Index.PayoutsIndex (cognitive 98) · ×1
  • Index.PayoutsIndex (cognitive 98) app/javascript/pages/Payouts/Index.tsx:470 — Index.PayoutsIndex has cognitive complexity 98 (threshold 15). Drivers by points: ternaries 36 (90 pts), boolean chains 6, if/else 2 (nesting depth added 54). Of this number, 97 points are the body's own statements and 1 belongs to 2 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.
D2 · Cognitive Complexity · CreateService.with_charge_processor_error_handler (cognitive 97) · ×1
  • CreateService.with_charge_processor_error_handler (cognitive 97) app/services/charge/create_service.rb:85 — CreateService.with_charge_processor_error_handler has cognitive complexity 97 (threshold 15). Drivers by points: error handling 12 (78 pts), if/else 3 (19 pts) (nesting depth added 82). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Layout.Layout (cognitive 96) · ×1
  • Layout.Layout (cognitive 96) app/javascript/components/ProductEdit/Layout.tsx:121 — Layout.Layout has cognitive complexity 96 (threshold 15). Drivers by points: ternaries 28 (52 pts), if/else 15 (27 pts), boolean chains 16, error handling 1 (nesting depth added 36). Of this number, 62 points are the body's own statements and 34 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.
D2 · Cognitive Complexity · CreateService.perform (cognitive 95) · ×1
  • CreateService.perform (cognitive 95) app/services/purchase/create_service.rb:30 — CreateService.perform has cognitive complexity 95 (threshold 15). Drivers by points: if/else 42 (68 pts), boolean chains 16, ternaries 3 (8 pts), error handling 2 (3 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Show.SettingsPage (cognitive 89) · ×1
  • Show.SettingsPage (cognitive 89) app/javascript/pages/Settings/Profile/Show.tsx:102 — Show.SettingsPage has cognitive complexity 89 (threshold 15). Drivers by points: ternaries 25 (47 pts), boolean chains 22, if/else 15 (19 pts), error handling 1 (nesting depth added 26). Of this number, 35 points are the body's own statements and 54 belong to 16 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.
D2 · Cognitive Complexity · PaymentForm.CreditCardContent (cognitive 88) · ×1
  • PaymentForm.CreditCardContent (cognitive 88) app/javascript/components/Checkout/PaymentForm.tsx:694 — PaymentForm.CreditCardContent has cognitive complexity 88 (threshold 15). Drivers by points: if/else 29 (43 pts), boolean chains 26, ternaries 14 (19 pts) (nesting depth added 19). Of this number, 18 points are the body's own statements and 70 belong to 10 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.
D2 · Cognitive Complexity · StripeMerchantAccountManager.handle_stripe_info_requirements (cognitive 86) · ×1
  • StripeMerchantAccountManager.handle_stripe_info_requirements (cognitive 86) REDACTED:3245 — StripeMerchantAccountManager.handle_stripe_info_requirements has cognitive complexity 86 (threshold 15). Drivers by points: if/else 50 (61 pts), boolean chains 22, ternaries 1 (2 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CustomersPage.CustomersPage (cognitive 83) · ×1
  • CustomersPage.CustomersPage (cognitive 83) app/javascript/components/Audience/CustomersPage.tsx:66 — CustomersPage.CustomersPage has cognitive complexity 83 (threshold 15). Drivers by points: ternaries 36 (60 pts), boolean chains 12, if/else 7 (10 pts), error handling 1 (nesting depth added 27). Of this number, 20 points are the body's own statements and 63 belong to 10 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.
D2 · Cognitive Complexity · Manage.SubscriptionsManage (cognitive 83) · ×1
  • Manage.SubscriptionsManage (cognitive 83) app/javascript/pages/Subscriptions/Manage.tsx:117 — Manage.SubscriptionsManage has cognitive complexity 83 (threshold 15). Drivers by points: ternaries 31 (38 pts), boolean chains 26, if/else 16 (19 pts) (nesting depth added 10). Of this number, 63 points are the body's own statements and 20 belong to 4 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.
D2 · Cognitive Complexity · Published.EmailsPublished (cognitive 82) · ×1
  • Published.EmailsPublished (cognitive 82) app/javascript/pages/Emails/Published.tsx:40 — Published.EmailsPublished has cognitive complexity 82 (threshold 15). Drivers by points: ternaries 29 (72 pts), boolean chains 4, if/else 4, match/switch 2 (nesting depth added 43). Of this number, 36 points are the body's own statements and 46 belong to 8 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.
D2 · Cognitive Complexity · StripeChargeProcessor.handle_stripe_charge_event (cognitive 81) · ×1
  • StripeChargeProcessor.handle_stripe_charge_event (cognitive 81) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:1375 — StripeChargeProcessor.handle_stripe_charge_event has cognitive complexity 81 (threshold 15). Drivers by points: if/else 34 (54 pts), match/switch 3 (10 pts), boolean chains 9, ternaries 3 (8 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Edit.PagesEdit (cognitive 80) · ×1
  • Edit.PagesEdit (cognitive 80) app/javascript/pages/Pages/Edit.tsx:70 — Edit.PagesEdit has cognitive complexity 80 (threshold 15). Drivers by points: ternaries 33 (55 pts), boolean chains 15, if/else 10 (nesting depth added 22). Of this number, 64 points are the body's own statements and 16 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.
D2 · Cognitive Complexity · Index.LibraryPage (cognitive 77) · ×1
  • Index.LibraryPage (cognitive 77) app/javascript/pages/Library/Index.tsx:228 — Index.LibraryPage has cognitive complexity 77 (threshold 15). Drivers by points: ternaries 23 (46 pts), if/else 16 (18 pts), boolean chains 11, error handling 1, loops 1 (nesting depth added 25). Of this number, 40 points are the body's own statements and 37 belong to 11 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.
D2 · Cognitive Complexity · LinksController.create (cognitive 76) · ×1
  • LinksController.create (cognitive 76) app/controllers/api/v2/links_controller.rb:81 — LinksController.create has cognitive complexity 76 (threshold 15). Drivers by points: if/else 39 (56 pts), boolean chains 11, error handling 3 (6 pts), ternaries 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Show.PiracyReportsShow (cognitive 72) · ×1
  • Show.PiracyReportsShow (cognitive 72) app/javascript/pages/PiracyReports/Show.tsx:92 — Show.PiracyReportsShow has cognitive complexity 72 (threshold 15). Drivers by points: ternaries 20 (66 pts), boolean chains 6 (nesting depth added 46). Of this number, 71 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.
D2 · Cognitive Complexity · Payouts.is_user_payable (cognitive 71) · ×1
  • Payouts.is_user_payable (cognitive 71) app/business/payments/payouts/payouts.rb:37 — Payouts.is_user_payable has cognitive complexity 71 (threshold 15). Drivers by points: if/else 22 (46 pts), boolean chains 17, ternaries 3 (8 pts) (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · purchase.createPurchasesRequestData (cognitive 71) · ×1
  • purchase.createPurchasesRequestData (cognitive 71) app/javascript/data/purchase.ts:269 — purchase.createPurchasesRequestData has cognitive complexity 71 (threshold 15). Drivers by points: if/else 24 (46 pts), boolean chains 25 (nesting depth added 22). Of this number, 65 points are the body's own statements and 6 belong to one function literal 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.
D2 · Cognitive Complexity · AccountStatusSection.AccountStatusSection (cognitive 70) · ×1
  • AccountStatusSection.AccountStatusSection (cognitive 70) app/javascript/components/Settings/PaymentsPage/AccountStatusSection.tsx:43 — AccountStatusSection.AccountStatusSection has cognitive complexity 70 (threshold 15). Drivers by points: ternaries 22 (60 pts), boolean chains 9, if/else 1 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Refundable.refund_and_save! (cognitive 69) · ×1
  • Refundable.refund_and_save! (cognitive 69) app/modules/purchase/refundable.rb:49 — Refundable.refund_and_save! has cognitive complexity 69 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 24, error handling 5 (15 pts), ternaries 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SyncStatusWithChargeProcessorService.perform (cognitive 69) · ×1
  • SyncStatusWithChargeProcessorService.perform (cognitive 69) app/services/purchase/sync_status_with_charge_processor_service.rb:22 — SyncStatusWithChargeProcessorService.perform has cognitive complexity 69 (threshold 15). Drivers by points: if/else 26 (41 pts), boolean chains 22, error handling 3 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StripeMerchantAccountManager.update_account (cognitive 68) · ×1
  • StripeMerchantAccountManager.update_account (cognitive 68) REDACTED:456 — StripeMerchantAccountManager.update_account has cognitive complexity 68 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 30, ternaries 4, error handling 3 (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.
D2 · Cognitive Complexity · StripePayoutProcessor.prepare_payment_and_set_amount (cognitive 68) · ×1
  • StripePayoutProcessor.prepare_payment_and_set_amount (cognitive 68) app/business/payments/payouts/processor/stripe/stripe_payout_processor.rb:346 — StripePayoutProcessor.prepare_payment_and_set_amount has cognitive complexity 68 (threshold 15). Drivers by points: if/else 20 (31 pts), error handling 6 (21 pts), boolean chains 15, ternaries 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.
D2 · Cognitive Complexity · FileList.FileRow (cognitive 68) · ×1
  • FileList.FileRow (cognitive 68) app/javascript/components/Download/FileList.tsx:169 — FileList.FileRow has cognitive complexity 68 (threshold 15). Drivers by points: ternaries 34 (42 pts), boolean chains 14, if/else 8 (9 pts), error handling 1 (3 pts) (nesting depth added 11). Of this number, 55 points are the body's own statements and 13 belong to 4 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.
D2 · Cognitive Complexity · Refundable.handle_event_refund_updated! (cognitive 66) · ×1
  • Refundable.handle_event_refund_updated! (cognitive 66) app/models/concerns/charge/refundable.rb:42 — Refundable.handle_event_refund_updated! has cognitive complexity 66 (threshold 15). Drivers by points: if/else 24 (44 pts), boolean chains 12, error handling 3 (5 pts), ternaries 2 (5 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.
D2 · Cognitive Complexity · Purchase.with_charge_processor_error_handler (cognitive 66) · ×1
  • Purchase.with_charge_processor_error_handler (cognitive 66) app/models/purchase.rb:5267 — Purchase.with_charge_processor_error_handler has cognitive complexity 66 (threshold 15). Drivers by points: error handling 10 (55 pts), if/else 2 (11 pts) (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WithFiltering.seller_post_passes_filters (cognitive 65) · ×1
  • WithFiltering.seller_post_passes_filters (cognitive 65) app/models/concerns/with_filtering.rb:150 — WithFiltering.seller_post_passes_filters has cognitive complexity 65 (threshold 15). Drivers by points: if/else 25 (38 pts), boolean chains 27 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BeneficialOwnersSection.BeneficialOwnersSection (cognitive 65) · ×1
  • BeneficialOwnersSection.BeneficialOwnersSection (cognitive 65) app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:423 — BeneficialOwnersSection.BeneficialOwnersSection has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 59 (164 pts), if/else 29 (36 pts), boolean chains 32, error handling 3 (nesting depth added 112). 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. This shape REPEATS in the file: one other method here (BeneficialOwnersSection.BeneficialOwnersSection::validateJpKanaFields) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Read.EpubReader (cognitive 64) · ×1
  • Read.EpubReader (cognitive 64) app/javascript/pages/UrlRedirects/Read.tsx:523 — Read.EpubReader has cognitive complexity 64 (threshold 15). Drivers by points: if/else 32 (35 pts), boolean chains 12, ternaries 11 (12 pts), loops 3, error handling 2 (nesting depth added 4). Most of this is not in the body itself: 4 of the 64 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 639, a function literal at line 716, a function literal at line 809, …). 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.
D2 · Cognitive Complexity · Show.PaymentsPage (cognitive 63) · ×1
  • Show.PaymentsPage (cognitive 63) app/javascript/pages/Settings/Payments/Show.tsx:259 — Show.PaymentsPage has cognitive complexity 63 (threshold 15). Drivers by points: if/else 182 (232 pts), boolean chains 149, ternaries 38 (61 pts), error handling 1 (3 pts), match/switch 1 (nesting depth added 75). 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. This shape REPEATS in the file: 2 other methods here (Show.PaymentsPage::validateBankAccountFields, Show.PaymentsPage::validateComplianceInfoFields) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · StripeMerchantAccountManager.create_account (cognitive 62) · ×1
  • StripeMerchantAccountManager.create_account (cognitive 62) REDACTED:214 — StripeMerchantAccountManager.create_account has cognitive complexity 62 (threshold 15). Drivers by points: if/else 26 (37 pts), boolean chains 15, ternaries 2 (7 pts), error handling 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WithContent.WithContent (cognitive 62) · ×1
  • WithContent.WithContent (cognitive 62) app/javascript/components/DownloadPage/WithContent.tsx:109 — WithContent.WithContent has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 20 (28 pts), if/else 13 (17 pts), boolean chains 16, loops 1 (nesting depth added 12). Of this number, 37 points are the body's own statements and 25 belong to 10 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.
D2 · Cognitive Complexity · UtmLinkForm.UtmLinkForm (cognitive 62) · ×1
  • UtmLinkForm.UtmLinkForm (cognitive 62) app/javascript/components/UtmLinks/UtmLinkForm.tsx:94 — UtmLinkForm.UtmLinkForm has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 28 (30 pts), if/else 17 (19 pts), boolean chains 13 (nesting depth added 4). Of this number, 31 points are the body's own statements and 31 belong to 9 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.
D2 · Cognitive Complexity · ProductEditPage.applyCanonicalIds (cognitive 62) · ×1
  • ProductEditPage.applyCanonicalIds (cognitive 62) app/javascript/components/server-components/ProductEditPage.tsx:293 — ProductEditPage.applyCanonicalIds has cognitive complexity 62 (threshold 15). Drivers by points: if/else 18 (32 pts), loops 12 (13 pts), ternaries 4 (9 pts), boolean chains 8 (nesting depth added 20). Of this number, 59 points are the body's own statements and 3 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.
D2 · Cognitive Complexity · Payouts.create_payments (cognitive 60) · ×1
  • Payouts.create_payments (cognitive 60) app/business/payments/payouts/payouts.rb:450 — Payouts.create_payments has cognitive complexity 60 (threshold 15). Drivers by points: if/else 27 (37 pts), boolean chains 11, error handling 3 (8 pts), ternaries 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReviewForm.ReviewForm (cognitive 60) · ×1
  • ReviewForm.ReviewForm (cognitive 60) app/javascript/components/ReviewForm.tsx:119 — ReviewForm.ReviewForm has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 19 (23 pts), boolean chains 18, if/else 14 (15 pts), error handling 2 (3 pts), match/switch 1 (nesting depth added 6). Of this number, 32 points are the body's own statements and 28 belong to 12 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.
D2 · Cognitive Complexity · Show.CheckoutIndexPage · ×1
  • Show.CheckoutIndexPage::pay (cognitive 60) app/javascript/pages/Checkout/Show.tsx:540 — Show.CheckoutIndexPage::pay has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (27 pts), ternaries 9 (17 pts), boolean chains 12, loops 2 (3 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. This shape REPEATS in the file: one other method here (Show.CheckoutIndexPage) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · SettingsPresenter.account_status_details (cognitive 59) · ×1
  • SettingsPresenter.account_status_details (cognitive 59) REDACTED:448 — SettingsPresenter.account_status_details has cognitive complexity 59 (threshold 15). Drivers by points: if/else 28 (40 pts), boolean chains 19 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateService.perform (cognitive 59) · ×1
  • CreateService.perform (cognitive 59) app/services/order/create_service.rb:33 — CreateService.perform has cognitive complexity 59 (threshold 15). Drivers by points: if/else 29 (46 pts), boolean chains 12, ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutoTopUpNegativeDestinationBalancesJob.topup (cognitive 59) · ×1
  • AutoTopUpNegativeDestinationBalancesJob.topup (cognitive 59) REDACTED:97 — AutoTopUpNegativeDestinationBalancesJob.topup has cognitive complexity 59 (threshold 15). Drivers by points: if/else 31 (45 pts), error handling 4 (7 pts), boolean chains 4, ternaries 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · New.PurchaseNewInvoicePage (cognitive 59) · ×1
  • New.PurchaseNewInvoicePage (cognitive 59) app/javascript/pages/Purchases/Invoices/New.tsx:59 — New.PurchaseNewInvoicePage has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 30 (34 pts), boolean chains 13, if/else 9 (12 pts) (nesting depth added 7). Of this number, 40 points are the body's own statements and 19 belong to 9 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.
D2 · Cognitive Complexity · ConfigurationSelector.ConfigurationSelector (cognitive 58) · ×1
  • ConfigurationSelector.ConfigurationSelector (cognitive 58) app/javascript/components/Product/ConfigurationSelector.tsx:749 — ConfigurationSelector.ConfigurationSelector has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 22 (30 pts), boolean chains 19, if/else 7 (9 pts) (nesting depth added 10). Of this number, 34 points are the body's own statements and 24 belong to 13 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.
D2 · Cognitive Complexity · index.CartItemComponent (cognitive 57) · ×1
  • index.CartItemComponent (cognitive 57) app/javascript/components/Checkout/index.tsx:1043 — index.CartItemComponent has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 24 (41 pts), boolean chains 14, if/else 2 (nesting depth added 17). Of this number, 43 points are the body's own statements and 14 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.
D2 · Cognitive Complexity · index.ProductTab (cognitive 57) · ×1
  • index.ProductTab (cognitive 57) app/javascript/components/ProductEdit/ProductTab/index.tsx:53 — index.ProductTab has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 24 (53 pts), boolean chains 3, if/else 1 (nesting depth added 29). Of this number, 54 points are the body's own statements and 3 belong to 2 function literals 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.
D2 · Cognitive Complexity · SendWorkflowInstallmentWorker.perform (cognitive 55) · ×1
  • SendWorkflowInstallmentWorker.perform (cognitive 55) app/sidekiq/send_workflow_installment_worker.rb:11 — SendWorkflowInstallmentWorker.perform has cognitive complexity 55 (threshold 15). Drivers by points: if/else 24 (32 pts), boolean chains 22, 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.
D2 · Cognitive Complexity · UpsellsPage.Form (cognitive 55) · ×1
  • UpsellsPage.Form (cognitive 55) app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:523 — UpsellsPage.Form has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 39 (66 pts), if/else 12 (20 pts), boolean chains 16 (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. This shape REPEATS in the file: one other method here (UpsellsPage.Form::handleSubmit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ApplicationForm.ApplicationForm (cognitive 55) · ×1
  • ApplicationForm.ApplicationForm (cognitive 55) app/javascript/components/Settings/AdvancedPage/ApplicationForm.tsx:32 — ApplicationForm.ApplicationForm has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 16 (28 pts), if/else 13 (17 pts), boolean chains 7, error handling 1 (3 pts) (nesting depth added 18). Of this number, 22 points are the body's own statements and 33 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.
D2 · Cognitive Complexity · Index.DiscoverIndex (cognitive 55) · ×1
  • Index.DiscoverIndex (cognitive 55) app/javascript/pages/Discover/Index.tsx:244 — Index.DiscoverIndex has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 21 (29 pts), boolean chains 13, if/else 9 (11 pts), error handling 1, loops 1 (nesting depth added 10). Of this number, 33 points are the body's own statements and 22 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.
D2 · Cognitive Complexity · UpdateUserComplianceInfo.process_locked (cognitive 53) · ×1
  • UpdateUserComplianceInfo.process_locked (cognitive 53) app/services/update_user_compliance_info.rb:104 — UpdateUserComplianceInfo.process_locked has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (47 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscountsPage.Form (cognitive 53) · ×1
  • DiscountsPage.Form (cognitive 53) app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:894 — DiscountsPage.Form has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 60 (66 pts), boolean chains 38, if/else 23 (33 pts), loops 1 (nesting depth added 16). 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. This shape REPEATS in the file: one other method here (DiscountsPage.Form::handleSubmit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · CircleIntegrationEditor.CircleIntegrationEditor (cognitive 52) · ×1
  • CircleIntegrationEditor.CircleIntegrationEditor (cognitive 52) app/javascript/components/ProductEdit/ProductTab/CircleIntegrationEditor.tsx:29 — CircleIntegrationEditor.CircleIntegrationEditor has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 14 (39 pts), if/else 6, boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 26). Of this number, 40 points are the body's own statements and 12 belong to 6 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.
D2 · Cognitive Complexity · Index.Period (cognitive 52) · ×1
  • Index.Period (cognitive 52) app/javascript/pages/Payouts/Index.tsx:48 — Index.Period has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 26 (40 pts), boolean chains 6, if/else 2 (3 pts), match/switch 2, error handling 1 (nesting depth added 15). Of this number, 43 points are the body's own statements and 9 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.
D2 · Cognitive Complexity · StripeChargeProcessor.create_payment_intent_or_charge! (cognitive 50) · ×1
  • StripeChargeProcessor.create_payment_intent_or_charge! (cognitive 50) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:396 — StripeChargeProcessor.create_payment_intent_or_charge! has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (30 pts), boolean chains 15, ternaries 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Layout.BundleEditLayout (cognitive 50) · ×1
  • Layout.BundleEditLayout (cognitive 50) app/javascript/components/BundleEdit/Layout.tsx:57 — Layout.BundleEditLayout has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 21 (43 pts), boolean chains 5, if/else 2 (nesting depth added 22). Of this number, 44 points are the body's own statements and 6 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.
D2 · Cognitive Complexity · PaymentForm.useStripePaymentRequest (cognitive 50) · ×1
  • PaymentForm.useStripePaymentRequest (cognitive 50) app/javascript/components/Checkout/PaymentForm.tsx:1561 — PaymentForm.useStripePaymentRequest has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 14, ternaries 9 (13 pts) (nesting depth added 7). Most of this is not in the body itself: 4 of the 50 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 1635, a function literal at line 1681, a function literal at line 1699, …). 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.
D2 · Cognitive Complexity · PasskeysSection.PasskeysSection (cognitive 50) · ×1
  • PasskeysSection.PasskeysSection (cognitive 50) app/javascript/components/Settings/PasswordPage/PasskeysSection.tsx:27 — PasskeysSection.PasskeysSection has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 14 (27 pts), if/else 8 (14 pts), boolean chains 6, error handling 3 (nesting depth added 19). Most of this is not in the body itself: 10 of the 50 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 38, 52, 82, …). 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.
D2 · Cognitive Complexity · Workflow.schedule_installment (cognitive 49) · ×1
  • Workflow.schedule_installment (cognitive 49) app/models/workflow.rb:118 — Workflow.schedule_installment has cognitive complexity 49 (threshold 15). Drivers by points: if/else 19 (30 pts), boolean chains 12, ternaries 3 (7 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CardGrid.CardGrid (cognitive 49) · ×1
  • CardGrid.CardGrid (cognitive 49) app/javascript/components/Product/CardGrid.tsx:216 — CardGrid.CardGrid has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 12 (26 pts), if/else 11 (12 pts), boolean chains 10, loops 1 (nesting depth added 15). Of this number, 33 points are the body's own statements and 16 belong to 5 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.
D2 · Cognitive Complexity · index.ContentTab (cognitive 49) · ×1
  • index.ContentTab (cognitive 49) app/javascript/components/ProductEdit/ContentTab/index.tsx:1449 — index.ContentTab has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 12 (19 pts), if/else 9 (15 pts), boolean chains 11, loops 2 (4 pts) (nesting depth added 15). Most of this is not in the body itself: 6 of the 49 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 1580, a function literal at line 1464, setHasSameRichContent, …). 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.
D2 · Cognitive Complexity · CoverEditor.CoverUploader (cognitive 49) · ×1
  • CoverEditor.CoverUploader (cognitive 49) app/javascript/components/ProductEdit/ProductTab/CoverEditor.tsx:154 — CoverEditor.CoverUploader has cognitive complexity 49 (threshold 15). Drivers by points: if/else 7 (24 pts), ternaries 5 (12 pts), error handling 2 (6 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 32). Most of this is not in the body itself: 10 of the 49 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 199, a function literal at line 238, saveCover, …). 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.
D2 · Cognitive Complexity · ScheduledPayout.execute! (cognitive 48) · ×1
  • ScheduledPayout.execute! (cognitive 48) app/models/scheduled_payout.rb:34 — ScheduledPayout.execute! has cognitive complexity 48 (threshold 15). Drivers by points: if/else 24 (38 pts), boolean chains 6, error handling 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StoreAgentService.respond_streaming (cognitive 48) · ×1
  • StoreAgentService.respond_streaming (cognitive 48) app/services/ai/store_agent_service.rb:859 — StoreAgentService.respond_streaming has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (37 pts), ternaries 2 (5 pts), error handling 1 (2 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RecurringChargeWorker.perform (cognitive 48) · ×1
  • RecurringChargeWorker.perform (cognitive 48) app/sidekiq/recurring_charge_worker.rb:7 — RecurringChargeWorker.perform has cognitive complexity 48 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 11, error handling 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.
D2 · Cognitive Complexity · New.NewProductPage (cognitive 48) · ×1
  • New.NewProductPage (cognitive 48) app/javascript/pages/Products/New.tsx:113 — New.NewProductPage has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 14 (17 pts), if/else 13 (16 pts), boolean chains 13, error handling 2 (nesting depth added 6). Of this number, 22 points are the body's own statements and 26 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, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Purchase.purchase_info (cognitive 47) · ×1
  • Purchase.purchase_info (cognitive 47) app/models/purchase.rb:1444 — Purchase.purchase_info has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (22 pts), ternaries 9 (16 pts), boolean chains 9 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChargeService.ensure_all_purchases_processed (cognitive 47) · ×1
  • ChargeService.ensure_all_purchases_processed (cognitive 47) app/services/order/charge_service.rb:704 — ChargeService.ensure_all_purchases_processed has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 18 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscountsPage.Form · ×1
  • DiscountsPage.Form::handleSubmit (cognitive 47) app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:1089 — DiscountsPage.Form::handleSubmit has cognitive complexity 47 (threshold 15). Drivers by points: boolean chains 18, if/else 9 (16 pts), ternaries 13 (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. This shape REPEATS in the file: one other method here (DiscountsPage.Form) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · StripeBeneficialOwnersManager.build_person_params (cognitive 46) · ×1
  • StripeBeneficialOwnersManager.build_person_params (cognitive 46) app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb:333 — StripeBeneficialOwnersManager.build_person_params has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (36 pts), boolean chains 10 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StripePayoutProcessor.perform_payment (cognitive 45) · ×1
  • StripePayoutProcessor.perform_payment (cognitive 45) app/business/payments/payouts/processor/stripe/stripe_payout_processor.rb:720 — StripePayoutProcessor.perform_payment has cognitive complexity 45 (threshold 15). Drivers by points: if/else 23 (30 pts), error handling 4 (10 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.Analytics (cognitive 45) · ×1
  • index.Analytics (cognitive 45) app/javascript/components/Analytics/index.tsx:154 — index.Analytics has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (23 pts), ternaries 9 (15 pts), boolean chains 6, error handling 1 (nesting depth added 11). Most of this is not in the body itself: 10 of the 45 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 262, 224, 363, …). 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.
D2 · Cognitive Complexity · ShareYourLaunchCard.ChannelComposer (cognitive 45) · ×1
  • ShareYourLaunchCard.ChannelComposer (cognitive 45) app/javascript/components/ProductEdit/ShareTab/ShareYourLaunchCard.tsx:233 — ShareYourLaunchCard.ChannelComposer has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 17 (33 pts), boolean chains 8, if/else 2 (3 pts), error handling 1 (nesting depth added 17). Of this number, 40 points are the body's own statements and 5 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.
D2 · Cognitive Complexity · EditPage.EditProfile (cognitive 45) · ×1
  • EditPage.EditProfile (cognitive 45) app/javascript/components/Profile/EditPage.tsx:114 — EditPage.EditProfile has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 16 (28 pts), if/else 7 (12 pts), boolean chains 3, error handling 1, match/switch 1 (nesting depth added 17). Of this number, 18 points are the body's own statements and 27 belong to 11 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.
D2 · Cognitive Complexity · AgentStreamsController.create (cognitive 44) · ×1
  • AgentStreamsController.create (cognitive 44) app/controllers/api/mobile/agent_streams_controller.rb:45 — AgentStreamsController.create has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (22 pts), error handling 7 (12 pts), boolean chains 5, ternaries 3 (4 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Purchase.as_json (cognitive 44) · ×1
  • Purchase.as_json (cognitive 44) app/models/purchase.rb:1014 — Purchase.as_json has cognitive complexity 44 (threshold 15). Drivers by points: if/else 25 (27 pts), ternaries 10 (11 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, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Posts.visible_posts_for (cognitive 44) · ×1
  • Posts.visible_posts_for (cognitive 44) app/modules/user/posts.rb:4 — Posts.visible_posts_for has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (34 pts), ternaries 4 (9 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.
D2 · Cognitive Complexity · AdminSearchService.search_purchases (cognitive 44) · ×1
  • AdminSearchService.search_purchases (cognitive 44) app/services/admin_search_service.rb:9 — AdminSearchService.search_purchases has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (39 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpsellsPage.UpsellsPage (cognitive 44) · ×1
  • UpsellsPage.UpsellsPage (cognitive 44) app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:107 — UpsellsPage.UpsellsPage has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 10 (24 pts), if/else 8 (11 pts), error handling 5, boolean chains 3, loops 1 (nesting depth added 17). Of this number, 17 points are the body's own statements and 27 belong to 8 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.
D2 · Cognitive Complexity · LegalGuardianSection.LegalGuardianSection (cognitive 43) · ×1
  • LegalGuardianSection.LegalGuardianSection (cognitive 43) app/javascript/components/Settings/PaymentsPage/LegalGuardianSection.tsx:88 — LegalGuardianSection.LegalGuardianSection has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18, ternaries 14 (17 pts), boolean chains 7, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 13 of the 43 points are its own statements and the rest belongs to 4 function items inside it that branch (missingRequiredField, handleSubmit, handleKeyDown, …). 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.
D2 · Cognitive Complexity · AgentMessageStreamsController.create (cognitive 42) · ×1
  • AgentMessageStreamsController.create (cognitive 42) app/controllers/api/internal/agent_message_streams_controller.rb:49 — AgentMessageStreamsController.create has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (22 pts), error handling 7 (12 pts), boolean chains 4, ternaries 2 (3 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfirmService.charge_setup_confirmed_purchases_locked! (cognitive 42) · ×1
  • ConfirmService.charge_setup_confirmed_purchases_locked! (cognitive 42) app/services/order/confirm_service.rb:238 — ConfirmService.charge_setup_confirmed_purchases_locked! has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (28 pts), ternaries 4 (8 pts), boolean chains 4, error handling 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdateUserComplianceInfo.assign_compliance_params (cognitive 42) · ×1
  • UpdateUserComplianceInfo.assign_compliance_params (cognitive 42) app/services/update_user_compliance_info.rb:201 — UpdateUserComplianceInfo.assign_compliance_params has cognitive complexity 42 (threshold 15). Drivers by points: if/else 40, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SendWorkflowPostEmailsJob.perform (cognitive 42) · ×1
  • SendWorkflowPostEmailsJob.perform (cognitive 42) app/sidekiq/send_workflow_post_emails_job.rb:17 — SendWorkflowPostEmailsJob.perform has cognitive complexity 42 (threshold 15). Drivers by points: if/else 26 (30 pts), boolean chains 10, match/switch 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Index.AffiliatesIndex (cognitive 41) · ×1
  • Index.AffiliatesIndex (cognitive 41) app/javascript/pages/Affiliates/Index.tsx:214 — Index.AffiliatesIndex has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 10 (21 pts), if/else 9 (10 pts), boolean chains 9, loops 1 (nesting depth added 12). Most of this is not in the body itself: 15 of the 41 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 386, onSetSort, a function literal at line 307, …). 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.
D2 · Cognitive Complexity · Edit.BundlesContentEdit (cognitive 41) · ×1
  • Edit.BundlesContentEdit (cognitive 41) app/javascript/pages/Bundles/Content/Edit.tsx:51 — Edit.BundlesContentEdit has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 12, ternaries 6 (10 pts) (nesting depth added 8). Most of this is not in the body itself: 15 of the 41 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 77, a function literal at line 100, loadMore, …). 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.
D2 · Cognitive Complexity · StripeChargeProcessor.debit_stripe_account_for_refund_fee (cognitive 40) · ×1
  • StripeChargeProcessor.debit_stripe_account_for_refund_fee (cognitive 40) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:822 — StripeChargeProcessor.debit_stripe_account_for_refund_fee has cognitive complexity 40 (threshold 15). Drivers by points: if/else 24 (34 pts), boolean chains 3, error handling 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.
D2 · Cognitive Complexity · PaypalMerchantAccountManager.update_merchant_account (cognitive 40) · ×1
  • PaypalMerchantAccountManager.update_merchant_account (cognitive 40) app/business/payments/merchant_registration/implementations/paypal/paypal_merchant_account_manager.rb:43 — PaypalMerchantAccountManager.update_merchant_account has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 9 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuyerCurrencyQuote.canonical_components_hint (cognitive 40) · ×1
  • BuyerCurrencyQuote.canonical_components_hint (cognitive 40) app/services/checkout/buyer_currency_quote.rb:366 — BuyerCurrencyQuote.canonical_components_hint has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 8, ternaries 3 (7 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.
D2 · Cognitive Complexity · SendWorkflowInstallmentWorker.recipient_matches_current_audience? (cognitive 40) · ×1
  • SendWorkflowInstallmentWorker.recipient_matches_current_audience? (cognitive 40) app/sidekiq/send_workflow_installment_worker.rb:208 — SendWorkflowInstallmentWorker.recipient_matches_current_audience? has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (31 pts), boolean chains 9 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProductEditPage.ProductEditPage · ×1
  • ProductEditPage.ProductEditPage::performSave (cognitive 40) app/javascript/components/server-components/ProductEditPage.tsx:617 — ProductEditPage.ProductEditPage::performSave has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (28 pts), ternaries 4 (8 pts), boolean chains 2, error handling 1, 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. This shape REPEATS in the file: one other method here (ProductEditPage.ProductEditPage) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · UrlRedirectsController.check_permissions (cognitive 39) · ×1
  • UrlRedirectsController.check_permissions (cognitive 39) REDACTED:537 — UrlRedirectsController.check_permissions has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 20, if/else 15 (19 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.
D2 · Cognitive Complexity · Purchase.refund_purchase! (cognitive 39) · ×1
  • Purchase.refund_purchase! (cognitive 39) app/modules/purchase/refundable.rb:288 — Purchase.refund_purchase! has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 16 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BuyerCurrencyEligibility.decision (cognitive 39) · ×1
  • BuyerCurrencyEligibility.decision (cognitive 39) app/services/checkout/buyer_currency_eligibility.rb:399 — BuyerCurrencyEligibility.decision has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 19 (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.
D2 · Cognitive Complexity · SaveInstallmentsService.process (cognitive 39) · ×1
  • SaveInstallmentsService.process (cognitive 39) app/services/workflow/save_installments_service.rb:19 — SaveInstallmentsService.process has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 18, if/else 17 (18 pts), error handling 2 (3 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.
D2 · Cognitive Complexity · Purchase.process_without_charging! (cognitive 38) · ×1
  • Purchase.process_without_charging! (cognitive 38) app/models/purchase.rb:4730 — Purchase.process_without_charging! has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WithProductFiles.save_files! (cognitive 38) · ×1
  • WithProductFiles.save_files! (cognitive 38) app/modules/with_product_files.rb:50 — WithProductFiles.save_files! has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 13, error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CustomerPresenter.customer (cognitive 38) · ×1
  • CustomerPresenter.customer (cognitive 38) app/presenters/customer_presenter.rb:26 — CustomerPresenter.customer has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 19 (27 pts), boolean chains 9, if/else 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentChat.ProposedActionCard (cognitive 38) · ×1
  • AgentChat.ProposedActionCard (cognitive 38) app/javascript/components/Agent/AgentChat.tsx:335 — AgentChat.ProposedActionCard has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 13 (31 pts), boolean chains 6, if/else 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FileEmbedGroup.FileEmbedGroupNodeView (cognitive 38) · ×1
  • FileEmbedGroup.FileEmbedGroupNodeView (cognitive 38) app/javascript/components/ProductEdit/ContentTab/FileEmbedGroup.tsx:60 — FileEmbedGroup.FileEmbedGroupNodeView has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 11 (21 pts), if/else 7 (10 pts), boolean chains 5, error handling 2 (nesting depth added 13). Of this number, 24 points are the body's own statements and 14 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.
D2 · Cognitive Complexity · StripeBeneficialOwnersManager.validate_required_fields! (cognitive 37) · ×1
  • StripeBeneficialOwnersManager.validate_required_fields! (cognitive 37) app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb:121 — StripeBeneficialOwnersManager.validate_required_fields! has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 11, ternaries 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.
D2 · Cognitive Complexity · ConfirmService.perform (cognitive 37) · ×1
  • ConfirmService.perform (cognitive 37) app/services/purchase/confirm_service.rb:13 — ConfirmService.perform has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 12 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaymentForm.PaymentMethodsSection (cognitive 37) · ×1
  • PaymentForm.PaymentMethodsSection (cognitive 37) app/javascript/components/Checkout/PaymentForm.tsx:1849 — PaymentForm.PaymentMethodsSection has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 14 (24 pts), boolean chains 11, if/else 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FormPage.FormPage (cognitive 37) · ×1
  • FormPage.FormPage (cognitive 37) app/javascript/components/CheckoutDashboard/FormPage.tsx:77 — FormPage.FormPage has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 11 (17 pts), if/else 11 (13 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 9). Most of this is not in the body itself: 5 of the 37 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 124, a function literal at line 143, a function literal at line 223, …). 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.
D2 · Cognitive Complexity · ChatMessageList.ChatMessageList (cognitive 37) · ×1
  • ChatMessageList.ChatMessageList (cognitive 37) app/javascript/components/Communities/ChatMessageList.tsx:19 — ChatMessageList.ChatMessageList has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 7, ternaries 4 (6 pts), loops 1 (nesting depth added 9). Most of this is not in the body itself: 6 of the 37 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 47, 104, 87, …). 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.
D2 · Cognitive Complexity · CartRecoveryCard.CartRecoveryCard (cognitive 37) · ×1
  • CartRecoveryCard.CartRecoveryCard (cognitive 37) app/javascript/components/ProductEdit/ShareTab/CartRecoveryCard.tsx:43 — CartRecoveryCard.CartRecoveryCard has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 11 (27 pts), boolean chains 5, error handling 2 (3 pts), if/else 2 (nesting depth added 17). Of this number, 29 points are the body's own statements and 8 belong to 4 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.
D2 · Cognitive Complexity · AgentCustomHtmlPreviewsController.resulting_custom_html (cognitive 36) · ×1
  • AgentCustomHtmlPreviewsController.resulting_custom_html (cognitive 36) app/controllers/api/internal/agent_custom_html_previews_controller.rb:170 — AgentCustomHtmlPreviewsController.resulting_custom_html has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 3, ternaries 1 (3 pts), match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LinksController.show (cognitive 36) · ×1
  • LinksController.show (cognitive 36) REDACTED:148 — LinksController.show has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 13, 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.
D2 · Cognitive Complexity · InvoicesController.create (cognitive 36) · ×1
  • InvoicesController.create (cognitive 36) app/controllers/purchases/invoices_controller.rb:19 — InvoicesController.create has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 13, 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.
D2 · Cognitive Complexity · ProfileController.update (cognitive 36) · ×1
  • ProfileController.update (cognitive 36) app/controllers/settings/profile_controller.rb:18 — ProfileController.update has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (23 pts), error handling 4 (8 pts), boolean chains 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Compliance.country_supports_iban? (cognitive 36) · ×1
  • Compliance.country_supports_iban? (cognitive 36) app/modules/user/compliance.rb:229 — Compliance.country_supports_iban? has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 36. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · CtaButton.CtaButton (cognitive 36) · ×1
  • CtaButton.CtaButton (cognitive 36) app/javascript/components/Product/CtaButton.tsx:105 — CtaButton.CtaButton has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 10, ternaries 8 (10 pts), loops 1 (nesting depth added 4). Of this number, 34 points are the body's own statements and 2 belong to one function literal 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.
D2 · Cognitive Complexity · SectionsForm.ProfileSectionsForm (cognitive 36) · ×1
  • SectionsForm.ProfileSectionsForm (cognitive 36) app/javascript/components/Profile/SectionsForm.tsx:683 — SectionsForm.ProfileSectionsForm has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16, ternaries 11 (12 pts), boolean chains 7, match/switch 1 (nesting depth added 1). Most of this is not in the body itself: 7 of the 36 points are its own statements and the rest belongs to 18 function items inside it that branch (removePage, duplicateSection, togglePage, …). 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.
D2 · Cognitive Complexity · Index.UtmLinksIndex (cognitive 36) · ×1
  • Index.UtmLinksIndex (cognitive 36) app/javascript/pages/UtmLinks/Index.tsx:82 — Index.UtmLinksIndex has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 11 (27 pts), boolean chains 5, if/else 4 (nesting depth added 16). Of this number, 21 points are the body's own statements and 15 belong to 6 function literals 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.
D2 · Cognitive Complexity · ChargeService.setup_for_future_charges_without_charging (cognitive 35) · ×1
  • ChargeService.setup_for_future_charges_without_charging (cognitive 35) app/services/order/charge_service.rb:199 — ChargeService.setup_for_future_charges_without_charging has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 7, error handling 1 (4 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PreparePaymentIntentService.create_unconfirmed_intent (cognitive 35) · ×1
  • PreparePaymentIntentService.create_unconfirmed_intent (cognitive 35) app/services/order/prepare_payment_intent_service.rb:924 — PreparePaymentIntentService.create_unconfirmed_intent has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (28 pts), boolean chains 4, error handling 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.
D2 · Cognitive Complexity · CreateService.build_purchase (cognitive 35) · ×1
  • CreateService.build_purchase (cognitive 35) app/services/purchase/create_service.rb:555 — CreateService.build_purchase has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 18, if/else 14 (16 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.
D2 · Cognitive Complexity · LinksController.search (cognitive 34) · ×1
  • LinksController.search (cognitive 34) REDACTED:278 — LinksController.search has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 7, ternaries 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.
D2 · Cognitive Complexity · UrlRedirectsController.send_to_kindle (cognitive 34) · ×1
  • UrlRedirectsController.send_to_kindle (cognitive 34) REDACTED:330 — UrlRedirectsController.send_to_kindle has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 18, if/else 13 (15 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.
D2 · Cognitive Complexity · Subscription.indian_card_mandate_terms (cognitive 34) · ×1
  • Subscription.indian_card_mandate_terms (cognitive 34) REDACTED:733 — Subscription.indian_card_mandate_terms has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 7 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChargeService.perform (cognitive 34) · ×1
  • ChargeService.perform (cognitive 34) app/services/order/charge_service.rb:16 — ChargeService.perform has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 20, if/else 9 (11 pts), error handling 2 (3 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.
D2 · Cognitive Complexity · payment.loadSurcharges (cognitive 34) · ×1
  • payment.loadSurcharges (cognitive 34) app/javascript/components/Checkout/payment.ts:1237 — payment.loadSurcharges has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 22 (26 pts), boolean chains 8 (nesting depth added 4). Of this number, 20 points are the body's own statements and 14 belong to 2 function literals 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.
D2 · Cognitive Complexity · DashboardPage.DashboardPage (cognitive 34) · ×1
  • DashboardPage.DashboardPage (cognitive 34) app/javascript/components/DashboardPage.tsx:310 — DashboardPage.DashboardPage has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 14 (25 pts), boolean chains 9 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Posts.PostsNodeView (cognitive 34) · ×1
  • Posts.PostsNodeView (cognitive 34) app/javascript/components/TiptapExtensions/Posts.tsx:48 — Posts.PostsNodeView has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 13 (25 pts), boolean chains 6, if/else 3 (nesting depth added 12). Of this number, 20 points are the body's own statements and 14 belong to 3 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.
D2 · Cognitive Complexity · WorkflowEmails.WorkflowEmails (cognitive 34) · ×1
  • WorkflowEmails.WorkflowEmails (cognitive 34) app/javascript/components/WorkflowsPage/WorkflowEmails.tsx:102 — WorkflowEmails.WorkflowEmails has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 15 (20 pts), boolean chains 10, if/else 4 (nesting depth added 5). Most of this is not in the body itself: 13 of the 34 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 153, updateEmail, a function literal at line 309, …). 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.
D2 · Cognitive Complexity · StripeMerchantAccountManager.update_person (cognitive 33) · ×1
  • StripeMerchantAccountManager.update_person (cognitive 33) REDACTED:1065 — StripeMerchantAccountManager.update_person has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 7, error handling 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.
D2 · Cognitive Complexity · PurchaseExportService.purchase_data (cognitive 33) · ×1
  • PurchaseExportService.purchase_data (cognitive 33) app/services/exports/purchase_export_service.rb:151 — PurchaseExportService.purchase_data has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 18, if/else 10, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · New.LoginPage (cognitive 33) · ×1
  • New.LoginPage (cognitive 33) app/javascript/pages/Logins/New.tsx:46 — New.LoginPage has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 7 (11 pts), boolean chains 7, error handling 1 (nesting depth added 9). Most of this is not in the body itself: 9 of the 33 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 81, 148, 152). 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.
D2 · Cognitive Complexity · StripeChargeProcessor.debit_stripe_account_for_australia_backtaxes (cognitive 32) · ×1
  • StripeChargeProcessor.debit_stripe_account_for_australia_backtaxes (cognitive 32) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:1046 — StripeChargeProcessor.debit_stripe_account_for_australia_backtaxes has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (27 pts), error handling 1 (2 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Link.description_scrubber (cognitive 32) · ×1
  • Link.description_scrubber (cognitive 32) app/models/link.rb:2227 — Link.description_scrubber has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 5, error handling 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Purchase.minimum_paid_price_cents (cognitive 32) · ×1
  • Purchase.minimum_paid_price_cents (cognitive 32) app/models/purchase.rb:1939 — Purchase.minimum_paid_price_cents has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (24 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.
D2 · Cognitive Complexity · Subscription.process_purchase! (cognitive 32) · ×1
  • Subscription.process_purchase! (cognitive 32) REDACTED:362 — Subscription.process_purchase! has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 6, ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Subscription.resume_held_indian_card_mandate! (cognitive 32) · ×1
  • Subscription.resume_held_indian_card_mandate! (cognitive 32) REDACTED:603 — Subscription.resume_held_indian_card_mandate! has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · Subscription.unsubscribe_and_fail! (cognitive 32) · ×1
  • Subscription.unsubscribe_and_fail! (cognitive 32) REDACTED:1120 — Subscription.unsubscribe_and_fail! has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VariantCategoryUpdaterService.perform (cognitive 32) · ×1
  • VariantCategoryUpdaterService.perform (cognitive 32) app/services/product/variant_category_updater_service.rb:174 — VariantCategoryUpdaterService.perform has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 3 (7 pts), ternaries 2 (6 pts), boolean chains 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProductController.update (cognitive 31) · ×1
  • ProductController.update (cognitive 31) REDACTED:12 — ProductController.update has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 7, ternaries 1 (3 pts), error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · WithFiltering.add_and_validate_filters (cognitive 31) · ×1
  • WithFiltering.add_and_validate_filters (cognitive 31) app/models/concerns/with_filtering.rb:58 — WithFiltering.add_and_validate_filters has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 9, 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.
D2 · Cognitive Complexity · AnthropicClient.stream_messages (cognitive 31) · ×1
  • AnthropicClient.stream_messages (cognitive 31) app/services/ai/anthropic_client.rb:213 — AnthropicClient.stream_messages has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 4 (6 pts), boolean chains 4, match/switch 2 (3 pts), ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuyerCurrencyQuote.charge_quote_for (cognitive 31) · ×1
  • BuyerCurrencyQuote.charge_quote_for (cognitive 31) app/services/checkout/buyer_currency_quote.rb:683 — BuyerCurrencyQuote.charge_quote_for has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25 (26 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · UpdateProductFilesArchiveWorker.build_archive (cognitive 31) · ×1
  • UpdateProductFilesArchiveWorker.build_archive (cognitive 31) app/sidekiq/update_product_files_archive_worker.rb:99 — UpdateProductFilesArchiveWorker.build_archive has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 5, error handling 3 (4 pts), ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigurationSelector.CallDateAndTimeSelector (cognitive 31) · ×1
  • ConfigurationSelector.CallDateAndTimeSelector (cognitive 31) app/javascript/components/Product/ConfigurationSelector.tsx:436 — ConfigurationSelector.CallDateAndTimeSelector has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 9 (11 pts), boolean chains 5, loops 2 (nesting depth added 5). Most of this is not in the body itself: 12 of the 31 points are its own statements and the rest belongs to 8 function items inside it that branch (getAvailableStartTimesByDate, a function literal at line 456, a function literal at line 505, …). 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.
D2 · Cognitive Complexity · Show.Show (cognitive 31) · ×1
  • Show.Show (cognitive 31) app/javascript/pages/Purchases/DisputeEvidence/Show.tsx:106 — Show.Show has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 25 (37 pts), if/else 8 (9 pts), boolean chains 8, error handling 1 (2 pts), 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. This shape REPEATS in the file: one other method here (Show.Show::handleFileUpload) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Read.PdfReader (cognitive 31) · ×1
  • Read.PdfReader (cognitive 31) app/javascript/pages/UrlRedirects/Read.tsx:200 — Read.PdfReader has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15, ternaries 8 (12 pts), boolean chains 4 (nesting depth added 4). Most of this is not in the body itself: 6 of the 31 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 273, a function literal at line 218, a function literal at line 292, …). 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.
D2 · Cognitive Complexity · PurchasesController.refund (cognitive 30) · ×1
  • PurchasesController.refund (cognitive 30) app/controllers/api/internal/admin/purchases_controller.rb:151 — PurchasesController.refund has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 7, error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OrderInfo.purchase_sales_tax_info_business_vat_id_label (cognitive 30) · ×1
  • OrderInfo.purchase_sales_tax_info_business_vat_id_label (cognitive 30) app/presenters/invoice_presenter/order_info.rb:163 — OrderInfo.purchase_sales_tax_info_business_vat_id_label has cognitive complexity 30 (threshold 15). Drivers by points: if/else 24, 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.
D2 · Cognitive Complexity · StoreAgentService.write_fields (cognitive 30) · ×1
  • StoreAgentService.write_fields (cognitive 30) app/services/ai/store_agent_service.rb:1713 — StoreAgentService.write_fields has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 12, 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, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ReassignByEmailService.perform (cognitive 30) · ×1
  • ReassignByEmailService.perform (cognitive 30) app/services/purchase/reassign_by_email_service.rb:20 — ReassignByEmailService.perform has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SalesChart.SalesChart (cognitive 30) · ×1
  • SalesChart.SalesChart (cognitive 30) app/javascript/components/Analytics/SalesChart.tsx:139 — SalesChart.SalesChart has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 13 (18 pts), boolean chains 7, if/else 5 (nesting depth added 5). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 161, 192, 235, …). 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.
D2 · Cognitive Complexity · cartState.getDiscountedPriceForItem (cognitive 30) · ×1
  • cartState.getDiscountedPriceForItem (cognitive 30) app/javascript/components/Checkout/cartState.ts:249 — cartState.getDiscountedPriceForItem has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 6 (13 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.
D2 · Cognitive Complexity · RichTextEditor.useRichTextEditor (cognitive 30) · ×1
  • RichTextEditor.useRichTextEditor (cognitive 30) app/javascript/components/RichTextEditor.tsx:288 — RichTextEditor.useRichTextEditor has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 6, ternaries 5 (6 pts), error handling 1, loops 1 (nesting depth added 2). Most of this is not in the body itself: 11 of the 30 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 361, walk, a function literal at line 449, …). 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.
D2 · Cognitive Complexity · agent.streamAgentMessage (cognitive 30) · ×1
  • agent.streamAgentMessage (cognitive 30) app/javascript/data/agent.ts:333 — agent.streamAgentMessage has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3 (4 pts), error handling 2, ternaries 2, boolean chains 1, match/switch 1 (nesting depth added 9). Of this number, 19 points are the body's own statements and 11 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.
D2 · Cognitive Complexity · Purchase.later_charge_presentment_processor_args (cognitive 29) · ×1
  • Purchase.later_charge_presentment_processor_args (cognitive 29) app/models/purchase.rb:5077 — Purchase.later_charge_presentment_processor_args has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CheckoutPresenter.checkout_product (cognitive 29) · ×1
  • CheckoutPresenter.checkout_product (cognitive 29) app/presenters/checkout_presenter.rb:111 — CheckoutPresenter.checkout_product has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 16, ternaries 7 (8 pts), if/else 4 (5 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.
D2 · Cognitive Complexity · CheckoutPresenter.subscription_manager_props (cognitive 29) · ×1
  • CheckoutPresenter.subscription_manager_props (cognitive 29) app/presenters/checkout_presenter.rb:229 — CheckoutPresenter.subscription_manager_props has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 18, if/else 6, ternaries 4 (5 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.
D2 · Cognitive Complexity · UpsellsPage.UpsellDrawer (cognitive 29) · ×1
  • UpsellsPage.UpsellDrawer (cognitive 29) app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:365 — UpsellsPage.UpsellDrawer has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 14 (25 pts), boolean chains 4 (nesting depth added 11). Of this number, 17 points are the body's own statements and 12 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.
D2 · Cognitive Complexity · DiscordIntegrationEditor.DiscordIntegrationEditor (cognitive 29) · ×1
  • DiscordIntegrationEditor.DiscordIntegrationEditor (cognitive 29) app/javascript/components/ProductEdit/ProductTab/DiscordIntegrationEditor.tsx:23 — DiscordIntegrationEditor.DiscordIntegrationEditor has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 7 (22 pts), if/else 4 (6 pts), loops 1 (nesting depth added 17). Of this number, 22 points are the body's own statements and 7 belong to 3 function literals 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.
D2 · Cognitive Complexity · Index.FollowersPage (cognitive 29) · ×1
  • Index.FollowersPage (cognitive 29) app/javascript/pages/Followers/Index.tsx:41 — Index.FollowersPage has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 11 (23 pts), boolean chains 4, if/else 2 (nesting depth added 12). Of this number, 22 points are the body's own statements and 7 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.
D2 · Cognitive Complexity · StripeChargeProcessor.refund! (cognitive 28) · ×1
  • StripeChargeProcessor.refund! (cognitive 28) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:662 — StripeChargeProcessor.refund! has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (16 pts), error handling 4 (7 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomerSurchargeController.calculate_all (cognitive 28) · ×1
  • CustomerSurchargeController.calculate_all (cognitive 28) app/controllers/customer_surcharge_controller.rb:6 — CustomerSurchargeController.calculate_all has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 10, ternaries 9, if/else 8, 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.
D2 · Cognitive Complexity · LinksController.sanitized_price_check_overrides (cognitive 28) · ×1
  • LinksController.sanitized_price_check_overrides (cognitive 28) REDACTED:931 — LinksController.sanitized_price_check_overrides 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.
D2 · Cognitive Complexity · Installment.download_url (cognitive 28) · ×1
  • Installment.download_url (cognitive 28) app/models/installment.rb:614 — Installment.download_url has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 11, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ProfileSectionsPresenter.section_props (cognitive 28) · ×1
  • ProfileSectionsPresenter.section_props (cognitive 28) REDACTED:135 — ProfileSectionsPresenter.section_props has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 2 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PostSendgridApi.build_personalization_for_recipient (cognitive 28) · ×1
  • PostSendgridApi.build_personalization_for_recipient (cognitive 28) app/services/post_sendgrid_api.rb:131 — PostSendgridApi.build_personalization_for_recipient has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PaymentForm.PaymentForm (cognitive 28) · ×1
  • PaymentForm.PaymentForm (cognitive 28) app/javascript/components/Checkout/PaymentForm.tsx:1999 — PaymentForm.PaymentForm has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 6 (9 pts), boolean chains 7 (nesting depth added 6). Most of this is not in the body itself: 10 of the 28 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 2053, 2035, 2065). 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.
D2 · Cognitive Complexity · UpsellsPage.Form · ×1
  • UpsellsPage.Form::handleSubmit (cognitive 28) app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:611 — UpsellsPage.Form::handleSubmit has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 10, ternaries 5 (6 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. This shape REPEATS in the file: one other method here (UpsellsPage.Form) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · WorkflowEmails.EmailRow (cognitive 28) · ×1
  • WorkflowEmails.EmailRow (cognitive 28) app/javascript/components/WorkflowsPage/WorkflowEmails.tsx:402 — WorkflowEmails.EmailRow has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 12 (21 pts), boolean chains 4, if/else 3 (nesting depth added 9). Of this number, 22 points are the body's own statements and 6 belong to 3 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.
D2 · Cognitive Complexity · SalesTaxCalculator.calculate_with_lookup_table (cognitive 27) · ×1
  • SalesTaxCalculator.calculate_with_lookup_table (cognitive 27) app/business/sales_tax/sales_tax_calculator.rb:146 — SalesTaxCalculator.calculate_with_lookup_table has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 3 (8 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Subscription.update_renewal_for_indian_card_mandate! (cognitive 27) · ×1
  • Subscription.update_renewal_for_indian_card_mandate! (cognitive 27) REDACTED:460 — Subscription.update_renewal_for_indian_card_mandate! has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (21 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.
D2 · Cognitive Complexity · PingNotification.payload_for_ping_notification (cognitive 27) · ×1
  • PingNotification.payload_for_ping_notification (cognitive 27) app/modules/purchase/ping_notification.rb:4 — PingNotification.payload_for_ping_notification has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25 (26 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Purchase.refund_gumroad_taxes! (cognitive 27) · ×1
  • Purchase.refund_gumroad_taxes! (cognitive 27) app/modules/purchase/refundable.rb:440 — Purchase.refund_gumroad_taxes! has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 4 (10 pts), boolean chains 3, ternaries 1 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · CreatePublicMediaService.process (cognitive 27) · ×1
  • CreatePublicMediaService.process (cognitive 27) app/services/create_public_media_service.rb:68 — CreatePublicMediaService.process has cognitive complexity 27 (threshold 15). Drivers by points: error handling 6 (16 pts), if/else 6, boolean chains 4, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BackfillLegacyFeatureAnnouncementPreferences.process (cognitive 27) · ×1
  • BackfillLegacyFeatureAnnouncementPreferences.process (cognitive 27) app/services/onetime/backfill_legacy_feature_announcement_preferences.rb:15 — BackfillLegacyFeatureAnnouncementPreferences.process has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 10, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomFields.CustomField (cognitive 27) · ×1
  • CustomFields.CustomField (cognitive 27) app/javascript/components/Checkout/CustomFields.tsx:15 — CustomFields.CustomField has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 13 (26 pts), match/switch 1 (nesting depth added 13). Of this number, 23 points are the body's own statements and 4 belong to 2 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · index.TipSelector (cognitive 27) · ×1
  • index.TipSelector (cognitive 27) app/javascript/components/Checkout/index.tsx:875 — index.TipSelector has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (18 pts), boolean chains 8, if/else 1 (nesting depth added 7). Of this number, 17 points are the body's own statements and 10 belong to 3 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.
D2 · Cognitive Complexity · ProductPreview.ProductPreview (cognitive 27) · ×1
  • ProductPreview.ProductPreview (cognitive 27) app/javascript/components/ProductEdit/ProductPreview.tsx:14 — ProductPreview.ProductPreview has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 18 (22 pts), boolean chains 3, if/else 2 (nesting depth added 4). Of this number, 14 points are the body's own statements and 13 belong to 4 function literals 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.
D2 · Cognitive Complexity · ActionsPopover.ActionsPopover (cognitive 27) · ×1
  • ActionsPopover.ActionsPopover (cognitive 27) app/javascript/components/ProductsPage/ActionsPopover.tsx:15 — ActionsPopover.ActionsPopover has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 14 (19 pts), boolean chains 4, error handling 4 (nesting depth added 5). Of this number, 22 points are the body's own statements and 5 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.
D2 · Cognitive Complexity · Show.CheckoutIndexPage (cognitive 27) · ×1
  • Show.CheckoutIndexPage (cognitive 27) app/javascript/pages/Checkout/Show.tsx:185 — Show.CheckoutIndexPage has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 38 (58 pts), if/else 45 (54 pts), boolean chains 43, loops 5 (7 pts), error handling 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent 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 (Show.CheckoutIndexPage::pay) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Index.PeriodBankAccount (cognitive 27) · ×1
  • Index.PeriodBankAccount (cognitive 27) app/javascript/pages/Payouts/Index.tsx:375 — Index.PeriodBankAccount has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 13 (25 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Show.PasswordPage (cognitive 27) · ×1
  • Show.PasswordPage (cognitive 27) app/javascript/pages/Settings/Password/Show.tsx:31 — Show.PasswordPage has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 6, if/else 6, error handling 2 (nesting depth added 3). Of this number, 17 points are the body's own statements and 10 belong to 4 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.
D2 · Cognitive Complexity · Show.TeamMembersSection (cognitive 27) · ×1
  • Show.TeamMembersSection (cognitive 27) app/javascript/pages/Settings/Team/Show.tsx:205 — Show.TeamMembersSection has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 9 (15 pts), if/else 3 (5 pts), boolean chains 3, error handling 2 (3 pts), match/switch 1 (nesting depth added 9). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 4 function items inside it that branch (handleOptionChange, a function literal at line 306, a function literal at line 278, …). 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.
D2 · Cognitive Complexity · StripeChargeProcessor.get_refund (cognitive 26) · ×1
  • StripeChargeProcessor.get_refund (cognitive 26) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:600 — StripeChargeProcessor.get_refund has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AffiliatesController.process_affiliate_params (cognitive 26) · ×1
  • AffiliatesController.process_affiliate_params (cognitive 26) app/controllers/affiliates_controller.rb:148 — AffiliatesController.process_affiliate_params has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 9, 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.
D2 · Cognitive Complexity · PayoutsHelper.payout_method_details (cognitive 26) · ×1
  • PayoutsHelper.payout_method_details (cognitive 26) app/helpers/payouts_helper.rb:218 — PayoutsHelper.payout_method_details has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 2 (3 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · Purchase.set_price_and_rate (cognitive 26) · ×1
  • Purchase.set_price_and_rate (cognitive 26) app/models/purchase.rb:2555 — Purchase.set_price_and_rate has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 6 (8 pts), boolean chains 7 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Purchase.json_data_for_mobile (cognitive 26) · ×1
  • Purchase.json_data_for_mobile (cognitive 26) app/models/purchase.rb:2968 — Purchase.json_data_for_mobile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Subscription.update_current_plan! (cognitive 26) · ×1
  • Subscription.update_current_plan! (cognitive 26) REDACTED:1241 — Subscription.update_current_plan! has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14, boolean chains 8, 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.
D2 · Cognitive Complexity · ProductPresenter.edit_props (cognitive 26) · ×1
  • ProductPresenter.edit_props (cognitive 26) app/presenters/product_presenter.rb:155 — ProductPresenter.edit_props has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 11, ternaries 8 (9 pts), if/else 5 (6 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.
D2 · Cognitive Complexity · UpdaterService.charge_user! (cognitive 26) · ×1
  • UpdaterService.charge_user! (cognitive 26) app/services/subscription/updater_service.rb:593 — UpdaterService.charge_user! has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, if/else 9 (11 pts), ternaries 1 (2 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.
D2 · Cognitive Complexity · ManageService.process (cognitive 26) · ×1
  • ManageService.process (cognitive 26) app/services/workflow/manage_service.rb:16 — ManageService.process has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, ternaries 2 (4 pts), 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.
D2 · Cognitive Complexity · GenerateSalesReportJob.perform (cognitive 26) · ×1
  • GenerateSalesReportJob.perform (cognitive 26) app/sidekiq/generate_sales_report_job.rb:13 — GenerateSalesReportJob.perform has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, boolean chains 5, ternaries 3 (5 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.
D2 · Cognitive Complexity · ScheduleWorkflowInstallmentJob.perform (cognitive 26) · ×1
  • ScheduleWorkflowInstallmentJob.perform (cognitive 26) app/sidekiq/schedule_workflow_installment_job.rb:32 — ScheduleWorkflowInstallmentJob.perform has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 10, 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.
D2 · Cognitive Complexity · PostCommentsSection.CommentContainer (cognitive 26) · ×1
  • PostCommentsSection.CommentContainer (cognitive 26) REDACTED:203 — PostCommentsSection.CommentContainer has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 12 (17 pts), boolean chains 5, error handling 2, if/else 2 (nesting depth added 5). Of this number, 21 points are the body's own statements and 5 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.
D2 · Cognitive Complexity · TiersEditor.TierEditor (cognitive 26) · ×1
  • TiersEditor.TierEditor (cognitive 26) app/javascript/components/ProductEdit/ProductTab/TiersEditor.tsx:164 — TiersEditor.TierEditor has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 12 (21 pts), if/else 2 (3 pts), boolean chains 2 (nesting depth added 10). Of this number, 14 points are the body's own statements and 12 belong to 5 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.
D2 · Cognitive Complexity · SectionsForm.SectionRow (cognitive 26) · ×1
  • SectionsForm.SectionRow (cognitive 26) app/javascript/components/Profile/SectionsForm.tsx:261 — SectionsForm.SectionRow has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (23 pts), boolean chains 1, error handling 1, if/else 1 (nesting depth added 15). Of this number, 23 points are the body's own statements and 3 belong to 2 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.
D2 · Cognitive Complexity · TestimonialSelectModal.TestimonialSelectModal (cognitive 26) · ×1
  • TestimonialSelectModal.TestimonialSelectModal (cognitive 26) app/javascript/components/TestimonialSelectModal.tsx:15 — TestimonialSelectModal.TestimonialSelectModal has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 9 (10 pts), boolean chains 4, error handling 1 (nesting depth added 7). Of this number, 15 points are the body's own statements and 11 belong to 5 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.
D2 · Cognitive Complexity · Show.MainPage (cognitive 26) · ×1
  • Show.MainPage (cognitive 26) app/javascript/pages/Settings/Main/Show.tsx:85 — Show.MainPage has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 9, if/else 4 (nesting depth added 4). Of this number, 20 points are the body's own statements and 6 belong to 3 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.
D2 · Cognitive Complexity · styles.getAppliedStyles (cognitive 26) · ×1
  • styles.getAppliedStyles (cognitive 26) app/javascript/utils/styles.ts:3 — styles.getAppliedStyles has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 4 (11 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StripePayoutProcessor.handle_stripe_event (cognitive 25) · ×1
  • StripePayoutProcessor.handle_stripe_event (cognitive 25) app/business/payments/payouts/processor/stripe/stripe_payout_processor.rb:993 — StripePayoutProcessor.handle_stripe_event has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (15 pts), match/switch 3 (7 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CheckoutController.update (cognitive 25) · ×1
  • CheckoutController.update (cognitive 25) app/controllers/checkout_controller.rb:28 — CheckoutController.update has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 8, ternaries 3, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Purchase.calculate_taxes (cognitive 25) · ×1
  • Purchase.calculate_taxes (cognitive 25) app/models/purchase.rb:5568 — Purchase.calculate_taxes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 10 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ContentExtractor.self_contained_svg? (cognitive 25) · ×1
  • ContentExtractor.self_contained_svg? (cognitive 25) app/services/content_moderation/content_extractor.rb:268 — ContentExtractor.self_contained_svg? has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassifierStrategy.perform (cognitive 25) · ×1
  • ClassifierStrategy.perform (cognitive 25) app/services/content_moderation/strategies/classifier_strategy.rb:82 — ClassifierStrategy.perform has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 6, error handling 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.
D2 · Cognitive Complexity · index.CurrencyPicker (cognitive 25) · ×1
  • index.CurrencyPicker (cognitive 25) app/javascript/components/Checkout/index.tsx:139 — index.CurrencyPicker has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 11, if/else 2 (nesting depth added 4). Of this number, 20 points are the body's own statements and 5 belong to 3 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.
D2 · Cognitive Complexity · ChatMessage.ChatMessage (cognitive 25) · ×1
  • ChatMessage.ChatMessage (cognitive 25) app/javascript/components/Communities/ChatMessage.tsx:24 — ChatMessage.ChatMessage has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 7 (8 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 5). Of this number, 13 points are the body's own statements and 12 belong to 6 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.
D2 · Cognitive Complexity · shared.ResendToNonOpenersButton (cognitive 25) · ×1
  • shared.ResendToNonOpenersButton (cognitive 25) app/javascript/components/EmailsPage/shared.tsx:112 — shared.ResendToNonOpenersButton has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (18 pts), boolean chains 4, error handling 2, if/else 1 (nesting depth added 11). Of this number, 21 points are the body's own statements and 4 belong to 2 function literals 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.
D2 · Cognitive Complexity · Edit.BundlesProductEdit (cognitive 25) · ×1
  • Edit.BundlesProductEdit (cognitive 25) app/javascript/pages/Bundles/Product/Edit.tsx:110 — Edit.BundlesProductEdit has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 8, if/else 5 (nesting depth added 4). Of this number, 17 points are the body's own statements and 8 belong to 6 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.
D2 · Cognitive Complexity · Show.Churn (cognitive 25) · ×1
  • Show.Churn (cognitive 25) app/javascript/pages/Churn/Show.tsx:140 — Show.Churn has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 12 (17 pts), if/else 6, boolean chains 2 (nesting depth added 5). Most of this is not in the body itself: 7 of the 25 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 222, 250, 188, …). 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.
D2 · Cognitive Complexity · StripeMerchantAccountManager.person_hash (cognitive 24) · ×1
  • StripeMerchantAccountManager.person_hash (cognitive 24) REDACTED:2972 — StripeMerchantAccountManager.person_hash has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 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.
D2 · Cognitive Complexity · PaypalPayoutProcessor.is_user_payable (cognitive 24) · ×1
  • PaypalPayoutProcessor.is_user_payable (cognitive 24) app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:48 — PaypalPayoutProcessor.is_user_payable has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinksController.update_sections (cognitive 24) · ×1
  • LinksController.update_sections (cognitive 24) app/controllers/api/v2/links_controller.rb:621 — LinksController.update_sections has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 6, ternaries 1 (2 pts), 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.
D2 · Cognitive Complexity · SalesController.index (cognitive 24) · ×1
  • SalesController.index (cognitive 24) app/controllers/api/v2/sales_controller.rb:39 — SalesController.index has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 5 (7 pts), ternaries 4 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Link.cart_item (cognitive 24) · ×1
  • Link.cart_item (cognitive 24) app/models/link.rb:1572 — Link.cart_item has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 14, ternaries 6, 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.
D2 · Cognitive Complexity · BuyerCurrencyEligibility.direct_listed_line_items_eligible? (cognitive 24) · ×1
  • BuyerCurrencyEligibility.direct_listed_line_items_eligible? (cognitive 24) app/services/checkout/buyer_currency_eligibility.rb:152 — BuyerCurrencyEligibility.direct_listed_line_items_eligible? has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MergeCartsService.process (cognitive 24) · ×1
  • MergeCartsService.process (cognitive 24) app/services/merge_carts_service.rb:14 — MergeCartsService.process has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · BackfillMembershipAdvanceRenewalReminders.process (cognitive 24) · ×1
  • BackfillMembershipAdvanceRenewalReminders.process (cognitive 24) app/services/onetime/backfill_membership_advance_renewal_reminders.rb:64 — BackfillMembershipAdvanceRenewalReminders.process has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 2 (3 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · TriageUnlinkedStripeBankAccounts.classify (cognitive 24) · ×1
  • TriageUnlinkedStripeBankAccounts.classify (cognitive 24) app/services/onetime/triage_unlinked_stripe_bank_accounts.rb:139 — TriageUnlinkedStripeBankAccounts.classify has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PaymentForm.SharedInputs (cognitive 24) · ×1
  • PaymentForm.SharedInputs (cognitive 24) app/javascript/components/Checkout/PaymentForm.tsx:276 — PaymentForm.SharedInputs has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 8, if/else 2, match/switch 1 (nesting depth added 4). Of this number, 20 points are the body's own statements and 4 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.
D2 · Cognitive Complexity · NestedMenu.MenubarItem (cognitive 24) · ×1
  • NestedMenu.MenubarItem (cognitive 24) app/javascript/components/NestedMenu.tsx:194 — NestedMenu.MenubarItem has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 7 (nesting depth added 5). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 4 function items inside it that branch (handleToggleMenu, a function literal at line 259, a function literal at line 214, …). 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.
D2 · Cognitive Complexity · CardGrid.useSearchReducer (cognitive 24) · ×1
  • CardGrid.useSearchReducer (cognitive 24) app/javascript/components/Product/CardGrid.tsx:67 — CardGrid.useSearchReducer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (9 pts), boolean chains 2, error handling 1, match/switch 1 (nesting depth added 9). None of this is in the body itself: all 24 points belong to 2 function literals inside it that branch (lines 106, 75). 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.
D2 · Cognitive Complexity · Layout.CtaBar (cognitive 24) · ×1
  • Layout.CtaBar (cognitive 24) app/javascript/components/Product/Layout.tsx:142 — Layout.CtaBar has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 14 (17 pts), if/else 4, boolean chains 3 (nesting depth added 3). Of this number, 19 points are the body's own statements and 5 belong to 4 function literals 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.
D2 · Cognitive Complexity · index.ExistingPurchaseCard (cognitive 24) · ×1
  • index.ExistingPurchaseCard (cognitive 24) REDACTED:974 — index.ExistingPurchaseCard has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (22 pts), boolean chains 1, if/else 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.
D2 · Cognitive Complexity · FollowForm.FollowForm (cognitive 24) · ×1
  • FollowForm.FollowForm (cognitive 24) app/javascript/components/Profile/FollowForm.tsx:22 — FollowForm.FollowForm has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 7 (9 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 11 of the 24 points are its own statements and the rest belongs to one function item inside it that branches (submit). 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.
D2 · Cognitive Complexity · AuthenticatorSetup.AuthenticatorSetup (cognitive 24) · ×1
  • AuthenticatorSetup.AuthenticatorSetup (cognitive 24) app/javascript/components/Settings/PasswordPage/AuthenticatorSetup.tsx:24 — AuthenticatorSetup.AuthenticatorSetup has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 4 (8 pts), boolean chains 4, error handling 2 (nesting depth added 6). Of this number, 13 points are the body's own statements and 11 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.
D2 · Cognitive Complexity · ProductEditPage.ProductEditPage (cognitive 24) · ×1
  • ProductEditPage.ProductEditPage (cognitive 24) app/javascript/components/server-components/ProductEditPage.tsx:525 — ProductEditPage.ProductEditPage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 29 (38 pts), ternaries 22 (37 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ProductEditPage.ProductEditPage::performSave) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Show.HelpCenterArticle (cognitive 24) · ×1
  • Show.HelpCenterArticle (cognitive 24) app/javascript/pages/HelpCenter/Articles/Show.tsx:143 — Show.HelpCenterArticle has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, error handling 1 (2 pts), loops 2, ternaries 2 (nesting depth added 3). None of this is in the body itself: all 24 points belong to 7 function literals inside it that branch (lines 152, 210, 237, …). 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.
D2 · Cognitive Complexity · Show.SocialConnectionsPage (cognitive 24) · ×1
  • Show.SocialConnectionsPage (cognitive 24) app/javascript/pages/Settings/SocialConnections/Show.tsx:59 — Show.SocialConnectionsPage has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 15 (19 pts), boolean chains 4, error handling 1 (nesting depth added 4). Of this number, 12 points are the body's own statements and 12 belong to 3 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.
D2 · Cognitive Complexity · Show.TwoFactorAuthentication (cognitive 24) · ×1
  • Show.TwoFactorAuthentication (cognitive 24) app/javascript/pages/TwoFactorAuthentication/Show.tsx:26 — Show.TwoFactorAuthentication has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 5, if/else 4, match/switch 1 (nesting depth added 3). Of this number, 14 points are the body's own statements and 10 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.
D2 · Cognitive Complexity · prepareImageForUpload.prepareImageForUpload (cognitive 24) · ×1
  • prepareImageForUpload.prepareImageForUpload (cognitive 24) app/javascript/utils/prepareImageForUpload.ts:107 — prepareImageForUpload.prepareImageForUpload has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 6, ternaries 4, 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.
D2 · Cognitive Complexity · BraintreeChargeProcessor.create_payment_intent_or_charge! (cognitive 23) · ×1
  • BraintreeChargeProcessor.create_payment_intent_or_charge! (cognitive 23) app/business/payments/charging/implementations/braintree/braintree_charge_processor.rb:66 — BraintreeChargeProcessor.create_payment_intent_or_charge! has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), error handling 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.
D2 · Cognitive Complexity · SignupController.create (cognitive 23) · ×1
  • SignupController.create (cognitive 23) REDACTED:26 — SignupController.create has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 2 (7 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Purchase.not_double_charged (cognitive 23) · ×1
  • Purchase.not_double_charged (cognitive 23) app/models/purchase.rb:6001 — Purchase.not_double_charged has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · Base.payout_data (cognitive 23) · ×1
  • Base.payout_data (cognitive 23) app/services/exports/payouts/base.rb:27 — Base.payout_data has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 6, ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ChargeService.register_india_mandate_for_off_session_cart! (cognitive 23) · ×1
  • ChargeService.register_india_mandate_for_off_session_cart! (cognitive 23) app/services/order/charge_service.rb:339 — ChargeService.register_india_mandate_for_off_session_cart! has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 7 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdaterService.validate_indian_card_mandate! (cognitive 23) · ×1
  • UpdaterService.validate_indian_card_mandate! (cognitive 23) app/services/subscription/updater_service.rb:361 — UpdaterService.validate_indian_card_mandate! has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, boolean chains 10, 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.
D2 · Cognitive Complexity · CreateUsStateMonthlySalesReportsJob.perform (cognitive 23) · ×1
  • CreateUsStateMonthlySalesReportsJob.perform (cognitive 23) app/sidekiq/create_us_state_monthly_sales_reports_job.rb:13 — CreateUsStateMonthlySalesReportsJob.perform has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FileList.MobileAppAudioFileRow (cognitive 23) · ×1
  • FileList.MobileAppAudioFileRow (cognitive 23) app/javascript/components/Download/FileList.tsx:512 — FileList.MobileAppAudioFileRow has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 7, if/else 3 (nesting depth added 2). Of this number, 18 points are the body's own statements and 5 belong to 2 function literals 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.
D2 · Cognitive Complexity · selectionDiscounts.useSelectionDiscounts (cognitive 23) · ×1
  • selectionDiscounts.useSelectionDiscounts (cognitive 23) app/javascript/components/Product/selectionDiscounts.ts:49 — selectionDiscounts.useSelectionDiscounts has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 7, if/else 4 (nesting depth added 3). Of this number, 16 points are the body's own statements and 7 belong to 4 function literals 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.
D2 · Cognitive Complexity · product_edit.applyRichContentPageSaveResponse (cognitive 23) · ×1
  • product_edit.applyRichContentPageSaveResponse (cognitive 23) app/javascript/data/product_edit.ts:282 — product_edit.applyRichContentPageSaveResponse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6, ternaries 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.
D2 · Cognitive Complexity · Edit.AffiliatesEdit (cognitive 23) · ×1
  • Edit.AffiliatesEdit (cognitive 23) app/javascript/pages/Affiliates/Edit.tsx:33 — Edit.AffiliatesEdit has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 7, ternaries 4 (5 pts) (nesting depth added 1). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 8 function items inside it that branch (handleSubmit, a function literal at line 119, toggleAllProducts, …). 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.
D2 · Cognitive Complexity · New.AffiliatesNew (cognitive 23) · ×1
  • New.AffiliatesNew (cognitive 23) app/javascript/pages/Affiliates/New.tsx:25 — New.AffiliatesNew has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, if/else 8, ternaries 5 (6 pts) (nesting depth added 1). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (handleSubmit, a function literal at line 117, toggleAllProducts, …). 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.
D2 · Cognitive Complexity · StripePayoutProcessor.is_user_payable (cognitive 22) · ×1
  • StripePayoutProcessor.is_user_payable (cognitive 22) app/business/payments/payouts/processor/stripe/stripe_payout_processor.rb:48 — StripePayoutProcessor.is_user_payable has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BalanceTransaction.find_or_create_balance (cognitive 22) · ×1
  • BalanceTransaction.find_or_create_balance (cognitive 22) app/models/balance_transaction.rb:252 — BalanceTransaction.find_or_create_balance has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 6, error handling 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OfferCode.validate_default_discount_remains_applicable (cognitive 22) · ×1
  • OfferCode.validate_default_discount_remains_applicable (cognitive 22) app/models/offer_code.rb:836 — OfferCode.validate_default_discount_remains_applicable has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 4 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Payment.terminal_paypal_failure_seller_solution (cognitive 22) · ×1
  • Payment.terminal_paypal_failure_seller_solution (cognitive 22) app/models/payment.rb:325 — Payment.terminal_paypal_failure_seller_solution has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ClassifierStrategy.moderate (cognitive 22) · ×1
  • ClassifierStrategy.moderate (cognitive 22) app/services/content_moderation/strategies/classifier_strategy.rb:330 — ClassifierStrategy.moderate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (8 pts), error handling 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.
D2 · Cognitive Complexity · UpdatePayoutMethod.process (cognitive 22) · ×1
  • UpdatePayoutMethod.process (cognitive 22) REDACTED:122 — UpdatePayoutMethod.process has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, ternaries 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.
D2 · Cognitive Complexity · FailAbandonedPurchaseWorker.perform (cognitive 22) · ×1
  • FailAbandonedPurchaseWorker.perform (cognitive 22) app/sidekiq/fail_abandoned_purchase_worker.rb:9 — FailAbandonedPurchaseWorker.perform has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RetryStripeRejectedPayoutSetupForSellerJob.attempt_remediation (cognitive 22) · ×1
  • RetryStripeRejectedPayoutSetupForSellerJob.attempt_remediation (cognitive 22) app/sidekiq/retry_stripe_rejected_payout_setup_for_seller_job.rb:295 — RetryStripeRejectedPayoutSetupForSellerJob.attempt_remediation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 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.
D2 · Cognitive Complexity · ScheduleMembershipPriceUpdatesJob.perform (cognitive 22) · ×1
  • ScheduleMembershipPriceUpdatesJob.perform (cognitive 22) app/sidekiq/schedule_membership_price_updates_job.rb:7 — ScheduleMembershipPriceUpdatesJob.perform has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, ternaries 3, error handling 1 (2 pts), loops 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · buyerCurrencyDisplay.getCheckoutListedCurrencyDisplay (cognitive 22) · ×1
  • buyerCurrencyDisplay.getCheckoutListedCurrencyDisplay (cognitive 22) app/javascript/components/Checkout/buyerCurrencyDisplay.ts:147 — buyerCurrencyDisplay.getCheckoutListedCurrencyDisplay has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 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.
D2 · Cognitive Complexity · PostCommentsSection.PostCommentsSection (cognitive 22) · ×1
  • PostCommentsSection.PostCommentsSection (cognitive 22) REDACTED:51 — PostCommentsSection.PostCommentsSection has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 5, boolean chains 3, error handling 3 (nesting depth added 3). Of this number, 12 points are the body's own statements and 10 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, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ShareSection.ShareSection (cognitive 22) · ×1
  • ShareSection.ShareSection (cognitive 22) app/javascript/components/Product/ShareSection.tsx:24 — ShareSection.ShareSection has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 4 (6 pts), boolean chains 2, error handling 1 (nesting depth added 6). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 120, a function literal at line 99, a function literal at line 169, …). 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.
D2 · Cognitive Complexity · AvailabilityEditor.AvailabilityEditor (cognitive 22) · ×1
  • AvailabilityEditor.AvailabilityEditor (cognitive 22) app/javascript/components/ProductEdit/ProductTab/AvailabilityEditor.tsx:20 — AvailabilityEditor.AvailabilityEditor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 6 (9 pts), boolean chains 3 (nesting depth added 7). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 93, a function literal at line 62, a function literal at line 128, …). 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.
D2 · Cognitive Complexity · WishlistsSectionView.WishlistsSectionView (cognitive 22) · ×1
  • WishlistsSectionView.WishlistsSectionView (cognitive 22) app/javascript/components/Profile/EditSections/WishlistsSectionView.tsx:17 — WishlistsSectionView.WishlistsSectionView has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 10 (18 pts), boolean chains 2, error handling 1, if/else 1 (nesting depth added 8). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 51, 93, 30, …). 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.
D2 · Cognitive Complexity · FollowUserForm.FollowUserForm (cognitive 22) · ×1
  • FollowUserForm.FollowUserForm (cognitive 22) app/javascript/components/Profile/FollowUserForm.tsx:22 — FollowUserForm.FollowUserForm has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 5 (7 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 7). Of this number, 11 points are the body's own statements and 11 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.
D2 · Cognitive Complexity · ReviewVideoRecorderClientOnly.ReviewVideoRecorderClientOnly (cognitive 22) · ×1
  • ReviewVideoRecorderClientOnly.ReviewVideoRecorderClientOnly (cognitive 22) app/javascript/components/ReviewForm/ReviewVideoRecorderClientOnly.tsx:132 — ReviewVideoRecorderClientOnly.ReviewVideoRecorderClientOnly has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, boolean chains 6, ternaries 2 (3 pts), match/switch 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 8 function items inside it that branch (renderUiState, a function literal at line 210, clearRecordedVideo, …). 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.
D2 · Cognitive Complexity · PublicFileEmbed.NodeView (cognitive 22) · ×1
  • PublicFileEmbed.NodeView (cognitive 22) app/javascript/components/TiptapExtensions/PublicFileEmbed.tsx:47 — PublicFileEmbed.NodeView has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12 (15 pts), boolean chains 6, if/else 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.
D2 · Cognitive Complexity · StripeChargeProcessor.handle_stripe_capital_loan_event (cognitive 21) · ×1
  • StripeChargeProcessor.handle_stripe_capital_loan_event (cognitive 21) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:1295 — StripeChargeProcessor.handle_stripe_capital_loan_event has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (18 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.
D2 · Cognitive Complexity · PaypalPayoutProcessor.search_payment_on_paypal (cognitive 21) · ×1
  • PaypalPayoutProcessor.search_payment_on_paypal (cognitive 21) app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:618 — PaypalPayoutProcessor.search_payment_on_paypal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (15 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.
D2 · Cognitive Complexity · SalesController.update (cognitive 21) · ×1
  • SalesController.update (cognitive 21) app/controllers/api/mobile/sales_controller.rb:66 — SalesController.update has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (17 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.
D2 · Cognitive Complexity · ContactingCreatorMailer.notify (cognitive 21) · ×1
  • ContactingCreatorMailer.notify (cognitive 21) app/mailers/contacting_creator_mailer.rb:34 — ContactingCreatorMailer.notify has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5, 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.
D2 · Cognitive Complexity · CreditCard.create_from_client_confirmed_intent! (cognitive 21) · ×1
  • CreditCard.create_from_client_confirmed_intent! (cognitive 21) REDACTED:106 — CreditCard.create_from_client_confirmed_intent! has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, ternaries 6, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Purchase.confirm_charge_intent! (cognitive 21) · ×1
  • Purchase.confirm_charge_intent! (cognitive 21) app/models/purchase.rb:2434 — Purchase.confirm_charge_intent! has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 4 (10 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Subscription.build_purchase (cognitive 21) · ×1
  • Subscription.build_purchase (cognitive 21) REDACTED:271 — Subscription.build_purchase has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, ternaries 2 (4 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.
D2 · Cognitive Complexity · BackfillSelfAffiliateDroppedProceeds.check_eligibility (cognitive 21) · ×1
  • BackfillSelfAffiliateDroppedProceeds.check_eligibility (cognitive 21) app/services/onetime/backfill_self_affiliate_dropped_proceeds.rb:163 — BackfillSelfAffiliateDroppedProceeds.check_eligibility has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, 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.
D2 · Cognitive Complexity · SubmitPaypalDisputeEvidenceJob.perform (cognitive 21) · ×1
  • SubmitPaypalDisputeEvidenceJob.perform (cognitive 21) app/sidekiq/submit_paypal_dispute_evidence_job.rb:46 — SubmitPaypalDisputeEvidenceJob.perform has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PayPalConnectSection.PayPalConnectSection (cognitive 21) · ×1
  • PayPalConnectSection.PayPalConnectSection (cognitive 21) app/javascript/components/CheckoutDashboard/PayPalConnectSection.tsx:51 — PayPalConnectSection.PayPalConnectSection has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (17 pts), if/else 4 (nesting depth added 10). Of this number, 17 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.
D2 · Cognitive Complexity · FileList.VideoEmbedPreview (cognitive 21) · ×1
  • FileList.VideoEmbedPreview (cognitive 21) app/javascript/components/Download/FileList.tsx:669 — FileList.VideoEmbedPreview has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, ternaries 5 (7 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 8 function items inside it that branch (startPlaying, a function literal at line 684, a function literal at line 696, …). 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.
D2 · Cognitive Complexity · EmailAttachments.filesReducer (cognitive 21) · ×1
  • EmailAttachments.filesReducer (cognitive 21) app/javascript/components/EmailAttachments.tsx:403 — EmailAttachments.filesReducer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (nesting depth added 10). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 412, 428, 444, …). 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.
D2 · Cognitive Complexity · ConfigurationSelector.OptionRadioButton (cognitive 21) · ×1
  • ConfigurationSelector.OptionRadioButton (cognitive 21) app/javascript/components/Product/ConfigurationSelector.tsx:316 — ConfigurationSelector.OptionRadioButton has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 14 (20 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StripeMerchantAccountManager.update_account_attributes (cognitive 20) · ×1
  • StripeMerchantAccountManager.update_account_attributes (cognitive 20) REDACTED:695 — StripeMerchantAccountManager.update_account_attributes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 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.
D2 · Cognitive Complexity · PaypalPayoutProcessor.topup_amount_in_transit (cognitive 20) · ×1
  • PaypalPayoutProcessor.topup_amount_in_transit (cognitive 20) app/business/payments/payouts/processor/paypal/paypal_payout_processor.rb:691 — PaypalPayoutProcessor.topup_amount_in_transit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ThumbnailsController.create (cognitive 20) · ×1
  • ThumbnailsController.create (cognitive 20) app/controllers/api/v2/thumbnails_controller.rb:7 — ThumbnailsController.create has cognitive complexity 20 (threshold 15). Drivers by points: error handling 4 (10 pts), if/else 7 (8 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VariantsController.update (cognitive 20) · ×1
  • VariantsController.update (cognitive 20) app/controllers/api/v2/variants_controller.rb:28 — VariantsController.update has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UtmLinkTracking.track_utm_link_visit (cognitive 20) · ×1
  • UtmLinkTracking.track_utm_link_visit (cognitive 20) REDACTED:7 — UtmLinkTracking.track_utm_link_visit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 3 (5 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · CreateService.handle_existing_subscription (cognitive 20) · ×1
  • CreateService.handle_existing_subscription (cognitive 20) app/services/purchase/create_service.rb:332 — CreateService.handle_existing_subscription has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 3, boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · UpdaterService.validate_saved_indian_card_mandate! (cognitive 20) · ×1
  • UpdaterService.validate_saved_indian_card_mandate! (cognitive 20) app/services/subscription/updater_service.rb:494 — UpdaterService.validate_saved_indian_card_mandate! 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.
D2 · Cognitive Complexity · SendWorkflowEmailsToPastCanceledMembersJob.perform (cognitive 20) · ×1
  • SendWorkflowEmailsToPastCanceledMembersJob.perform (cognitive 20) app/sidekiq/send_workflow_emails_to_past_canceled_members_job.rb:11 — SendWorkflowEmailsToPastCanceledMembersJob.perform has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 8, 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.
D2 · Cognitive Complexity · CustomFields.getCustomFields (cognitive 20) · ×1
  • CustomFields.getCustomFields (cognitive 20) app/javascript/components/Checkout/CustomFields.tsx:92 — CustomFields.getCustomFields has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (7 pts), boolean chains 5 (nesting depth added 7). Of this number, 19 points are the body's own statements and 1 belongs to one function literal 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.
D2 · Cognitive Complexity · payment.createReducer (cognitive 20) · ×1
  • payment.createReducer (cognitive 20) app/javascript/components/Checkout/payment.ts:1988 — payment.createReducer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 4). None of this is in the body itself: all 20 points belong to 5 function literals inside it that branch (lines 2012, 2094, 2115, …). 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.
D2 · Cognitive Complexity · ConfigurationSelector.applySelection (cognitive 20) · ×1
  • ConfigurationSelector.applySelection (cognitive 20) app/javascript/components/Product/ConfigurationSelector.tsx:260 — ConfigurationSelector.applySelection has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, ternaries 7 (9 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.
D2 · Cognitive Complexity · DescriptionEditor.DescriptionEditor (cognitive 20) · ×1
  • DescriptionEditor.DescriptionEditor (cognitive 20) app/javascript/components/ProductEdit/ProductTab/DescriptionEditor.tsx:116 — DescriptionEditor.DescriptionEditor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (16 pts), ternaries 3, boolean chains 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 168, 273, 231, …). 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.
D2 · Cognitive Complexity · ReviewResponseForm.ReviewResponseForm (cognitive 20) · ×1
  • ReviewResponseForm.ReviewResponseForm (cognitive 20) app/javascript/components/ReviewResponseForm.tsx:12 — ReviewResponseForm.ReviewResponseForm has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (17 pts), error handling 2, if/else 1 (nesting depth added 8). Of this number, 17 points are the body's own statements and 3 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.
D2 · Cognitive Complexity · UpsellSelectModal.UpsellSelectModal (cognitive 20) · ×1
  • UpsellSelectModal.UpsellSelectModal (cognitive 20) app/javascript/components/UpsellSelectModal.tsx:43 — UpsellSelectModal.UpsellSelectModal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 5 (6 pts), boolean chains 4, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 7 function items inside it that branch (fetchProducts, a function literal at line 156, selectProductOption, …). 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.
D2 · Cognitive Complexity · index.Wishlist (cognitive 20) · ×1
  • index.Wishlist (cognitive 20) app/javascript/components/Wishlist/index.tsx:175 — index.Wishlist has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (14 pts), if/else 3, boolean chains 2, error handling 1 (nesting depth added 4). Of this number, 14 points are the body's own statements and 6 belong to 3 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.
D2 · Cognitive Complexity · product_save_contract.buildDeletionOperations (cognitive 20) · ×1
  • product_save_contract.buildDeletionOperations (cognitive 20) app/javascript/data/product_save_contract.ts:103 — product_save_contract.buildDeletionOperations has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, loops 1 (nesting depth added 4). Of this number, 17 points are the body's own statements and 3 belong to 3 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.
D2 · Cognitive Complexity · Stream.Stream (cognitive 20) · ×1
  • Stream.Stream (cognitive 20) app/javascript/pages/UrlRedirects/Stream.tsx:42 — Stream.Stream has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 3). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 97, 106, 160, …). 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.
D2 · Cognitive Complexity · epub.removeRemoteEpubResources (cognitive 20) · ×1
  • epub.removeRemoteEpubResources (cognitive 20) REDACTED:217 — epub.removeRemoteEpubResources has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 6 (7 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · email.sift3Distance (cognitive 20) · ×1
  • email.sift3Distance (cognitive 20) app/javascript/utils/email.ts:6 — email.sift3Distance has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · price.parseLocaleAwareCurrencyString (cognitive 20) · ×1
  • price.parseLocaleAwareCurrencyString (cognitive 20) app/javascript/utils/price.ts:32 — price.parseLocaleAwareCurrencyString has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (9 pts), ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgentConversationPersistence.claim_agent_action (cognitive 19) · ×1
  • AgentConversationPersistence.claim_agent_action (cognitive 19) app/controllers/concerns/agent_conversation_persistence.rb:309 — AgentConversationPersistence.claim_agent_action has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CustomersController.fetch_sales (cognitive 19) · ×1
  • CustomersController.fetch_sales (cognitive 19) app/controllers/customers_controller.rb:143 — CustomersController.fetch_sales has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · FollowersController.from_embed_form (cognitive 19) · ×1
  • FollowersController.from_embed_form (cognitive 19) app/controllers/followers_controller.rb:98 — FollowersController.from_embed_form has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OrdersController.release_failed_client_confirmation (cognitive 19) · ×1
  • OrdersController.release_failed_client_confirmation (cognitive 19) app/controllers/orders_controller.rb:157 — OrdersController.release_failed_client_confirmation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 3, boolean chains 2, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Purchase.prepare_chargeable_for_charge! (cognitive 19) · ×1
  • Purchase.prepare_chargeable_for_charge! (cognitive 19) app/models/purchase.rb:4957 — Purchase.prepare_chargeable_for_charge! has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (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.
D2 · Cognitive Complexity · Variant.recurrence_price_values (cognitive 19) · ×1
  • Variant.recurrence_price_values (cognitive 19) app/models/variant.rb:48 — Variant.recurrence_price_values has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, ternaries 2 (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.
D2 · Cognitive Complexity · StripePaymentPresenter.client_confirm_props (cognitive 19) · ×1
  • StripePaymentPresenter.client_confirm_props (cognitive 19) app/presenters/checkout/stripe_payment_presenter.rb:269 — StripePaymentPresenter.client_confirm_props has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 6, 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.
D2 · Cognitive Complexity · AnthropicClient.parse_buffered_fallback (cognitive 19) · ×1
  • AnthropicClient.parse_buffered_fallback (cognitive 19) app/services/ai/anthropic_client.rb:352 — AnthropicClient.parse_buffered_fallback has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 6, 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.
D2 · Cognitive Complexity · ModerateRecordService.seller_message (cognitive 19) · ×1
  • ModerateRecordService.seller_message (cognitive 19) app/services/content_moderation/moderate_record_service.rb:102 — ModerateRecordService.seller_message has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 7, 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.
D2 · Cognitive Complexity · ModerateRecordService.check (cognitive 19) · ×1
  • ModerateRecordService.check (cognitive 19) app/services/content_moderation/moderate_record_service.rb:163 — ModerateRecordService.check has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · LowBalanceProbationRecovery.bind_comment (cognitive 19) · ×1
  • LowBalanceProbationRecovery.bind_comment (cognitive 19) app/services/low_balance_probation_recovery.rb:262 — LowBalanceProbationRecovery.bind_comment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BackfillSelfAffiliateDroppedProceeds.process_one (cognitive 19) · ×1
  • BackfillSelfAffiliateDroppedProceeds.process_one (cognitive 19) app/services/onetime/backfill_self_affiliate_dropped_proceeds.rb:78 — BackfillSelfAffiliateDroppedProceeds.process_one has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PostBlastSending.enrich_with_gathered_records (cognitive 19) · ×1
  • PostBlastSending.enrich_with_gathered_records (cognitive 19) app/sidekiq/concerns/post_blast_sending.rb:173 — PostBlastSending.enrich_with_gathered_records has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdateTaxRatesJob.perform (cognitive 19) · ×1
  • UpdateTaxRatesJob.perform (cognitive 19) app/sidekiq/update_tax_rates_job.rb:7 — UpdateTaxRatesJob.perform has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 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.
D2 · Cognitive Complexity · DateRangePicker.DateRangePicker (cognitive 19) · ×1
  • DateRangePicker.DateRangePicker (cognitive 19) app/javascript/components/DateRangePicker.tsx:35 — DateRangePicker.DateRangePicker has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 3 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 105, 133, 145, …). 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.
D2 · Cognitive Complexity · RichContent.FileGroupDownloadAllButton (cognitive 19) · ×1
  • RichContent.FileGroupDownloadAllButton (cognitive 19) app/javascript/components/Download/RichContent.tsx:413 — RichContent.FileGroupDownloadAllButton has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (6 pts), error handling 2 (5 pts), boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 483, 502, 418, …). 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.
D2 · Cognitive Complexity · ShareYourLaunchCard.EmailChannelRow (cognitive 19) · ×1
  • ShareYourLaunchCard.EmailChannelRow (cognitive 19) app/javascript/components/ProductEdit/ShareTab/ShareYourLaunchCard.tsx:185 — ShareYourLaunchCard.EmailChannelRow has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (17 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.
D2 · Cognitive Complexity · Link.LinkNodeView (cognitive 19) · ×1
  • Link.LinkNodeView (cognitive 19) app/javascript/components/TiptapExtensions/Link.tsx:119 — Link.LinkNodeView has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 8 function items inside it that branch (handleSave, a function literal at line 147, a function literal at line 190, …). 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.
D2 · Cognitive Complexity · google_analytics.trackProductEvent (cognitive 19) · ×1
  • google_analytics.trackProductEvent (cognitive 19) app/javascript/data/google_analytics.ts:64 — google_analytics.trackProductEvent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (4 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · StripeChargeProcessor.find_or_create_external_refund_reversal (cognitive 18) · ×1
  • StripeChargeProcessor.find_or_create_external_refund_reversal (cognitive 18) app/business/payments/charging/implementations/stripe/stripe_charge_processor.rb:748 — StripeChargeProcessor.find_or_create_external_refund_reversal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SalesTaxCalculator.is_vat_exempt? (cognitive 18) · ×1
  • SalesTaxCalculator.is_vat_exempt? (cognitive 18) app/business/sales_tax/sales_tax_calculator.rb:226 — SalesTaxCalculator.is_vat_exempt? has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinksController.validate_product_refund_policy_params (cognitive 18) · ×1
  • LinksController.validate_product_refund_policy_params (cognitive 18) app/controllers/api/v2/links_controller.rb:815 — LinksController.validate_product_refund_policy_params has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpsellsController.backfill_absent_associations (cognitive 18) · ×1
  • UpsellsController.backfill_absent_associations (cognitive 18) app/controllers/api/v2/upsells_controller.rb:72 — UpsellsController.backfill_absent_associations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (7 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.
D2 · Cognitive Complexity · SearchProducts.normalize_search_param_values! (cognitive 18) · ×1
  • SearchProducts.normalize_search_param_values! (cognitive 18) app/controllers/concerns/search_products.rb:47 — SearchProducts.normalize_search_param_values! has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SubscriptionsController.check_can_manage (cognitive 18) · ×1
  • SubscriptionsController.check_can_manage (cognitive 18) REDACTED:50 — SubscriptionsController.check_can_manage has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 8 (9 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.
D2 · Cognitive Complexity · Installment.installment_mobile_json_data (cognitive 18) · ×1
  • Installment.installment_mobile_json_data (cognitive 18) app/models/installment.rb:277 — Installment.installment_mobile_json_data has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 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.
D2 · Cognitive Complexity · Purchase.indian_card_charge_intent_matches_subscription_terms? (cognitive 18) · ×1
  • Purchase.indian_card_charge_intent_matches_subscription_terms? (cognitive 18) app/models/purchase.rb:4024 — Purchase.indian_card_charge_intent_matches_subscription_terms? has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 12, 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.
D2 · Cognitive Complexity · Purchase.free_trial_purchase_set_correctly (cognitive 18) · ×1
  • Purchase.free_trial_purchase_set_correctly (cognitive 18) app/models/purchase.rb:6226 — Purchase.free_trial_purchase_set_correctly has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Refund.collect_pending_fee_retention! (cognitive 18) · ×1
  • Refund.collect_pending_fee_retention! (cognitive 18) app/models/refund.rb:219 — Refund.collect_pending_fee_retention! has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), error handling 2 (3 pts) (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Risk.chargeback_payment_identity (cognitive 18) · ×1
  • Risk.chargeback_payment_identity (cognitive 18) app/modules/purchase/risk.rb:113 — Risk.chargeback_payment_identity has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 4 (5 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.
D2 · Cognitive Complexity · StripePaymentPresenter.fallback_reason_for (cognitive 18) · ×1
  • StripePaymentPresenter.fallback_reason_for (cognitive 18) app/presenters/checkout/stripe_payment_presenter.rb:350 — StripePaymentPresenter.fallback_reason_for has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 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.
D2 · Cognitive Complexity · UrlRedirectPresenter.map_file (cognitive 18) · ×1
  • UrlRedirectPresenter.map_file (cognitive 18) app/presenters/url_redirect_presenter.rb:263 — UrlRedirectPresenter.map_file has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 11 (14 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.
D2 · Cognitive Complexity · MethodForcedPresentment.perform (cognitive 18) · ×1
  • MethodForcedPresentment.perform (cognitive 18) app/services/charge/method_forced_presentment.rb:77 — MethodForcedPresentment.perform has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 3 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BuyerCurrencyQuote.verify! (cognitive 18) · ×1
  • BuyerCurrencyQuote.verify! (cognitive 18) app/services/checkout/buyer_currency_quote.rb:277 — BuyerCurrencyQuote.verify! has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, error handling 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.
D2 · Cognitive Complexity · ChargeService.setup_intent_covers_mandate_options? (cognitive 18) · ×1
  • ChargeService.setup_intent_covers_mandate_options? (cognitive 18) app/services/order/charge_service.rb:424 — ChargeService.setup_intent_covers_mandate_options? has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (8 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.
D2 · Cognitive Complexity · PreparePaymentIntentService.recurring_upi_registration_shape_value (cognitive 18) · ×1
  • PreparePaymentIntentService.recurring_upi_registration_shape_value (cognitive 18) app/services/order/prepare_payment_intent_service.rb:1271 — PreparePaymentIntentService.recurring_upi_registration_shape_value has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AlertOnStaleBlocksHoldingEstablishedBuyersJob.scan_for_stale_blocks (cognitive 18) · ×1
  • AlertOnStaleBlocksHoldingEstablishedBuyersJob.scan_for_stale_blocks (cognitive 18) app/sidekiq/alert_on_stale_blocks_holding_established_buyers_job.rb:70 — AlertOnStaleBlocksHoldingEstablishedBuyersJob.scan_for_stale_blocks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PostBlastSending.partition_members_that_left_the_audience (cognitive 18) · ×1
  • PostBlastSending.partition_members_that_left_the_audience (cognitive 18) app/sidekiq/concerns/post_blast_sending.rb:334 — PostBlastSending.partition_members_that_left_the_audience has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 8, 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.
D2 · Cognitive Complexity · AgentChat.AgentChat (cognitive 18) · ×1
  • AgentChat.AgentChat (cognitive 18) app/javascript/components/Agent/AgentChat.tsx:467 — AgentChat.AgentChat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 59 (89 pts), ternaries 33 (54 pts), boolean chains 33, error handling 5 (7 pts), loops 4, match/switch 1 (2 pts) (nesting depth added 54). To reduce it, split the body into named stages: move each independent 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: 2 other methods here (AgentChat.AgentChat::send, AgentChat.AgentChat::confirmAction) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · CustomerDetailPage.ColumnLayout (cognitive 18) · ×1
  • CustomerDetailPage.ColumnLayout (cognitive 18) app/javascript/components/Audience/CustomerDetailPage.tsx:2362 — CustomerDetailPage.ColumnLayout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (5 pts), boolean chains 2, loops 2 (nesting depth added 3). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 2386, 2363, 2371, …). 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.
D2 · Cognitive Complexity · Form.CollaboratorForm · ×1
  • Form.CollaboratorForm::submitForm (cognitive 18) app/javascript/components/Collaborators/Form.tsx:66 — Form.CollaboratorForm::submitForm has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 2 (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.
D2 · Cognitive Complexity · ComboBox.ComboBox (cognitive 18) · ×1
  • ComboBox.ComboBox (cognitive 18) app/javascript/components/ComboBox.tsx:24 — ComboBox.ComboBox has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, ternaries 3, loops 1, match/switch 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 68, moveCursor, toggle, …). 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.
D2 · Cognitive Complexity · Search.Search (cognitive 18) · ×1
  • Search.Search (cognitive 18) app/javascript/components/Discover/Search.tsx:17 — Search.Search has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 5, boolean chains 1 (nesting depth added 4). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 101, a function literal at line 34, a function literal at line 38, …). 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.
D2 · Cognitive Complexity · Interactions.NativeAppLink (cognitive 18) · ×1
  • Interactions.NativeAppLink (cognitive 18) app/javascript/components/Download/Interactions.tsx:39 — Interactions.NativeAppLink has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 3 (6 pts), boolean chains 5 (nesting depth added 4). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 66). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · NestedMenu.ItemsList (cognitive 18) · ×1
  • NestedMenu.ItemsList (cognitive 18) app/javascript/components/NestedMenu.tsx:365 — NestedMenu.ItemsList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, ternaries 5 (nesting depth added 2). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 427, a function literal at line 423, a function literal at line 394, …). 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.
D2 · Cognitive Complexity · PurchaseButton.PurchaseButton (cognitive 18) · ×1
  • PurchaseButton.PurchaseButton (cognitive 18) app/javascript/components/Product/PurchaseButton.tsx:22 — PurchaseButton.PurchaseButton has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (validate, a function literal at line 73). 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.
D2 · Cognitive Complexity · index.PriceCheckerCard (cognitive 18) · ×1
  • index.PriceCheckerCard (cognitive 18) app/javascript/components/ProductEdit/ProductTab/PriceChecker/index.tsx:66 — index.PriceCheckerCard has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 4 (5 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 4). Of this number, 10 points are the body's own statements and 8 belong to one function literal 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.
D2 · Cognitive Complexity · Sections.Section (cognitive 18) · ×1
  • Sections.Section (cognitive 18) app/javascript/components/Profile/Sections.tsx:251 — Sections.Section has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (16 pts), boolean chains 1, if/else 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Layout.Layout (cognitive 18) · ×1
  • Layout.Layout (cognitive 18) app/javascript/components/Profile/Layout.tsx:28 — Layout.Layout has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 11 (15 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.
D2 · Cognitive Complexity · RichTextEditor.RichTextEditorToolbar (cognitive 18) · ×1
  • RichTextEditor.RichTextEditorToolbar (cognitive 18) app/javascript/components/RichTextEditor.tsx:487 — RichTextEditor.RichTextEditorToolbar has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 4, boolean chains 1, loops 1, match/switch 1 (nesting depth added 2). Of this number, 10 points are the body's own statements and 8 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, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BeneficialOwnersSection.BeneficialOwnersSection · ×1
  • BeneficialOwnersSection.BeneficialOwnersSection::validateJpKanaFields (cognitive 18) app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:523 — BeneficialOwnersSection.BeneficialOwnersSection::validateJpKanaFields has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 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. This shape REPEATS in the file: one other method here (BeneficialOwnersSection.BeneficialOwnersSection) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · UpsellCard.UpsellCardNodeView (cognitive 18) · ×1
  • UpsellCard.UpsellCardNodeView (cognitive 18) app/javascript/components/TiptapExtensions/UpsellCard.tsx:127 — UpsellCard.UpsellCardNodeView has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (15 pts), boolean chains 2, error handling 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 2 belong to one function literal 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.
D2 · Cognitive Complexity · ProductEditPage.scopedConfirmedPageIdMappings (cognitive 18) · ×1
  • ProductEditPage.scopedConfirmedPageIdMappings (cognitive 18) app/javascript/components/server-components/ProductEditPage.tsx:454 — ProductEditPage.scopedConfirmedPageIdMappings has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3, boolean chains 2, 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.
D2 · Cognitive Complexity · order.startClientConfirmOrderCreation (cognitive 18) · ×1
  • order.startClientConfirmOrderCreation (cognitive 18) app/javascript/data/order.ts:653 — order.startClientConfirmOrderCreation has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (4 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · StripeErrorHandler.with_stripe_error_handler (cognitive 17) · ×1
  • StripeErrorHandler.with_stripe_error_handler (cognitive 17) app/business/payments/charging/implementations/stripe/helpers/stripe_error_handler.rb:5 — StripeErrorHandler.with_stripe_error_handler has cognitive complexity 17 (threshold 15). Drivers by points: error handling 5 (15 pts), if/else 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StripeMerchantAccountManager.account_hash (cognitive 17) · ×1
  • StripeMerchantAccountManager.account_hash (cognitive 17) REDACTED:2856 — StripeMerchantAccountManager.account_hash has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentController.create (cognitive 17) · ×1
  • AgentController.create (cognitive 17) app/controllers/api/mobile/agent_controller.rb:92 — AgentController.create has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6, error handling 3 (4 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · EmailsController.valid_write_params? (cognitive 17) · ×1
  • EmailsController.valid_write_params? (cognitive 17) app/controllers/api/v2/workflows/emails_controller.rb:81 — EmailsController.valid_write_params? has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 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.
D2 · Cognitive Complexity · PurchasesController.unsubscribe (cognitive 17) · ×1
  • PurchasesController.unsubscribe (cognitive 17) REDACTED:61 — PurchasesController.unsubscribe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, error handling 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.
D2 · Cognitive Complexity · InvitationsController.accept (cognitive 17) · ×1
  • InvitationsController.accept (cognitive 17) app/controllers/settings/team/invitations_controller.rb:71 — InvitationsController.accept has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OmniauthCallbacksController.twitter (cognitive 17) · ×1
  • OmniauthCallbacksController.twitter (cognitive 17) REDACTED:20 — OmniauthCallbacksController.twitter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 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.
D2 · Cognitive Complexity · UsersController.add_purchase_to_library (cognitive 17) · ×1
  • UsersController.add_purchase_to_library (cognitive 17) REDACTED:195 — UsersController.add_purchase_to_library has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PayoutsHelper.current_payout_period_data (cognitive 17) · ×1
  • PayoutsHelper.current_payout_period_data (cognitive 17) app/helpers/payouts_helper.rb:58 — PayoutsHelper.current_payout_period_data has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NotifyOfSaleHeaders.set_notify_of_sale_headers (cognitive 17) · ×1
  • NotifyOfSaleHeaders.set_notify_of_sale_headers (cognitive 17) REDACTED:6 — NotifyOfSaleHeaders.set_notify_of_sale_headers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CustomerMailer.abandoned_cart (cognitive 17) · ×1
  • CustomerMailer.abandoned_cart (cognitive 17) app/mailers/customer_mailer.rb:321 — CustomerMailer.abandoned_cart has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, error handling 1 (2 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AbandonedCartProducts.abandoned_cart_products (cognitive 17) · ×1
  • AbandonedCartProducts.abandoned_cart_products (cognitive 17) app/models/concerns/workflow/abandoned_cart_products.rb:11 — AbandonedCartProducts.abandoned_cart_products has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Installment.send_installment_from_workflow_for_purchase (cognitive 17) · ×1
  • Installment.send_installment_from_workflow_for_purchase (cognitive 17) app/models/installment.rb:433 — Installment.send_installment_from_workflow_for_purchase has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, 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, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Link.publish! (cognitive 17) · ×1
  • Link.publish! (cognitive 17) app/models/link.rb:551 — Link.publish! has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Preorder.charge! (cognitive 17) · ×1
  • Preorder.charge! (cognitive 17) app/models/preorder.rb:110 — Preorder.charge! has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 3, ternaries 3, error handling 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Purchase.product_installments (cognitive 17) · ×1
  • Purchase.product_installments (cognitive 17) app/models/purchase.rb:3189 — Purchase.product_installments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, ternaries 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Purchase.calculate_fees (cognitive 17) · ×1
  • Purchase.calculate_fees (cognitive 17) app/models/purchase.rb:5470 — Purchase.calculate_fees has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Purchase.reverse_excess_amount_from_stripe_transfer (cognitive 17) · ×1
  • Purchase.reverse_excess_amount_from_stripe_transfer (cognitive 17) app/modules/purchase/refundable.rb:782 — Purchase.reverse_excess_amount_from_stripe_transfer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 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.
D2 · Cognitive Complexity · StoreAgentObjectFormatter.discounts (cognitive 17) · ×1
  • StoreAgentObjectFormatter.discounts (cognitive 17) app/services/ai/store_agent_object_formatter.rb:88 — StoreAgentObjectFormatter.discounts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 4, ternaries 2 (4 pts), error handling 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.
D2 · Cognitive Complexity · StoreAgentService.final_turn_decision (cognitive 17) · ×1
  • StoreAgentService.final_turn_decision (cognitive 17) app/services/ai/store_agent_service.rb:1079 — StoreAgentService.final_turn_decision has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BuyerCurrencyEligibility.method_forced_decision (cognitive 17) · ×1
  • BuyerCurrencyEligibility.method_forced_decision (cognitive 17) app/services/checkout/buyer_currency_eligibility.rb:522 — BuyerCurrencyEligibility.method_forced_decision has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PromptStrategy.perform (cognitive 17) · ×1
  • PromptStrategy.perform (cognitive 17) app/services/content_moderation/strategies/prompt_strategy.rb:233 — PromptStrategy.perform has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 2 (3 pts), boolean chains 2, 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, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BackfillTaxonomyAttributeClassification.cleanup_orphaned_inferred_values (cognitive 17) · ×1
  • BackfillTaxonomyAttributeClassification.cleanup_orphaned_inferred_values (cognitive 17) app/services/onetime/backfill_taxonomy_attribute_classification.rb:62 — BackfillTaxonomyAttributeClassification.cleanup_orphaned_inferred_values has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · RepairCapitalDeduction.validate_records! (cognitive 17) · ×1
  • RepairCapitalDeduction.validate_records! (cognitive 17) app/services/onetime/repair_capital_deduction.rb:55 — RepairCapitalDeduction.validate_records! has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 13, 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.
D2 · Cognitive Complexity · ConfirmService.charge_seller_groups_awaiting_setup_confirmation! (cognitive 17) · ×1
  • ConfirmService.charge_seller_groups_awaiting_setup_confirmation! (cognitive 17) app/services/order/confirm_service.rb:83 — ConfirmService.charge_seller_groups_awaiting_setup_confirmation! has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OfferCodeRecoveryService.sanitize_retry_candidates (cognitive 17) · ×1
  • OfferCodeRecoveryService.sanitize_retry_candidates (cognitive 17) app/services/order/offer_code_recovery_service.rb:27 — OfferCodeRecoveryService.sanitize_retry_candidates has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 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.
D2 · Cognitive Complexity · Interpolator.interpolate (cognitive 17) · ×1
  • Interpolator.interpolate (cognitive 17) app/services/pages/interpolator.rb:122 — Interpolator.interpolate 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.
D2 · Cognitive Complexity · AlertOnStalledPostEmailBlastsJob.resolve_action (cognitive 17) · ×1
  • AlertOnStalledPostEmailBlastsJob.resolve_action (cognitive 17) app/sidekiq/alert_on_stalled_post_email_blasts_job.rb:182 — AlertOnStalledPostEmailBlastsJob.resolve_action has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ElasticsearchIndexerWorker.perform (cognitive 17) · ×1
  • ElasticsearchIndexerWorker.perform (cognitive 17) app/sidekiq/elasticsearch_indexer_worker.rb:20 — ElasticsearchIndexerWorker.perform has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, error handling 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.
D2 · Cognitive Complexity · RetryStripeRejectedPayoutSetupForSellerJob.perform (cognitive 17) · ×1
  • RetryStripeRejectedPayoutSetupForSellerJob.perform (cognitive 17) app/sidekiq/retry_stripe_rejected_payout_setup_for_seller_job.rb:41 — RetryStripeRejectedPayoutSetupForSellerJob.perform has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · main.normalizeParams (cognitive 17) · ×1
  • main.normalizeParams (cognitive 17) resend_callbacks/event.go:104 — main.normalizeParams has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PaymentForm.PayPalContent (cognitive 17) · ×1
  • PaymentForm.PayPalContent (cognitive 17) app/javascript/components/Checkout/PaymentForm.tsx:1512 — PaymentForm.PayPalContent has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 6, boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1528, 1516). 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.
D2 · Cognitive Complexity · payment.validatePaymentMethodIndependentFields (cognitive 17) · ×1
  • payment.validatePaymentMethodIndependentFields (cognitive 17) app/javascript/components/Checkout/payment.ts:1335 — payment.validatePaymentMethodIndependentFields has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 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.
D2 · Cognitive Complexity · DateInput.DateInput (cognitive 17) · ×1
  • DateInput.DateInput (cognitive 17) app/javascript/components/DateInput.tsx:18 — DateInput.DateInput has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (8 pts), if/else 5, boolean chains 4 (nesting depth added 1). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (formatDate, a function literal at line 60, a function literal at line 47). 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.
D2 · Cognitive Complexity · ImageUploader.ImageUploader (cognitive 17) · ×1
  • ImageUploader.ImageUploader (cognitive 17) app/javascript/components/ImageUploader.tsx:13 — ImageUploader.ImageUploader has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 4 (6 pts), boolean chains 2 (nesting depth added 5). Of this number, 9 points are the body's own statements and 8 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.
D2 · Cognitive Complexity · AttributesEditor.AttributesEditor (cognitive 17) · ×1
  • AttributesEditor.AttributesEditor (cognitive 17) app/javascript/components/ProductEdit/ProductTab/AttributesEditor.tsx:11 — AttributesEditor.AttributesEditor has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 5, boolean chains 4 (nesting depth added 2). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 47, moveCustomAttribute, 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.
D2 · Cognitive Complexity · WorkflowEmails.AbandonedCartProductListNodeView (cognitive 17) · ×1
  • WorkflowEmails.AbandonedCartProductListNodeView (cognitive 17) app/javascript/components/WorkflowsPage/WorkflowEmails.tsx:605 — WorkflowEmails.AbandonedCartProductListNodeView has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 12 (17 pts) (nesting depth added 5). Of this number, 11 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.
D2 · Cognitive Complexity · Index.TaxCenterIndex (cognitive 17) · ×1
  • Index.TaxCenterIndex (cognitive 17) app/javascript/pages/TaxCenter/Index.tsx:99 — Index.TaxCenterIndex has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 2, boolean chains 1, error handling 1 (nesting depth added 5). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 213, a function literal at line 110, handleDownload::handleVisibilityChange). 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.
D2 · Cognitive Complexity · PaypalChargeProcessor.refund! (cognitive 16) · ×1
  • PaypalChargeProcessor.refund! (cognitive 16) app/business/payments/charging/implementations/paypal/paypal_charge_processor.rb:746 — PaypalChargeProcessor.refund! has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 1 (3 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.
D2 · Cognitive Complexity · StripeCharge.build_flow_of_funds (cognitive 16) · ×1
  • StripeCharge.build_flow_of_funds (cognitive 16) app/business/payments/charging/implementations/stripe/stripe_charge.rb:120 — StripeCharge.build_flow_of_funds has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StripeMerchantAccountManager.list_matching_uncertain_account (cognitive 16) · ×1
  • StripeMerchantAccountManager.list_matching_uncertain_account (cognitive 16) REDACTED:2299 — StripeMerchantAccountManager.list_matching_uncertain_account has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · StripeMerchantAccountManager.bank_account_hash (cognitive 16) · ×1
  • StripeMerchantAccountManager.bank_account_hash (cognitive 16) REDACTED:2917 — StripeMerchantAccountManager.bank_account_hash has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OnboardingFormController.update (cognitive 16) · ×1
  • OnboardingFormController.update (cognitive 16) app/controllers/affiliate_requests/onboarding_form_controller.rb:7 — OnboardingFormController.update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 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.
D2 · Cognitive Complexity · UsersController.purchases_scope (cognitive 16) · ×1
  • UsersController.purchases_scope (cognitive 16) app/controllers/api/internal/admin/users_controller.rb:871 — UsersController.purchases_scope has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), 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.
D2 · Cognitive Complexity · PagesController.validate_content_params (cognitive 16) · ×1
  • PagesController.validate_content_params (cognitive 16) app/controllers/api/v2/pages_controller.rb:98 — PagesController.validate_content_params has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProductEligibilityController.development_product (cognitive 16) · ×1
  • ProductEligibilityController.development_product (cognitive 16) app/controllers/global_affiliates/product_eligibility_controller.rb:60 — ProductEligibilityController.development_product has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SecureRedirectController.create (cognitive 16) · ×1
  • SecureRedirectController.create (cognitive 16) app/controllers/secure_redirect_controller.rb:18 — SecureRedirectController.create has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 2 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AsJson.as_json_for_api (cognitive 16) · ×1
  • AsJson.as_json_for_api (cognitive 16) app/models/concerns/product/as_json.rb:76 — AsJson.as_json_for_api has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (7 pts), if/else 5, boolean chains 2, error handling 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Blockable.processor_rule_refusal (cognitive 16) · ×1
  • Blockable.processor_rule_refusal (cognitive 16) app/models/concerns/purchase/blockable.rb:310 — Blockable.processor_rule_refusal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 2 (4 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · ChargeEventsHandler.promote_confirmed_setup_intents_for_client_confirmed_charge! (cognitive 16) · ×1
  • ChargeEventsHandler.promote_confirmed_setup_intents_for_client_confirmed_charge! (cognitive 16) app/models/concerns/purchase/charge_events_handler.rb:234 — ChargeEventsHandler.promote_confirmed_setup_intents_for_client_confirmed_charge! has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (6 pts), error handling 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.
D2 · Cognitive Complexity · DashboardNav.earned_items (cognitive 16) · ×1
  • DashboardNav.earned_items (cognitive 16) app/models/dashboard_nav.rb:82 — DashboardNav.earned_items has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OauthDeviceAuthorization.poll! (cognitive 16) · ×1
  • OauthDeviceAuthorization.poll! (cognitive 16) app/models/oauth_device_authorization.rb:168 — OauthDeviceAuthorization.poll! has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 2 (4 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · Payment.sync_with_stripe (cognitive 16) · ×1
  • Payment.sync_with_stripe (cognitive 16) app/models/payment.rb:583 — Payment.sync_with_stripe has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 1 (2 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · Purchase.decrement_balance_for_refund_or_chargeback! (cognitive 16) · ×1
  • Purchase.decrement_balance_for_refund_or_chargeback! (cognitive 16) app/models/purchase.rb:2735 — Purchase.decrement_balance_for_refund_or_chargeback! has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · Purchase.retrieve_indian_card_mandate (cognitive 16) · ×1
  • Purchase.retrieve_indian_card_mandate (cognitive 16) app/models/purchase.rb:3960 — Purchase.retrieve_indian_card_mandate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Purchase.mandate_options_for_stripe (cognitive 16) · ×1
  • Purchase.mandate_options_for_stripe (cognitive 16) app/models/purchase.rb:4127 — Purchase.mandate_options_for_stripe 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.
D2 · Cognitive Complexity · Purchase.validate_offer_code (cognitive 16) · ×1
  • Purchase.validate_offer_code (cognitive 16) app/models/purchase.rb:5716 — Purchase.validate_offer_code has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, 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.
D2 · Cognitive Complexity · Subscription.indian_card_mandate_for (cognitive 16) · ×1
  • Subscription.indian_card_mandate_for (cognitive 16) REDACTED:1033 — Subscription.indian_card_mandate_for has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 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.
D2 · Cognitive Complexity · UserComplianceInfo.has_completed_compliance_info? (cognitive 16) · ×1
  • UserComplianceInfo.has_completed_compliance_info? (cognitive 16) app/models/user_compliance_info.rb:102 — UserComplianceInfo.has_completed_compliance_info? has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 16. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · StripePaymentPresenter.recurring_upi_registration_shape? (cognitive 16) · ×1
  • StripePaymentPresenter.recurring_upi_registration_shape? (cognitive 16) app/presenters/checkout/stripe_payment_presenter.rb:494 — StripePaymentPresenter.recurring_upi_registration_shape? has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · InstallmentPresenter.props (cognitive 16) · ×1
  • InstallmentPresenter.props (cognitive 16) app/presenters/installment_presenter.rb:16 — InstallmentPresenter.props has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 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.
D2 · Cognitive Complexity · LibraryPresenter.ongoing_subscription_label (cognitive 16) · ×1
  • LibraryPresenter.ongoing_subscription_label (cognitive 16) app/presenters/library_presenter.rb:333 — LibraryPresenter.ongoing_subscription_label has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (4 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.
D2 · Cognitive Complexity · UrlRedirectPresenter.download_page_layout_props (cognitive 16) · ×1
  • UrlRedirectPresenter.download_page_layout_props (cognitive 16) app/presenters/url_redirect_presenter.rb:89 — UrlRedirectPresenter.download_page_layout_props has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageSanitizer.scrub_node (cognitive 16) · ×1
  • PageSanitizer.scrub_node (cognitive 16) app/services/ai/page_sanitizer.rb:78 — PageSanitizer.scrub_node has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, 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.
D2 · Cognitive Complexity · StoreAgentObjectFormatter.from_response (cognitive 16) · ×1
  • StoreAgentObjectFormatter.from_response (cognitive 16) app/services/ai/store_agent_object_formatter.rb:27 — StoreAgentObjectFormatter.from_response has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 4, 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.
D2 · Cognitive Complexity · StoreAgentService.respond (cognitive 16) · ×1
  • StoreAgentService.respond (cognitive 16) app/services/ai/store_agent_service.rb:772 — StoreAgentService.respond has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 2 (5 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Mcp.handle_message (cognitive 16) · ×1
  • Mcp.handle_message (cognitive 16) app/services/muse/mcp.rb:131 — Mcp.handle_message has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 4, ternaries 3 (4 pts), error handling 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.
D2 · Cognitive Complexity · ResolveTerminalPaypalPayoutFailures.process (cognitive 16) · ×1
  • ResolveTerminalPaypalPayoutFailures.process (cognitive 16) app/services/onetime/resolve_terminal_paypal_payout_failures.rb:46 — ResolveTerminalPaypalPayoutFailures.process has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ConfirmService.perform (cognitive 16) · ×1
  • ConfirmService.perform (cognitive 16) app/services/order/confirm_service.rb:14 — ConfirmService.perform has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutoTopUpNegativeDestinationBalancesJob.valid_transfer_request? (cognitive 16) · ×1
  • AutoTopUpNegativeDestinationBalancesJob.valid_transfer_request? (cognitive 16) REDACTED:387 — AutoTopUpNegativeDestinationBalancesJob.valid_transfer_request? has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, 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.
D2 · Cognitive Complexity · SendPostBlastEmailsJob.perform (cognitive 16) · ×1
  • SendPostBlastEmailsJob.perform (cognitive 16) app/sidekiq/send_post_blast_emails_job.rb:27 — SendPostBlastEmailsJob.perform has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · PaymentElementInput.PaymentElementControllerInput (cognitive 16) · ×1
  • PaymentElementInput.PaymentElementControllerInput (cognitive 16) app/javascript/components/Checkout/PaymentElementInput.tsx:211 — PaymentElementInput.PaymentElementControllerInput has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10 (11 pts), boolean chains 3, if/else 2 (nesting depth added 1). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 283, 265, 270). 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.
D2 · Cognitive Complexity · PaymentForm.CustomerDetails (cognitive 16) · ×1
  • PaymentForm.CustomerDetails (cognitive 16) app/javascript/components/Checkout/PaymentForm.tsx:548 — PaymentForm.CustomerDetails has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 3, if/else 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 1 belongs to one function literal 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.
D2 · Cognitive Complexity · ExportPayoutsPopover.ExportPayoutsPopoverContent (cognitive 16) · ×1
  • ExportPayoutsPopover.ExportPayoutsPopoverContent (cognitive 16) app/javascript/components/Payouts/ExportPayoutsPopover.tsx:18 — ExportPayoutsPopover.ExportPayoutsPopoverContent has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (6 pts), boolean chains 5, if/else 3, error handling 2 (nesting depth added 1). Of this number, 10 points are the body's own statements and 6 belong to 5 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.
D2 · Cognitive Complexity · LookupLayout.LookupLayout · ×1
  • LookupLayout.LookupLayout::handleCardLookup (cognitive 16) app/javascript/components/Public/LookupLayout.tsx:53 — LookupLayout.LookupLayout::handleCardLookup has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, ternaries 3 (5 pts), if/else 4, error handling 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.
D2 · Cognitive Complexity · ContactSupportModal.ContactSupportForm (cognitive 16) · ×1
  • ContactSupportModal.ContactSupportForm (cognitive 16) app/javascript/components/Support/ContactSupportModal.tsx:85 — ContactSupportModal.ContactSupportForm has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, ternaries 4 (7 pts), error handling 1 (nesting depth added 3). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (addFiles, handleSubmit, handlePaste). 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.
D2 · Cognitive Complexity · Image.uploadImages (cognitive 16) · ×1
  • Image.uploadImages (cognitive 16) app/javascript/components/TiptapExtensions/Image.tsx:98 — Image.uploadImages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 2 (5 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (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 literal inside it that branches (line 113). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Link.LinkDialog (cognitive 16) · ×1
  • Link.LinkDialog (cognitive 16) app/javascript/components/TiptapExtensions/Link.tsx:29 — Link.LinkDialog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 5, boolean chains 4 (nesting depth added 1). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (onAddLink, a function literal at line 46, a function literal at line 38, …). 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.
D2 · Cognitive Complexity · WorkflowList.WorkflowList (cognitive 16) · ×1
  • WorkflowList.WorkflowList (cognitive 16) app/javascript/components/WorkflowsPage/WorkflowList.tsx:23 — WorkflowList.WorkflowList has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 1 (nesting depth added 7). Of this number, 12 points are the body's own statements and 4 belong to one function literal 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.
D2 · Cognitive Complexity · product_edit.scalarSettingsForSave (cognitive 16) · ×1
  • product_edit.scalarSettingsForSave (cognitive 16) app/javascript/data/product_edit.ts:532 — product_edit.scalarSettingsForSave has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 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.
D2 · Cognitive Complexity · Show.Show · ×1
  • Show.Show::handleFileUpload (cognitive 16) app/javascript/pages/Purchases/DisputeEvidence/Show.tsx:222 — Show.Show::handleFileUpload has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 5, error handling 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. This shape REPEATS in the file: one other method here (Show.Show) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · New.SubscriptionsMagicLink (cognitive 16) · ×1
  • New.SubscriptionsMagicLink (cognitive 16) app/javascript/pages/Subscriptions/MagicLinks/New.tsx:24 — New.SubscriptionsMagicLink has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10 (16 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×1
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: stripe_beneficial_owners_manager.rb → AccountDetailsSection.tsx, BeneficialOwnersSection.tsx, REDACTED app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb — `app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb` changes together with 3 other files — `app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx`, `app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx`, `app/javascript/pages/Settings/Payments/Show.tsx` — 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (41 shared lines) · ×1
  • Near-duplicate member pair (41 shared lines) app/controllers/api/internal/agent_messages_controller.rb:27 — app/controllers/api/internal/agent_messages_controller.rb:27-82 | app/controllers/api/mobile/agent_controller.rb:93-151 — These two members are variants of one another: 41 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) app/sidekiq/create_canada_monthly_sales_report_job.rb:17 — app/sidekiq/create_canada_monthly_sales_report_job.rb:17-170 | app/sidekiq/create_india_sales_report_job.rb:32-136 | app/sidekiq/create_us_state_monthly_sales_reports_job.rb:14-177 | app/sidekiq/create_us_states_sales_summary_report_job.rb:19-164 | app/sidekiq/generate_canada_sales_report_job.rb:10-140 | app/sidekiq/generate_fees_by_creator_location_report_job.rb:10-142 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Duplicated block (105–132 lines × 2) · ×1
  • Duplicated block (105–132 lines × 2) app/controllers/api/internal/agent_message_streams_controller.rb:50 — app/controllers/api/internal/agent_message_streams_controller.rb:50-181 | app/controllers/api/mobile/agent_streams_controller.rb:46-150 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/controllers/api/internal/agent_message_streams_controller.rb: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.
D4 · Code Duplication · Duplicated block (57 lines × 2) · ×1
  • Duplicated block (57 lines × 2) config/environments/production.rb:5 — config/environments/production.rb:5-61 | config/environments/staging.rb:5-61 — before extracting anything, compare `config/environments/production.rb` and `config/environments/staging.rb` as WHOLE FILES: 94% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (29–31 lines × 2) · ×1
  • Duplicated block (29–31 lines × 2) app/controllers/api/internal/agent_messages_controller.rb:91 — app/controllers/api/internal/agent_messages_controller.rb:91-119 | app/controllers/api/mobile/agent_controller.rb:160-190 — before extracting anything, compare `app/controllers/api/internal/agent_messages_controller.rb` and `app/controllers/api/mobile/agent_controller.rb` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (25–30 lines × 2) · ×1
  • Duplicated block (25–30 lines × 2) app/controllers/api/internal/agent_message_streams_controller.rb:203 — app/controllers/api/internal/agent_message_streams_controller.rb:203-232 | app/controllers/api/mobile/agent_streams_controller.rb:176-200 — 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 · Duplicated block (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) app/controllers/api/v2/links_controller.rb:116 — app/controllers/api/v2/links_controller.rb:116-145 | app/controllers/api/v2/links_controller.rb:346-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/controllers/api/v2/links_controller.rb:115` calls `render_response` and `app/controllers/api/v2/links_controller.rb:345` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (20–30 lines × 2) · ×1
  • Duplicated block (20–30 lines × 2) app/services/onetime/backfill_april_tax_remittances.rb:61 — app/services/onetime/backfill_april_tax_remittances.rb:61-90 | app/services/onetime/backfill_q2_2026_tax_remittances.rb:66-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/services/onetime/backfill_april_tax_remittances.rb:61` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) app/models/credit.rb:323 — app/models/credit.rb:323-350 | app/models/credit.rb:488-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/models/credit.rb:322` calls `get_usd_cents` and `app/models/credit.rb:487` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) app/controllers/api/internal/agent_messages_controller.rb:121 — app/controllers/api/internal/agent_messages_controller.rb:121-146 | app/controllers/api/mobile/agent_controller.rb:192-216 — before extracting anything, compare `app/controllers/api/internal/agent_messages_controller.rb` and `app/controllers/api/mobile/agent_controller.rb` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/controllers/api/internal/agent_messages_controller.rb:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/controllers/api/internal/agent_messages_controller.rb:154` calls `find` and `app/controllers/api/mobile/agent_controller.rb:217` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14–24 lines × 2) · ×1
  • Duplicated block (14–24 lines × 2) app/controllers/api/v2/links_controller.rb:53 — app/controllers/api/v2/links_controller.rb:53-66 | app/controllers/api/v2/product_reviews_controller.rb:24-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/controllers/api/v2/links_controller.rb:53` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) app/models/concerns/purchase/charge_events_handler.rb:237 — app/models/concerns/purchase/charge_events_handler.rb:237-260 | app/sidekiq/reconcile_client_confirmed_charge_job.rb:91-113 — 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 · Duplicated block (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) app/services/onetime/backfill_self_affiliate_dropped_proceeds.rb:260 — app/services/onetime/backfill_self_affiliate_dropped_proceeds.rb:260-281 | app/services/onetime/rebuilds_seller_settlement_amounts.rb:43-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) app/controllers/api/internal/agent_messages_controller.rb:27 — app/controllers/api/internal/agent_messages_controller.rb:27-47 | app/controllers/api/mobile/agent_controller.rb:93-113 — before extracting anything, compare `app/controllers/api/internal/agent_messages_controller.rb` and `app/controllers/api/mobile/agent_controller.rb` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) app/controllers/api/internal/agent_messages_controller.rb:155 — app/controllers/api/internal/agent_messages_controller.rb:155-170 | app/controllers/api/mobile/agent_controller.rb:217-235 — before extracting anything, compare `app/controllers/api/internal/agent_messages_controller.rb` and `app/controllers/api/mobile/agent_controller.rb` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/controllers/api/internal/agent_messages_controller.rb:154` calls `find` and `app/controllers/api/mobile/agent_controller.rb:216` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) app/services/post_resend_api.rb:225 — app/services/post_resend_api.rb:225-243 | app/services/post_sendgrid_api.rb:220-238 — before extracting anything, compare `app/services/post_resend_api.rb` and `app/services/post_sendgrid_api.rb` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) app/sidekiq/generate_canada_sales_report_job.rb:147 — app/sidekiq/generate_canada_sales_report_job.rb:147-164 | app/sidekiq/generate_canada_sales_report_job.rb:182-199 | app/sidekiq/generate_canada_sales_report_job.rb:226-243 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/sidekiq/generate_canada_sales_report_job.rb:147` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) app/services/post_resend_api.rb:190 — app/services/post_resend_api.rb:190-206 | app/services/post_sendgrid_api.rb:111-128 — before extracting anything, compare `app/services/post_resend_api.rb` and `app/services/post_sendgrid_api.rb` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×1
  • Duplicated block (17 lines × 4) app/models/credit.rb:144 — app/models/credit.rb:144-160 | app/models/credit.rb:204-220 | app/models/credit.rb:370-386 | app/models/credit.rb:465-481 — 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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) app/services/post_resend_api.rb:247 — app/services/post_resend_api.rb:247-263 | app/services/post_sendgrid_api.rb:242-258 — before extracting anything, compare `app/services/post_resend_api.rb` and `app/services/post_sendgrid_api.rb` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) config/initializers/mailer.rb:40 — config/initializers/mailer.rb:40-55 | config/initializers/mailer.rb:78-94 — both copies are in the same file, so extract the 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 `config/initializers/mailer.rb:40` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–16 lines × 3) · ×1
  • Duplicated block (10–16 lines × 3) config/domain.rb:12 — config/domain.rb:12-27 | config/domain.rb:29-44 | config/domain.rb:45-54 — 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 `config/domain.rb:45` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) REDACTED:1456 — REDACTED:1456-1470 | app/controllers/products/archived_controller.rb:57-71 | app/controllers/products/collabs_controller.rb:47-61 — 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.
D4 · Code Duplication · Duplicated block (14 lines × 6) · ×1
  • Duplicated block (14 lines × 6) app/sidekiq/create_canada_monthly_sales_report_job.rb:157 — app/sidekiq/create_canada_monthly_sales_report_job.rb:157-170 | app/sidekiq/create_india_sales_report_job.rb:123-136 | app/sidekiq/create_us_state_monthly_sales_reports_job.rb:164-177 | app/sidekiq/create_us_states_sales_summary_report_job.rb:151-164 | app/sidekiq/generate_canada_sales_report_job.rb:127-140 | app/sidekiq/generate_fees_by_creator_location_report_job.rb:129-142 — 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 6 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (12–13 lines × 4) · ×1
  • Duplicated block (12–13 lines × 4) config/routes.rb:997 — config/routes.rb:997-1008 | config/routes.rb:1435-1446 | config/routes.rb:1557-1568 | config/routes.rb:1593-1605 — 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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) REDACTED:3 — REDACTED:3-14 | db/seeds/030_development/mobile_oauth_application.rb:3-14 | db/seeds/030_staging/mobile_oauth_application.rb:3-14 — 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) app/services/order/confirm_service.rb:336 — app/services/order/confirm_service.rb:336-344 | app/services/order/confirm_service.rb:355-365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) app/services/creator_analytics/sales.rb:132 — app/services/creator_analytics/sales.rb:132-140 | app/services/seller_mobile_analytics_service.rb:29-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/services/creator_analytics/sales.rb:132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) app/services/risk/stranded_buyer_scan_service.rb:159 — app/services/risk/stranded_buyer_scan_service.rb:159-167 | app/sidekiq/alert_on_stale_blocks_holding_established_buyers_job.rb:534-541 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/services/risk/stranded_buyer_scan_service.rb: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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) lib/mailer_previews/post_resend_api_preview.rb:28 — lib/mailer_previews/post_resend_api_preview.rb:28-34 | lib/mailer_previews/post_resend_api_preview.rb:44-50 | lib/mailer_previews/post_sendgrid_api_preview.rb:28-34 | lib/mailer_previews/post_sendgrid_api_preview.rb:44-50 — before extracting anything, compare `lib/mailer_previews/post_resend_api_preview.rb` and `lib/mailer_previews/post_sendgrid_api_preview.rb` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) db/migrate/20240616210250_remove_sales_stats_tables.rb:61 — db/migrate/20240616210250_remove_sales_stats_tables.rb:61-65 | db/migrate/20240616210250_remove_sales_stats_tables.rb:146-150 | db/migrate/20240616210250_remove_sales_stats_tables.rb:236-240 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (4–5 lines × 6) · ×1
  • Duplicated block (4–5 lines × 6) db/migrate/20240616210250_remove_sales_stats_tables.rb:49 — db/migrate/20240616210250_remove_sales_stats_tables.rb:49-52 | db/migrate/20240616210250_remove_sales_stats_tables.rb:93-96 | db/migrate/20240616210250_remove_sales_stats_tables.rb:136-139 | db/migrate/20240616210250_remove_sales_stats_tables.rb:178-181 | db/migrate/20240616210250_remove_sales_stats_tables.rb:224-228 | db/migrate/20240616210250_remove_sales_stats_tables.rb:270-274 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (49 lines × 2) · ×1
  • Duplicated block (49 lines × 2) app/policies/installment_policy.rb:7 — app/policies/installment_policy.rb:7-72 | app/policies/workflow_policy.rb:7-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) db/seeds/010_development_staging_test/taxonomy_create.rb:63 — db/seeds/010_development_staging_test/taxonomy_create.rb:63-71 | db/seeds/010_development_staging_test/taxonomy_create.rb:74-83 | db/seeds/010_development_staging_test/taxonomy_create.rb:152-161 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6–9 lines × 10) · ×1
  • Duplicated block (6–9 lines × 10) db/seeds/010_development_staging_test/taxonomy_create.rb:25 — db/seeds/010_development_staging_test/taxonomy_create.rb:25-31 | db/seeds/010_development_staging_test/taxonomy_create.rb:107-113 | db/seeds/010_development_staging_test/taxonomy_create.rb:146-151 | db/seeds/010_development_staging_test/taxonomy_create.rb:172-177 | db/seeds/010_development_staging_test/taxonomy_create.rb:178-184 | db/seeds/010_development_staging_test/taxonomy_create.rb:200-205 | db/seeds/010_development_staging_test/taxonomy_create.rb:225-231 | db/seeds/010_development_staging_test/taxonomy_create.rb:233-239 | db/seeds/010_development_staging_test/taxonomy_create.rb:261-269 | db/seeds/010_development_staging_test/taxonomy_create.rb:304-310 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6 lines × 9) · ×1
  • Duplicated block (6 lines × 9) db/seeds/010_development_staging_test/taxonomy_create.rb:25 — db/seeds/010_development_staging_test/taxonomy_create.rb:25-30 | db/seeds/010_development_staging_test/taxonomy_create.rb:74-79 | db/seeds/010_development_staging_test/taxonomy_create.rb:107-112 | db/seeds/010_development_staging_test/taxonomy_create.rb:152-157 | db/seeds/010_development_staging_test/taxonomy_create.rb:178-183 | db/seeds/010_development_staging_test/taxonomy_create.rb:225-230 | db/seeds/010_development_staging_test/taxonomy_create.rb:233-238 | db/seeds/010_development_staging_test/taxonomy_create.rb:261-268 | db/seeds/010_development_staging_test/taxonomy_create.rb:304-309 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) db/seeds/010_development_staging_test/taxonomy_create.rb:62 — db/seeds/010_development_staging_test/taxonomy_create.rb:62-67 | db/seeds/010_development_staging_test/taxonomy_create.rb:145-150 | db/seeds/010_development_staging_test/taxonomy_create.rb:171-176 | db/seeds/010_development_staging_test/taxonomy_create.rb:199-204 — 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.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) db/seeds/010_development_staging_test/taxonomy_create.rb:84 — db/seeds/010_development_staging_test/taxonomy_create.rb:84-88 | db/seeds/010_development_staging_test/taxonomy_create.rb:97-101 | db/seeds/010_development_staging_test/taxonomy_create.rb:120-124 | db/seeds/010_development_staging_test/taxonomy_create.rb:134-138 | db/seeds/010_development_staging_test/taxonomy_create.rb:163-167 — 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.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the repository root runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
P5 · DR & Backup · No DR/backup evidence · ×1
  • No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
R10 · Code Duplication · Duplication concentrated across 26 sibling directories (69 clone groups) · ×1
  • Duplication concentrated across 26 sibling directories (69 clone groups) app/javascript/components/Download/RichContent.tsx:367 — 69 duplicated blocks under app/javascript/components/ have copies in at least two of the sibling directories Agent, Analytics, ApiDocumentation, Audience, BundleEdit, Checkout (+20 more sibling(s) not listed) — 35 of them are reported below, and 34 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 69 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 69 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 69 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 7 sibling directories (50 clone groups) · ×1
  • Duplication concentrated across 7 sibling directories (50 clone groups) app/javascript/entrypoints/mobile_tracking.ts:1 — 50 duplicated blocks under app/javascript/ have copies in at least two of the sibling directories components, data, entrypoints, packs, pages, parsers (+1 more sibling(s) not listed) — 26 of them are reported below, and 24 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 50 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 50 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 50 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 24 sibling directories (24 clone groups) · ×1
  • Duplication concentrated across 24 sibling directories (24 clone groups) app/javascript/pages/Collaborators/Index.tsx:77 — 24 duplicated blocks under app/javascript/pages/ have copies in at least two of the sibling directories Affiliates, Audience, Collaborators, Customers, Dashboard, Emails (+18 more sibling(s) not listed) — 12 of them are reported below, and 12 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 24 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 24 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 24 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 3 sibling directories (5 clone groups) · ×1
  • Duplication concentrated across 3 sibling directories (5 clone groups) app/javascript/pages/Bundles/Content/Edit.tsx:46 — 5 duplicated blocks under app/javascript/pages/Bundles/ have copies in at least two of the sibling directories Content, Product, Share — 1 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (176 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (176 matched lines × 2 locations) app/javascript/components/ProductEdit/ProductTab/DurationsEditor.tsx:22 — app/javascript/components/ProductEdit/ProductTab/DurationsEditor.tsx:22 · app/javascript/components/ProductEdit/ProductTab/VersionsEditor.tsx:23 — the two spans are one implementation copied and then locally edited — 1130 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 (174 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (174 matched lines × 2 locations) app/javascript/components/ProductEdit/ProductTab/TiersEditor.tsx:54 — app/javascript/components/ProductEdit/ProductTab/TiersEditor.tsx:54 · app/javascript/components/ProductEdit/ProductTab/VersionsEditor.tsx:34 — the two spans are one implementation copied and then locally edited — 1129 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 (151 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (151 matched lines × 2 locations) app/javascript/components/ProductsPage/MembershipsTable.tsx:27 — app/javascript/components/ProductsPage/MembershipsTable.tsx:27 · app/javascript/components/ProductsPage/ProductsTable.tsx:51 — the two spans are one implementation copied and then locally edited — 1010 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 (114 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (114 matched lines × 2 locations) app/javascript/pages/Affiliates/Edit.tsx:29 — app/javascript/pages/Affiliates/Edit.tsx:29 · app/javascript/pages/Affiliates/New.tsx:21 — the two spans are one implementation copied and then locally edited — 676 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 (90 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (90 matched lines × 2 locations) app/javascript/components/ProductsPage/Collabs/MembershipsTable.tsx:24 — app/javascript/components/ProductsPage/Collabs/MembershipsTable.tsx:24 · app/javascript/components/ProductsPage/Collabs/ProductsTable.tsx:24 — the two spans are one implementation copied and then locally edited — 657 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 (86 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (86 matched lines × 2 locations) app/javascript/components/Audience/CustomerDetailPage.tsx:1082 — app/javascript/components/Audience/CustomerDetailPage.tsx:1082 · app/javascript/components/Audience/CustomerDetailPage.tsx:1502 — the two spans are one implementation copied and then locally edited — 499 tokens are still identical, in the same order in both spans, 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 (77 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (77 matched lines × 2 locations) app/javascript/components/Profile/FollowForm.tsx:22 — app/javascript/components/Profile/FollowForm.tsx:22 · app/javascript/components/Profile/FollowUserForm.tsx:22 — the two spans are one implementation copied and then locally edited — 418 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 · Wholesale file copy (70 identical lines × 2 files) · ×1
  • Wholesale file copy (70 identical lines × 2 files) app/javascript/entrypoints/mobile_tracking.ts:1 — app/javascript/entrypoints/mobile_tracking.ts:1 · app/javascript/packs/mobile_tracking.ts:1 — these 2 files are line-for-line copies of one another — 70 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 (69 lines × 4 locations) · ×1
  • Duplicated block (69 lines × 4 locations) app/javascript/components/ApiDocumentation/Endpoints/Licenses.tsx:25 — app/javascript/components/ApiDocumentation/Endpoints/Licenses.tsx:25 · app/javascript/components/ApiDocumentation/Endpoints/Licenses.tsx:95 · app/javascript/components/ApiDocumentation/Endpoints/Licenses.tsx:165 · app/javascript/components/ApiDocumentation/Endpoints/Licenses.tsx:235 — all 4 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block with local edits (63 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (63 matched lines × 2 locations) app/javascript/pages/Collaborators/Index.tsx:77 — app/javascript/pages/Collaborators/Index.tsx:77 · app/javascript/pages/UtmLinks/Index.tsx:191 — the two spans are one implementation copied and then locally edited — 312 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 (60 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (60 matched lines × 2 locations) app/javascript/components/ProductEdit/ProductTab/CircleIntegrationEditor.tsx:96 — app/javascript/components/ProductEdit/ProductTab/CircleIntegrationEditor.tsx:96 · app/javascript/components/ProductEdit/ProductTab/DiscordIntegrationEditor.tsx:44 — the two spans are one implementation copied and then locally edited — 301 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 (55 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (55 matched lines × 2 locations) app/javascript/components/TiptapExtensions/LicenseKey.tsx:32 — app/javascript/components/TiptapExtensions/LicenseKey.tsx:32 · app/javascript/components/TiptapExtensions/Posts.tsx:34 — the two spans are one implementation copied and then locally edited — 302 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 (54 lines × 2 locations) · ×1
  • Duplicated block (54 lines × 2 locations) app/javascript/pages/Settings/Payments/Show.tsx:849 — app/javascript/pages/Settings/Payments/Show.tsx:849 · app/javascript/pages/Settings/Payments/Show.tsx:1082 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (49 lines × 2 locations) · ×1
  • Duplicated block (49 lines × 2 locations) app/javascript/pages/Emails/Drafts.tsx:96 — app/javascript/pages/Emails/Drafts.tsx:96 · app/javascript/pages/Emails/Scheduled.tsx:117 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block with local edits (47 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (47 matched lines × 2 locations) app/javascript/components/ConfirmBalanceForfeitOnPayoutMethodChangeModal.tsx:28 — app/javascript/components/ConfirmBalanceForfeitOnPayoutMethodChangeModal.tsx:28 · app/javascript/components/UpdateCountryConfirmationModal.tsx:16 — the two spans are one implementation copied and then locally edited — 241 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 (41 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (41 matched lines × 2 locations) app/javascript/pages/Wishlists/Following/Index.tsx:60 — app/javascript/pages/Wishlists/Following/Index.tsx:60 · app/javascript/pages/Wishlists/Index.tsx:76 — the two spans are one implementation copied and then locally edited — 256 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 (40 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (40 matched lines × 2 locations) app/javascript/components/CurrentSeller.ts:24 — app/javascript/components/CurrentSeller.ts:24 · app/javascript/components/LoggedInUser.ts:99 — the two spans are one implementation copied and then locally edited — 227 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 (38 lines × 2 locations) · ×1
  • Duplicated block (38 lines × 2 locations) app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:765 — app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:765 · app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:819 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (37 lines × 2 locations) · ×1
  • Duplicated block (37 lines × 2 locations) app/javascript/components/ApiDocumentation/Endpoints/Emails.tsx:118 — app/javascript/components/ApiDocumentation/Endpoints/Emails.tsx:118 · app/javascript/components/ApiDocumentation/Endpoints/Emails.tsx:336 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block with local edits (37 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (37 matched lines × 2 locations) app/javascript/pages/User/Passwords/Edit.tsx:24 — app/javascript/pages/User/Passwords/Edit.tsx:24 · app/javascript/pages/User/Passwords/New.tsx:29 — the two spans are one implementation copied and then locally edited — 222 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 (30 lines × 2 locations) · ×1
  • Duplicated block (30 lines × 2 locations) app/javascript/components/ProductsPage/Collabs/MembershipsTable.tsx:64 — app/javascript/components/ProductsPage/Collabs/MembershipsTable.tsx:64 · app/javascript/components/ProductsPage/MembershipsTable.tsx:100 — 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.
R10 · Code Duplication · Duplicated block with local edits (28 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (28 matched lines × 2 locations) app/javascript/components/DashboardPage.tsx:379 — app/javascript/components/DashboardPage.tsx:379 · app/javascript/components/ProductEdit/Layout.tsx:274 — the two spans are one implementation copied and then locally edited — 150 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 (27 lines × 4 locations) · ×1
  • Duplicated block (27 lines × 4 locations) app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:842 — app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:842 · app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:972 · app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:1002 · app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:1032 — all 4 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block with local edits (26 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (26 matched lines × 2 locations) app/javascript/pages/Checkout/Show.tsx:1213 — app/javascript/pages/Checkout/Show.tsx:1213 · app/javascript/pages/Checkout/Show.tsx:1262 — the two spans are one implementation copied and then locally edited — 94 tokens are still identical, in the same order in both spans, 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 (25 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (25 matched lines × 2 locations) app/javascript/components/Analytics/LocationsTable.tsx:102 — app/javascript/components/Analytics/LocationsTable.tsx:102 · app/javascript/components/Analytics/ReferrersTable.tsx:48 — the two spans are one implementation copied and then locally edited — 181 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 (25 lines × 2 locations) · ×1
  • Duplicated block (25 lines × 2 locations) app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:227 — app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:227 · app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (24 lines × 2 locations) · ×1
  • Duplicated block (24 lines × 2 locations) app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:782 — app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:782 · app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:876 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R11 · Import Boundaries · Boundary violation [package · ×1
  • Boundary violation [package:third-party-deep-import] app/javascript/types/epubjs-internals.d.ts:84 — app/javascript/types/epubjs-internals.d.ts:84 imports epubjs/src/utils/queue, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
R2 · Cyclomatic Complexity · Complex function BankAccountSection (cyclomatic 202, cognitive 200) · ×1
  • Complex function BankAccountSection (cyclomatic 202, cognitive 200) app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx:773 — BankAccountSection has cyclomatic complexity 202 and cognitive complexity 200; 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.
R2 · Cyclomatic Complexity · Complex function validateBankAccountFields (cyclomatic 180, cognitive 184) · ×1
  • Complex function validateBankAccountFields (cyclomatic 180, cognitive 184) app/javascript/pages/Settings/Payments/Show.tsx:532 — validateBankAccountFields has cyclomatic complexity 180 and cognitive complexity 184; 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.
R2 · Cyclomatic Complexity · Complex function applyCheckoutAction (cyclomatic 161, cognitive 244) · ×1
  • Complex function applyCheckoutAction (cyclomatic 161, cognitive 244) app/javascript/components/Checkout/payment.ts:1492 — applyCheckoutAction has cyclomatic complexity 161 and cognitive complexity 244; 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.
R2 · Cyclomatic Complexity · Complex function AccountDetailsSection (cyclomatic 154, cognitive 145) · ×1
  • Complex function AccountDetailsSection (cyclomatic 154, cognitive 145) app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:50 — AccountDetailsSection has cyclomatic complexity 154 and cognitive complexity 145; 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.
R2 · Cyclomatic Complexity · Complex function Product (cyclomatic 122, cognitive 109) · ×1
  • Complex function Product (cyclomatic 122, cognitive 109) REDACTED:297 — Product has cyclomatic complexity 122 and cognitive complexity 109; 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.
R2 · Cyclomatic Complexity · Complex function FileEmbedNodeView (cyclomatic 101, cognitive 93) · ×1
  • Complex function FileEmbedNodeView (cyclomatic 101, cognitive 93) app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:84 — FileEmbedNodeView has cyclomatic complexity 101 and cognitive complexity 93; 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.
R2 · Cyclomatic Complexity · Complex function validateComplianceInfoFields (cyclomatic 98, cognitive 126) · ×1
  • Complex function validateComplianceInfoFields (cyclomatic 98, cognitive 126) app/javascript/pages/Settings/Payments/Show.tsx:832 — validateComplianceInfoFields has cyclomatic complexity 98 and cognitive complexity 126; 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.
R2 · Cyclomatic Complexity · Complex function Checkout (cyclomatic 97, cognitive 89) · ×1
  • Complex function Checkout (cyclomatic 97, cognitive 89) app/javascript/components/Checkout/index.tsx:258 — Checkout has cyclomatic complexity 97 and cognitive complexity 89; 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.
R2 · Cyclomatic Complexity · Complex function EmailForm (cyclomatic 96, cognitive 91) · ×1
  • Complex function EmailForm (cyclomatic 96, cognitive 91) app/javascript/components/EmailsPage/EmailForm.tsx:221 — EmailForm has cyclomatic complexity 96 and cognitive complexity 91; 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.
R2 · Cyclomatic Complexity · Complex function CustomerDetailPage (cyclomatic 78, cognitive 70) · ×1
  • Complex function CustomerDetailPage (cyclomatic 78, cognitive 70) app/javascript/components/Audience/CustomerDetailPage.tsx:135 — CustomerDetailPage has cyclomatic complexity 78 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 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.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 76, cognitive 159) · ×1
  • Complex function (anonymous) (cyclomatic 76, cognitive 159) app/javascript/data/order.ts:162 — (anonymous) has cyclomatic complexity 76 and cognitive complexity 159; 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.
R2 · Cyclomatic Complexity · Complex function SubscriptionsManage (cyclomatic 74, cognitive 66) · ×1
  • Complex function SubscriptionsManage (cyclomatic 74, cognitive 66) app/javascript/pages/Subscriptions/Manage.tsx:117 — SubscriptionsManage has cyclomatic complexity 74 and cognitive complexity 66; 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.
R2 · Cyclomatic Complexity · Complex function Form (cyclomatic 69, cognitive 64) · ×1
  • Complex function Form (cyclomatic 69, cognitive 64) app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:894 — Form has cyclomatic complexity 69 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 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.
R2 · Cyclomatic Complexity · Complex function FileRow (cyclomatic 54, cognitive 52) · ×1
  • Complex function FileRow (cyclomatic 54, cognitive 52) app/javascript/components/Download/FileList.tsx:169 — FileRow has cyclomatic complexity 54 and cognitive complexity 52; 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.
R2 · Cyclomatic Complexity · Complex function PaymentsPage (cyclomatic 54, cognitive 50) · ×1
  • Complex function PaymentsPage (cyclomatic 54, cognitive 50) app/javascript/pages/Settings/Payments/Show.tsx:259 — PaymentsPage has cyclomatic complexity 54 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 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.
R2 · Cyclomatic Complexity · Complex function applyCanonicalIds (cyclomatic 52, cognitive 68) · ×1
  • Complex function applyCanonicalIds (cyclomatic 52, cognitive 68) app/javascript/components/server-components/ProductEditPage.tsx:293 — applyCanonicalIds has cyclomatic complexity 52 and cognitive complexity 68; 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.
R2 · Cyclomatic Complexity · Complex function pay (cyclomatic 49, cognitive 60) · ×1
  • Complex function pay (cyclomatic 49, cognitive 60) app/javascript/pages/Checkout/Show.tsx:540 — pay has cyclomatic complexity 49 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.
R2 · Cyclomatic Complexity · Complex function Form (cyclomatic 49, cognitive 48) · ×1
  • Complex function Form (cyclomatic 49, cognitive 48) app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:523 — Form has cyclomatic complexity 49 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 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.
R2 · Cyclomatic Complexity · Complex function handleSubmit (cyclomatic 49, cognitive 44) · ×1
  • Complex function handleSubmit (cyclomatic 49, cognitive 44) app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:1089 — handleSubmit has cyclomatic complexity 49 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 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.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 48, cognitive 48) · ×1
  • Complex function (anonymous) (cyclomatic 48, cognitive 48) app/javascript/components/Checkout/PaymentForm.tsx:902 — (anonymous) has cyclomatic complexity 48 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.
R3 · Large Files · app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx · ×1
  • app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx: 2645 lines of code app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx:1 — app/javascript/components/Settings/PaymentsPage/BankAccountSection.tsx has 2645 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 · app/javascript/components/Audience/CustomerDetailPage.tsx · ×1
  • app/javascript/components/Audience/CustomerDetailPage.tsx: 2344 lines of code app/javascript/components/Audience/CustomerDetailPage.tsx:1 — app/javascript/components/Audience/CustomerDetailPage.tsx has 2344 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 · app/javascript/components/Checkout/payment.ts · ×1
  • app/javascript/components/Checkout/payment.ts: 2024 lines of code app/javascript/components/Checkout/payment.ts:1 — app/javascript/components/Checkout/payment.ts has 2024 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 · app/javascript/components/Checkout/PaymentForm.tsx · ×1
  • app/javascript/components/Checkout/PaymentForm.tsx: 2006 lines of code app/javascript/components/Checkout/PaymentForm.tsx:1 — app/javascript/components/Checkout/PaymentForm.tsx has 2006 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 · app/javascript/pages/Settings/Payments/Show.tsx · ×1
  • app/javascript/pages/Settings/Payments/Show.tsx: 1684 lines of code app/javascript/pages/Settings/Payments/Show.tsx:1 — app/javascript/pages/Settings/Payments/Show.tsx has 1684 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 · app/javascript/components/CheckoutDashboard/DiscountsPage.tsx · ×1
  • app/javascript/components/CheckoutDashboard/DiscountsPage.tsx: 1654 lines of code app/javascript/components/CheckoutDashboard/DiscountsPage.tsx:1 — app/javascript/components/CheckoutDashboard/DiscountsPage.tsx has 1654 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 · app/javascript/components/ProductEdit/ContentTab/index.tsx · ×1
  • app/javascript/components/ProductEdit/ContentTab/index.tsx: 1631 lines of code app/javascript/components/ProductEdit/ContentTab/index.tsx:1 — app/javascript/components/ProductEdit/ContentTab/index.tsx has 1631 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 · app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx · ×1
  • app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx: 1364 lines of code app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx:1 — app/javascript/components/Settings/PaymentsPage/BeneficialOwnersSection.tsx has 1364 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 · app/javascript/components/EmailsPage/EmailForm.tsx · ×1
  • app/javascript/components/EmailsPage/EmailForm.tsx: 1322 lines of code app/javascript/components/EmailsPage/EmailForm.tsx:1 — app/javascript/components/EmailsPage/EmailForm.tsx has 1322 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 · app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx · ×1
  • app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx: 1317 lines of code app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx:1 — app/javascript/components/Settings/PaymentsPage/AccountDetailsSection.tsx has 1317 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 · app/javascript/components/Checkout/index.tsx · ×1
  • app/javascript/components/Checkout/index.tsx: 1277 lines of code app/javascript/components/Checkout/index.tsx:1 — app/javascript/components/Checkout/index.tsx has 1277 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 · REDACTED · ×1
  • REDACTED: 1266 lines of code REDACTED:1 — REDACTED has 1266 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 · app/javascript/pages/Checkout/Show.tsx · ×1
  • app/javascript/pages/Checkout/Show.tsx: 1257 lines of code app/javascript/pages/Checkout/Show.tsx:1 — app/javascript/pages/Checkout/Show.tsx has 1257 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 · app/javascript/components/Agent/AgentChat.tsx · ×1
  • app/javascript/components/Agent/AgentChat.tsx: 1198 lines of code app/javascript/components/Agent/AgentChat.tsx:1 — app/javascript/components/Agent/AgentChat.tsx has 1198 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 · app/javascript/components/server-components/ProductEditPage.tsx · ×1
  • app/javascript/components/server-components/ProductEditPage.tsx: 1155 lines of code app/javascript/components/server-components/ProductEditPage.tsx:1 — app/javascript/components/server-components/ProductEditPage.tsx has 1155 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 · app/javascript/components/Product/ConfigurationSelector.tsx · ×1
  • app/javascript/components/Product/ConfigurationSelector.tsx: 1028 lines of code app/javascript/components/Product/ConfigurationSelector.tsx:1 — app/javascript/components/Product/ConfigurationSelector.tsx has 1028 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 · app/javascript/components/CheckoutDashboard/UpsellsPage.tsx · ×1
  • app/javascript/components/CheckoutDashboard/UpsellsPage.tsx: 989 lines of code app/javascript/components/CheckoutDashboard/UpsellsPage.tsx:1 — app/javascript/components/CheckoutDashboard/UpsellsPage.tsx has 989 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 · app/javascript/components/ApiDocumentation/responseFieldDefinitions.ts · ×1
  • app/javascript/components/ApiDocumentation/responseFieldDefinitions.ts: 975 lines of code app/javascript/components/ApiDocumentation/responseFieldDefinitions.ts:1 — app/javascript/components/ApiDocumentation/responseFieldDefinitions.ts has 975 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 · app/javascript/components/Profile/SectionsForm.tsx · ×1
  • app/javascript/components/Profile/SectionsForm.tsx: 952 lines of code app/javascript/components/Profile/SectionsForm.tsx:1 — app/javascript/components/Profile/SectionsForm.tsx has 952 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 · app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx · ×1
  • app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx: 942 lines of code app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:1 — app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx has 942 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 · app/javascript/pages/UrlRedirects/Read.tsx · ×1
  • app/javascript/pages/UrlRedirects/Read.tsx: 900 lines of code app/javascript/pages/UrlRedirects/Read.tsx:1 — app/javascript/pages/UrlRedirects/Read.tsx has 900 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 · app/javascript/pages/Payouts/Index.tsx · ×1
  • app/javascript/pages/Payouts/Index.tsx: 851 lines of code app/javascript/pages/Payouts/Index.tsx:1 — app/javascript/pages/Payouts/Index.tsx has 851 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 · app/javascript/components/Download/FileList.tsx · ×1
  • app/javascript/components/Download/FileList.tsx: 849 lines of code app/javascript/components/Download/FileList.tsx:1 — app/javascript/components/Download/FileList.tsx has 849 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 · app/javascript/data/order.ts · ×1
  • app/javascript/data/order.ts: 848 lines of code app/javascript/data/order.ts:1 — app/javascript/data/order.ts has 848 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 · app/javascript/components/RichTextEditor.tsx · ×1
  • app/javascript/components/RichTextEditor.tsx: 799 lines of code app/javascript/components/RichTextEditor.tsx:1 — app/javascript/components/RichTextEditor.tsx has 799 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 · app/javascript/components/ApiDocumentation/Endpoints/Products.tsx · ×1
  • app/javascript/components/ApiDocumentation/Endpoints/Products.tsx: 787 lines of code app/javascript/components/ApiDocumentation/Endpoints/Products.tsx:1 — app/javascript/components/ApiDocumentation/Endpoints/Products.tsx has 787 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 · app/javascript/components/Profile/EditSections.tsx · ×1
  • app/javascript/components/Profile/EditSections.tsx: 765 lines of code app/javascript/components/Profile/EditSections.tsx:1 — app/javascript/components/Profile/EditSections.tsx has 765 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 · app/javascript/components/WorkflowsPage/WorkflowEmails.tsx · ×1
  • app/javascript/components/WorkflowsPage/WorkflowEmails.tsx: 756 lines of code app/javascript/components/WorkflowsPage/WorkflowEmails.tsx:1 — app/javascript/components/WorkflowsPage/WorkflowEmails.tsx has 756 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 · app/javascript/pages/Communities/Index.tsx · ×1
  • app/javascript/pages/Communities/Index.tsx: 751 lines of code app/javascript/pages/Communities/Index.tsx:1 — app/javascript/pages/Communities/Index.tsx has 751 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 · app/javascript/data/product_edit.ts · ×1
  • app/javascript/data/product_edit.ts: 689 lines of code app/javascript/data/product_edit.ts:1 — app/javascript/data/product_edit.ts has 689 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 · app/javascript/pages/Settings/Profile/Show.tsx · ×1
  • app/javascript/pages/Settings/Profile/Show.tsx: 670 lines of code app/javascript/pages/Settings/Profile/Show.tsx:1 — app/javascript/pages/Settings/Profile/Show.tsx has 670 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 · app/javascript/components/WorkflowsPage/WorkflowForm.tsx · ×1
  • app/javascript/components/WorkflowsPage/WorkflowForm.tsx: 660 lines of code app/javascript/components/WorkflowsPage/WorkflowForm.tsx:1 — app/javascript/components/WorkflowsPage/WorkflowForm.tsx has 660 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 · app/javascript/pages/Settings/Main/Show.tsx · ×1
  • app/javascript/pages/Settings/Main/Show.tsx: 655 lines of code app/javascript/pages/Settings/Main/Show.tsx:1 — app/javascript/pages/Settings/Main/Show.tsx has 655 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 · app/javascript/utils/mimetypes.ts · ×1
  • app/javascript/utils/mimetypes.ts: 632 lines of code app/javascript/utils/mimetypes.ts:1 — app/javascript/utils/mimetypes.ts has 632 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 · app/javascript/components/Audience/CustomersPage.tsx · ×1
  • app/javascript/components/Audience/CustomersPage.tsx: 629 lines of code app/javascript/components/Audience/CustomersPage.tsx:1 — app/javascript/components/Audience/CustomersPage.tsx has 629 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 · app/javascript/pages/Library/Index.tsx · ×1
  • app/javascript/pages/Library/Index.tsx: 584 lines of code app/javascript/pages/Library/Index.tsx:1 — app/javascript/pages/Library/Index.tsx has 584 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 · app/javascript/pages/Products/New.tsx · ×1
  • app/javascript/pages/Products/New.tsx: 572 lines of code app/javascript/pages/Products/New.tsx:1 — app/javascript/pages/Products/New.tsx has 572 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 · app/javascript/pages/Discover/Index.tsx · ×1
  • app/javascript/pages/Discover/Index.tsx: 541 lines of code app/javascript/pages/Discover/Index.tsx:1 — app/javascript/pages/Discover/Index.tsx has 541 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 · app/javascript/pages/Purchases/DisputeEvidence/Show.tsx · ×1
  • app/javascript/pages/Purchases/DisputeEvidence/Show.tsx: 536 lines of code app/javascript/pages/Purchases/DisputeEvidence/Show.tsx:1 — app/javascript/pages/Purchases/DisputeEvidence/Show.tsx has 536 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 · app/javascript/components/ProductEdit/ProductTab/TiersEditor.tsx · ×1
  • app/javascript/components/ProductEdit/ProductTab/TiersEditor.tsx: 533 lines of code app/javascript/components/ProductEdit/ProductTab/TiersEditor.tsx:1 — app/javascript/components/ProductEdit/ProductTab/TiersEditor.tsx has 533 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R5 · Dependency Freshness · Dependency Freshness · ×1
  • Dependency Freshness — 75 outdated package(s); JS/npm CVEs scored in D30
R7 · Dead Code · Dead file (~188 LoC) · ×1
  • Dead file (~188 LoC) app/javascript/hooks/useLazyFetch.ts — no import path from any entry point (7 application, 18 tooling, 265 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
R7 · Dead Code · Dead file (~95 LoC) · ×1
  • Dead file (~95 LoC) app/javascript/entrypoints/custom_html_analytics.ts — no import path from any entry point (7 application, 18 tooling, 265 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
R7 · Dead Code · Dead file (~38 LoC) · ×1
  • Dead file (~38 LoC) scripts/mcp-review-video.mjs — no import path from any entry point (7 application, 18 tooling, 265 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
R7 · Dead Code · Dead file (~22 LoC) · ×1
  • Dead file (~22 LoC) app/javascript/components/useIsIntersecting.ts — no import path from any entry point (7 application, 18 tooling, 265 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
R7 · Dead Code · Dead file (~9 LoC) · ×1
  • Dead file (~9 LoC) app/javascript/types/domain_settings.ts — no import path from any entry point (7 application, 18 tooling, 265 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
R7 · Dead Code · Dead file (~2 LoC) · ×1
  • Dead file (~2 LoC) app/javascript/entrypoints/overlay.ts — no import path from any entry point (7 application, 18 tooling, 265 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
S1 · Web-Security Posture · Third-party script without Subresource Integrity · ×1
  • Third-party script without Subresource Integrity app/views/shared/_load_dropbox_dropins_js.html.erb:2 — `https://www.dropbox.com/static/api/2/dropins.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. 8 such include(s) across the repository's markup.
X2 · Cancellation propagation · Async function without AbortSignal · ×1
  • Async function without AbortSignal: fetchWithOneRetry app/javascript/utils/lazy_chunk.ts:8 — `fetchWithOneRetry` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
X3 · Exception handling · Swallowed exception (empty catch) · ×1
  • Swallowed exception (empty catch) config/vite/stale-module-guard.ts:61 — 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.
Minor — 179 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×42
  • Orphaned file app/javascript/components/ApiDocumentation/Endpoints/Payouts.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/components/icons/getting-started/FirstSaleIcon.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/components/ProductEdit/ProductTab/PriceChecker/DistributionChart.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/models/concerns/attribute_blockable.rb:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/services/ai/product_details_generator_service.rb:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/components/ApiDocumentation/Endpoints/ResourceSubscriptions.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/components/icons/getting-started/CustomizeProfileIcon.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/components/ProductEdit/ProductTab/PriceChecker/index.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/components/ReviewForm/ReviewVideoRecorderClientOnly.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/pages/Collaborators/Incomings/Index.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/components/icons/getting-started/FirstPayoutIcon.tsx: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 REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/components/icons/getting-started/FirstFollowerIcon.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/pages/Emails/Scheduled.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/components/icons/getting-started/FirstProductIcon.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/components/icons/getting-started/EmailBlastIcon.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/components/Settings/AdvancedPage/ProductLevelSupportEmailsForm.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/pages/Emails/Drafts.tsx: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 REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/components/icons/getting-started/MakeAccountIcon.tsx: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 REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/hooks/useLazyFetch.ts:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/javascript/components/ApiDocumentation/Endpoints/CustomFields.tsx: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 REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file app/controllers/utm_links_controller.rb: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.
  • + 17 more in this group — see findings.md.
D10 · Test Quality · Mock-dominated test · ×38
  • Mock-dominated test: reports an authorization exchange failure once app/javascript/utils/oauth.test.ts:55 — This test sets up 5 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: forwards begin_checkout to TikTok and Google, not Facebook app/javascript/utils/user_analytics.test.ts:56 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: stops polling from the URL clock when sessionStorage is unavailable app/javascript/pages/Checkout/Returns/Pending.test.tsx:94 — This test sets up 4 test doubles (for example `vi.spyOn`) against 2 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: scrolls the disclosure to the top of the nav so the new rows are on screen app/javascript/components/client-components/Nav/index.test.tsx:292 — This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: scrolls without animation when the user prefers reduced motion app/javascript/components/client-components/Nav/index.test.tsx:324 — This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: puts the date the publish recorded into the editor state app/javascript/components/ProductEdit/Layout.test.tsx:305 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: commits a units-only edit without waiting for a mouse event app/javascript/components/ProductEdit/ProductTab/CallLimitationsEditor.test.tsx:50 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: saves the selected code as the membership's default offer code app/javascript/components/ProductEdit/ProductTab/index.test.tsx:296 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: tells the config which file was cancelled when the seller cancels an in-progress upload app/javascript/components/ProductEdit/ContentTab/FileEmbed.test.tsx:178 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: replies with a settled failure when the request fails, so the page never hangs app/javascript/components/Pages/CustomHtmlPreview.test.tsx:131 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: replies with a failure when the endpoint answers success: false app/javascript/components/Pages/CustomHtmlPreview.test.tsx:145 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: drops a reply carrying a different document's token app/javascript/components/Pages/CustomHtmlPreview.test.tsx:168 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: still replies normally when no reload happened before the request settled app/javascript/components/Pages/CustomHtmlPreview.test.tsx:192 — This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: uses loaded metadata in the original throttled callback when content length is missing app/javascript/components/DownloadPage/AudioPlayerContainer.test.tsx:21 — This test sets up 5 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: embedded row restores %s seconds / saved %s to %s app/javascript/components/Download/MediaResume.test.tsx:215 — This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: reuses a mounted row with a newer native saved position of %s app/javascript/components/Download/MediaResume.test.tsx:237 — This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: shows an error and resets checkout when the post-wallet security check rejects unexpectedly app/javascript/components/Checkout/PaymentForm.test.tsx:272 — This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: converts the merged cart it is handed, not the cart still on the page app/javascript/components/Checkout/buyerCurrencyQuoteRecovery.test.ts:367 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: adopts the configuration and does nothing further when the save delivered one app/javascript/components/Checkout/checkoutPaymentRefresh.test.ts:21 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: does not adopt before the save finishes app/javascript/components/Checkout/checkoutPaymentRefresh.test.ts:36 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: does not adopt a configuration from a save a newer edit displaced app/javascript/components/Checkout/checkoutPaymentRefresh.test.ts:53 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: does not adopt a configuration from a cancelled save that had answered app/javascript/components/Checkout/checkoutPaymentRefresh.test.ts:71 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: does not adopt the configuration the server sent back with a rejected edit app/javascript/components/Checkout/checkoutPaymentRefresh.test.ts:86 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: re-issues the save when the response is lost entirely app/javascript/components/Checkout/checkoutPaymentRefresh.test.ts:105 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: re-issues the save when the response came back without a configuration app/javascript/components/Checkout/checkoutPaymentRefresh.test.ts:125 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • + 13 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate app/javascript/pages/Pages/Edit.tsx:123 — `!isDirtyRef.current || visit.method !== "get"` appears character-identically in 2 files — app/javascript/pages/Pages/Edit.tsx, app/javascript/pages/Settings/Profile/Show.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/pages/Logins/New.tsx:106 — `!optionsResponse.ok || !optionsResult.success || !optionsResult.options` appears character-identically in 2 files — app/javascript/pages/Logins/New.tsx, app/javascript/utils/passkeyRegistration.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 app/javascript/components/Settings/AdvancedPage/ApplicationsSection.tsx:64 — `application.icon_url || placeholderAppIcon` appears character-identically in 2 files — app/javascript/components/Settings/AdvancedPage/ApplicationsSection.tsx, app/javascript/pages/Settings/AuthorizedApplications/Index.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/components/Profile/FollowForm.tsx:100 — `buttonLabel && buttonLabel !== "Subscribe"` appears character-identically in 2 files — app/javascript/components/Profile/FollowForm.tsx, app/javascript/components/Profile/FollowUserForm.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/components/Checkout/index.tsx:464 — `buyerCurrencyDisplay || !canUseStripePaymentElementClientConfirm(state) || !directListedCurrencySelected` appears character-identically in 2 files — app/javascript/components/Checkout/index.tsx, app/javascript/pages/Checkout/Show.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/data/facebook_pixel.ts:35 — `config.trackFreeSales || data.value !== 0` appears character-identically in 2 files — app/javascript/data/facebook_pixel.ts, app/javascript/data/tiktok_pixel.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 app/javascript/components/Checkout/index.tsx:424 — `configuredDirectListedCurrency || recurringUpiRegistration || !canDisplayBuyerCurrencyQuote(state)` appears character-identically in 2 files — app/javascript/components/Checkout/index.tsx, app/javascript/pages/Checkout/Show.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/components/BundleEdit/Layout.tsx:110 — `currentSeller?.profileFont && currentSeller.profileFont !== "ABC Favorit"` appears character-identically in 2 files — app/javascript/components/BundleEdit/Layout.tsx, app/javascript/components/ProductEdit/Layout.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/pages/Affiliates/Edit.tsx:85 — `data.affiliate.apply_to_all_products && (!data.affiliate.fee_percent || data.affiliate.fee_percent < 1 || data.affiliate.fee_percent > 75)` appears character-identically in 2 files — app/javascript/pages/Affiliates/Edit.tsx, app/javascript/pages/Affiliates/New.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/pages/Affiliates/Edit.tsx:109 — `data.affiliate.destination_url && data.affiliate.destination_url !== "" && !isUrlValid(data.affiliate.destination_url)` appears character-identically in 2 files — app/javascript/pages/Affiliates/Edit.tsx, app/javascript/pages/Affiliates/New.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/components/Product/Covers/Embed.tsx:52 — `dimensions == null || dimensions.width > DEFAULT_IMAGE_WIDTH` appears character-identically in 3 files — app/javascript/components/Product/Covers/Embed.tsx, app/javascript/components/Product/Covers/Image.tsx, app/javascript/components/Product/Covers/Video.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/components/Checkout/cartState.ts:261 — `discount.type === "fixed" && discount.once_per_cart` appears character-identically in 2 files — app/javascript/components/Checkout/cartState.ts, app/javascript/components/Product/ConfigurationSelector.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/components/PasskeySetupPrompt.tsx:51 — `e instanceof DOMException && (e.name === "NotAllowedError" || e.name === "AbortError")` appears character-identically in 3 files — app/javascript/components/PasskeySetupPrompt.tsx, app/javascript/components/Settings/PasswordPage/PasskeysSection.tsx, app/javascript/pages/Logins/New.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/data/affiliated_products.ts:18 — `e instanceof DOMException && e.name === "AbortError"` appears character-identically in 2 files — app/javascript/data/affiliated_products.ts, app/javascript/utils/request.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 app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx:253 — `editor.state.selection instanceof NodeSelection && editor.state.selection.node === node` appears character-identically in 2 files — app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx, app/javascript/components/TiptapExtensions/PublicFileEmbed.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/components/BundleEdit/Layout.tsx:83 — `f.status?.type === "unsaved" && f.status.uploadStatus.type === "uploading"` appears character-identically in 2 files — app/javascript/components/BundleEdit/Layout.tsx, app/javascript/components/ProductEdit/Layout.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/components/EmailAttachments.tsx:84 — `file.status.type === "unsaved" && file.status.uploadStatus.type === "uploading"` appears character-identically in 3 files — app/javascript/components/EmailAttachments.tsx, app/javascript/components/ProductEdit/ContentTab/FileEmbed.tsx, app/javascript/components/ProductEdit/Layout.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/components/ProductEdit/ProductTab/DescriptionEditor.tsx:233 — `file?.status?.type === "unsaved" && file.status.uploadStatus.type === "uploading"` appears character-identically in 2 files — app/javascript/components/ProductEdit/ProductTab/DescriptionEditor.tsx, app/javascript/components/TiptapExtensions/PublicFileEmbed.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/components/ProductEdit/ContentTab/index.tsx:1012 — `fileListMatchesPickedFiles(input.files, picked) && canResetFileInputAfterSnapshot(picked, files)` appears character-identically in 3 files — app/javascript/components/ProductEdit/ContentTab/index.tsx, app/javascript/components/TiptapExtensions/Image.tsx, app/javascript/components/TiptapExtensions/PublicFileEmbed.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/components/AffiliatedPage.tsx:168 — `isLoading && "pointer-events-none opacity-50"` appears character-identically in 9 files — app/javascript/components/AffiliatedPage.tsx, app/javascript/components/Audience/CustomersPage.tsx, app/javascript/components/CheckoutDashboard/DiscountsPage.tsx, app/javascript/components/CheckoutDashboard/UpsellsPage.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/pages/Affiliates/Index.tsx:360 — `isNavigating && "pointer-events-none opacity-50"` appears character-identically in 2 files — app/javascript/pages/Affiliates/Index.tsx, app/javascript/pages/UtmLinks/Index.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/data/marketing_actions.ts:60 — `isRecord(json) && json.success === false && isString(json.error)` appears character-identically in 2 files — app/javascript/data/marketing_actions.ts, app/javascript/data/marketing_cart_recovery.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 app/javascript/components/Checkout/index.tsx:1305 — `item.pay_in_installments && item.product.installment_plan` appears character-identically in 2 files — app/javascript/components/Checkout/index.tsx, app/javascript/pages/Checkout/Show.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/components/CollabsPage.tsx:56 — `memberships.length === 0 && products.length === 0` appears character-identically in 2 files — app/javascript/components/CollabsPage.tsx, app/javascript/pages/Products/Index.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/javascript/pages/Affiliates/Edit.tsx:101 — `p.enabled && (!p.fee_percent || p.fee_percent < 1 || p.fee_percent > 75)` appears character-identically in 2 files — app/javascript/pages/Affiliates/Edit.tsx, app/javascript/pages/Affiliates/New.tsx. 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.
D30 · Dependency Vulnerabilities · Low CVE · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R7 · Dead Code · Unused export 'default' · ×6
  • Unused export 'default' app/javascript/components/ConfirmBalanceForfeitOnPayoutMethodChangeModal.tsx:112 — Nothing imports this binding — it is safe to review for removal.
  • Unused export 'default' app/javascript/components/CountrySelectionModal.tsx:125 — Nothing imports this binding — it is safe to review for removal.
  • Unused export 'default' app/javascript/components/PayoutPage/CreditCard.tsx:35 — Nothing imports this binding — it is safe to review for removal.
  • Unused export 'default' app/javascript/components/Settings/AdvancedPage/CreditCardForm.tsx:76 — Nothing imports this binding — it is safe to review for removal.
  • Unused export 'default' app/javascript/components/UpdateCountryConfirmationModal.tsx:73 — Nothing imports this binding — it is safe to review for removal.
  • Unused export 'default' app/javascript/components/Wishlist/index.tsx:320 — Nothing imports this binding — it is safe to review for removal.
X7 · Silent fallback defaults · Silent fallback default in rescue · ×6
  • Silent fallback default in rescue app/services/product/save_contract.rb:189 — `deleted_ids` rescues every error into `[]` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the rescue or above the method, and the row stops firing.
  • Silent fallback default in rescue app/services/product/save_contract.rb:205 — `raw_deleted_ids` rescues every error into `[]` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the rescue or above the method, and the row stops firing.
  • Silent fallback default in rescue app/services/product/save_contract.rb:223 — `variant_deleted_ids` rescues every error into `[]` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the rescue or above the method, and the row stops firing.
  • Silent fallback default in rescue app/services/product/save_contract.rb:243 — `raw_variant_deleted_ids` rescues every error into `[]` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the rescue or above the method, and the row stops firing.
  • Silent fallback default in rescue app/services/product/save_contract.rb:262 — `variant_deletion_owner_ids` rescues every error into `[]` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the rescue or above the method, and the row stops firing.
  • Silent fallback default in rescue app/services/product/save_contract.rb:354 — `deletion_operations` rescues every error into `{}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the rescue or above the method, and the row stops firing.
X7 · Silent fallback defaults · Silent fallback default in catch · ×5
  • Silent fallback default in catch app/javascript/components/ProductEdit/ContentTab/EpubNudge.tsx:19 — `EpubNudge` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch app/javascript/components/RichTextEditor.tsx:226 — `validateUrl` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch app/javascript/components/Support/ContactSupportModal.tsx:36 — `readDraft` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch app/javascript/pages/Discover/Index.tsx:356 — `DiscoverIndex` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch app/javascript/utils/widgetCodeToCopyBuilders.ts:33 — `permalinkFromProductUrl` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×4
  • Hand-rolled JSON/XML parsing via regex app/services/community_chat_recap_generator_service.rb:129 — 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 Ruby code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex app/services/community_chat_recap_generator_service.rb:158 — 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 Ruby code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:191 — 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 Ruby code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:206 — 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 Ruby code already uses a real parser in the same package; use it here too.
D16 · Bus Factor · Off-boarding risk · ×3
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 193 significant file(s) lose their only recent owner: app/services/checkout/buyer_currency_quote.rb, app/services/checkout/buyer_currency_eligibility.rb, app/sidekiq/alert_on_stale_blocks_holding_established_buyers_job.rb, app/controllers/customer_surcharge_controller.rb, app/business/payments/merchant_registration/implementations/stripe/stripe_guardian_manager.rb, app/services/content_moderation/moderate_record_service.rb, app/mailers/customer_mailer.rb, app/services/charge/create_service.rb (+185 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 21 significant file(s) lose their only recent owner: app/services/onetime/triage_unlinked_stripe_bank_accounts.rb, app/controllers/stripe/setup_intents_controller.rb, app/javascript/components/ApiDocumentation/Endpoints/Workflows.tsx, app/javascript/components/Settings/PasswordPage/PasskeysSection.tsx, app/models/workflow.rb, app/models/product_affiliate.rb, app/services/workflow/save_installments_service.rb, app/services/onetime/pause_indian_card_mandate_renewals.rb (+13 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 3 significant file(s) lose their only recent owner: app/services/onetime/restore_partial_paypal_dispute_access.rb, app/services/onetime/backfill_inventory_counter_cache.rb, app/services/onetime/restore_stranded_paypal_reversal_balances.rb. Pair on, review, or document these before any departure.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
IC1 · Incompleteness & stubs · Disabled test · ×3
  • Disabled test spec/config/test_redis_isolation_spec.rb:81 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test spec/requests/products/collabs_spec.rb:138 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test spec/requests/products/collabs_spec.rb:159 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×2
  • Silent fallback default on parse failure app/models/refund_policy.rb:138 — `parse_no_refunds_classification` answers `true` when `ParserError | KeyError | TypeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the rescue or above the method, and the row stops firing.
  • Silent fallback default on parse failure app/services/low_balance_probation_recovery.rb:299 — `risk_state_change` answers `[]` when `ParserError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the rescue or above the method, and the row stops firing.
C5 · Data-Subject Rights · Partial data-subject-rights support · ×1
  • Partial data-subject-rights support — Corroborated rights: erasure ✓ · export ✗ · consent ✗. Each tick means this scan found code in the repository implementing that right — a deletion/anonymisation path for erasure, a data-export or portability path for export, and consent state recorded alongside the personal data it authorises. A ✗ therefore means no such code was recognised HERE, not that the right is unsupported: a capability provided by a platform, a manual runbook, or code spelled in a way this scan does not match is not visible to it. Confirm before treating a cross as a gap; where it is one, the right has to be fulfilled manually.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (219 single-owned of 1209 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; 1209 of the 4058 production source files in this repository met that bar). They are anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: app/services/onetime/restamp_gumroad_held_presentment_balances.rb.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
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)` (323236 LoC, 4327 module-visible types across 374 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 42 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: app/javascript/components/icons/getting-started/FirstSaleIcon.tsx, app/javascript/components/ProductEdit/ProductTab/PriceChecker/DistributionChart.tsx, app/models/concerns/attribute_blockable.rb, app/services/ai/product_details_generator_service.rb, app/javascript/components/icons/getting-started/CustomizeProfileIcon.tsx, app/javascript/components/ProductEdit/ProductTab/PriceChecker/index.tsx, app/javascript/components/ReviewForm/ReviewVideoRecorderClientOnly.tsx, app/javascript/components/ApiDocumentation/Endpoints/Payouts.tsx (and 34 more) (43 orphaned of 1209 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; 1209 of the 4058 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
IC1 · Incompleteness & stubs · Empty method body · ×1
  • Empty method body app/business/payments/charging/implementations/braintree/braintree_chargeable_credit_card.rb:33 — `braintree_device_data` has an empty body — confirm it's an intentional no-op and not an unfinished method.
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift CONTRIBUTING.md:67 — CONTRIBUTING.md links to `./before.png`, but `before.png` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add brakeman for Rails apps, otherwise `semgrep --config=auto` or CodeQL's ruby pack as a CI step. What was searched, so you can tell an absence from a miss: the 144542 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.
R7 · Dead Code · Unused export 'readDesignSettings' · ×1
  • Unused export 'readDesignSettings' app/javascript/components/DesignSettings.tsx:17 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'InertiaNavLink' · ×1
  • Unused export 'InertiaNavLink' app/javascript/components/Nav.tsx:92 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'VisualState' · ×1
  • Unused export 'VisualState' app/javascript/components/design.ts:4 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'MainColor' · ×1
  • Unused export 'MainColor' app/javascript/components/design.ts:7 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'getMissedPosts' · ×1
  • Unused export 'getMissedPosts' app/javascript/data/customers.ts:202 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'getCustomerEmails' · ×1
  • Unused export 'getCustomerEmails' app/javascript/data/customers.ts:218 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'getProductPurchases' · ×1
  • Unused export 'getProductPurchases' app/javascript/data/customers.ts:303 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'PriceDistributionTier' · ×1
  • Unused export 'PriceDistributionTier' app/javascript/data/price_distribution.ts:4 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'DisputeReason' · ×1
  • Unused export 'DisputeReason' app/javascript/data/purchase/dispute_evidence_data.ts:129 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'saveThirdPartyAnalytics' · ×1
  • Unused export 'saveThirdPartyAnalytics' app/javascript/data/third_party_analytics.ts:24 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'deleteWishlist' · ×1
  • Unused export 'deleteWishlist' app/javascript/data/wishlists.ts:109 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ZOOM_OAUTH_URL' · ×1
  • Unused export 'ZOOM_OAUTH_URL' app/javascript/utils/integrations.ts:3 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ZOOM_CLIENT_ID' · ×1
  • Unused export 'ZOOM_CLIENT_ID' app/javascript/utils/integrations.ts:4 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'GCAL_CLIENT_ID' · ×1
  • Unused export 'GCAL_CLIENT_ID' app/javascript/utils/integrations.ts:6 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'prepareImagesForUpload' · ×1
  • Unused export 'prepareImagesForUpload' app/javascript/utils/prepareImageForUpload.ts:166 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'paramsToQueryString' · ×1
  • Unused export 'paramsToQueryString' app/javascript/utils/url.ts:18 — Nothing imports this binding — it is safe to review for removal.
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 2/3 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Ruby's type checker does not check nil everywhere · ×1
  • Ruby's type checker does not check nil everywhere — This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 3271 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
X7 · Silent fallback defaults · Silent fallback default on error · ×1
  • Silent fallback default on error resend_callbacks/ruby.go:48 — `rubyToI` turns a non-nil `err` into `return 0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-2df8a9c576fc4d32a4023936a2fdeef7/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-2df8a9c576fc4d32a4023936a2fdeef7/tree.json --exit-code 0 --source .0—
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude public/mobile --exclude spec/support/fixtures/vcr_cassettes --exclude vendor .247artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update65artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .35artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep --config /opt/semgrep-rules/gdpr.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude public/mobile --exclude spec/support/fixtures/vcr_cassettes --exclude vendor .14artifacts/raw/semgrep-gdpr.json
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a174ec-c711-7fcc-8aac-f927ee228cc3 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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