Public report of Homebrew/brew, published 14 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 14 November 2026, 03:40 UTC · Survey ID cd_11814dafcbf74240b2837342a32c18ae
Homebrew/brew
Measured 14 November 2026, 03:39 UTC, at code version cbd3ae6
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Down 3 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: 142,081 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 2.1 person-years · Weakest lens: Production Readiness, 48
Findings by how serious they are
29 critical1007 serious47 minor
13 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 03:39 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
41of 41 dimensions measured by tools.
1063of 1083 findings point to an exact file and line, so you can open each one in the code. The other 20 concern the repository as a whole, such as missing documentation.
41dimensions across 5 lenses, read from 142,081 lines of product code in 3 projects.
Homebrew/brew falls short of our standard for production because we found no logging, tracing or health checks in the code. It scores 57 out of 100 and is rated Adequate, and all 29 of its critical findings are security problems.
Production Readiness, at 48, is the weakest lens and counts most in the score. The best first step is fixing the password or key in the code, worth about 7 points. Adding a diagnostic log would lift Production Readiness itself, worth about 6 points. Raising Production Readiness to 70 would lift the score to about 64.
Ten pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Nine places in the code run text as code, which an attacker could use, and five passwords or keys in the code's history and one in the code are open to anyone who can read the repository. Replacing each exposed password or key, pinning each tool to an exact version and replacing text run as code with direct calls would close these risks. Fixing the weaknesses the scanner points to would fix the two security weaknesses in the code, and the two unsafe settings in infrastructure or container files need changing to safe values.
The product code is 142,081 lines, about €300,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 48 to 70, the lowest score rated Strong, the score would rise from 57 to about 64.
Code composition: what the lines of code are
Product code 48%Tests 52%
New since the last survey: 154 findings
These 154 critical or serious findings weren't in the previous survey, on 25 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · TooManyMethods: Cargo Library/Homebrew/bundle/extensions/cargo.rb
God Classes · FileTooLong: extensions/winget.rb Library/Homebrew/bundle/extensions/winget.rb
Code Duplication · Edited copy of a member (42 corresponding lines) Library/Homebrew/cask/cask_loader.rb
Code Duplication · Edited copy of a member (31 corresponding lines) Library/Homebrew/diagnostic.rb
Code Duplication · Edited copy of a member (32 corresponding lines) Library/Homebrew/cask/cask_loader.rb
Code Duplication · Edited copy of a member (40 corresponding lines) Library/Homebrew/dev-cmd/bump-compatibility-version.rb
Code Duplication · Edited copy of a member (37 corresponding lines) Library/Homebrew/cask/installer.rb
Code Duplication · Edited copy of a member (37 corresponding lines) Library/Homebrew/reinstall/reinstall.rb
Code Duplication · Edited copy of a member (24 corresponding lines) Library/Homebrew/cask/staged.rb
Code Duplication · Edited copy of a member (26 corresponding lines) Library/Homebrew/rubocops/bottle.rb
Code Duplication · Edited copy of a member (10 corresponding lines) Library/Homebrew/cli/named_args.rb
Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) Library/Homebrew/cmd/nodenv-sync.rb
Code Duplication · Edited copies of one member (4 members, 19+ corresponding lines) Library/Homebrew/livecheck/strategy/crate.rb
Code Duplication · Edited copy of a member (13 corresponding lines) Library/Homebrew/description_cache_store.rb
Code Duplication · Edited copy of a member (15 corresponding lines) Library/Homebrew/tap/core_cask_tap.rb
Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) Library/Homebrew/utils/shared_audits.rb
Code Duplication · Edited copy of a member (20 corresponding lines) Library/Homebrew/cmd/source.rb
Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) Library/Homebrew/cask/artifact/abstract_artifact.rb
Code Duplication · Edited copy of a member (18 corresponding lines) Library/Homebrew/diagnostic.rb
Code Duplication · Edited copy of a member (22 corresponding lines) Library/Homebrew/cask/artifact/abstract_uninstall.rb
Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) Library/Homebrew/cli/named_args.rb
Code Duplication · Edited copy of a member (20 corresponding lines) Library/Homebrew/cask/dsl.rb
Code Duplication · Edited copy of a member (4 corresponding lines) Library/Homebrew/bundle/cask.rb
Code Duplication · Edited copy of a member (6 corresponding lines) Library/Homebrew/services/formula_wrapper.rb
Code Duplication · Edited copy of a member (18 corresponding lines) Library/Homebrew/diagnostic.rb
Code Duplication · Edited copy of a member (14 corresponding lines) Library/Homebrew/dev-cmd/advisory-match.rb
Code Duplication · Edited copy of a member (19 corresponding lines) Library/Homebrew/livecheck/strategy/apache.rb
Code Duplication · Edited copy of a member (16 corresponding lines) Library/Homebrew/cmd/update_report/reporter_hub.rb
Code Duplication · Edited copy of a member (10 corresponding lines) Library/Homebrew/rubocops/urls.rb
Code Duplication · Edited copy of a member (12 corresponding lines) Library/Homebrew/utils/shared_audits.rb
Code Duplication · Edited copy of a member (6 corresponding lines) Library/Homebrew/tap.rb
Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) Library/Homebrew/cask/audit.rb
Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) Library/Homebrew/cask/audit.rb
Code Duplication · Edited copy of a member (10 corresponding lines) Library/Homebrew/tap.rb
Code Duplication · Edited copy of a member (9 corresponding lines) Library/Homebrew/sorbet/tapioca/compilers/rspec_dynamic_matchers.rb
Code Duplication · Edited copy of a member (16 corresponding lines) Library/Homebrew/extend/os/linux/keg_relocate.rb
Code Duplication · Edited copy of a member (15 corresponding lines) Library/Homebrew/bundle/brew.rb
Code Duplication · Edited copy of a member (6 corresponding lines) Library/Homebrew/download_strategy/curl_download_strategy.rb
Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) Library/Homebrew/cask/audit.rb
Code Duplication · Edited copy of a member (12 corresponding lines) Library/Homebrew/cmd/tap-info.rb
Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) Library/Homebrew/bundle/extensions/cargo.rb
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 68 findings
These 68 critical or serious findings were in the previous survey, on 25 October 2026, and are gone from this one.
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/caveats.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/diagnostic.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/formula.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/formula.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/formula_cellar_checks.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/global.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/install.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/install.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/search.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/uninstall.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/uninstall.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/utils/github/api.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/services/cli.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/services/formula_wrapper.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/services/formula_wrapper.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/services/formula_wrapper.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/services/formula_wrapper.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/extend/os/mac/diagnostic.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/extend/os/mac/diagnostic.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/extend/os/mac/diagnostic.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/extend/os/mac/pkgconf.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/extend/hash/keys.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/dev-cmd/bump-unversioned-casks.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/cask/appcast.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/cask/audit.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/cask/audit.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/cask/cask.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/cask/caskroom.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/cask/upgrade.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/cask/utils/trash.rb
Exception handling · Swallowed exception (caught, then discarded) Library/Homebrew/bundle/installer.rb
A11y enforcement · Accessibility enforcement below the top rung
Rebuild cost: about €300,000 · Estimate
Cost to rebuild
€100,000 to €510,000, for 1,676 to 5,316 hours of work, about 2.1 person-years for 1 to 4 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 57. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 142,081 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag.
Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
Raises the score by about 6 points · Medium effort · Observability
3
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
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 €300,000 to build again, about 2.1 person-years of work. Its weakest lens is Production Readiness, at 48 (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 1 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 7 points for low effort, because it clears the 1 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.9 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 134,949 lines over the last 90 days, which is about 547,293 lines a year. At that pace, the extra work comes to an estimated 72.4 to 434.5 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
218 modules, with 103 dependencies between them. One loop runs through 4 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 178 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.
Homebrew.API.Cask uses Utils.Output, so a change to Utils.Output can break Homebrew.API.Cask, while a change to Homebrew.API.Cask can't break Utils.Output.
Position
Below the diagonal: Homebrew.API.Cask uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in Homebrew.Aliases uses a type in Utils.Output.
The types involved
Homebrew.Aliases.Alias → Utils.Output.Mixin
Direction
Homebrew.Aliases uses Utils.Output, so a change to Utils.Output can break Homebrew.Aliases, while a change to Homebrew.Aliases can't break Utils.Output.
Position
Below the diagonal: Homebrew.Aliases uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in Homebrew.Diagnostic uses a type in Utils.Output.
The types involved
Homebrew.Diagnostic.Checks → Utils.Output.Mixin
Direction
Homebrew.Diagnostic uses Utils.Output, so a change to Utils.Output can break Homebrew.Diagnostic, while a change to Homebrew.Diagnostic can't break Utils.Output.
Position
Below the diagonal: Homebrew.Diagnostic uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in Homebrew.Diagnostic uses a type in SystemCommand.
The types involved
Homebrew.Diagnostic.Checks → SystemCommand.Mixin
Direction
Homebrew.Diagnostic uses SystemCommand, so a change to SystemCommand can break Homebrew.Diagnostic, while a change to Homebrew.Diagnostic can't break SystemCommand.
Position
Below the diagonal: Homebrew.Diagnostic uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in Homebrew.InstallSteps uses a type in Utils.Output.
The types involved
Homebrew.InstallSteps.Runner → Utils.Output.Mixin
Direction
Homebrew.InstallSteps uses Utils.Output, so a change to Utils.Output can break Homebrew.InstallSteps, while a change to Homebrew.InstallSteps can't break Utils.Output.
Position
Below the diagonal: Homebrew.InstallSteps uses a module listed above it, which is the healthy direction.
Homebrew.InstallSteps uses SystemCommand, so a change to SystemCommand can break Homebrew.InstallSteps, while a change to Homebrew.InstallSteps can't break SystemCommand.
Position
Below the diagonal: Homebrew.InstallSteps uses a module listed above it, which is the healthy direction.
39 pairs of types, where a type in (global) uses a type in Utils.Output. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
The types involved
AbstractDownloadStrategy → Utils.Output.Mixin
BottleSpecification → Utils.Output.Mixin
Build → Utils.Output.Mixin
BuildError → Utils.Output.Mixin
CPAN → Utils.Output.Mixin
Cleaner → Utils.Output.Mixin
DependentsMessage → Utils.Output.Mixin
DevelopmentTools → Utils.Output.Mixin
Downloadable → Utils.Output.Mixin
EmbeddedPatch → Utils.Output.Mixin
ExternalPatch → Utils.Output.Mixin
Formula → Utils.Output.Mixin
FormulaInstaller → Utils.Output.Mixin
FormulaVersions → Utils.Output.Mixin
Formulary → Utils.Output.Mixin
GitHub → Utils.Output.Mixin
GitHubPackages → Utils.Output.Mixin
GitHubReleases → Utils.Output.Mixin
GitHubRunnerMatrix → Utils.Output.Mixin
Keg → Utils.Output.Mixin
LinkageChecker → Utils.Output.Mixin
LockFile → Utils.Output.Mixin
MacOSRequirement → Utils.Output.Mixin
Messages → Utils.Output.Mixin
Migrator → Utils.Output.Mixin
Direction
(global) uses Utils.Output, so a change to Utils.Output can break (global), while a change to (global) can't break Utils.Output.
Position
Below the diagonal: (global) uses a module listed above it, which is the healthy direction.
Homebrew.Livecheck.Strategy uses SystemCommand, so a change to SystemCommand can break Homebrew.Livecheck.Strategy, while a change to Homebrew.Livecheck.Strategy can't break SystemCommand.
Position
Below the diagonal: Homebrew.Livecheck.Strategy uses a module listed above it, which is the healthy direction.
Homebrew.Livecheck.Strategy uses Homebrew.Livecheck, so a change to Homebrew.Livecheck can break Homebrew.Livecheck.Strategy, while a change to Homebrew.Livecheck.Strategy can't break Homebrew.Livecheck.
Position
Below the diagonal: Homebrew.Livecheck.Strategy uses a module listed above it, which is the healthy direction.
28 pairs of types, where a type in Homebrew uses a type in Utils.Output. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
The types involved
Homebrew.API → Utils.Output.Mixin
Homebrew.AbstractCommand → Utils.Output.Mixin
Homebrew.AbstractSubcommand → Utils.Output.Mixin
Homebrew.Ask → Utils.Output.Mixin
Homebrew.Assertions → Utils.Output.Mixin
Homebrew.Attestation → Utils.Output.Mixin
Homebrew.Bump → Utils.Output.Mixin
Homebrew.Cleanup → Utils.Output.Mixin
Homebrew.Completions → Utils.Output.Mixin
Homebrew.Diagnostic → Utils.Output.Mixin
Homebrew.DownloadQueue → Utils.Output.Mixin
Homebrew.EnvConfig → Utils.Output.Mixin
Homebrew.ExecutablesDB → Utils.Output.Mixin
Homebrew.FormulaAuditor → Utils.Output.Mixin
Homebrew.FormulaCreator → Utils.Output.Mixin
Homebrew.Help → Utils.Output.Mixin
Homebrew.Install → Utils.Output.Mixin
Homebrew.MissingFormula → Utils.Output.Mixin
Homebrew.Reinstall → Utils.Output.Mixin
Homebrew.RetryableDownload → Utils.Output.Mixin
Homebrew.Search → Utils.Output.Mixin
Homebrew.Service → Utils.Output.Mixin
Homebrew.Style → Utils.Output.Mixin
Homebrew.TestBot → Utils.Output.Mixin
Homebrew.Trust → Utils.Output.Mixin
Direction
Homebrew uses Utils.Output, so a change to Utils.Output can break Homebrew, while a change to Homebrew can't break Utils.Output.
Position
Below the diagonal: Homebrew uses a module listed above it, which is the healthy direction.
Homebrew.Bundle.Brew uses Utils.Output, so a change to Utils.Output can break Homebrew.Bundle.Brew, while a change to Homebrew.Bundle.Brew can't break Utils.Output.
Position
Below the diagonal: Homebrew.Bundle.Brew uses a module listed above it, which is the healthy direction.
Homebrew.Bundle.Brew uses Homebrew.Bundle, so a change to Homebrew.Bundle can break Homebrew.Bundle.Brew, while a change to Homebrew.Bundle.Brew can't break Homebrew.Bundle.
Position
Below the diagonal: Homebrew.Bundle.Brew uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in Homebrew.Bundle.Brew uses a type in (global).
The types involved
Homebrew.Bundle.Brew.Topo → Hash
Direction
Homebrew.Bundle.Brew uses (global), so a change to (global) can break Homebrew.Bundle.Brew, while a change to Homebrew.Bundle.Brew can't break (global).
Position
Below the diagonal: Homebrew.Bundle.Brew uses a module listed above it, which is the healthy direction.
OS.Mac.Cask.Quarantine uses Utils.Output, so a change to Utils.Output can break OS.Mac.Cask.Quarantine, while a change to OS.Mac.Cask.Quarantine can't break Utils.Output.
Position
Below the diagonal: OS.Mac.Cask.Quarantine uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in OS.Mac.Cask.Quarantine uses a type in (global).
The types involved
OS.Mac.Cask.Quarantine.ClassMethods → Kernel
Direction
OS.Mac.Cask.Quarantine uses (global), so a change to (global) can break OS.Mac.Cask.Quarantine, while a change to OS.Mac.Cask.Quarantine can't break (global).
Position
Below the diagonal: OS.Mac.Cask.Quarantine uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in UnpackStrategy.Dmg uses a type in Utils.Output.
The types involved
UnpackStrategy.Dmg.Bom → Utils.Output.Mixin
Direction
UnpackStrategy.Dmg uses Utils.Output, so a change to Utils.Output can break UnpackStrategy.Dmg, while a change to UnpackStrategy.Dmg can't break Utils.Output.
Position
Below the diagonal: UnpackStrategy.Dmg uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in UnpackStrategy.Dmg uses a type in SystemCommand.
The types involved
UnpackStrategy.Dmg.Bom → SystemCommand.Mixin
Direction
UnpackStrategy.Dmg uses SystemCommand, so a change to SystemCommand can break UnpackStrategy.Dmg, while a change to UnpackStrategy.Dmg can't break SystemCommand.
Position
Below the diagonal: UnpackStrategy.Dmg uses a module listed above it, which is the healthy direction.
95 pairs of types, where a type in Homebrew.Cmd uses a type in Homebrew. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Homebrew.Cmd.Analytics uses Homebrew, so a change to Homebrew can break Homebrew.Cmd.Analytics, while a change to Homebrew.Cmd.Analytics can't break Homebrew.
Position
Below the diagonal: Homebrew.Cmd.Analytics uses a module listed above it, which is the healthy direction.
Homebrew.Cmd.Bundle uses Utils.Output, so a change to Utils.Output can break Homebrew.Cmd.Bundle, while a change to Homebrew.Cmd.Bundle can't break Utils.Output.
Position
Below the diagonal: Homebrew.Cmd.Bundle uses a module listed above it, which is the healthy direction.
Homebrew.Cmd.Services uses Utils.Output, so a change to Utils.Output can break Homebrew.Cmd.Services, while a change to Homebrew.Cmd.Services can't break Utils.Output.
Position
Below the diagonal: Homebrew.Cmd.Services uses a module listed above it, which is the healthy direction.
Homebrew.Cmd.Services uses Homebrew, so a change to Homebrew can break Homebrew.Cmd.Services, while a change to Homebrew.Cmd.Services can't break Homebrew.
Position
Below the diagonal: Homebrew.Cmd.Services uses a module listed above it, which is the healthy direction.
Homebrew.DevCmd uses SystemCommand, so a change to SystemCommand can break Homebrew.DevCmd, while a change to Homebrew.DevCmd can't break SystemCommand.
Position
Below the diagonal: Homebrew.DevCmd uses a module listed above it, which is the healthy direction.
69 pairs of types, where a type in Homebrew.DevCmd uses a type in Homebrew. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
28
High / Critical
A02:2025 — Security Misconfiguration
8
High / Critical
A07:2025 — Authentication Failures
7
High / Critical
A03:2025 — Software Supply Chain Failures
1
Medium
Roadmap
Top priorities: Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED; Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce; Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
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 — 29
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 — 1007
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 — 47
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 13
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 41 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 41 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1063 of 1083 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT READ here — but this repository measures it: a Codecov configuration (.github/codecov.yml) and a coverage step in CI (`codecov/codecov-action`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.rb), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rb) and this repository declares a Ruby test suite (RSpec: Library/Homebrew, 758 spec files; minitest: Library/Homebrew, 1 test file), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D20 ADR Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The ADR lexicon (adr-lexicon-1) covers de, en, it, nl. A record identified as another language, or whose language could not be identified (fewer than 25 words of prose, or no clear winner), is never read with English rules: its missing-section, status, consequence-cost and same-question rules abstain, and only the structural rules (title, single option, dangling link, enforcement field) run.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: it declares a published package (REDACTED), but no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — roperties-common && apt-get autoremove --purge -y && sed -i -E 's/^(USERGROUPS_ENAB\\s+)yes$/\\1no/' /etc/login.defs && localedef -i en_US -f UTF-8 en_US.UTF-8 && useradd -u \"${USER_ID}\" --create-home --shell /bin/bash --user-group linuxbrew && echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers && su - linuxbrew -c 'mkdir ~/.linuxbrew'" did not complete successfully: exit code: 1; runtime evidence skipped.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository's C# was parsed (it ships no .sln or .csproj, so it was read as syntax-only projects), but this check proves its findings from resolved symbols and a reference-free parse resolves none. It abstained rather than report a clean bill it could not earn. That is a gap in this analyzer's reach into build-less repositories — not a finding that the repository is free of what this check looks for.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations: 11 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
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
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.
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 (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
251 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was BumpFormulaPr.run at 112. A further 6 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 ClassMethods.intel_family at 25 — they are counted neither in the figure above nor in this dimension's score. 3 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: Library/Homebrew/extend/os/linux/hardware/cpu.rb (ClassMethods.intel_family at 25), Library/Homebrew/extend/ENV/super.rb (Superenv.setup_build_environment at 16), Library/Homebrew/extend/os/mac/hardware/cpu/hardware.rb (CPU.arm_family at 16). 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.
+ 246 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 20 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with BumpFormulaPr.run (cyclomatic 112), Livecheck.latest_version (cyclomatic 112), List.run (cyclomatic 93). — 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 20 together lifts Cyclomatic Complexity from 5.1 to about 6.0/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 302 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 4 bodies over 120 down to 120 or less in Cognitive Complexity — start with List.run (cognitive 184), Livecheck.latest_version (cognitive 162), UpdateReport.output_update_report (cognitive 150). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cognitive Complexity from 3.6 to about 4.3/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.9 / 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.
TooManyMethods: Formula · ×44Library/Homebrew/formula.rb:88
What to do
Resolve the 46 FileTooLong finding(s) in God Classes — start with install_steps.rb (2), upgrade.rb (2), formula.rb. — One of this dimension's main actionable groups (46 warning-level).
Resolve the 44 TooManyMethods finding(s) in God Classes — start with install_steps.rb (2), formula.rb, tap.rb. — One of this dimension's main actionable groups (44 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
33 duplicated block group(s) detected. 1.5 % of the production lines (2,102 of 142,081) are in a reported copy. A further 61 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 1 of the 94 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.
Edited copy of a member (10 corresponding lines) · ×5Library/Homebrew/cli/named_args.rb:109
Edited copy of a member (6 corresponding lines) · ×4Library/Homebrew/services/formula_wrapper.rb:500
Edited copy of a member (15 corresponding lines) · ×3Library/Homebrew/tap/core_cask_tap.rb:59
+ 56 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 5 Edited copy of a member (10 corresponding lines) finding(s) in Code Duplication — start with named_args.rb, urls.rb, tap.rb. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 4 Edited copy of a member (6 corresponding lines) finding(s) in Code Duplication — start with formula_wrapper.rb, tap.rb, curl_download_strategy.rb. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 4 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with build.rb, install.rb, contributions.rb. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
3 production modules (Python+source-import), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations, and — for the source no manifest declares — its top-level source directories, with the imports between them as edges, and main-sequence distance (abstractness) is not computed for these modules yet.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 86 Low cohesion finding(s) in Cohesion (LCOM4) — start with cask_loader.rb (2), resource.rb (2), migrator.rb (2). — One of this dimension's main actionable groups (86 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
8 outdated direct gem(s), 0 pinning defect(s). 52 declaration(s) graded against rubygems.org, 52 of them against a version resolved in a committed Gemfile.lock. Whether any of these gems is DEPRECATED or YANKED is not graded — rubygems.org publishes no deprecation marker, and a yank removes a version rather than flagging it. Whether any is UNMAINTAINED is not graded either: no registry publishes a maintenance status, and release age does not stand in for one. Whether any is UNUSED is a source question, not a registry one. Known CVEs in this dependency graph are D30's question, read from the manifest there.
Outdated: irb · ×8
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 112 shipped gem(s) use a banned license. Licences were resolved from rubygems.org over the 112 gem(s) a consumer installs — this repository's runtime declarations closed transitively over its committed Gemfile.lock. Development-group and `add_development_dependency` gems are excluded: they are not distributed with this repository.
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.
Resolve the 97 Hotspot finding(s) in Churn × Complexity Hotspots — start with livecheck.rb (3), upgrade.rb (3), audit.rb (2). — One of this dimension's main actionable groups (97 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.2 / 10Exemplary✓ 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.
39 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Library/Homebrew/rubocops/shared/install_steps_helper.rb. Counted over 508 of the 1030 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)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
59 deducted task-comment markers across 142081 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.
Resolve the 47 TodoComment finding(s) in Explicit Debt — start with strategy_spec.rb (6), formula.rb (2), linkage_checker.rb (2). — One of this dimension's main actionable groups (47 warning-level).
Resolve the 10 FixmeComment finding(s) in Explicit Debt — start with REDACTED (2), formulary_spec.rb (2), cask_loader_spec.rb (2). — One of this dimension's main actionable groups (10 warning-level).
Resolve the 1 XxxComment finding(s) in Explicit Debt — start with requirement.rb. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
0 of 8 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
✓ On the Gold path — maintain.
Detailed fixes: d20_recommendation.md.
Do you agree with this assessment?
D26 · Project Cohesion3.3 / 10Weak✓ Tool-verified
What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.
1 of 3 build units (Bundler, checkout) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
5 finding(s): 0 critical, 5 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 5 REDACTED finding(s) in Secrets (history) — start with REDACTED (5). — One of this dimension's main actionable groups (5 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
29 finding(s): 0 critical, 21 high, 8 medium, 0 low. semgrep hit a parse error in 12 file(s) — `.vscode/ruby-lsp-activate.sh` (lines 3–28), `Library/Homebrew/brew.sh` (lines 8–685), `Library/Homebrew/cmd/--repository.sh` (line 28), `REDACTED` (line 430), `Library/Homebrew/shims/mac/super/bin/xcrun` (line 73), … (+7 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 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 10 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (8), REDACTED, REDACTED. — One of this dimension's main actionable groups (10 issue-level).
Resolve the 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (9 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED.long_runner, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 6 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED.long_runner (2). — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
1 of 508 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is Library/Homebrew/extend/file/atomic.rb. Counted over 508 of the 1030 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 4 Change coupling finding(s) in Change Coupling — start with reinstall.rb, formula_actions.rb, cask.rb. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 3 Change-coupling hub finding(s) in Change Coupling — start with leaves.rb, cask_dependent.rb, installed_dependents.rb. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 53 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.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in 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.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.
What to do
Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
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.
What to do
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Do you agree with this assessment?
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
Do you agree with this assessment?
P6 · Release Hygiene8.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
The changelog this check read carries 0 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
What to do
Keep the changelog current — add a versioned entry (Keep-a-Changelog ## [x.y.z]) for each release so the history isn't a stub.
Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
0/1 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.
What to do
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Capped at Fair by a Critical contributor — resolve it before relying on this lens.
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.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 27 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 72 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — Frontend below the scale floor (22 DOM element(s) < 25) — too little surface to assess accessibility.
AC2 Forms & labels — Frontend below the scale floor (22 DOM element(s) < 25) — too little surface to assess accessibility.
AC3 Page structure — Frontend below the scale floor (22 DOM element(s) < 25) — too little surface to assess accessibility.
AC4 Keyboard semantics — Frontend below the scale floor (22 DOM element(s) < 25) — too little surface to assess accessibility.
AC5 ARIA correctness — Frontend below the scale floor (22 DOM element(s) < 25) — too little surface to assess accessibility.
AC6 Visual & motion safety — Frontend below the scale floor (22 DOM element(s) < 25) — too little surface to assess accessibility.
AX1 Captive dependencies — no DI registrations detected
AX2 Stateful singletons — no singleton implementations detected
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) — roperties-common && apt-get autoremove --purge -y && sed -i -E 's/^(USERGROUPS_ENAB\\s+)yes$/\\1no/' /etc/login.defs && localedef -i en_US -f UTF-8 en_US.UTF-8 && useradd -u \"${USER_ID}\" --create-home --shell /bin/bash --user-group linuxbrew && echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers && su - linuxbrew -c 'mkdir ~/.linuxbrew'" did not complete successfully: exit code: 1; 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.
C1 Data Protection — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
D10 Test Quality — ~151825 lines of test source are present (.rb) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .rb suite was found but not re-run
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency does not read html yet; not measured.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .py, .rb, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D27 Navigability — symbol resolution incomplete — navigability not assessed
D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (53 value object(s))
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 (this repository commits no MSBuild project, so its C# was read as syntax-only projects — a handler marked ONLY by an interface from a package is not visible without a build)
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Python, Ruby source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
PF3 Async & latency hygiene — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X12 Unreachable branch — X12 reached only 0% of this repository's production lines — ruby (142,044 lines), javascript (50 lines), python (37 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — X24 reached only 0% of this repository's production lines — ruby (142,044 lines), python (37 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — This check needs a compiled C# program and this repository commits no project file to compile, so only its syntax could be read. That is a limit of the analyzer, not a finding about your code.
X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Hotspot: Library/Homebrew/cmd/info.rb Library/Homebrew/cmd/info.rb:307— Library/Homebrew/cmd/info.rb changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in Info.info_formula at line 307. 2 of those changes were fix/bug commits, and the other 32 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/cmd/info.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: Library/Homebrew/cask/audit.rb Library/Homebrew/cask/audit.rb:629— Library/Homebrew/cask/audit.rb changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in Audit.audit_signing at line 629. 2 of those changes were fix/bug commits, and the other 34 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/cask/audit.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: Library/Homebrew/dev-cmd/advisory-match.rb Library/Homebrew/dev-cmd/advisory-match.rb:74— Library/Homebrew/dev-cmd/advisory-match.rb changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 88 in AdvisoryMatch.run at line 74. 3 of those changes were fix/bug commits, and the other 21 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/dev-cmd/advisory-match.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:103— REDACTED changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 112 in BumpFormulaPr.run at line 103. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00: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:221— REDACTED changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in Bump.retrieve_versions_by_arch at line 221. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00: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: Library/Homebrew/formula.rb Library/Homebrew/formula.rb:3851— Library/Homebrew/formula.rb changed 72 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in Formula.eligible_kegs_for_cleanup at line 3851. 2 of those changes were fix/bug commits, and the other 70 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/formula.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: Library/Homebrew/formula_installer.rb Library/Homebrew/formula_installer.rb:1070— Library/Homebrew/formula_installer.rb changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in FormulaInstaller.finish at line 1070. 1 of those changes was a fix/bug commit, and the other 45 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/formula_installer.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: Library/Homebrew/formula_auditor.rb Library/Homebrew/formula_auditor.rb:884— Library/Homebrew/formula_auditor.rb changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in FormulaAuditor.audit_specs at line 884. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/formula_auditor.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: Library/Homebrew/tap.rb Library/Homebrew/tap.rb:675— Library/Homebrew/tap.rb changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in Tap.install at line 675. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/tap.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: Library/Homebrew/install_steps.rb Library/Homebrew/install_steps.rb:1002— Library/Homebrew/install_steps.rb changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in Runner.run_install_step at line 1002. 1 of those changes was a fix/bug commit, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/install_steps.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: Library/Homebrew/cmd/update-report.rb Library/Homebrew/cmd/update-report.rb:94— Library/Homebrew/cmd/update-report.rb changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in UpdateReport.output_update_report at line 94. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/cmd/update-report.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: Library/Homebrew/dev-cmd/bottle.rb Library/Homebrew/dev-cmd/bottle.rb:427— Library/Homebrew/dev-cmd/bottle.rb changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in Bottle.bottle_formula at line 427. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/dev-cmd/bottle.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: Library/Homebrew/dev-cmd/contributions.rb Library/Homebrew/dev-cmd/contributions.rb:126— Library/Homebrew/dev-cmd/contributions.rb changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in Contributions.run at line 126. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/dev-cmd/contributions.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: Library/Homebrew/cleanup.rb Library/Homebrew/cleanup.rb:167— Library/Homebrew/cleanup.rb changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in Cleanup.stale_formula? at line 167. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/cleanup.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: Library/Homebrew/cmd/install.rb Library/Homebrew/cmd/install.rb:179— Library/Homebrew/cmd/install.rb changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in InstallCmd.run at line 179. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/cmd/install.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: Library/Homebrew/livecheck/livecheck.rb Library/Homebrew/livecheck/livecheck.rb:634— Library/Homebrew/livecheck/livecheck.rb changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 112 in Livecheck.latest_version at line 634. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/livecheck/livecheck.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: Library/Homebrew/utils/curl.rb Library/Homebrew/utils/curl.rb:590— Library/Homebrew/utils/curl.rb changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in Curl.curl_check_http_content at line 590. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/utils/curl.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: Library/Homebrew/cmd/upgrade.rb Library/Homebrew/cmd/upgrade.rb:186— Library/Homebrew/cmd/upgrade.rb changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in UpgradeCmd.run at line 186. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/cmd/upgrade.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: Library/Homebrew/cask/upgrade.rb Library/Homebrew/cask/upgrade.rb:138— Library/Homebrew/cask/upgrade.rb changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in Upgrade.upgrade_casks! at line 138. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/cask/upgrade.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: Library/Homebrew/utils/pypi.rb Library/Homebrew/utils/pypi.rb:250— Library/Homebrew/utils/pypi.rb changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in PyPI.update_python_resources! at line 250. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/utils/pypi.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: Library/Homebrew/dev-cmd/audit.rb Library/Homebrew/dev-cmd/audit.rb:106— Library/Homebrew/dev-cmd/audit.rb changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in Audit.run at line 106. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/dev-cmd/audit.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: Library/Homebrew/rubocops/lines.rb Library/Homebrew/rubocops/lines.rb:954— Library/Homebrew/rubocops/lines.rb changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in Miscellaneous.audit_formula at line 954. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/rubocops/lines.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: Library/Homebrew/keg.rb Library/Homebrew/keg.rb:936— Library/Homebrew/keg.rb changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in Keg.link_dir at line 936. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/keg.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: Library/Homebrew/vulns/match.rb Library/Homebrew/vulns/match.rb:968— Library/Homebrew/vulns/match.rb changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in Match.reconcile_history at line 968. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00:00' --full-history --no-merges -- Library/Homebrew/vulns/match.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:236— REDACTED changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in Formulary.load_formula_from_struct! at line 236. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 01:18:58 +00:00' --until='2026-11-14 01:18:58 +00: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.
Low cohesion: Pathname (LCOM4 26) Library/Homebrew/extend/pathname.rb:30— Pathname's methods fall into 26 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 26 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: FormulaInstaller (LCOM4 20) Library/Homebrew/formula_installer.rb:39— FormulaInstaller's methods fall into 20 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 20 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: Formula (LCOM4 16) Library/Homebrew/formula.rb:88— Formula's methods fall into 16 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 16 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DSL (LCOM4 15) Library/Homebrew/cask/dsl.rb:35— DSL's methods fall into 15 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 15 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Checks (LCOM4 15) Library/Homebrew/diagnostic.rb:62— Checks's methods fall into 15 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 15 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Service (LCOM4 13) Library/Homebrew/service.rb:16— Service'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: Installer (LCOM4 11) Library/Homebrew/cask/installer.rb:24— Installer'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: Tap (LCOM4 10) Library/Homebrew/tap.rb:20— Tap'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: TestFormulae (LCOM4 10) REDACTED:9— TestFormulae'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: AbstractArtifact (LCOM4 9) Library/Homebrew/cask/artifact/abstract_artifact.rb:16— AbstractArtifact'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: Cleanup (LCOM4 9) Library/Homebrew/cleanup.rb:16— Cleanup'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: Requirement (LCOM4 9) Library/Homebrew/requirement.rb:13— Requirement'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: Cask (LCOM4 8) Library/Homebrew/cask/cask.rb:19— Cask'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: DependsOn (LCOM4 8) Library/Homebrew/cask/dsl/depends_on.rb:13— DependsOn'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: AbstractDownloadStrategy (LCOM4 8) Library/Homebrew/download_strategy/abstract_download_strategy.rb:7— AbstractDownloadStrategy'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: FormulaAuditor (LCOM4 8) Library/Homebrew/formula_auditor.rb:20— FormulaAuditor'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: FormulaLoader (LCOM4 8) REDACTED:496— FormulaLoader'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: Keg (LCOM4 8) Library/Homebrew/keg.rb:16— Keg'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: Result (LCOM4 8) Library/Homebrew/system_command.rb:625— Result'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: Test (LCOM4 8) Library/Homebrew/test_bot/test.rb:9— Test'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: Config (LCOM4 7) Library/Homebrew/cask/config.rb:17— Config'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: Base (LCOM4 7) Library/Homebrew/cask/dsl/base.rb:9— Base'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: Cleaner (LCOM4 7) Library/Homebrew/cleaner.rb:16— Cleaner'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: VerificationCache (LCOM4 7) Library/Homebrew/downloadable.rb:21— VerificationCache'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: FormulaCreator (LCOM4 7) Library/Homebrew/formula_creator.rb:12— FormulaCreator'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.
TodoComment Library/Homebrew/cleanup.rb:947— # TODO: Work out a sensible way to clean up `pip`'s, `setuptools`' and `wheel`'s — 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 Library/Homebrew/diagnostic.rb:1031— # TODO: remove this once it's no longer in the default GitHub Actions image — 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 Library/Homebrew/formula.rb:5297— # TODO: replace legacy `replacement` with `replacement_formula` or `replacement_cask` — 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 Library/Homebrew/formula.rb:5408— # TODO: replace legacy `replacement` with `replacement_formula` or `replacement_cask` — 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 Library/Homebrew/formula_auditor.rb:463— # TODO: remove this and check these there too. — 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 Library/Homebrew/github_packages.rb:367— # TODO: upload/add tag_hash["all_files"] somewhere. — 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 Library/Homebrew/hardware.rb:39— # TODO: -mcpu=apple-m1 when we've patched all our GCCs to support it — 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 Library/Homebrew/linkage_checker.rb:369— # TODO: Report linkage with `/usr/lib/libc++.1.dylib` when this link is broken. — 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 Library/Homebrew/resource_auditor.rb:200— # TODO: try remove the OS/env conditional — 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 Library/Homebrew/service.rb:775— # TODO: Remove this code when all users are running on versions of Homebrew — 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 Library/Homebrew/upgrade.rb:290— # TODO: this should be refactored to use FormulaInstaller new logic — 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 Library/Homebrew/utils/curl.rb:666— # TODO: `utils/shared_audits` requires this file in turn. — 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 Library/Homebrew/test_bot/formulae_dependents.rb:267— # TODO: Try generalising this by sorting dependents according to install size, — 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 Library/Homebrew/test_bot/formulae_dependents.rb:353— # TODO: Consider handling the following case better. — 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 Library/Homebrew/test_bot/formulae_detect.rb:186— # TODO: Remove `GITHUB_EVENT_NAME` check when formulae detection — 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 Library/Homebrew/test_bot/tap_syntax.rb:17— # TODO: consider in future if we want to allow unsupported taps here. — 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 Library/Homebrew/test/completions_spec.rb:157— # TODO: re-enable this test if it can be made to take ~ 1 second or there's — 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 Library/Homebrew/test/utils/curl_spec.rb:93— # TODO: Make the Incapsula test data more realistic once we can find an — 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 Library/Homebrew/test/rubocops/uses_from_macos_spec.rb:180— # TODO: consider reporting an offense for some of these, e.g. :postgresql — 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 Library/Homebrew/test/os/mac/pkgconfig_spec.rb:43— # TODO: uncomment this when GitHub Actions has completed their macOS-26-arm64 expat 2.7.4 rollout — 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 Library/Homebrew/test/livecheck/strategy_spec.rb:307— # TODO: Remove this line when removing the user agent fallback logic — 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 Library/Homebrew/test/livecheck/strategy_spec.rb:316— # TODO: Remove this line when removing the user agent fallback logic — 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 Library/Homebrew/test/livecheck/strategy_spec.rb:525— # TODO: Remove this line when removing the user agent fallback logic — 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 Library/Homebrew/test/livecheck/strategy_spec.rb:322— # TODO: Remove this block when removing the user agent fallback logic — 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 Library/Homebrew/test/livecheck/strategy_spec.rb:348— # TODO: Remove this block when removing the user agent fallback logic — 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.
FileTooLong: Homebrew/formula.rb Library/Homebrew/formula.rb— FileTooLong — 2743 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2243 over it, 5.49× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Homebrew/formula_installer.rb Library/Homebrew/formula_installer.rb— FileTooLong — 1567 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1067 over it, 3.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Homebrew/diagnostic.rb Library/Homebrew/diagnostic.rb— FileTooLong — 1559 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1059 over it, 3.12× 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: Homebrew/install_steps.rb Library/Homebrew/install_steps.rb— FileTooLong — 1442 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 942 over it, 2.88× 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: dev-cmd/contributions.rb Library/Homebrew/dev-cmd/contributions.rb— FileTooLong — 1357 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 857 over it, 2.71× 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: cask/audit.rb Library/Homebrew/cask/audit.rb— FileTooLong — 1196 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 696 over it, 2.39× 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: dev-cmd/advisory-match.rb Library/Homebrew/dev-cmd/advisory-match.rb— FileTooLong — 1164 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 664 over it, 2.33× 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: Homebrew/formula_auditor.rb Library/Homebrew/formula_auditor.rb— FileTooLong — 1111 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 611 over it, 2.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: Homebrew/tap.rb Library/Homebrew/tap.rb— FileTooLong — 1107 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 607 over it, 2.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: livecheck/livecheck.rb Library/Homebrew/livecheck/livecheck.rb— FileTooLong — 1061 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 561 over it, 2.12× 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 — 991 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 491 over it, 1.98× 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: cli/parser.rb Library/Homebrew/cli/parser.rb— FileTooLong — 982 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 482 over it, 1.96× 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 — 954 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 454 over it, 1.91× 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: rubocops/lines.rb Library/Homebrew/rubocops/lines.rb— FileTooLong — 920 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 420 over it, 1.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: vulns/match.rb Library/Homebrew/vulns/match.rb— FileTooLong — 887 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 387 over it, 1.77× 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: cask/installer.rb Library/Homebrew/cask/installer.rb— FileTooLong — 871 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 371 over it, 1.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: Homebrew/cleanup.rb Library/Homebrew/cleanup.rb— FileTooLong — 868 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 368 over it, 1.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: cmd/upgrade.rb Library/Homebrew/cmd/upgrade.rb— FileTooLong — 854 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 354 over it, 1.71× 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: Homebrew/env_config.rb Library/Homebrew/env_config.rb— FileTooLong — 847 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 347 over it, 1.69× 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 — 821 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 321 over it, 1.64× 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: Homebrew/exceptions.rb Library/Homebrew/exceptions.rb— FileTooLong — 779 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 279 over it, 1.56× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: dev-cmd/bottle.rb Library/Homebrew/dev-cmd/bottle.rb— FileTooLong — 775 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 275 over it, 1.55× 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: Homebrew/keg.rb Library/Homebrew/keg.rb— FileTooLong — 764 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 264 over it, 1.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: cask/cask.rb Library/Homebrew/cask/cask.rb— FileTooLong — 725 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 225 over it, 1.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: utils/curl.rb Library/Homebrew/utils/curl.rb— FileTooLong — 724 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 224 over it, 1.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
TooManyMethods: Formula Library/Homebrew/formula.rb:88— TooManyMethods — 293 methods. The bar is 30 methods; this is 263 over it, 9.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Tap Library/Homebrew/tap.rb:20— TooManyMethods — 99 methods. The bar is 30 methods; this is 69 over it, 3.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FormulaInstaller Library/Homebrew/formula_installer.rb:39— 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: Audit Library/Homebrew/cask/audit.rb:26— TooManyMethods — 87 methods. The bar is 30 methods; this is 57 over it, 2.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Checks Library/Homebrew/diagnostic.rb:62— TooManyMethods — 87 methods. The bar is 30 methods; this is 57 over it, 2.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Cask Library/Homebrew/cask/cask.rb:19— TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Installer Library/Homebrew/cask/installer.rb:24— TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DSL Library/Homebrew/install_steps.rb:38— TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Sandbox Library/Homebrew/sandbox.rb:15— TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Brew Library/Homebrew/bundle/brew.rb:14— 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: Parser Library/Homebrew/cli/parser.rb:20— 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: Keg Library/Homebrew/keg.rb:16— 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: Cleanup Library/Homebrew/cleanup.rb:16— 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: Service Library/Homebrew/service.rb:16— TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FormulaWrapper Library/Homebrew/services/formula_wrapper.rb:10— TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Extension Library/Homebrew/bundle/extensions/extension.rb:10— 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: FormulaAuditor Library/Homebrew/formula_auditor.rb:20— 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: Superenv Library/Homebrew/extend/ENV/super.rb:18— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Winget Library/Homebrew/bundle/extensions/winget.rb:12— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.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: Runner Library/Homebrew/install_steps.rb:896— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: InstallStepsHelper Library/Homebrew/rubocops/shared/install_steps_helper.rb:6— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GitHub Library/Homebrew/utils/github.rb:14— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DSL Library/Homebrew/cask/dsl.rb:35— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SharedEnvExtension Library/Homebrew/extend/ENV/shared.rb:15— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Trust Library/Homebrew/trust.rb:15— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
FixmeComment Library/Homebrew/formula.rb:885— # FIXME: This should not actually take a block. All resources should be defined — 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 REDACTED:1216— # FIXME: Remove the need to do this here. — 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 REDACTED:1221— # FIXME: Remove the need to split the name and instead make — 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 Library/Homebrew/test/formulary_spec.rb:1416— # FIXME — 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 Library/Homebrew/test/formulary_spec.rb:1467— # FIXME — 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 Library/Homebrew/test/cask/cask_loader_spec.rb:98— # FIXME — 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 Library/Homebrew/test/cask/cask_loader_spec.rb:201— # FIXME — 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 Library/Homebrew/test/cmd/bundle/remove_subcommand_spec.rb:129— # FIXME: Why doesn't this work? — 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 Library/Homebrew/extend/os/linux/diagnostic.rb:276— # FIXME: This includes formulae that have no runtime dependency on GCC. — 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 Library/Homebrew/cli/parser.rb:75— # FIXME: remove once commands are all subclasses of `AbstractCommand`: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×5
Edited copy of a member (10 corresponding lines) Library/Homebrew/cli/named_args.rb:109— Library/Homebrew/cli/named_args.rb:109-118 | Library/Homebrew/cli/named_args.rb:288-304 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Library/Homebrew/rubocops/urls.rb:137— Library/Homebrew/rubocops/urls.rb:137-146 | Library/Homebrew/rubocops/urls.rb:160-169 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Library/Homebrew/tap.rb:98— Library/Homebrew/tap.rb:98-107 | Library/Homebrew/tap.rb:112-121 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Library/Homebrew/formula_auditor.rb:1298— Library/Homebrew/formula_auditor.rb:1298-1307 | Library/Homebrew/resource_auditor.rb:76-87 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) Library/Homebrew/livecheck/strategy/github_latest.rb:60— Library/Homebrew/livecheck/strategy/github_latest.rb:60-69 | Library/Homebrew/livecheck/strategy/github_releases.rb:70-79 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Change coupling: reinstall.rb ↔ upgrade.rb Library/Homebrew/cask/reinstall.rb:1— `Library/Homebrew/cask/reinstall.rb` and `Library/Homebrew/cask/upgrade.rb` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 `8c459e7e` Move API and queue helpers to owners; `61cef916` Fetch cask downloads with formula bottles; `bd463ee7` Keep one failure from aborting a batch install — run `git show` on any of them.
Change coupling: formula_actions.rb ↔ install_steps_helper.rb Library/Homebrew/install_steps/formula_actions.rb:1— `Library/Homebrew/install_steps/formula_actions.rb` and `Library/Homebrew/rubocops/shared/install_steps_helper.rb` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `431a27c1` Add Python bootstrap action; `0e956148` Add PHP configuration action; `b312752f` Add Clang system config action — run `git show` on any of them.
Change coupling: cask.rb ↔ formula.rb Library/Homebrew/api/cask.rb:1— `Library/Homebrew/api/cask.rb` and `Library/Homebrew/api/formula.rb` change together 55% of the time (12 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — 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 12 shared commits counted here, the most recent 3 are `7b7c464d` Stop using unsigned per-package API data for installs; `170eed9f` Harden unsigned API, trust, installer and output boundaries; `5ab33c9e` Parse only needed internal API payload entries — run `git show` on any of them.
Change coupling: test.rb ↔ formula_installer.rb Library/Homebrew/dev-cmd/test.rb:1— `Library/Homebrew/dev-cmd/test.rb` and `Library/Homebrew/formula_installer.rb` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `e29632cf` Unify sandbox temporary directory handling; `f8fcbd88` Sandbox structured cask operations; `dd8119e3` Harden sandboxed install phases — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×4
Edited copy of a member (6 corresponding lines) Library/Homebrew/services/formula_wrapper.rb:500— Library/Homebrew/services/formula_wrapper.rb:500-505 | Library/Homebrew/services/formula_wrapper.rb:510-515 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) Library/Homebrew/tap.rb:1082— Library/Homebrew/tap.rb:1082-1087 | Library/Homebrew/tap.rb:1106-1111 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) Library/Homebrew/download_strategy/curl_download_strategy.rb:372— Library/Homebrew/download_strategy/curl_download_strategy.rb:372-377 | Library/Homebrew/download_strategy/curl_download_strategy.rb:407-413 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) Library/Homebrew/download_strategy/homebrew_curl_download_strategy.rb:49— Library/Homebrew/download_strategy/homebrew_curl_download_strategy.rb:49-55 | Library/Homebrew/utils/curl.rb:467-472 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (12 lines × 2) Library/Homebrew/build.rb:101— Library/Homebrew/build.rb:101-112 | Library/Homebrew/build.rb:114-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) Library/Homebrew/cmd/install.rb:451— Library/Homebrew/cmd/install.rb:451-462 | Library/Homebrew/cmd/reinstall.rb:319-330 — before extracting anything, compare `Library/Homebrew/cmd/install.rb` and `Library/Homebrew/cmd/reinstall.rb` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Library/Homebrew/cmd/install.rb:451` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Library/Homebrew/dev-cmd/contributions.rb:478— Library/Homebrew/dev-cmd/contributions.rb:478-489 | Library/Homebrew/dev-cmd/contributions.rb:525-536 — both copies are in the same file, so extract the 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) Library/Homebrew/livecheck/strategy/pypi.rb:96— Library/Homebrew/livecheck/strategy/pypi.rb:96-107 | Library/Homebrew/livecheck/strategy/ruby_gems.rb:85-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) REDACTED:147— REDACTED:147-154 | Library/Homebrew/dev-cmd/livecheck.rb:71-78 — 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) Library/Homebrew/abstract_command.rb:33— Library/Homebrew/abstract_command.rb:33-40 | Library/Homebrew/abstract_subcommand.rb:21-28 — 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) Library/Homebrew/rubocops/blank.rb:49— Library/Homebrew/rubocops/blank.rb:49-56 | Library/Homebrew/rubocops/present.rb:42-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.
Duplicated block (8 lines × 2) Library/Homebrew/tap/core_cask_tap.rb:78— Library/Homebrew/tap/core_cask_tap.rb:78-85 | Library/Homebrew/tap/core_tap.rb:180-187 — 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.
Change-coupling hub: leaves.rb → cleanup.rb, install.rb, dependency.rb, diagnostic.rb, installed_dependents.rb, autoremove.rb Library/Homebrew/cmd/leaves.rb— `Library/Homebrew/cmd/leaves.rb` changes together with 6 other files — `Library/Homebrew/cleanup.rb`, `Library/Homebrew/cmd/install.rb`, `Library/Homebrew/dependency.rb`, `Library/Homebrew/diagnostic.rb`, `Library/Homebrew/installed_dependents.rb`, `Library/Homebrew/utils/autoremove.rb` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6.
Change-coupling hub: cask_dependent.rb → cleanup.rb, install.rb, diagnostic.rb, autoremove.rb Library/Homebrew/cask_dependent.rb— `Library/Homebrew/cask_dependent.rb` changes together with 4 other files — `Library/Homebrew/cleanup.rb`, `Library/Homebrew/cmd/install.rb`, `Library/Homebrew/diagnostic.rb`, `Library/Homebrew/utils/autoremove.rb` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Change-coupling hub: installed_dependents.rb → dependency.rb, diagnostic.rb, autoremove.rb Library/Homebrew/installed_dependents.rb— `Library/Homebrew/installed_dependents.rb` changes together with 3 other files — `Library/Homebrew/dependency.rb`, `Library/Homebrew/diagnostic.rb`, `Library/Homebrew/utils/autoremove.rb` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×3
Edited copy of a member (15 corresponding lines) Library/Homebrew/tap/core_cask_tap.rb:59— Library/Homebrew/tap/core_cask_tap.rb:59-73 | Library/Homebrew/tap/core_tap.rb:206-220 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) Library/Homebrew/bundle/brew.rb:306— Library/Homebrew/bundle/brew.rb:306-320 | Library/Homebrew/bundle/brew.rb:325-339 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) Library/Homebrew/livecheck/strategy/hackage.rb:56— Library/Homebrew/livecheck/strategy/hackage.rb:56-70 | Library/Homebrew/livecheck/strategy/gnome.rb:57-72 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×3
Edited copy of a member (4 corresponding lines) Library/Homebrew/bundle/cask.rb:23— Library/Homebrew/bundle/cask.rb:23-27 | Library/Homebrew/bundle/extensions/flatpak.rb:57-60 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Library/Homebrew/utils/cpan.rb:18— Library/Homebrew/utils/cpan.rb:18-21 | Library/Homebrew/utils/pypi.rb:27-32 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) Library/Homebrew/sorbet/tapioca/compilers/args.rb:22— Library/Homebrew/sorbet/tapioca/compilers/args.rb:22-25 | Library/Homebrew/sorbet/tapioca/compilers/subcommand_args.rb:18-21 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×3
Edited copy of a member (12 corresponding lines) Library/Homebrew/utils/shared_audits.rb:371— Library/Homebrew/utils/shared_audits.rb:371-383 | Library/Homebrew/utils/shared_audits.rb:406-417 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) Library/Homebrew/cmd/tap-info.rb:124— Library/Homebrew/cmd/tap-info.rb:124-135 | Library/Homebrew/cmd/tap-info.rb:140-151 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) Library/Homebrew/bundle/extensions/cargo.rb:101— Library/Homebrew/bundle/extensions/cargo.rb:101-112 | Library/Homebrew/bundle/extensions/npm.rb:98-109 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×3
Edited copy of a member (3 corresponding lines) Library/Homebrew/bundle/extensions/winget.rb:135— Library/Homebrew/bundle/extensions/winget.rb:135-137 | Library/Homebrew/caveats.rb:18-22 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) Library/Homebrew/bundle/extensions/extension.rb:399— Library/Homebrew/bundle/extensions/extension.rb:399-401 | Library/Homebrew/bundle/package_type.rb:171-173 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) Library/Homebrew/install.rb:709— Library/Homebrew/install.rb:709-711 | Library/Homebrew/upgrade.rb:236-238 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×2
Edited copy of a member (37 corresponding lines) Library/Homebrew/cask/installer.rb:886— Library/Homebrew/cask/installer.rb:886-922 | Library/Homebrew/formula_installer.rb:1899-1941 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) Library/Homebrew/reinstall/reinstall.rb:42— Library/Homebrew/reinstall/reinstall.rb:42-78 | Library/Homebrew/upgrade.rb:594-635 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×2
Edited copy of a member (20 corresponding lines) Library/Homebrew/cmd/source.rb:141— Library/Homebrew/cmd/source.rb:141-166 | Library/Homebrew/cmd/source.rb:171-190 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) Library/Homebrew/cask/dsl.rb:774— Library/Homebrew/cask/dsl.rb:774-793 | Library/Homebrew/cask/dsl.rb:811-840 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×2
Edited copy of a member (18 corresponding lines) Library/Homebrew/diagnostic.rb:1557— Library/Homebrew/diagnostic.rb:1557-1574 | Library/Homebrew/diagnostic.rb:1579-1598 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Library/Homebrew/diagnostic.rb:543— Library/Homebrew/diagnostic.rb:543-560 | Library/Homebrew/diagnostic.rb:565-583 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×2
Edited copy of a member (16 corresponding lines) Library/Homebrew/cmd/update_report/reporter_hub.rb:113— Library/Homebrew/cmd/update_report/reporter_hub.rb:113-128 | Library/Homebrew/cmd/update_report/reporter_hub.rb:133-151 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) Library/Homebrew/extend/os/linux/keg_relocate.rb:117— Library/Homebrew/extend/os/linux/keg_relocate.rb:117-132 | Library/Homebrew/extend/os/mac/keg_relocate.rb:229-244 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×2
Edited copies of one member (3 members, 10+ corresponding lines) Library/Homebrew/cask/audit.rb:1012— Library/Homebrew/cask/audit.rb:1012-1021 | Library/Homebrew/cask/audit.rb:1026-1036 | Library/Homebrew/cask/audit.rb:1041-1050 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) Library/Homebrew/cask/audit.rb:1056— Library/Homebrew/cask/audit.rb:1056-1065 | Library/Homebrew/cask/audit.rb:1071-1082 | Library/Homebrew/cask/audit.rb:1087-1099 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×2
Edited copy of a member (9 corresponding lines) Library/Homebrew/sorbet/tapioca/compilers/rspec_dynamic_matchers.rb:42— Library/Homebrew/sorbet/tapioca/compilers/rspec_dynamic_matchers.rb:42-50 | Library/Homebrew/sorbet/tapioca/compilers/rspec_dynamic_matchers.rb:85-93 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) Library/Homebrew/bundle/extensions/extension.rb:230— Library/Homebrew/bundle/extensions/extension.rb:230-239 | Library/Homebrew/bundle/extensions/flatpak.rb:408-416 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (18 lines × 2) Library/Homebrew/cask/artifact/abstract_uninstall.rb:474— Library/Homebrew/cask/artifact/abstract_uninstall.rb:474-491 | Library/Homebrew/cask/ci/zap_check.rb:120-137 — 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 (18 lines × 2) Library/Homebrew/formula.rb:5312— Library/Homebrew/formula.rb:5312-5329 | Library/Homebrew/formula.rb:5423-5440 — both copies are in the same file, so extract the 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 (17 lines × 2) Library/Homebrew/diagnostic.rb:1817— Library/Homebrew/diagnostic.rb:1817-1833 | Library/Homebrew/diagnostic.rb:1852-1868 — both copies are in the same file, so extract the 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 `Library/Homebrew/diagnostic.rb:1817` 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 (17 lines × 2) Library/Homebrew/utils/shared_audits.rb:429— Library/Homebrew/utils/shared_audits.rb:429-445 | Library/Homebrew/utils/shared_audits.rb:523-539 — both copies are in the same file, so extract the 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 (13 lines × 2) Library/Homebrew/livecheck/strategy/crate.rb:97— Library/Homebrew/livecheck/strategy/crate.rb:97-109 | Library/Homebrew/livecheck/strategy/npm.rb:77-89 — 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 (13 lines × 2) Library/Homebrew/livecheck/strategy/github_latest.rb:91— Library/Homebrew/livecheck/strategy/github_latest.rb:91-103 | Library/Homebrew/livecheck/strategy/github_releases.rb:134-146 — 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 (10 lines × 2) Library/Homebrew/cask/cask_loader.rb:700— Library/Homebrew/cask/cask_loader.rb:700-709 | REDACTED:1267-1276 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Library/Homebrew/bundle/extensions/cargo.rb:268— Library/Homebrew/bundle/extensions/cargo.rb:268-277 | Library/Homebrew/bundle/extensions/uv.rb:351-360 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 5) Library/Homebrew/livecheck/strategy/json.rb:111— Library/Homebrew/livecheck/strategy/json.rb:111-119 | Library/Homebrew/livecheck/strategy/page_match.rb:100-108 | Library/Homebrew/livecheck/strategy/sparkle.rb:253-261 | Library/Homebrew/livecheck/strategy/xml.rb:150-158 | Library/Homebrew/livecheck/strategy/yaml.rb:109-117 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 5) Library/Homebrew/livecheck/strategy/apache.rb:103— Library/Homebrew/livecheck/strategy/apache.rb:103-111 | Library/Homebrew/livecheck/strategy/bitbucket.rb:114-122 | Library/Homebrew/livecheck/strategy/cpan.rb:92-100 | Library/Homebrew/livecheck/strategy/gnu.rb:107-115 | Library/Homebrew/livecheck/strategy/hackage.rb:91-99 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
Duplicated block (9 lines × 2) Library/Homebrew/livecheck/livecheck.rb:760— Library/Homebrew/livecheck/livecheck.rb:760-768 | Library/Homebrew/livecheck/livecheck.rb:1017-1025 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) Library/Homebrew/cask/staged.rb:48— Library/Homebrew/cask/staged.rb:48-56 | Library/Homebrew/install_steps.rb:1366-1374 — 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.
BumpFormulaPr.run (cyclomatic 112) REDACTED:103— BumpFormulaPr.run has cyclomatic complexity 112 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Livecheck.latest_version (cyclomatic 112) Library/Homebrew/livecheck/livecheck.rb:634— Livecheck.latest_version has cyclomatic complexity 112 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
List.run (cyclomatic 93) Library/Homebrew/cmd/list.rb:95— List.run has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Livecheck.run_checks (cyclomatic 90) Library/Homebrew/livecheck/livecheck.rb:161— Livecheck.run_checks has cyclomatic complexity 90 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AdvisoryMatch.run (cyclomatic 88) Library/Homebrew/dev-cmd/advisory-match.rb:74— AdvisoryMatch.run has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Livecheck.resource_version (cyclomatic 86) Library/Homebrew/livecheck/livecheck.rb:910— Livecheck.resource_version has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Runner.run_install_step (cyclomatic 84) Library/Homebrew/install_steps.rb:1002— Runner.run_install_step has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Bump.retrieve_versions_by_arch (cyclomatic 82) REDACTED:221— Bump.retrieve_versions_by_arch has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PyPI.update_python_resources! (cyclomatic 77) Library/Homebrew/utils/pypi.rb:250— PyPI.update_python_resources! 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.
UpdateReport.output_update_report (cyclomatic 75) Library/Homebrew/cmd/update-report.rb:94— UpdateReport.output_update_report has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FormulaAuditor.audit_deps (cyclomatic 72) Library/Homebrew/formula_auditor.rb:337— FormulaAuditor.audit_deps has cyclomatic complexity 72 (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.
Bump.retrieve_and_display_info_and_open_pr (cyclomatic 71) REDACTED:467— Bump.retrieve_and_display_info_and_open_pr has cyclomatic complexity 71 (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.
Bottle.bottle_formula (cyclomatic 67) Library/Homebrew/dev-cmd/bottle.rb:427— Bottle.bottle_formula has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Audit.run (cyclomatic 66) Library/Homebrew/dev-cmd/audit.rb:106— Audit.run has cyclomatic complexity 66 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Info.info_formula (cyclomatic 65) Library/Homebrew/cmd/info.rb:307— Info.info_formula has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InstallCmd.run (cyclomatic 64) Library/Homebrew/cmd/install.rb:179— InstallCmd.run 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.
FormulaAuditor.audit_specs (cyclomatic 64) Library/Homebrew/formula_auditor.rb:884— FormulaAuditor.audit_specs 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.
Influx.query (cyclomatic 64) Library/Homebrew/utils/analytics/influx.rb:87— Influx.query 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.
Repository.rows (cyclomatic 64) Library/Homebrew/utils/analytics/repository.rb:31— Repository.rows 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.
Audit.audit_signing (cyclomatic 61) Library/Homebrew/cask/audit.rb:629— Audit.audit_signing has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Bump.version_with_cooldown (cyclomatic 60) REDACTED:791— Bump.version_with_cooldown has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Contributions.run (cyclomatic 60) Library/Homebrew/dev-cmd/contributions.rb:126— Contributions.run has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Install.install_formula? (cyclomatic 59) Library/Homebrew/install/check.rb:17— Install.install_formula? has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
API.fetch_json_api_file (cyclomatic 58) Library/Homebrew/api.rb:50— API.fetch_json_api_file 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.
Tap.install (cyclomatic 58) Library/Homebrew/tap.rb:675— Tap.install 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.
NamedArgs.load_formula_or_cask (cyclomatic 55) Library/Homebrew/cli/named_args.rb:342— NamedArgs.load_formula_or_cask has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StaleLeadMaintainerPrApproval.evaluate (cyclomatic 49) .github/scripts/approve_stale_lead_maintainer_prs.rb:180— StaleLeadMaintainerPrApproval.evaluate has cyclomatic complexity 49 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UpgradeCmd.run (cyclomatic 47) Library/Homebrew/cmd/upgrade.rb:186— UpgradeCmd.run 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.
Curl.curl_check_http_content (cyclomatic 47) Library/Homebrew/utils/curl.rb:590— Curl.curl_check_http_content has cyclomatic complexity 47 (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.
BumpCaskPr.replace_version_and_checksum (cyclomatic 46) REDACTED:294— BumpCaskPr.replace_version_and_checksum 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.
OsvExport.merge_range_transitions (cyclomatic 46) Library/Homebrew/vulns/osv_export.rb:251— OsvExport.merge_range_transitions 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.
Release.run (cyclomatic 44) Library/Homebrew/dev-cmd/release.rb:43— Release.run 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.
DownloadQueue.fetch (cyclomatic 44) Library/Homebrew/download_queue.rb:141— DownloadQueue.fetch 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.
Miscellaneous.audit_formula (cyclomatic 44) Library/Homebrew/rubocops/lines.rb:954— Miscellaneous.audit_formula has cyclomatic complexity 44 (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.
Bottle.merge (cyclomatic 43) Library/Homebrew/dev-cmd/bottle.rb:786— Bottle.merge 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.
BumpCaskPr.run (cyclomatic 43) REDACTED:70— BumpCaskPr.run 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.
Upgrade.upgrade_casks! (cyclomatic 42) Library/Homebrew/cask/upgrade.rb:138— Upgrade.upgrade_casks! has cyclomatic complexity 42 (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.
PlatformIndependence.body? (cyclomatic 42) Library/Homebrew/vulns/platform_independence.rb:42— PlatformIndependence.body? 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.
ExecSubcommand.run_external_command (cyclomatic 41) Library/Homebrew/bundle/subcommand/exec.rb:89— ExecSubcommand.run_external_command 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.
UninstallCmd.run (cyclomatic 40) Library/Homebrew/cmd/uninstall.rb:46— UninstallCmd.run 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.
PrPull.run (cyclomatic 40) Library/Homebrew/dev-cmd/pr-pull.rb:84— PrPull.run 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.
Cleanup.stale_formula? (cyclomatic 39) Library/Homebrew/cleanup.rb:167— Cleanup.stale_formula? 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.
Cli.stop (cyclomatic 39) Library/Homebrew/services/cli.rb:230— Cli.stop 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.
OnSystemConditionals.simplify_os_sha256_stanzas (cyclomatic 38) Library/Homebrew/rubocops/cask/on_system_conditionals.rb:127— OnSystemConditionals.simplify_os_sha256_stanzas 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.
DocstringParser.parse_content (cyclomatic 38) Library/Homebrew/yard/docstring_parser.rb:25— DocstringParser.parse_content has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FormulaHistory.report (cyclomatic 36) Library/Homebrew/utils/analytics/formula_history.rb:64— FormulaHistory.report 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.
App.install_phase (cyclomatic 35) Library/Homebrew/cask/artifact/app.rb:23— App.install_phase 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.
Caskroom.migrate_caskfile_to_json (cyclomatic 34) Library/Homebrew/cask/caskroom.rb:72— Caskroom.migrate_caskfile_to_json has cyclomatic complexity 34 (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.
Reporter.report (cyclomatic 34) Library/Homebrew/cmd/update_report/reporter.rb:58— Reporter.report has cyclomatic complexity 34 (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.
Extract.run (cyclomatic 34) Library/Homebrew/dev-cmd/extract.rb:36— Extract.run has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Tap.apply_redirected_remote! (cyclomatic 34) Library/Homebrew/tap.rb:550— Tap.apply_redirected_remote! has cyclomatic complexity 34 (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.
Link.run (cyclomatic 33) Library/Homebrew/cmd/link.rb:42— Link.run 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.
FormulaCellarChecks.check_prebuilt_npm_binaries (cyclomatic 33) Library/Homebrew/formula_cellar_checks.rb:436— FormulaCellarChecks.check_prebuilt_npm_binaries has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Bump.run (cyclomatic 31) REDACTED:110— Bump.run 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.
Contributions.scan_maintainer_contributions (cyclomatic 31) Library/Homebrew/dev-cmd/contributions.rb:558— Contributions.scan_maintainer_contributions 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.
Version.<=> (cyclomatic 31) Library/Homebrew/version.rb:574— Version.<=> 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.
Deps.run (cyclomatic 30) REDACTED:120— Deps.run 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.
BumpFormulaPr.patches_for_removal (cyclomatic 30) REDACTED:564— BumpFormulaPr.patches_for_removal 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.
GitHubPackages.upload_bottle (cyclomatic 30) Library/Homebrew/github_packages.rb:205— GitHubPackages.upload_bottle 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.
LinkageChecker.check_dylibs (cyclomatic 30) Library/Homebrew/linkage_checker.rb:148— LinkageChecker.check_dylibs 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.
InstallStepsHelper.simple_install_step_line (cyclomatic 30) Library/Homebrew/rubocops/shared/install_steps_helper.rb:466— InstallStepsHelper.simple_install_step_line 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.
Style.check_style_impl (cyclomatic 30) REDACTED:86— Style.check_style_impl 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.
AdvisoryOverrides.initialize (cyclomatic 30) Library/Homebrew/vulns/advisory_overrides.rb:43— AdvisoryOverrides.initialize 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.
FormulaStructGenerator.generate_formula_struct_hash (cyclomatic 29) Library/Homebrew/api/formula/formula_struct_generator.rb:43— FormulaStructGenerator.generate_formula_struct_hash has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Audit.audit_min_os (cyclomatic 29) Library/Homebrew/cask/audit.rb:949— Audit.audit_min_os 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.
FormulaAuditor.audit_revision (cyclomatic 29) Library/Homebrew/formula_auditor.rb:1056— FormulaAuditor.audit_revision 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.
StaleLeadMaintainerPrApproval.finish (cyclomatic 28) .github/scripts/approve_stale_lead_maintainer_prs.rb:375— StaleLeadMaintainerPrApproval.finish 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.
Cask.install! (cyclomatic 28) Library/Homebrew/bundle/cask.rb:74— Cask.install! has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FormulaInstaller.finish (cyclomatic 28) Library/Homebrew/formula_installer.rb:1070— FormulaInstaller.finish has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Metadata.read_directly (cyclomatic 28) Library/Homebrew/os/linux/elf.rb:270— Metadata.read_directly 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.
TestResource.audit_formula (cyclomatic 28) Library/Homebrew/rubocops/class.rb:84— TestResource.audit_formula 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.
JavaVersions.audit_formula (cyclomatic 28) Library/Homebrew/rubocops/lines.rb:510— JavaVersions.audit_formula 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.
Upgrade.upgrade_dependents (cyclomatic 28) Library/Homebrew/upgrade.rb:319— Upgrade.upgrade_dependents 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.
CPAN.update_perl_resources! (cyclomatic 28) Library/Homebrew/utils/cpan.rb:93— CPAN.update_perl_resources! has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SharedAudits.new_domain_problem (cyclomatic 28) Library/Homebrew/utils/shared_audits.rb:67— SharedAudits.new_domain_problem has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Identify.registry_purl (cyclomatic 28) Library/Homebrew/vulns/identify.rb:197— Identify.registry_purl has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CleanupSubcommand.cleanup (cyclomatic 27) Library/Homebrew/bundle/subcommand/cleanup.rb:123— CleanupSubcommand.cleanup 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.
FetchCmd.run (cyclomatic 27) Library/Homebrew/cmd/fetch.rb:83— FetchCmd.run 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.
Reporter.migrate_tap_migration (cyclomatic 27) Library/Homebrew/cmd/update_report/reporter.rb:224— Reporter.migrate_tap_migration 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.
CurlDownloadStrategy.fetch (cyclomatic 27) Library/Homebrew/download_strategy/curl_download_strategy.rb:40— CurlDownloadStrategy.fetch 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.
FormulaInstaller.check_install_sanity (cyclomatic 27) Library/Homebrew/formula_installer.rb:418— FormulaInstaller.check_install_sanity 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.
FormulaInstaller.expand_dependencies_for_formula_once (cyclomatic 27) Library/Homebrew/formula_installer.rb:794— FormulaInstaller.expand_dependencies_for_formula_once 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.
Text.audit_formula (cyclomatic 27) Library/Homebrew/rubocops/text.rb:14— Text.audit_formula 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.
Style.run_rubocop (cyclomatic 27) REDACTED:210— Style.run_rubocop 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.
Match.reconcile_history (cyclomatic 27) Library/Homebrew/vulns/match.rb:968— Match.reconcile_history 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.
AppImage.install_phase (cyclomatic 26) Library/Homebrew/cask/artifact/appimage.rb:28— AppImage.install_phase 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.
Audit.extract_artifacts (cyclomatic 26) Library/Homebrew/cask/audit.rb:185— Audit.extract_artifacts 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.
Audit.audit_rosetta (cyclomatic 26) Library/Homebrew/cask/audit.rb:824— Audit.audit_rosetta 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.
Cask.auto_updates_bundle_outdated? (cyclomatic 26) Library/Homebrew/cask/cask.rb:884— Cask.auto_updates_bundle_outdated? 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.
Upgrade.outdated_casks (cyclomatic 26) Library/Homebrew/cask/upgrade.rb:40— Upgrade.outdated_casks 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.
Parser.parse (cyclomatic 26) Library/Homebrew/cli/parser.rb:462— Parser.parse 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.
Contributions.scan_contributions (cyclomatic 26) Library/Homebrew/dev-cmd/contributions.rb:385— Contributions.scan_contributions 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.
Contributions.parse_git_log (cyclomatic 26) Library/Homebrew/dev-cmd/contributions.rb:928— Contributions.parse_git_log 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.
LivecheckCmd.run (cyclomatic 26) Library/Homebrew/dev-cmd/livecheck.rb:59— LivecheckCmd.run 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.
Typecheck.run (cyclomatic 26) Library/Homebrew/dev-cmd/typecheck.rb:48— Typecheck.run 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.
Unbottled.output_unbottled (cyclomatic 26) Library/Homebrew/dev-cmd/unbottled.rb:210— Unbottled.output_unbottled 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.
Moved.move (cyclomatic 25) Library/Homebrew/cask/artifact/moved.rb:83— Moved.move 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.
Audit.cask_bundle_min_os (cyclomatic 25) Library/Homebrew/cask/audit.rb:1378— Audit.cask_bundle_min_os 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.
UpgradeCmd.formulae_upgrade_context (cyclomatic 25) Library/Homebrew/cmd/upgrade.rb:394— UpgradeCmd.formulae_upgrade_context 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.
Lgtm.run (cyclomatic 25) Library/Homebrew/dev-cmd/lgtm.rb:26— Lgtm.run 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.
FormulaCellarChecks.check_binary_arches (cyclomatic 25) Library/Homebrew/formula_cellar_checks.rb:370— FormulaCellarChecks.check_binary_arches 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.
FormulaInstaller.install (cyclomatic 25) Library/Homebrew/formula_installer.rb:559— FormulaInstaller.install 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.
Service.to_plist (cyclomatic 25) Library/Homebrew/service.rb:609— Service.to_plist 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.
Utils.safe_fork (cyclomatic 25) Library/Homebrew/utils/fork.rb:145— Utils.safe_fork 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.
Match.subject_version_at (cyclomatic 25) Library/Homebrew/vulns/match.rb:1199— Match.subject_version_at 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.
OnSystemConditionals.audit_identical_sha256_across_architectures (cyclomatic 24) Library/Homebrew/rubocops/cask/on_system_conditionals.rb:389— OnSystemConditionals.audit_identical_sha256_across_architectures 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.
OSDependsOn.on_send (cyclomatic 24) Library/Homebrew/rubocops/os_depends_on.rb:52— OSDependsOn.on_send 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.
Releases.report (cyclomatic 24) Library/Homebrew/utils/analytics/releases.rb:16— Releases.report 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.
PatchInclusion.removal_reason (cyclomatic 24) Library/Homebrew/utils/github/patch_inclusion.rb:24— PatchInclusion.removal_reason 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.
Mixin.odeprecated (cyclomatic 24) Library/Homebrew/utils/output.rb:189— Mixin.odeprecated 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.
Reinstall.run (cyclomatic 23) Library/Homebrew/cmd/reinstall.rb:124— Reinstall.run 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.
Untrust.run (cyclomatic 23) Library/Homebrew/cmd/untrust.rb:31— Untrust.run 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.
VersionInstall.run (cyclomatic 23) Library/Homebrew/cmd/version-install.rb:31— VersionInstall.run 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.
Contributions.generate_maintainer_report_csv (cyclomatic 23) Library/Homebrew/dev-cmd/contributions.rb:1172— Contributions.generate_maintainer_report_csv 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.
FormulaAuditor.audit_license (cyclomatic 23) Library/Homebrew/formula_auditor.rb:265— FormulaAuditor.audit_license 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.
ResourceAuditor.audit_urls (cyclomatic 23) Library/Homebrew/resource_auditor.rb:194— ResourceAuditor.audit_urls 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.
Uninstall.uninstall_kegs (cyclomatic 23) Library/Homebrew/uninstall.rb:25— Uninstall.uninstall_kegs 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.
FormulaHistory.apply (cyclomatic 23) Library/Homebrew/utils/analytics/formula_history.rb:206— FormulaHistory.apply 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.
Curl.curl_args (cyclomatic 23) Library/Homebrew/utils/curl.rb:121— Curl.curl_args 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.
Sponsors.open_collective (cyclomatic 23) Library/Homebrew/utils/sponsors.rb:145— Sponsors.open_collective 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.
Edit.run (cyclomatic 22) Library/Homebrew/dev-cmd/edit.rb:30— Edit.run 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.
GenerateCaskCiMatrix.run (cyclomatic 22) Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb:54— GenerateCaskCiMatrix.run 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.
FormulaInstaller.install_dependency (cyclomatic 22) Library/Homebrew/formula_installer.rb:962— FormulaInstaller.install_dependency 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.
Formulary.load_formula_from_struct! (cyclomatic 22) REDACTED:236— Formulary.load_formula_from_struct! 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.
ComponentsRedundancy.audit_formula (cyclomatic 22) Library/Homebrew/rubocops/components_redundancy.rb:22— ComponentsRedundancy.audit_formula 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.
UrlHelper.audit_url (cyclomatic 22) Library/Homebrew/rubocops/shared/url_helper.rb:52— UrlHelper.audit_url 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.
Caveats.keg_only_text (cyclomatic 21) Library/Homebrew/caveats.rb:72— Caveats.keg_only_text 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.
Cleanup.prune_prefix_symlinks_and_directories (cyclomatic 21) Library/Homebrew/cleanup.rb:989— Cleanup.prune_prefix_symlinks_and_directories 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.
Untap.run (cyclomatic 21) Library/Homebrew/cmd/untap.rb:25— Untap.run has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UpgradeCmd.show_final_upgrade_summary (cyclomatic 21) Library/Homebrew/cmd/upgrade.rb:571— UpgradeCmd.show_final_upgrade_summary 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.
UpgradeCmd.upgrade_outdated_formulae! (cyclomatic 21) Library/Homebrew/cmd/upgrade.rb:662— UpgradeCmd.upgrade_outdated_formulae! 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.
BumpUnversionedCasks.bump_unversioned_cask (cyclomatic 21) Library/Homebrew/dev-cmd/bump-unversioned-casks.rb:90— BumpUnversionedCasks.bump_unversioned_cask 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.
GitDownloadStrategy.env (cyclomatic 21) Library/Homebrew/download_strategy/git_download_strategy.rb:123— GitDownloadStrategy.env 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.
FormulaInstaller.forbidden_tap_check (cyclomatic 21) Library/Homebrew/formula_installer.rb:1898— FormulaInstaller.forbidden_tap_check 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.
Formulary.tap_formula_name_type (cyclomatic 21) REDACTED:1208— Formulary.tap_formula_name_type 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.
Keg.link_dir (cyclomatic 21) Library/Homebrew/keg.rb:936— Keg.link_dir 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.
TernaryToIf.before_declaring_variable (cyclomatic 21) Library/Homebrew/rubocops/ternary_to_if.rb:32— TernaryToIf.before_declaring_variable 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.
API.generate_repositories (cyclomatic 21) Library/Homebrew/utils/analytics/api.rb:368— API.generate_repositories 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.
Match.range_status (cyclomatic 21) Library/Homebrew/vulns/match.rb:729— Match.range_status 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.
Match.to_brew_record (cyclomatic 21) Library/Homebrew/vulns/match.rb:804— Match.to_brew_record 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.
Build.install (cyclomatic 20) Library/Homebrew/build.rb:85— Build.install 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.
Installer.homebrew_batchable? (cyclomatic 20) Library/Homebrew/bundle/installer.rb:248— Installer.homebrew_batchable? 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.
Installer.forbidden_cask_and_formula_check (cyclomatic 20) Library/Homebrew/cask/installer.rb:926— Installer.forbidden_cask_and_formula_check 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.
Installer.load_installed_caskfile! (cyclomatic 20) Library/Homebrew/cask/installer.rb:1027— Installer.load_installed_caskfile! 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.
Upgrade.upgrade_cask (cyclomatic 20) Library/Homebrew/cask/upgrade.rb:387— Upgrade.upgrade_cask 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.
DirEmitter.reconcile (cyclomatic 20) Library/Homebrew/dev-cmd/advisory-match.rb:955— DirEmitter.reconcile 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.
Contributions.approved_pull_request? (cyclomatic 20) Library/Homebrew/dev-cmd/contributions.rb:684— Contributions.approved_pull_request? 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.
FormulaCreator.initialize (cyclomatic 20) Library/Homebrew/formula_creator.rb:31— FormulaCreator.initialize 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.
InstalledDependents.find_some_installed_dependents (cyclomatic 20) Library/Homebrew/installed_dependents.rb:30— InstalledDependents.find_some_installed_dependents 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.
Livecheck.url (cyclomatic 20) Library/Homebrew/livecheck.rb:203— Livecheck.url 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.
OnSystemConditionals.sha256_pairs (cyclomatic 20) Library/Homebrew/rubocops/cask/on_system_conditionals.rb:338— OnSystemConditionals.sha256_pairs 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.
GemSetup.install_bundler_gems! (cyclomatic 20) Library/Homebrew/utils/gem_setup.rb:197— GemSetup.install_bundler_gems! 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.
Match.reconciliation_observation (cyclomatic 20) Library/Homebrew/vulns/match.rb:1035— Match.reconciliation_observation 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.
OsvExport.merge_existing (cyclomatic 20) Library/Homebrew/vulns/osv_export.rb:112— OsvExport.merge_existing 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.
Scanner.build_target (cyclomatic 20) Library/Homebrew/vulns/scanner.rb:171— Scanner.build_target 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.
Attestation.check_attestation (cyclomatic 19) REDACTED:222— Attestation.check_attestation 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.
Cargo.package_outdated? (cyclomatic 19) Library/Homebrew/bundle/extensions/cargo.rb:163— Cargo.package_outdated? 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.
CaskLoader.tap_cask_token_type (cyclomatic 19) Library/Homebrew/cask/cask_loader.rb:649— CaskLoader.tap_cask_token_type 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.
Installer.forbidden_tap_check (cyclomatic 19) Library/Homebrew/cask/installer.rb:885— Installer.forbidden_tap_check 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.
Caveats.service_caveats (cyclomatic 19) Library/Homebrew/caveats.rb:287— Caveats.service_caveats 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.
NamedArgs.to_paths (cyclomatic 19) Library/Homebrew/cli/named_args.rb:189— NamedArgs.to_paths 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.
Parser.generate_usage_banner (cyclomatic 19) Library/Homebrew/cli/parser.rb:780— Parser.generate_usage_banner 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.
Info.run (cyclomatic 19) Library/Homebrew/cmd/info.rb:100— Info.run 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.
DirEmitter.terminal_intervals (cyclomatic 19) Library/Homebrew/dev-cmd/advisory-match.rb:902— DirEmitter.terminal_intervals 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.
AdvisoryMatch.reconcile_formula (cyclomatic 19) Library/Homebrew/dev-cmd/advisory-match.rb:391— AdvisoryMatch.reconcile_formula 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.
Create.create_formula (cyclomatic 19) Library/Homebrew/dev-cmd/create.rb:228— Create.create_formula 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.
GenerateCaskCiMatrix.generate_matrix (cyclomatic 19) Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb:220— GenerateCaskCiMatrix.generate_matrix 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.
PrUpload.run (cyclomatic 19) Library/Homebrew/dev-cmd/pr-upload.rb:50— PrUpload.run 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.
Checks.check_untrusted_taps (cyclomatic 19) Library/Homebrew/diagnostic.rb:1050— Checks.check_untrusted_taps 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.
Formula.system (cyclomatic 19) Library/Homebrew/formula.rb:3743— Formula.system 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.
FormulaAuditor.audit_compatibility_version (cyclomatic 19) Library/Homebrew/formula_auditor.rb:1120— FormulaAuditor.audit_compatibility_version 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.
FormulaInstaller.pour (cyclomatic 19) Library/Homebrew/formula_installer.rb:1725— FormulaInstaller.pour 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.
Runner.sandbox_write_paths (cyclomatic 19) Library/Homebrew/install_steps.rb:947— Runner.sandbox_write_paths 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.
InstallSteps.keychain_find_certificate_name (cyclomatic 19) Library/Homebrew/rubocops/cask/install_steps.rb:187— InstallSteps.keychain_find_certificate_name 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.
NoOverrides.on_system_stanzas (cyclomatic 19) Library/Homebrew/rubocops/cask/no_overrides.rb:39— NoOverrides.on_system_stanzas 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.
ComponentsOrder.audit_formula (cyclomatic 19) Library/Homebrew/rubocops/components_order.rb:27— ComponentsOrder.audit_formula 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.
FormulaFeeds.changes (cyclomatic 19) Library/Homebrew/utils/analytics/formula_feeds.rb:90— FormulaFeeds.changes 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.
API.raise_error (cyclomatic 19) Library/Homebrew/utils/github/api.rb:463— API.raise_error 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.
History.walk (cyclomatic 19) Library/Homebrew/vulns/history.rb:66— History.walk 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.
Bump.create_pr (cyclomatic 18) Library/Homebrew/bump.rb:49— Bump.create_pr 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.
Brew.formula_to_hash (cyclomatic 18) Library/Homebrew/bundle/brew.rb:358— Brew.formula_to_hash 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.
Parser.named_args (cyclomatic 18) Library/Homebrew/cli/parser.rb:633— Parser.named_args 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.
DirEmitter.prepare_aliases (cyclomatic 18) Library/Homebrew/dev-cmd/advisory-match.rb:715— DirEmitter.prepare_aliases 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.
BumpFormulaPr.update_resource_block! (cyclomatic 18) REDACTED:869— BumpFormulaPr.update_resource_block! 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.
Contributions.maintainer_activity_summary (cyclomatic 18) Library/Homebrew/dev-cmd/contributions.rb:1317— Contributions.maintainer_activity_summary 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.
DispatchBuildBottle.run (cyclomatic 18) Library/Homebrew/dev-cmd/dispatch-build-bottle.rb:43— DispatchBuildBottle.run 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.
Unbottled.run (cyclomatic 18) Library/Homebrew/dev-cmd/unbottled.rb:45— Unbottled.run 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.
CurlDownloadStrategy.resolve_url_basename_time_file_size (cyclomatic 18) Library/Homebrew/download_strategy/curl_download_strategy.rb:209— CurlDownloadStrategy.resolve_url_basename_time_file_size 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.
Formula.eligible_kegs_for_cleanup (cyclomatic 18) Library/Homebrew/formula.rb:3851— Formula.eligible_kegs_for_cleanup 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.
FormulaAuditor.audit_file (cyclomatic 18) Library/Homebrew/formula_auditor.rb:89— FormulaAuditor.audit_file 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.
FormulaInstaller.enqueue_fetch (cyclomatic 18) Library/Homebrew/formula_installer.rb:1622— FormulaInstaller.enqueue_fetch has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Keg.make_relative_symlink (cyclomatic 18) Library/Homebrew/keg.rb:851— Keg.make_relative_symlink 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.
McpServer.respond_to_tools_call (cyclomatic 18) REDACTED:361— McpServer.respond_to_tools_call 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.
Patches.patch_problems (cyclomatic 18) Library/Homebrew/rubocops/patches.rb:58— Patches.patch_problems 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.
DescHelper.audit_desc (cyclomatic 18) Library/Homebrew/rubocops/shared/desc_helper.rb:21— DescHelper.audit_desc 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.
Cli.service_load (cyclomatic 18) Library/Homebrew/services/cli.rb:487— Cli.service_load has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
API.open_rest (cyclomatic 18) Library/Homebrew/utils/github/api.rb:299— API.open_rest 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.
Trust.entries (cyclomatic 17) Library/Homebrew/bundle/trust.rb:20— Trust.entries 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.
FromAPILoader.load_from_struct (cyclomatic 17) Library/Homebrew/cask/cask_loader.rb:386— FromAPILoader.load_from_struct 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.
NamedArgs.warn_if_cask_conflicts (cyclomatic 17) Library/Homebrew/cli/named_args.rb:631— NamedArgs.warn_if_cask_conflicts 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.
Info.print_json (cyclomatic 17) Library/Homebrew/cmd/info.rb:576— Info.print_json 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.
DeprecateDisable.message (cyclomatic 17) Library/Homebrew/deprecate_disable.rb:76— DeprecateDisable.message 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.
Bump.handle_formulae_and_casks (cyclomatic 17) REDACTED:951— Bump.handle_formulae_and_casks 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.
Bump.livecheck_result (cyclomatic 17) REDACTED:1030— Bump.livecheck_result 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.
Create.create_cask (cyclomatic 17) Library/Homebrew/dev-cmd/create.rb:93— Create.create_cask 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.
Extract.with_monkey_patch (cyclomatic 17) Library/Homebrew/dev-cmd/extract.rb:182— Extract.with_monkey_patch 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.
FormulaInstaller.pour_bottle? (cyclomatic 17) Library/Homebrew/formula_installer.rb:259— FormulaInstaller.pour_bottle? 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.
FormulaInstaller.build (cyclomatic 17) Library/Homebrew/formula_installer.rb:1214— FormulaInstaller.build 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.
FromNameLoader.try_new (cyclomatic 17) REDACTED:765— FromNameLoader.try_new 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.
Keg.relocate_build_prefix (cyclomatic 17) Library/Homebrew/keg_relocate.rb:325— Keg.relocate_build_prefix 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.
Readall.valid_casks? (cyclomatic 17) Library/Homebrew/readall.rb:130— Readall.valid_casks? 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.
InstallSteps.keychain_certificate_step_lines (cyclomatic 17) Library/Homebrew/rubocops/cask/install_steps.rb:118— InstallSteps.keychain_certificate_step_lines 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.
PythonVersions.audit_formula (cyclomatic 17) Library/Homebrew/rubocops/lines.rb:633— PythonVersions.audit_formula 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.
ShellCommands.on_send (cyclomatic 17) Library/Homebrew/rubocops/shell_commands.rb:74— ShellCommands.on_send 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.
Curl.curl_http_content_headers_and_checksum (cyclomatic 17) Library/Homebrew/utils/curl.rb:755— Curl.curl_http_content_headers_and_checksum 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.
Identify.registry_package_for (cyclomatic 17) Library/Homebrew/vulns/identify.rb:150— Identify.registry_package_for 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.
Vulnerability.non_semver_fix_available_of_type? (cyclomatic 17) Library/Homebrew/vulns/vulnerability.rb:429— Vulnerability.non_semver_fix_available_of_type? 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.
FromPathLoader.load (cyclomatic 16) Library/Homebrew/cask/cask_loader.rb:133— FromPathLoader.load 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.
FromNameLoader.try_new (cyclomatic 16) Library/Homebrew/cask/cask_loader.rb:480— FromNameLoader.try_new 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.
DSL.sha256 (cyclomatic 16) Library/Homebrew/cask/dsl.rb:553— DSL.sha256 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.
Cleanup.cleanup_cache (cyclomatic 16) Library/Homebrew/cleanup.rb:749— Cleanup.cleanup_cache 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.
Parser.switch (cyclomatic 16) Library/Homebrew/cli/parser.rb:233— Parser.switch 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.
Parser.formulae (cyclomatic 16) Library/Homebrew/cli/parser.rb:1148— Parser.formulae 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.
FetchCmd.cask_downloads (cyclomatic 16) Library/Homebrew/cmd/fetch.rb:197— FetchCmd.cask_downloads 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.
FetchCmd.enqueue_api_formula_bottles? (cyclomatic 16) Library/Homebrew/cmd/fetch.rb:286— FetchCmd.enqueue_api_formula_bottles? 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.
Info.github_info (cyclomatic 16) Library/Homebrew/cmd/info.rb:237— Info.github_info 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.
Dependency.installed? (cyclomatic 16) Library/Homebrew/dependency.rb:103— Dependency.installed? 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.
DirEmitter.reconciliation_resource_records (cyclomatic 16) Library/Homebrew/dev-cmd/advisory-match.rb:816— DirEmitter.reconciliation_resource_records 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.
Bottle.keg_contain? (cyclomatic 16) Library/Homebrew/dev-cmd/bottle.rb:254— Bottle.keg_contain? 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.
FormulaAnalytics.run (cyclomatic 16) Library/Homebrew/dev-cmd/formula-analytics.rb:66— FormulaAnalytics.run 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.
Unbottled.output_lost_bottles (cyclomatic 16) Library/Homebrew/dev-cmd/unbottled.rb:291— Unbottled.output_lost_bottles 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.
WhichUpdate.update_and_save! (cyclomatic 16) Library/Homebrew/dev-cmd/which-update.rb:56— WhichUpdate.update_and_save! 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.
FormulaCellarChecks.check_cpuid_instruction (cyclomatic 16) Library/Homebrew/formula_cellar_checks.rb:324— FormulaCellarChecks.check_cpuid_instruction 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.
Keg.elf_relocation_strings (cyclomatic 16) Library/Homebrew/keg_relocate.rb:702— Keg.elf_relocation_strings 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.
LinkageChecker.check_formula_deps (cyclomatic 16) Library/Homebrew/linkage_checker.rb:254— LinkageChecker.check_formula_deps 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.
Livecheck.livecheck_url_to_string (cyclomatic 16) Library/Homebrew/livecheck/livecheck.rb:535— Livecheck.livecheck_url_to_string 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.
McpServer.handle_request (cyclomatic 16) REDACTED:309— McpServer.handle_request has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
MissingFormula.tap_migration_reason (cyclomatic 16) Library/Homebrew/missing_formula.rb:102— MissingFormula.tap_migration_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.
AssertStatements.audit_formula (cyclomatic 16) Library/Homebrew/rubocops/lines.rb:72— AssertStatements.audit_formula 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.
RedundantGenerateCompletionsShells.audit_formula (cyclomatic 16) Library/Homebrew/rubocops/lines.rb:913— RedundantGenerateCompletionsShells.audit_formula 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.
InstallStepsHelper.brew_ruby_step_node (cyclomatic 16) Library/Homebrew/rubocops/shared/install_steps_helper.rb:175— InstallStepsHelper.brew_ruby_step_node 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.
Service.to_systemd_unit (cyclomatic 16) Library/Homebrew/service.rb:675— Service.to_systemd_unit 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.
Cli.start (cyclomatic 16) Library/Homebrew/services/cli.rb:181— Cli.start 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.
SystemCommand.each_output_line (cyclomatic 16) Library/Homebrew/system_command.rb:449— SystemCommand.each_output_line 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.
TapAuditor.check_renames (cyclomatic 16) Library/Homebrew/tap_auditor.rb:160— TapAuditor.check_renames 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.
UnversionedCaskChecker.guess_cask_version (cyclomatic 16) Library/Homebrew/unversioned_cask_checker.rb:184— UnversionedCaskChecker.guess_cask_version 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.
API.github_activity (cyclomatic 16) Library/Homebrew/utils/analytics/api.rb:245— API.github_activity 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.
FormulaFeeds.generate (cyclomatic 16) Library/Homebrew/utils/analytics/formula_feeds.rb:34— FormulaFeeds.generate 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.
Curl.curl_with_workarounds (cyclomatic 16) Library/Homebrew/utils/curl.rb:257— Curl.curl_with_workarounds 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.
Utils.popen (cyclomatic 16) Library/Homebrew/utils/popen.rb:102— Utils.popen 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.
Vulnerability.range_status_for_entries (cyclomatic 16) Library/Homebrew/vulns/vulnerability.rb:184— Vulnerability.range_status_for_entries 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.
XxxComment Library/Homebrew/requirement.rb:142— # XXX If the satisfy block returns a Pathname, then make sure that it — 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.
HackComment Library/Homebrew/cmd/update_report/reporter.rb:411— # Hack `git diff` output with regexes to look like `git diff-tree` output. — 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.
List.run (cognitive 184) Library/Homebrew/cmd/list.rb:95— List.run has cognitive complexity 184 (threshold 15). Drivers by points: if/else 66 (146 pts), boolean chains 28, ternaries 2 (6 pts), error handling 1 (4 pts) (nesting depth added 87). 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.
Livecheck.latest_version (cognitive 162) Library/Homebrew/livecheck/livecheck.rb:634— Livecheck.latest_version has cognitive complexity 162 (threshold 15). Drivers by points: if/else 75 (126 pts), boolean chains 25, match/switch 3 (7 pts), ternaries 2 (4 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpdateReport.output_update_report (cognitive 150) Library/Homebrew/cmd/update-report.rb:94— UpdateReport.output_update_report has cognitive complexity 150 (threshold 15). Drivers by points: if/else 57 (124 pts), boolean chains 17, error handling 3 (9 pts) (nesting depth added 73). 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.
BumpFormulaPr.run (cognitive 145) REDACTED:103— BumpFormulaPr.run has cognitive complexity 145 (threshold 15). Drivers by points: if/else 86 (113 pts), boolean chains 25, ternaries 2 (4 pts), error handling 2 (3 pts) (nesting depth added 30). 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.
Livecheck.resource_version (cognitive 119) Library/Homebrew/livecheck/livecheck.rb:910— Livecheck.resource_version has cognitive complexity 119 (threshold 15). Drivers by points: if/else 65 (98 pts), boolean chains 16, ternaries 2 (4 pts), error handling 1 (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.
Livecheck.run_checks (cognitive 112) Library/Homebrew/livecheck/livecheck.rb:161— Livecheck.run_checks has cognitive complexity 112 (threshold 15). Drivers by points: if/else 57 (87 pts), boolean chains 23, error handling 1, match/switch 1 (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.
Bump.retrieve_versions_by_arch (cognitive 103) REDACTED:221— Bump.retrieve_versions_by_arch has cognitive complexity 103 (threshold 15). Drivers by points: if/else 40 (59 pts), boolean chains 40, ternaries 3, error handling 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NamedArgs.load_formula_or_cask (cognitive 102) Library/Homebrew/cli/named_args.rb:342— NamedArgs.load_formula_or_cask has cognitive complexity 102 (threshold 15). Drivers by points: if/else 33 (73 pts), error handling 5 (14 pts), boolean chains 13, match/switch 1 (2 pts) (nesting depth added 50). 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.
InstallCmd.run (cognitive 102) Library/Homebrew/cmd/install.rb:179— InstallCmd.run has cognitive complexity 102 (threshold 15). Drivers by points: if/else 41 (75 pts), boolean chains 15, error handling 5 (9 pts), match/switch 1 (3 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.
DownloadQueue.fetch (cognitive 102) Library/Homebrew/download_queue.rb:141— DownloadQueue.fetch has cognitive complexity 102 (threshold 15). Drivers by points: if/else 36 (77 pts), error handling 5 (13 pts), boolean chains 7, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 52). 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.
Bottle.bottle_formula (cognitive 99) Library/Homebrew/dev-cmd/bottle.rb:427— Bottle.bottle_formula has cognitive complexity 99 (threshold 15). Drivers by points: if/else 60 (88 pts), boolean chains 8, ternaries 2, error handling 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runner.run_install_step (cognitive 97) Library/Homebrew/install_steps.rb:1002— Runner.run_install_step has cognitive complexity 97 (threshold 15). Drivers by points: if/else 39 (78 pts), boolean chains 18, match/switch 1 (nesting depth added 39). 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.
PyPI.update_python_resources! (cognitive 96) Library/Homebrew/utils/pypi.rb:250— PyPI.update_python_resources! has cognitive complexity 96 (threshold 15). Drivers by points: if/else 53 (71 pts), boolean chains 24, error handling 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdvisoryMatch.run (cognitive 94) Library/Homebrew/dev-cmd/advisory-match.rb:74— AdvisoryMatch.run has cognitive complexity 94 (threshold 15). Drivers by points: if/else 43 (59 pts), boolean chains 30, ternaries 1 (3 pts), error handling 1, match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Bump.retrieve_and_display_info_and_open_pr (cognitive 92) REDACTED:467— Bump.retrieve_and_display_info_and_open_pr has cognitive complexity 92 (threshold 15). Drivers by points: if/else 47 (62 pts), boolean chains 29, ternaries 1 (nesting depth added 15). 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.
Influx.query (cognitive 87) Library/Homebrew/utils/analytics/influx.rb:87— Influx.query has cognitive complexity 87 (threshold 15). Drivers by points: if/else 44 (63 pts), ternaries 8 (16 pts), boolean chains 4, loops 1 (2 pts), match/switch 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Bump.version_with_cooldown (cognitive 84) REDACTED:791— Bump.version_with_cooldown has cognitive complexity 84 (threshold 15). Drivers by points: if/else 37 (71 pts), boolean chains 12, match/switch 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Info.info_formula (cognitive 82) Library/Homebrew/cmd/info.rb:307— Info.info_formula has cognitive complexity 82 (threshold 15). Drivers by points: if/else 36 (52 pts), boolean chains 23, error handling 2 (4 pts), ternaries 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.
Repository.rows (cognitive 81) Library/Homebrew/utils/analytics/repository.rb:31— Repository.rows has cognitive complexity 81 (threshold 15). Drivers by points: if/else 33 (44 pts), boolean chains 17, ternaries 10 (16 pts), error handling 1 (2 pts), loops 1 (2 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.
Install.install_formula? (cognitive 80) Library/Homebrew/install/check.rb:17— Install.install_formula? has cognitive complexity 80 (threshold 15). Drivers by points: if/else 36 (55 pts), boolean chains 25 (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.
Contributions.run (cognitive 78) Library/Homebrew/dev-cmd/contributions.rb:126— Contributions.run has cognitive complexity 78 (threshold 15). Drivers by points: if/else 39 (54 pts), boolean chains 22, match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tap.install (cognitive 75) Library/Homebrew/tap.rb:675— Tap.install has cognitive complexity 75 (threshold 15). Drivers by points: if/else 36 (51 pts), boolean chains 19, ternaries 2 (4 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.
API.fetch_json_api_file (cognitive 74) Library/Homebrew/api.rb:50— API.fetch_json_api_file has cognitive complexity 74 (threshold 15). Drivers by points: if/else 30 (46 pts), boolean chains 24, error handling 2, ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Audit.run (cognitive 73) Library/Homebrew/dev-cmd/audit.rb:106— Audit.run has cognitive complexity 73 (threshold 15). Drivers by points: if/else 42 (53 pts), boolean chains 19, ternaries 1 (nesting depth added 11). 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.
FormulaAuditor.audit_specs (cognitive 68) Library/Homebrew/formula_auditor.rb:884— FormulaAuditor.audit_specs has cognitive complexity 68 (threshold 15). Drivers by points: if/else 32 (53 pts), boolean chains 14, match/switch 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.
FormulaAuditor.audit_deps (cognitive 67) Library/Homebrew/formula_auditor.rb:337— FormulaAuditor.audit_deps has cognitive complexity 67 (threshold 15). Drivers by points: if/else 34, boolean chains 27, error handling 3 (6 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Audit.audit_signing (cognitive 66) Library/Homebrew/cask/audit.rb:629— Audit.audit_signing has cognitive complexity 66 (threshold 15). Drivers by points: if/else 31 (43 pts), boolean chains 20, match/switch 2, 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.
Cli.stop (cognitive 66) Library/Homebrew/services/cli.rb:230— Cli.stop has cognitive complexity 66 (threshold 15). Drivers by points: if/else 31 (50 pts), boolean chains 13, loops 1 (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.
Moved.move (cognitive 64) Library/Homebrew/cask/artifact/moved.rb:83— Moved.move has cognitive complexity 64 (threshold 15). Drivers by points: if/else 23 (56 pts), boolean chains 8 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Release.run (cognitive 63) Library/Homebrew/dev-cmd/release.rb:43— Release.run has cognitive complexity 63 (threshold 15). Drivers by points: if/else 27 (42 pts), error handling 8 (10 pts), boolean chains 8, ternaries 1 (2 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpgradeCmd.run (cognitive 59) Library/Homebrew/cmd/upgrade.rb:186— UpgradeCmd.run has cognitive complexity 59 (threshold 15). Drivers by points: if/else 24 (38 pts), boolean chains 19, match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecSubcommand.run_external_command (cognitive 57) Library/Homebrew/bundle/subcommand/exec.rb:89— ExecSubcommand.run_external_command has cognitive complexity 57 (threshold 15). Drivers by points: if/else 36 (47 pts), boolean chains 7, error handling 1 (3 pts) (nesting depth added 13). 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.
StaleLeadMaintainerPrApproval.evaluate (cognitive 54) .github/scripts/approve_stale_lead_maintainer_prs.rb:180— StaleLeadMaintainerPrApproval.evaluate has cognitive complexity 54 (threshold 15). Drivers by points: if/else 27 (35 pts), boolean chains 19 (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.
OsvExport.merge_range_transitions (cognitive 54) Library/Homebrew/vulns/osv_export.rb:251— OsvExport.merge_range_transitions has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 22, 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.
BumpCaskPr.replace_version_and_checksum (cognitive 53) REDACTED:294— BumpCaskPr.replace_version_and_checksum has cognitive complexity 53 (threshold 15). Drivers by points: if/else 25 (33 pts), boolean chains 18, ternaries 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Extract.run (cognitive 53) Library/Homebrew/dev-cmd/extract.rb:36— Extract.run has cognitive complexity 53 (threshold 15). Drivers by points: if/else 28 (45 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CleanupSubcommand.cleanup (cognitive 52) Library/Homebrew/bundle/subcommand/cleanup.rb:123— CleanupSubcommand.cleanup has cognitive complexity 52 (threshold 15). Drivers by points: if/else 29 (48 pts), boolean chains 4 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Bottle.merge (cognitive 52) Library/Homebrew/dev-cmd/bottle.rb:786— Bottle.merge has cognitive complexity 52 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 16, error handling 1 (2 pts), match/switch 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BumpCaskPr.run (cognitive 52) REDACTED:70— BumpCaskPr.run has cognitive complexity 52 (threshold 15). Drivers by points: if/else 28 (35 pts), boolean chains 12, error handling 2 (3 pts), ternaries 1 (2 pts) (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, 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.
UninstallCmd.run (cognitive 51) Library/Homebrew/cmd/uninstall.rb:46— UninstallCmd.run has cognitive complexity 51 (threshold 15). Drivers by points: if/else 25 (37 pts), boolean chains 9, error handling 2 (3 pts), match/switch 1, ternaries 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.
Cleanup.stale_formula? (cognitive 50) Library/Homebrew/cleanup.rb:167— Cleanup.stale_formula? has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (35 pts), error handling 4 (8 pts), boolean chains 7 (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.
FetchCmd.run (cognitive 50) Library/Homebrew/cmd/fetch.rb:83— FetchCmd.run has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (37 pts), error handling 2 (7 pts), match/switch 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Untap.run (cognitive 50) Library/Homebrew/cmd/untap.rb:25— Untap.run has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (34 pts), error handling 3 (10 pts), boolean chains 6 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Reporter.migrate_tap_migration (cognitive 50) Library/Homebrew/cmd/update_report/reporter.rb:224— Reporter.migrate_tap_migration has cognitive complexity 50 (threshold 15). Drivers by points: if/else 24 (41 pts), error handling 2 (6 pts), boolean chains 3 (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.
Curl.curl_check_http_content (cognitive 49) Library/Homebrew/utils/curl.rb:590— Curl.curl_check_http_content has cognitive complexity 49 (threshold 15). Drivers by points: if/else 23 (27 pts), boolean chains 19, error handling 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Bump.run (cognitive 48) REDACTED:110— Bump.run has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (28 pts), ternaries 7 (14 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SharedAudits.new_domain_problem (cognitive 47) Library/Homebrew/utils/shared_audits.rb:67— SharedAudits.new_domain_problem has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (25 pts), error handling 4 (9 pts), boolean chains 5, match/switch 1 (3 pts), ternaries 1 (3 pts), loops 1 (2 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.
App.install_phase (cognitive 46) Library/Homebrew/cask/artifact/app.rb:23— App.install_phase has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (27 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.
Miscellaneous.audit_formula (cognitive 46) Library/Homebrew/rubocops/lines.rb:954— Miscellaneous.audit_formula has cognitive complexity 46 (threshold 15). Drivers by points: if/else 34 (37 pts), boolean chains 9 (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.
PlatformIndependence.body? (cognitive 46) Library/Homebrew/vulns/platform_independence.rb:42— PlatformIndependence.body? has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 15, match/switch 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Upgrade.upgrade_casks! (cognitive 45) Library/Homebrew/cask/upgrade.rb:138— Upgrade.upgrade_casks! has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 13, error handling 3 (5 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FormulaHistory.report (cognitive 45) Library/Homebrew/utils/analytics/formula_history.rb:64— FormulaHistory.report has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 12, ternaries 3 (6 pts), 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.
PrPull.run (cognitive 44) Library/Homebrew/dev-cmd/pr-pull.rb:84— PrPull.run has cognitive complexity 44 (threshold 15). Drivers by points: if/else 26 (29 pts), boolean chains 15 (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.
LinkageChecker.check_dylibs (cognitive 44) Library/Homebrew/linkage_checker.rb:148— LinkageChecker.check_dylibs has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (31 pts), boolean chains 8, error handling 3 (5 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.
Uninstall.uninstall_kegs (cognitive 44) Library/Homebrew/uninstall.rb:25— Uninstall.uninstall_kegs has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (36 pts), error handling 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (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.
GemSetup.install_bundler_gems! (cognitive 44) Library/Homebrew/utils/gem_setup.rb:197— GemSetup.install_bundler_gems! has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (39 pts), error handling 1 (4 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.
Cask.install! (cognitive 42) Library/Homebrew/bundle/cask.rb:74— Cask.install! has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (24 pts), ternaries 4 (9 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Unbottled.output_unbottled (cognitive 42) Library/Homebrew/dev-cmd/unbottled.rb:210— Unbottled.output_unbottled has cognitive complexity 42 (threshold 15). Drivers by points: if/else 23 (39 pts), match/switch 1 (2 pts), boolean chains 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.
Version.<=> (cognitive 42) Library/Homebrew/version.rb:574— Version.<=> has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 8, loops 1, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Deps.run (cognitive 41) REDACTED:120— Deps.run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 6, match/switch 2 (5 pts), 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, 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.
Lgtm.run (cognitive 41) Library/Homebrew/dev-cmd/lgtm.rb:26— Lgtm.run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (31 pts), ternaries 3 (8 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InstalledDependents.find_some_installed_dependents (cognitive 41) Library/Homebrew/installed_dependents.rb:30— InstalledDependents.find_some_installed_dependents has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (27 pts), error handling 4 (11 pts), boolean chains 2, match/switch 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Upgrade.outdated_casks (cognitive 40) Library/Homebrew/cask/upgrade.rb:40— Upgrade.outdated_casks has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Link.run (cognitive 40) Library/Homebrew/cmd/link.rb:42— Link.run has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 9, error handling 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BumpUnversionedCasks.bump_unversioned_cask (cognitive 40) Library/Homebrew/dev-cmd/bump-unversioned-casks.rb:90— BumpUnversionedCasks.bump_unversioned_cask has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (24 pts), error handling 4 (11 pts), boolean chains 5 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
OnSystemConditionals.simplify_os_sha256_stanzas (cognitive 40) Library/Homebrew/rubocops/cask/on_system_conditionals.rb:127— OnSystemConditionals.simplify_os_sha256_stanzas has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 21, if/else 15 (16 pts), ternaries 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.
Tap.apply_redirected_remote! (cognitive 40) Library/Homebrew/tap.rb:550— Tap.apply_redirected_remote! has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 19, ternaries 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.
Parser.parse (cognitive 39) Library/Homebrew/cli/parser.rb:462— Parser.parse has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 8, 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.
CurlDownloadStrategy.fetch (cognitive 39) Library/Homebrew/download_strategy/curl_download_strategy.rb:40— CurlDownloadStrategy.fetch has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 5, error handling 4 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocstringParser.parse_content (cognitive 39) Library/Homebrew/yard/docstring_parser.rb:25— DocstringParser.parse_content has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 14, ternaries 1 (4 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CPAN.update_perl_resources! (cognitive 38) Library/Homebrew/utils/cpan.rb:93— CPAN.update_perl_resources! has cognitive complexity 38 (threshold 15). Drivers by points: if/else 26 (35 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.
Reporter.report (cognitive 37) Library/Homebrew/cmd/update_report/reporter.rb:58— Reporter.report has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28 (32 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
UpgradeCmd.formulae_upgrade_context (cognitive 37) Library/Homebrew/cmd/upgrade.rb:394— UpgradeCmd.formulae_upgrade_context has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (30 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrUpload.run (cognitive 37) Library/Homebrew/dev-cmd/pr-upload.rb:50— PrUpload.run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (37 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.
Formula.eligible_kegs_for_cleanup (cognitive 37) Library/Homebrew/formula.rb:3851— Formula.eligible_kegs_for_cleanup has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 4 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Upgrade.upgrade_dependents (cognitive 37) Library/Homebrew/upgrade.rb:319— Upgrade.upgrade_dependents has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (22 pts), error handling 3 (6 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Caskroom.migrate_caskfile_to_json (cognitive 36) Library/Homebrew/cask/caskroom.rb:72— Caskroom.migrate_caskfile_to_json has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 14, error handling 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.
LivecheckCmd.run (cognitive 36) Library/Homebrew/dev-cmd/livecheck.rb:59— LivecheckCmd.run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 6 (12 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitHubPackages.upload_bottle (cognitive 36) Library/Homebrew/github_packages.rb:205— GitHubPackages.upload_bottle has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 5, error handling 1 (2 pts), ternaries 2, loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StaleLeadMaintainerPrApproval.finish (cognitive 35) .github/scripts/approve_stale_lead_maintainer_prs.rb:375— StaleLeadMaintainerPrApproval.finish has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 11, 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.
VersionInstall.run (cognitive 35) Library/Homebrew/cmd/version-install.rb:31— VersionInstall.run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (24 pts), error handling 3 (6 pts), boolean chains 5 (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.
Typecheck.run (cognitive 35) Library/Homebrew/dev-cmd/typecheck.rb:48— Typecheck.run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 6, ternaries 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Style.check_style_impl (cognitive 35) REDACTED:86— Style.check_style_impl has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 12, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Cleanup.prune_prefix_symlinks_and_directories (cognitive 34) Library/Homebrew/cleanup.rb:989— Cleanup.prune_prefix_symlinks_and_directories has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 3 (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.
FormulaAuditor.audit_license (cognitive 34) Library/Homebrew/formula_auditor.rb:265— FormulaAuditor.audit_license has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 5 (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.
Formulary.load_formula_from_struct! (cognitive 34) REDACTED:236— Formulary.load_formula_from_struct! has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22 (34 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.
Formulary.tap_formula_name_type (cognitive 34) REDACTED:1208— Formulary.tap_formula_name_type has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 5 (11 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.
Keg.link_dir (cognitive 34) Library/Homebrew/keg.rb:936— Keg.link_dir has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (27 pts), match/switch 2 (4 pts), boolean chains 3 (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.
Style.run_rubocop (cognitive 34) REDACTED:210— Style.run_rubocop has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 7, 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.
Installer.homebrew_batchable? (cognitive 33) Library/Homebrew/bundle/installer.rb:248— Installer.homebrew_batchable? has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 2, error handling 1, 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.
Upgrade.upgrade_cask (cognitive 33) Library/Homebrew/cask/upgrade.rb:387— Upgrade.upgrade_cask has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (24 pts), error handling 3 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Info.print_json (cognitive 33) Library/Homebrew/cmd/info.rb:576— Info.print_json has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 2, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TapInfo.print_tap_info (cognitive 33) Library/Homebrew/cmd/tap-info.rb:44— TapInfo.print_tap_info has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 4, ternaries 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.
Utils.popen (cognitive 33) Library/Homebrew/utils/popen.rb:102— Utils.popen has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), error handling 4 (8 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.
AdvisoryOverrides.initialize (cognitive 33) Library/Homebrew/vulns/advisory_overrides.rb:43— AdvisoryOverrides.initialize has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 11 (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.
Build.install (cognitive 32) Library/Homebrew/build.rb:85— Build.install has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 4 (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.
CaskLoader.tap_cask_token_type (cognitive 32) Library/Homebrew/cask/cask_loader.rb:649— CaskLoader.tap_cask_token_type has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 4 (10 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.
BumpFormulaPr.patches_for_removal (cognitive 32) REDACTED:564— BumpFormulaPr.patches_for_removal has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 15, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FormulaInstaller.finish (cognitive 32) Library/Homebrew/formula_installer.rb:1070— FormulaInstaller.finish has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 8 (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.
OnSystemConditionals.audit_identical_sha256_across_architectures (cognitive 32) Library/Homebrew/rubocops/cask/on_system_conditionals.rb:389— OnSystemConditionals.audit_identical_sha256_across_architectures has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 4, 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.
InstallStepsHelper.simple_install_step_line (cognitive 32) Library/Homebrew/rubocops/shared/install_steps_helper.rb:466— InstallStepsHelper.simple_install_step_line has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 8, match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Caveats.keg_only_text (cognitive 31) Library/Homebrew/caveats.rb:72— Caveats.keg_only_text has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 6 (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.
Info.run (cognitive 31) Library/Homebrew/cmd/info.rb:100— Info.run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Outdated.print_outdated (cognitive 31) Library/Homebrew/cmd/outdated.rb:123— Outdated.print_outdated has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Reinstall.run (cognitive 31) Library/Homebrew/cmd/reinstall.rb:124— Reinstall.run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (20 pts), error handling 4 (9 pts), boolean chains 1, 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.
FormulaCellarChecks.check_prebuilt_npm_binaries (cognitive 31) Library/Homebrew/formula_cellar_checks.rb:436— FormulaCellarChecks.check_prebuilt_npm_binaries has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23, boolean chains 5, error handling 2, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FormulaCreator.initialize (cognitive 31) Library/Homebrew/formula_creator.rb:31— FormulaCreator.initialize has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 7, error handling 1 (3 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Identify.registry_purl (cognitive 31) Library/Homebrew/vulns/identify.rb:197— Identify.registry_purl has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 2, match/switch 1 (nesting depth added 14). 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.
FormulaStructGenerator.generate_formula_struct_hash (cognitive 30) Library/Homebrew/api/formula/formula_struct_generator.rb:43— FormulaStructGenerator.generate_formula_struct_hash has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 15, if/else 11 (13 pts), match/switch 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.
Parser.generate_usage_banner (cognitive 30) Library/Homebrew/cli/parser.rb:780— Parser.generate_usage_banner has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (27 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.
Untrust.run (cognitive 30) Library/Homebrew/cmd/untrust.rb:31— Untrust.run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 2 (4 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BumpFormulaPr.update_resource_block! (cognitive 30) REDACTED:869— BumpFormulaPr.update_resource_block! has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (30 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.
FormulaInstaller.check_install_sanity (cognitive 30) Library/Homebrew/formula_installer.rb:418— FormulaInstaller.check_install_sanity has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 9 (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.
FormulaInstaller.install (cognitive 30) Library/Homebrew/formula_installer.rb:559— FormulaInstaller.install has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 6, error handling 3 (4 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
JavaVersions.audit_formula (cognitive 30) Library/Homebrew/rubocops/lines.rb:510— JavaVersions.audit_formula has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (24 pts), match/switch 2 (3 pts), boolean chains 2, ternaries 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.
NamedArgs.to_paths (cognitive 29) Library/Homebrew/cli/named_args.rb:189— NamedArgs.to_paths has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Contributions.scan_maintainer_contributions (cognitive 29) Library/Homebrew/dev-cmd/contributions.rb:558— Contributions.scan_maintainer_contributions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21, boolean chains 6, ternaries 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.
ResourceAuditor.audit_urls (cognitive 29) Library/Homebrew/resource_auditor.rb:194— ResourceAuditor.audit_urls has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 9, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComponentsRedundancy.audit_formula (cognitive 29) Library/Homebrew/rubocops/components_redundancy.rb:22— ComponentsRedundancy.audit_formula has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 7, ternaries 2 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Releases.report (cognitive 29) Library/Homebrew/utils/analytics/releases.rb:16— Releases.report has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (11 pts), ternaries 3 (5 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Curl.curl_http_content_headers_and_checksum (cognitive 29) Library/Homebrew/utils/curl.rb:755— Curl.curl_http_content_headers_and_checksum has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (22 pts), error handling 1 (4 pts), boolean chains 2, 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.
Audit.audit_min_os (cognitive 28) Library/Homebrew/cask/audit.rb:949— Audit.audit_min_os has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 10, 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.
Edit.run (cognitive 28) Library/Homebrew/dev-cmd/edit.rb:30— Edit.run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 9 (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.
FormulaAuditor.audit_file (cognitive 28) Library/Homebrew/formula_auditor.rb:89— FormulaAuditor.audit_file has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 6, error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Mixin.odeprecated (cognitive 28) Library/Homebrew/utils/output.rb:189— Mixin.odeprecated has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22 (23 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.
Audit.extract_artifacts (cognitive 27) Library/Homebrew/cask/audit.rb:185— Audit.extract_artifacts has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 10 (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.
Cask.auto_updates_bundle_outdated? (cognitive 27) Library/Homebrew/cask/cask.rb:884— Cask.auto_updates_bundle_outdated? has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 8, 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.
DirEmitter.reconcile (cognitive 27) Library/Homebrew/dev-cmd/advisory-match.rb:955— DirEmitter.reconcile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6, 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.
FormulaAuditor.audit_revision (cognitive 27) Library/Homebrew/formula_auditor.rb:1056— FormulaAuditor.audit_revision has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14, boolean chains 13. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FormulaInstaller.forbidden_tap_check (cognitive 27) Library/Homebrew/formula_installer.rb:1898— FormulaInstaller.forbidden_tap_check has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 7 (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.
FormulaFeeds.changes (cognitive 27) Library/Homebrew/utils/analytics/formula_feeds.rb:90— FormulaFeeds.changes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 8, ternaries 2 (6 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.
Sponsors.open_collective (cognitive 27) Library/Homebrew/utils/sponsors.rb:145— Sponsors.open_collective has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, ternaries 4, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Trust.entries (cognitive 26) Library/Homebrew/bundle/trust.rb:20— Trust.entries has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Audit.audit_rosetta (cognitive 26) Library/Homebrew/cask/audit.rb:824— Audit.audit_rosetta has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 8, 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.
Audit.cask_bundle_min_os (cognitive 26) Library/Homebrew/cask/audit.rb:1378— Audit.cask_bundle_min_os has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 2 (3 pts), error handling 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdvisoryMatch.reconcile_formula (cognitive 26) Library/Homebrew/dev-cmd/advisory-match.rb:391— AdvisoryMatch.reconcile_formula has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19 (21 pts), error handling 3 (4 pts), ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FormulaCellarChecks.check_binary_arches (cognitive 26) Library/Homebrew/formula_cellar_checks.rb:370— FormulaCellarChecks.check_binary_arches has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 11 (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.
FormulaInstaller.expand_dependencies_for_formula_once (cognitive 26) Library/Homebrew/formula_installer.rb:794— FormulaInstaller.expand_dependencies_for_formula_once has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, if/else 11 (13 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.
TestResource.audit_formula (cognitive 26) Library/Homebrew/rubocops/class.rb:84— TestResource.audit_formula has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, boolean chains 10. 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.
Text.audit_formula (cognitive 26) Library/Homebrew/rubocops/text.rb:14— Text.audit_formula has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 4, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
API.generate_repositories (cognitive 26) Library/Homebrew/utils/analytics/api.rb:368— API.generate_repositories has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 7, match/switch 2, 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.
FormulaHistory.apply (cognitive 26) Library/Homebrew/utils/analytics/formula_history.rb:206— FormulaHistory.apply has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
PatchInclusion.removal_reason (cognitive 26) Library/Homebrew/utils/github/patch_inclusion.rb:24— PatchInclusion.removal_reason has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 9, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Match.reconcile_history (cognitive 26) Library/Homebrew/vulns/match.rb:968— Match.reconcile_history has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 11, 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.
Match.subject_version_at (cognitive 26) Library/Homebrew/vulns/match.rb:1199— Match.subject_version_at has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Installer.load_installed_caskfile! (cognitive 25) Library/Homebrew/cask/installer.rb:1027— Installer.load_installed_caskfile! has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 7, 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.
Info.github_info (cognitive 25) Library/Homebrew/cmd/info.rb:237— Info.github_info has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpdateReport.tap_or_untap_core_taps_if_necessary (cognitive 25) Library/Homebrew/cmd/update-report.rb:420— UpdateReport.tap_or_untap_core_taps_if_necessary has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Contributions.scan_contributions (cognitive 25) Library/Homebrew/dev-cmd/contributions.rb:385— Contributions.scan_contributions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, boolean chains 2, 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.
Service.to_plist (cognitive 25) Library/Homebrew/service.rb:609— Service.to_plist has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Attestation.check_attestation (cognitive 25) Library/Homebrew/utils/attestation.rb:13— Attestation.check_attestation has cognitive complexity 25 (threshold 15). Drivers by points: error handling 6 (21 pts), if/else 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.
History.walk (cognitive 25) Library/Homebrew/vulns/history.rb:66— History.walk has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 4 (6 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
UpgradeCmd.show_final_upgrade_summary (cognitive 24) Library/Homebrew/cmd/upgrade.rb:571— UpgradeCmd.show_final_upgrade_summary has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 9, ternaries 3 (5 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.
Bump.handle_formulae_and_casks (cognitive 24) REDACTED:951— Bump.handle_formulae_and_casks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 3 (6 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.
Contributions.maintainer_activity_summary (cognitive 24) Library/Homebrew/dev-cmd/contributions.rb:1317— Contributions.maintainer_activity_summary has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FormulaInstaller.install_dependency (cognitive 24) Library/Homebrew/formula_installer.rb:962— FormulaInstaller.install_dependency has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 8, error handling 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Keg.make_relative_symlink (cognitive 24) Library/Homebrew/keg.rb:851— Keg.make_relative_symlink has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 3 (6 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.
Metadata.read_directly (cognitive 24) Library/Homebrew/os/linux/elf.rb:270— Metadata.read_directly has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15, boolean chains 4, ternaries 4, 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.
OnSystemConditionals.sha256_pairs (cognitive 24) Library/Homebrew/rubocops/cask/on_system_conditionals.rb:338— OnSystemConditionals.sha256_pairs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (19 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.
FormulaFeeds.generate (cognitive 24) Library/Homebrew/utils/analytics/formula_feeds.rb:34— FormulaFeeds.generate has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5 (9 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Curl.curl_args (cognitive 24) Library/Homebrew/utils/curl.rb:121— Curl.curl_args has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (20 pts), match/switch 2 (3 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.
Utils.safe_fork (cognitive 24) Library/Homebrew/utils/fork.rb:145— Utils.safe_fork has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (19 pts), error handling 3, boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AppImage.install_phase (cognitive 23) Library/Homebrew/cask/artifact/appimage.rb:28— AppImage.install_phase has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, error handling 2, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UpgradeCmd.upgrade_outdated_formulae! (cognitive 23) Library/Homebrew/cmd/upgrade.rb:662— UpgradeCmd.upgrade_outdated_formulae! has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (18 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.
Uses.intersection_of_dependents (cognitive 23) Library/Homebrew/cmd/uses.rb:103— Uses.intersection_of_dependents has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (6 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenerateCaskCiMatrix.run (cognitive 23) Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb:54— GenerateCaskCiMatrix.run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 4 (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.
Formula.system (cognitive 23) Library/Homebrew/formula.rb:3743— Formula.system has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (6 pts), match/switch 1 (2 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.
Cli.service_load (cognitive 23) Library/Homebrew/services/cli.rb:487— Cli.service_load has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, ternaries 3 (6 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.
Attestation.check_attestation (cognitive 22) REDACTED:222— Attestation.check_attestation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4, error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Brew.formula_to_hash (cognitive 22) Library/Homebrew/bundle/brew.rb:358— Brew.formula_to_hash has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 8, 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.
Cleanup.clean! (cognitive 22) Library/Homebrew/cleanup.rb:456— Cleanup.clean! has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 2 (4 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.
Contributions.approved_pull_request? (cognitive 22) Library/Homebrew/dev-cmd/contributions.rb:684— Contributions.approved_pull_request? has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 6, 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.
FormulaInstaller.check_conflicts (cognitive 22) Library/Homebrew/formula_installer.rb:663— FormulaInstaller.check_conflicts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 3 (6 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.
ComponentsOrder.audit_formula (cognitive 22) Library/Homebrew/rubocops/components_order.rb:27— ComponentsOrder.audit_formula has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3, 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.
PythonVersions.audit_formula (cognitive 22) Library/Homebrew/rubocops/lines.rb:633— PythonVersions.audit_formula has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 4 (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.
OSDependsOn.on_send (cognitive 22) Library/Homebrew/rubocops/os_depends_on.rb:52— OSDependsOn.on_send has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, boolean chains 8. 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.
UrlHelper.audit_url (cognitive 22) Library/Homebrew/rubocops/shared/url_helper.rb:52— UrlHelper.audit_url has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, 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.
Sandbox.deny_read_home (cognitive 22) Library/Homebrew/sandbox.rb:433— Sandbox.deny_read_home has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Trust.write_trust_store (cognitive 22) Library/Homebrew/trust.rb:481— Trust.write_trust_store has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (21 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.
Bump.create_pr (cognitive 21) Library/Homebrew/bump.rb:49— Bump.create_pr has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4, error handling 2 (3 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.
Brew.install! (cognitive 21) Library/Homebrew/bundle/brew.rb:556— Brew.install! has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Flatpak.install! (cognitive 21) Library/Homebrew/bundle/extensions/flatpak.rb:238— Flatpak.install! has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (20 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.
FromPathLoader.load (cognitive 21) Library/Homebrew/cask/cask_loader.rb:133— FromPathLoader.load has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 3 (5 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Installer.forbidden_tap_check (cognitive 21) Library/Homebrew/cask/installer.rb:885— Installer.forbidden_tap_check has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 7 (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.
Installer.forbidden_cask_and_formula_check (cognitive 21) Library/Homebrew/cask/installer.rb:926— Installer.forbidden_cask_and_formula_check 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.
Parser.generate_help_text (cognitive 21) Library/Homebrew/cli/parser.rb:560— Parser.generate_help_text has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 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.
DeprecateDisable.message (cognitive 21) Library/Homebrew/deprecate_disable.rb:76— DeprecateDisable.message has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (18 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.
Bump.version_args_for_bump (cognitive 21) REDACTED:657— Bump.version_args_for_bump has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4 (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.
Contributions.maintainer_activity_totals (cognitive 21) Library/Homebrew/dev-cmd/contributions.rb:1078— Contributions.maintainer_activity_totals has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Create.create_formula (cognitive 21) Library/Homebrew/dev-cmd/create.rb:228— Create.create_formula has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18 (21 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.
Unbottled.run (cognitive 21) Library/Homebrew/dev-cmd/unbottled.rb:45— Unbottled.run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FormulaInstaller.pour_bottle? (cognitive 21) Library/Homebrew/formula_installer.rb:259— FormulaInstaller.pour_bottle? has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4 (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.
FormulaInstaller.build (cognitive 21) Library/Homebrew/formula_installer.rb:1214— FormulaInstaller.build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FormulaInstaller.link (cognitive 21) Library/Homebrew/formula_installer.rb:1340— FormulaInstaller.link has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 4 (8 pts), boolean chains 3 (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.
Readall.valid_casks? (cognitive 21) Library/Homebrew/readall.rb:130— Readall.valid_casks? has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 2 (3 pts), ternaries 1 (2 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.
Patches.patch_problems (cognitive 21) Library/Homebrew/rubocops/patches.rb:58— Patches.patch_problems has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Trust.trust_name (cognitive 21) Library/Homebrew/trust.rb:380— Trust.trust_name has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, error handling 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
API.open_rest (cognitive 21) Library/Homebrew/utils/github/api.rb:299— API.open_rest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), error handling 2 (3 pts), ternaries 2 (3 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.
Parser.formulae (cognitive 20) Library/Homebrew/cli/parser.rb:1148— Parser.formulae has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7, 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.
DirEmitter.prepare_aliases (cognitive 20) Library/Homebrew/dev-cmd/advisory-match.rb:715— DirEmitter.prepare_aliases has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, 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.
Bump.livecheck_result (cognitive 20) REDACTED:1030— Bump.livecheck_result has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, 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.
Contributions.generate_maintainer_report_csv (cognitive 20) Library/Homebrew/dev-cmd/contributions.rb:1172— Contributions.generate_maintainer_report_csv has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 5, ternaries 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.
Create.create_cask (cognitive 20) Library/Homebrew/dev-cmd/create.rb:93— Create.create_cask has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 3, 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.
WhichUpdate.update_and_save! (cognitive 20) Library/Homebrew/dev-cmd/which-update.rb:56— WhichUpdate.update_and_save! has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, match/switch 1 (2 pts), 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.
Checks.check_untrusted_taps (cognitive 20) Library/Homebrew/diagnostic.rb:1050— Checks.check_untrusted_taps has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 1, 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.
Install.install_formulae (cognitive 20) Library/Homebrew/install.rb:359— Install.install_formulae has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, 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.
Keg.relocate_build_prefix (cognitive 20) Library/Homebrew/keg_relocate.rb:325— Keg.relocate_build_prefix has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpServer.respond_to_tools_call (cognitive 20) REDACTED:361— McpServer.respond_to_tools_call has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Patch.create (cognitive 20) Library/Homebrew/patch.rb:100— Patch.create has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 2 (3 pts) (nesting depth added 12). 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.
TernaryToIf.before_declaring_variable (cognitive 20) Library/Homebrew/rubocops/ternary_to_if.rb:32— TernaryToIf.before_declaring_variable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 2, 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.
Curl.curl_with_workarounds (cognitive 20) Library/Homebrew/utils/curl.rb:257— Curl.curl_with_workarounds has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Curl.curl_headers (cognitive 20) Library/Homebrew/utils/curl.rb:499— Curl.curl_headers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4 (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.
Match.to_brew_record (cognitive 20) Library/Homebrew/vulns/match.rb:804— Match.to_brew_record has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, boolean chains 7, 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.
Match.reconciliation_observation (cognitive 20) Library/Homebrew/vulns/match.rb:1035— Match.reconciliation_observation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 5, ternaries 1 (2 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.
OsvExport.merge_existing (cognitive 20) Library/Homebrew/vulns/osv_export.rb:112— OsvExport.merge_existing has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 9, 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.
Cargo.package_outdated? (cognitive 19) Library/Homebrew/bundle/extensions/cargo.rb:163— Cargo.package_outdated? has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, match/switch 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Cask.to_hash_with_variations (cognitive 19) Library/Homebrew/cask/cask.rb:677— Cask.to_hash_with_variations has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5 (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.
DependsOn.record_macos_requirement (cognitive 19) Library/Homebrew/cask/dsl/depends_on.rb:186— DependsOn.record_macos_requirement has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 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.
Caveats.service_caveats (cognitive 19) Library/Homebrew/caveats.rb:287— Caveats.service_caveats has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Parser.named_args (cognitive 19) Library/Homebrew/cli/parser.rb:633— Parser.named_args has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Deps.dep_display_name (cognitive 19) REDACTED:274— Deps.dep_display_name has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Descriptions.decorate_name (cognitive 19) Library/Homebrew/descriptions.rb:100— Descriptions.decorate_name has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), error handling 2 (5 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Bottle.keg_contain? (cognitive 19) Library/Homebrew/dev-cmd/bottle.rb:254— Bottle.keg_contain? has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 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.
Contributions.parse_git_log (cognitive 19) Library/Homebrew/dev-cmd/contributions.rb:928— Contributions.parse_git_log has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, 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.
GenerateCaskCiMatrix.generate_matrix (cognitive 19) Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb:220— GenerateCaskCiMatrix.generate_matrix has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AbstractFileDownloadStrategy.parse_basename (cognitive 19) Library/Homebrew/download_strategy/abstract_file_download_strategy.rb:63— AbstractFileDownloadStrategy.parse_basename has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (19 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.
GitDownloadStrategy.env (cognitive 19) Library/Homebrew/download_strategy/git_download_strategy.rb:123— GitDownloadStrategy.env has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 8, error handling 1, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ClassMethods.setup_preferred_gcc_libs (cognitive 19) Library/Homebrew/extend/os/linux/install.rb:73— ClassMethods.setup_preferred_gcc_libs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 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.
FormulaInstaller.prelude_fetch (cognitive 19) Library/Homebrew/formula_installer.rb:318— FormulaInstaller.prelude_fetch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FormulaInstaller.enqueue_fetch (cognitive 19) Library/Homebrew/formula_installer.rb:1622— FormulaInstaller.enqueue_fetch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GitHubPackages.preupload_check (cognitive 19) Library/Homebrew/github_packages.rb:527— GitHubPackages.preupload_check has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 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.
API.github_activity (cognitive 19) Library/Homebrew/utils/analytics/api.rb:245— API.github_activity has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SPDX.string_to_license_expression (cognitive 19) Library/Homebrew/utils/spdx.rb:182— SPDX.string_to_license_expression has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Identify.registry_package_for (cognitive 19) Library/Homebrew/vulns/identify.rb:150— Identify.registry_package_for has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tap.dump (cognitive 18) Library/Homebrew/bundle/tap.rb:89— Tap.dump has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 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.
FromAPILoader.load_from_struct (cognitive 18) Library/Homebrew/cask/cask_loader.rb:386— FromAPILoader.load_from_struct has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, error handling 1 (2 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.
Cleanup.cleanup_cache (cognitive 18) Library/Homebrew/cleanup.rb:749— Cleanup.cleanup_cache has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4 (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.
Completions.generate_fish_subcommand_completion (cognitive 18) Library/Homebrew/completions.rb:512— Completions.generate_fish_subcommand_completion has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 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.
DirEmitter.terminal_intervals (cognitive 18) Library/Homebrew/dev-cmd/advisory-match.rb:902— DirEmitter.terminal_intervals has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, boolean chains 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.
DispatchBuildBottle.run (cognitive 18) Library/Homebrew/dev-cmd/dispatch-build-bottle.rb:43— DispatchBuildBottle.run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, 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.
Unbottled.formulae_all_installs_from_args (cognitive 18) Library/Homebrew/dev-cmd/unbottled.rb:119— Unbottled.formulae_all_installs_from_args has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, error handling 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.
BuildError.dump (cognitive 18) Library/Homebrew/exceptions.rb:663— BuildError.dump has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (18 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.
Formula.ensure_installed! (cognitive 18) Library/Homebrew/formula.rb:381— Formula.ensure_installed! has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LinkageChecker.check_formula_deps (cognitive 18) Library/Homebrew/linkage_checker.rb:254— LinkageChecker.check_formula_deps has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 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, 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.
McpServer.tool_command_arguments (cognitive 18) REDACTED:449— McpServer.tool_command_arguments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Readall.valid_tap? (cognitive 18) Library/Homebrew/readall.rb:200— Readall.valid_tap? has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResourceAuditor.audit_download_strategy (cognitive 18) Library/Homebrew/resource_auditor.rb:109— ResourceAuditor.audit_download_strategy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InstallSteps.keychain_find_certificate_name (cognitive 18) Library/Homebrew/rubocops/cask/install_steps.rb:187— InstallSteps.keychain_find_certificate_name 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.
Sandbox.run (cognitive 18) Library/Homebrew/sandbox.rb:739— Sandbox.run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 3 (4 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.
Service.to_systemd_unit (cognitive 18) Library/Homebrew/service.rb:675— Service.to_systemd_unit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 2 (4 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.
TapAuditor.check_renames (cognitive 18) Library/Homebrew/tap_auditor.rb:160— TapAuditor.check_renames has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Brewfile.path (cognitive 17) Library/Homebrew/bundle/brewfile.rb:16— Brewfile.path has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 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.
BundleVersion.nice_parts (cognitive 17) Library/Homebrew/bundle_version.rb:99— BundleVersion.nice_parts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Migrator.move_old_cask (cognitive 17) Library/Homebrew/cask/migrator.rb:146— Migrator.move_old_cask has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (5 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.
Parser.parse_remaining (cognitive 17) Library/Homebrew/cli/parser.rb:426— Parser.parse_remaining has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Commands.command_options (cognitive 17) Library/Homebrew/commands.rb:248— Commands.command_options has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Dependency.installed? (cognitive 17) Library/Homebrew/dependency.rb:103— Dependency.installed? 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.
Contributions.maintainer_report_users (cognitive 17) Library/Homebrew/dev-cmd/contributions.rb:287— Contributions.maintainer_report_users has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 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.
CurlDownloadStrategy.resolve_url_basename_time_file_size (cognitive 17) Library/Homebrew/download_strategy/curl_download_strategy.rb:209— CurlDownloadStrategy.resolve_url_basename_time_file_size has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, error handling 2, 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.
ErrorDuringExecution.initialize (cognitive 17) Library/Homebrew/exceptions.rb:859— ErrorDuringExecution.initialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 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.
DiskUsageExtension.compute_disk_usage (cognitive 17) Library/Homebrew/extend/pathname/disk_usage_extension.rb:40— DiskUsageExtension.compute_disk_usage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 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.
FormulaAuditor.audit_compatibility_version (cognitive 17) Library/Homebrew/formula_auditor.rb:1120— FormulaAuditor.audit_compatibility_version 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.
FormulaCreator.write_formula! (cognitive 17) Library/Homebrew/formula_creator.rb:119— FormulaCreator.write_formula! has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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.
FromNameLoader.try_new (cognitive 17) REDACTED:765— FromNameLoader.try_new has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, ternaries 1 (3 pts), 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.
Formulary.load_formula (cognitive 17) REDACTED:119— Formulary.load_formula has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, error handling 2, match/switch 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.
Livecheck.url (cognitive 17) Library/Homebrew/livecheck.rb:203— Livecheck.url has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 5, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LivecheckVersion.<=> (cognitive 17) Library/Homebrew/livecheck/livecheck_version.rb:34— LivecheckVersion.<=> has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Git.preprocess_url (cognitive 17) Library/Homebrew/livecheck/strategy/git.rb:70— Git.preprocess_url has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), 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.
MissingFormula.tap_migration_reason (cognitive 17) Library/Homebrew/missing_formula.rb:102— MissingFormula.tap_migration_reason has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MissingFormula.deleted_reason (cognitive 17) Library/Homebrew/missing_formula.rb:155— MissingFormula.deleted_reason has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 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.
RetryableDownload.fetch (cognitive 17) Library/Homebrew/retryable_download.rb:59— RetryableDownload.fetch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, 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.
NoOverrides.on_system_stanzas (cognitive 17) Library/Homebrew/rubocops/cask/no_overrides.rb:39— NoOverrides.on_system_stanzas has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
InstallSteps.add_implicit_var_base_offense (cognitive 17) Library/Homebrew/rubocops/install_steps.rb:153— InstallSteps.add_implicit_var_base_offense has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DescHelper.audit_desc (cognitive 17) Library/Homebrew/rubocops/shared/desc_helper.rb:21— DescHelper.audit_desc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Cli.start (cognitive 17) Library/Homebrew/services/cli.rb:181— Cli.start has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Cli.take_root_ownership? (cognitive 17) Library/Homebrew/services/cli.rb:390— Cli.take_root_ownership? has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 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.
SystemCommand.each_output_line (cognitive 17) Library/Homebrew/system_command.rb:449— SystemCommand.each_output_line has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (7 pts), if/else 5 (6 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Trust.trust_fully_qualified_items! (cognitive 17) Library/Homebrew/trust.rb:125— Trust.trust_fully_qualified_items! has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, ternaries 3 (5 pts), 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.
UnversionedCaskChecker.guess_cask_version (cognitive 17) Library/Homebrew/unversioned_cask_checker.rb:184— UnversionedCaskChecker.guess_cask_version has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, error handling 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.
Annotation.to_s (cognitive 17) Library/Homebrew/utils/github/actions.rb:81— Annotation.to_s has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 1 (2 pts) (nesting depth added 9). 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.
API.raise_error (cognitive 17) Library/Homebrew/utils/github/api.rb:463— API.raise_error has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, 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.
Attestation.check_core_attestation (cognitive 16) REDACTED:395— Attestation.check_core_attestation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 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.
InstallSubcommand.run (cognitive 16) Library/Homebrew/bundle/subcommand/install.rb:57— InstallSubcommand.run has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Auditor.audit (cognitive 16) Library/Homebrew/cask/auditor.rb:77— Auditor.audit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FromNameLoader.try_new (cognitive 16) Library/Homebrew/cask/cask_loader.rb:480— FromNameLoader.try_new has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), ternaries 1 (3 pts), 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.
NamedArgs.warn_if_cask_conflicts (cognitive 16) Library/Homebrew/cli/named_args.rb:631— NamedArgs.warn_if_cask_conflicts has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 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.
Parser.switch (cognitive 16) Library/Homebrew/cli/parser.rb:233— Parser.switch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5 (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.
Doctor.run (cognitive 16) Library/Homebrew/cmd/doctor.rb:37— Doctor.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (15 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.
ReporterHub.dump (cognitive 16) Library/Homebrew/cmd/update_report/reporter_hub.rb:43— ReporterHub.dump has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BumpRevision.run (cognitive 16) Library/Homebrew/dev-cmd/bump-revision.rb:32— BumpRevision.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Extract.with_monkey_patch (cognitive 16) Library/Homebrew/dev-cmd/extract.rb:182— Extract.with_monkey_patch 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.
FormulaInstaller.fetch_bottle_tab (cognitive 16) Library/Homebrew/formula_installer.rb:1589— FormulaInstaller.fetch_bottle_tab has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (5 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.
FormulaInstaller.pour (cognitive 16) Library/Homebrew/formula_installer.rb:1725— FormulaInstaller.pour has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, ternaries 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.
Formulary.resolve_installed_spec (cognitive 16) REDACTED:465— Formulary.resolve_installed_spec has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runner.sandbox_write_paths (cognitive 16) Library/Homebrew/install_steps.rb:947— Runner.sandbox_write_paths has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HeaderMatch.versions_from_content (cognitive 16) Library/Homebrew/livecheck/strategy/header_match.rb:49— HeaderMatch.versions_from_content has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 6, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Migrator.link_newname (cognitive 16) Library/Homebrew/migrator.rb:370— Migrator.link_newname has cognitive complexity 16 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 4 (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.
Resource.unpack (cognitive 16) Library/Homebrew/resource.rb:165— Resource.unpack has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 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.
EmptyConditionalArgument.on_send (cognitive 16) Library/Homebrew/rubocops/cask/empty_conditional_argument.rb:39— EmptyConditionalArgument.on_send 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.
HelperFunctions.string_content (cognitive 16) Library/Homebrew/rubocops/shared/helper_functions.rb:106— HelperFunctions.string_content has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
OnSystemConditionalsHelper.audit_on_system_blocks (cognitive 16) Library/Homebrew/rubocops/shared/on_system_conditionals_helper.rb:33— OnSystemConditionalsHelper.audit_on_system_blocks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), 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.
ShellCommands.on_send (cognitive 16) Library/Homebrew/rubocops/shell_commands.rb:74— ShellCommands.on_send has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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.
Services.dispatch (cognitive 16) Library/Homebrew/services/subcommand.rb:24— Services.dispatch 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.
Trust.infer_target (cognitive 16) Library/Homebrew/trust.rb:339— Trust.infer_target has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 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.
Match.range_status (cognitive 16) Library/Homebrew/vulns/match.rb:729— Match.range_status 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.
Scanner.build_target (cognitive 16) Library/Homebrew/vulns/scanner.rb:171— Scanner.build_target has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7 (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.
Vulnerability.non_semver_fix_available_of_type? (cognitive 16) Library/Homebrew/vulns/vulnerability.rb:429— Vulnerability.non_semver_fix_available_of_type? 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.
Near-duplicate member pair (53 shared lines) Library/Homebrew/livecheck/livecheck.rb:640— Library/Homebrew/livecheck/livecheck.rb:640-893 | Library/Homebrew/livecheck/livecheck.rb:919-1139 — These two members are variants of one another: 53 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 (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) Library/Homebrew/livecheck/strategy/json.rb:109— Library/Homebrew/livecheck/strategy/json.rb:109-125 | Library/Homebrew/livecheck/strategy/page_match.rb:96-114 | Library/Homebrew/livecheck/strategy/sparkle.rb:248-267 | Library/Homebrew/livecheck/strategy/xml.rb:148-164 | Library/Homebrew/livecheck/strategy/yaml.rb:107-123 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Edited copy of a member (42 corresponding lines) · ×1
Edited copy of a member (42 corresponding lines) Library/Homebrew/cask/cask_loader.rb:650— Library/Homebrew/cask/cask_loader.rb:650-691 | REDACTED:1209-1261 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) Library/Homebrew/diagnostic.rb:1807— Library/Homebrew/diagnostic.rb:1807-1837 | Library/Homebrew/diagnostic.rb:1842-1873 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×1
Edited copy of a member (32 corresponding lines) Library/Homebrew/cask/cask_loader.rb:481— Library/Homebrew/cask/cask_loader.rb:481-512 | REDACTED:766-798 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) Library/Homebrew/dev-cmd/bump-compatibility-version.rb:33— Library/Homebrew/dev-cmd/bump-compatibility-version.rb:33-72 | Library/Homebrew/dev-cmd/bump-revision.rb:35-75 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) Library/Homebrew/cask/staged.rb:29— Library/Homebrew/cask/staged.rb:29-58 | Library/Homebrew/install_steps.rb:1356-1379 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) Library/Homebrew/rubocops/bottle.rb:61— Library/Homebrew/rubocops/bottle.rb:61-86 | Library/Homebrew/rubocops/bottle.rb:96-121 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×1
Edited copies of one member (3 members, 21+ corresponding lines) Library/Homebrew/cmd/nodenv-sync.rb:24— Library/Homebrew/cmd/nodenv-sync.rb:24-45 | Library/Homebrew/cmd/pyenv-sync.rb:24-44 | Library/Homebrew/cmd/rbenv-sync.rb:24-45 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 19+ corresponding lines) · ×1
Edited copies of one member (4 members, 19+ corresponding lines) Library/Homebrew/livecheck/strategy/crate.rb:97— Library/Homebrew/livecheck/strategy/crate.rb:97-117 | Library/Homebrew/livecheck/strategy/github_latest.rb:90-109 | Library/Homebrew/livecheck/strategy/github_releases.rb:133-152 | Library/Homebrew/livecheck/strategy/npm.rb:77-95 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×1
Edited copy of a member (13 corresponding lines) Library/Homebrew/description_cache_store.rb:52— Library/Homebrew/description_cache_store.rb:52-67 | Library/Homebrew/description_cache_store/cask_description_cache_store.rb:38-50 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 22+ corresponding lines) · ×1
Edited copies of one member (3 members, 22+ corresponding lines) Library/Homebrew/utils/shared_audits.rb:422— Library/Homebrew/utils/shared_audits.rb:422-445 | Library/Homebrew/utils/shared_audits.rb:450-471 | Library/Homebrew/utils/shared_audits.rb:517-539 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×1
Edited copies of one member (3 members, 7+ corresponding lines) Library/Homebrew/cask/artifact/abstract_artifact.rb:196— Library/Homebrew/cask/artifact/abstract_artifact.rb:196-202 | Library/Homebrew/downloadable.rb:176-183 | Library/Homebrew/os/linux/elf.rb:49-58 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) Library/Homebrew/cask/artifact/abstract_uninstall.rb:473— Library/Homebrew/cask/artifact/abstract_uninstall.rb:473-494 | Library/Homebrew/cask/ci/zap_check.rb:118-145 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) Library/Homebrew/cli/named_args.rb:240— Library/Homebrew/cli/named_args.rb:240-250 | Library/Homebrew/cli/named_args.rb:255-265 | Library/Homebrew/cli/named_args.rb:270-280 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×1
Edited copy of a member (14 corresponding lines) Library/Homebrew/dev-cmd/advisory-match.rb:1081— Library/Homebrew/dev-cmd/advisory-match.rb:1081-1095 | Library/Homebrew/dev-cmd/advisory-match.rb:1100-1113 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) Library/Homebrew/livecheck/strategy/apache.rb:62— Library/Homebrew/livecheck/strategy/apache.rb:62-82 | Library/Homebrew/livecheck/strategy/cpan.rb:50-71 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 11+ corresponding lines) · ×1
Edited copies of one member (4 members, 11+ corresponding lines) Library/Homebrew/cask/audit.rb:1104— Library/Homebrew/cask/audit.rb:1104-1114 | Library/Homebrew/cask/audit.rb:1119-1129 | Library/Homebrew/cask/audit.rb:1134-1144 | Library/Homebrew/cask/audit.rb:1149-1159 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×1
Edited copies of one member (3 members, 12+ corresponding lines) Library/Homebrew/bundle/extensions/cargo.rb:294— Library/Homebrew/bundle/extensions/cargo.rb:294-305 | Library/Homebrew/bundle/extensions/extension.rb:353-364 | Library/Homebrew/bundle/extensions/uv.rb:377-389 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 3+ corresponding lines) · ×1
Edited copies of one member (4 members, 3+ corresponding lines) Library/Homebrew/bundle/extensions/go.rb:25— Library/Homebrew/bundle/extensions/go.rb:25-27 | Library/Homebrew/bundle/extensions/krew.rb:22-25 | Library/Homebrew/bundle/extensions/mac_app_store.rb:51-54 | Library/Homebrew/bundle/extensions/npm.rb:22-24 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 3+ corresponding lines) · ×1
Edited copies of one member (3 members, 3+ corresponding lines) Library/Homebrew/bundle/extensions/cargo.rb:375— Library/Homebrew/bundle/extensions/cargo.rb:375-381 | Library/Homebrew/bundle/extensions/extension.rb:375-377 | Library/Homebrew/bundle/extensions/uv.rb:418-426 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×1
Edited copy of a member (11 corresponding lines) Library/Homebrew/livecheck/strategy/xml.rb:115— Library/Homebrew/livecheck/strategy/xml.rb:115-127 | Library/Homebrew/livecheck/strategy/yaml.rb:76-86 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×1
Edited copies of one member (3 members, 8+ corresponding lines) Library/Homebrew/analytics/subcommand.rb:17— Library/Homebrew/analytics/subcommand.rb:17-24 | Library/Homebrew/completions/subcommand.rb:17-24 | Library/Homebrew/developer/subcommand.rb:17-24 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 5+ corresponding lines) · ×1
Edited copies of one member (6 members, 5+ corresponding lines) Library/Homebrew/unpack_strategy/bzip2.rb:28— Library/Homebrew/unpack_strategy/bzip2.rb:28-33 | Library/Homebrew/unpack_strategy/gzip.rb:23-27 | Library/Homebrew/unpack_strategy/lzip.rb:28-33 | Library/Homebrew/unpack_strategy/lzma.rb:28-33 | Library/Homebrew/unpack_strategy/xz.rb:28-33 | Library/Homebrew/unpack_strategy/zstd.rb:28-33 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×1
Edited copies of one member (3 members, 5+ corresponding lines) Library/Homebrew/rubocops/cask/mixin/on_desc_stanza.rb:14— Library/Homebrew/rubocops/cask/mixin/on_desc_stanza.rb:14-18 | Library/Homebrew/rubocops/cask/mixin/on_homepage_stanza.rb:14-18 | Library/Homebrew/rubocops/cask/mixin/on_url_stanza.rb:14-18 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (2 corresponding lines) · ×1
Edited copy of a member (2 corresponding lines) Library/Homebrew/cask/auditor.rb:28— Library/Homebrew/cask/auditor.rb:28-31 | Library/Homebrew/system_command.rb:178-179 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×1
Edited copy of a member (5 corresponding lines) Library/Homebrew/api/cask_struct.rb:12— Library/Homebrew/api/cask_struct.rb:12-18 | Library/Homebrew/api/formula_struct.rb:13-17 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (24–25 lines × 2) Library/Homebrew/cmd/pyenv-sync.rb:51— Library/Homebrew/cmd/pyenv-sync.rb:51-75 | Library/Homebrew/cmd/rbenv-sync.rb:52-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (24 lines × 2) Library/Homebrew/livecheck/livecheck.rb:787— Library/Homebrew/livecheck/livecheck.rb:787-810 | Library/Homebrew/livecheck/livecheck.rb:1047-1070 — both copies are in the same file, so extract the 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) Library/Homebrew/livecheck/livecheck.rb:710— Library/Homebrew/livecheck/livecheck.rb:710-729 | Library/Homebrew/livecheck/livecheck.rb:960-979 — both copies are in the same file, so extract the 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 (14 lines × 4) Library/Homebrew/livecheck/strategy/json.rb:112— Library/Homebrew/livecheck/strategy/json.rb:112-125 | Library/Homebrew/livecheck/strategy/page_match.rb:101-114 | Library/Homebrew/livecheck/strategy/xml.rb:151-164 | Library/Homebrew/livecheck/strategy/yaml.rb:110-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (14 lines × 2) Library/Homebrew/reinstall/reinstall.rb:44— Library/Homebrew/reinstall/reinstall.rb:44-57 | Library/Homebrew/upgrade.rb:601-614 — 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 (11–12 lines × 2) Library/Homebrew/cmd/install.rb:370— Library/Homebrew/cmd/install.rb:370-381 | Library/Homebrew/cmd/reinstall.rb:246-256 — before extracting anything, compare `Library/Homebrew/cmd/install.rb` and `Library/Homebrew/cmd/reinstall.rb` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Library/Homebrew/cmd/install.rb:370` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) Library/Homebrew/cmd/install.rb:350— Library/Homebrew/cmd/install.rb:350-360 | Library/Homebrew/cmd/install.rb:374-384 | Library/Homebrew/cmd/reinstall.rb:233-243 — before extracting anything, compare `Library/Homebrew/cmd/install.rb` and `Library/Homebrew/cmd/reinstall.rb` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Library/Homebrew/cmd/install.rb:350` 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) Library/Homebrew/livecheck/strategy/page_match.rb:97— Library/Homebrew/livecheck/strategy/page_match.rb:97-107 | Library/Homebrew/livecheck/strategy/sparkle.rb:249-260 — 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 (10 lines × 7) Library/Homebrew/cmd/install.rb:349— Library/Homebrew/cmd/install.rb:349-358 | Library/Homebrew/cmd/install.rb:373-382 | Library/Homebrew/cmd/reinstall.rb:184-193 | Library/Homebrew/cmd/reinstall.rb:232-241 | Library/Homebrew/cmd/reinstall.rb:248-257 | Library/Homebrew/cmd/reinstall.rb:318-327 | Library/Homebrew/cmd/upgrade.rb:693-702 — before extracting anything, compare `Library/Homebrew/cmd/install.rb` and `Library/Homebrew/cmd/reinstall.rb` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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 × 3) Library/Homebrew/cli/named_args.rb:244— Library/Homebrew/cli/named_args.rb:244-250 | Library/Homebrew/cli/named_args.rb:259-265 | Library/Homebrew/cli/named_args.rb:274-280 — 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 `Library/Homebrew/cli/named_args.rb:244` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Library/Homebrew/tab/tab.rb:430— Library/Homebrew/tab/tab.rb:430-436 | Library/Homebrew/tab/tab.rb:459-465 — both copies are in the same file, so extract the 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 `Library/Homebrew/tab/tab.rb:430` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) Library/Homebrew/cask/dsl.rb:212— Library/Homebrew/cask/dsl.rb:212-217 | Library/Homebrew/cask/dsl.rb:219-224 — both copies are in the same file, so extract the 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) REDACTED:229— REDACTED:229-233 | REDACTED:237-241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×1
Edited copies of one member (4 members, 9+ corresponding lines) Library/Homebrew/extend/os/linux/sandbox/landlock.rb:164— Library/Homebrew/extend/os/linux/sandbox/landlock.rb:164-172 | Library/Homebrew/extend/os/linux/sandbox/landlock.rb:177-185 | Library/Homebrew/extend/os/linux/sandbox/landlock.rb:190-198 | Library/Homebrew/extend/os/linux/sandbox/landlock.rb:203-211 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
P12 · CI test-gate honesty· Coverage collected but not gated · ×1
Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
No structured logging — No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.
Duplicated predicate Library/Homebrew/cmd/missing.rb:28— `!HOMEBREW_CELLAR.exist? && !Cask::Caskroom.path.exist?` appears character-identically in 2 files — Library/Homebrew/cmd/missing.rb, Library/Homebrew/diagnostic.rb. 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 Library/Homebrew/bundle/brew_services.rb:79— `!Homebrew::Services::System.launchctl? && !Homebrew::Services::System.systemctl?` appears character-identically in 2 files — Library/Homebrew/bundle/brew_services.rb, Library/Homebrew/services/subcommand.rb. 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 Library/Homebrew/cask/installer.rb:917— `!dep_tap.allowed_by_env? && dep_tap.forbidden_by_env?` appears character-identically in 2 files — Library/Homebrew/cask/installer.rb, Library/Homebrew/formula_installer.rb. 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 Library/Homebrew/bundle/extensions/cargo.rb:271— `!no_upgrade && package_outdated?(name, with:, source:)` appears character-identically in 2 files — Library/Homebrew/bundle/extensions/cargo.rb, Library/Homebrew/bundle/extensions/uv.rb. 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 Library/Homebrew/unpack_strategy/dmg.rb:182— `(status.success? && !stdout.empty?) || false` appears character-identically in 2 files — Library/Homebrew/unpack_strategy/dmg.rb, Library/Homebrew/unpack_strategy/tar.rb. 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 Library/Homebrew/cask/cask_loader.rb:704— `FromAPILoader.try_new(ref, warn:) || FromTapLoader.try_new(ref, warn:) || FromNameLoader.try_new(ref, warn:) || NullLoader.new(ref)` appears character-identically in 2 files — Library/Homebrew/cask/cask_loader.rb, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate Library/Homebrew/extend/os/mac/development_tools.rb:32— `MacOS::Xcode.installed? || MacOS::CLT.installed?` appears character-identically in 2 files — Library/Homebrew/extend/os/mac/development_tools.rb, Library/Homebrew/extend/os/mac/system_config.rb. 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 Library/Homebrew/cask/audit.rb:1525— `SharedAudits.self_submission_for_repo_owner?(repo_owner) || !SharedAudits.commit_email_domain_match(self_submission_urls).nil?` appears character-identically in 2 files — Library/Homebrew/cask/audit.rb, Library/Homebrew/formula_auditor.rb. 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 Library/Homebrew/cask/installer.rb:886— `Tap.allowed_taps.blank? && Tap.forbidden_taps.blank?` appears character-identically in 2 files — Library/Homebrew/cask/installer.rb, Library/Homebrew/formula_installer.rb. 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 Library/Homebrew/cmd/--env.rb:45— `Utils::Shell.parent || Utils::Shell.preferred` appears character-identically in 2 files — Library/Homebrew/cmd/--env.rb, Library/Homebrew/cmd/command-not-found-init.rb. 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 Library/Homebrew/build.rb:145— `args.debug? && !Homebrew::EnvConfig.disable_debrew?` appears character-identically in 3 files — Library/Homebrew/build.rb, Library/Homebrew/postinstall.rb, Library/Homebrew/test.rb. 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 Library/Homebrew/cmd/outdated.rb:243— `args.minimum_version || args.min_version` appears character-identically in 2 files — Library/Homebrew/cmd/outdated.rb, Library/Homebrew/cmd/upgrade.rb. 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 Library/Homebrew/cmd/upgrade.rb:835— `artifact.is_a?(Cask::Artifact::Installer) && artifact.manual_install` appears character-identically in 2 files — Library/Homebrew/cmd/upgrade.rb, Library/Homebrew/dev-cmd/cask-ci.rb. 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 Library/Homebrew/cask/installer.rb:911— `dep_tap.blank? || (dep_tap.allowed_by_env? && !dep_tap.forbidden_by_env?)` appears character-identically in 2 files — Library/Homebrew/cask/installer.rb, Library/Homebrew/formula_installer.rb. 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 Library/Homebrew/cask/upgrade.rb:241— `download_queue || Homebrew::DownloadQueue.default` appears character-identically in 2 files — Library/Homebrew/cask/upgrade.rb, Library/Homebrew/cmd/upgrade.rb. 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 Library/Homebrew/diagnostic.rb:1158— `dst.symlink? && src == Utils::Path.resolved_path(dst)` appears character-identically in 2 files — Library/Homebrew/diagnostic.rb, Library/Homebrew/utils/link.rb. 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 Library/Homebrew/tap/core_cask_tap.rb:69— `existing_path.nil? || existing_path.to_s.length < new_path.length` appears character-identically in 2 files — Library/Homebrew/tap/core_cask_tap.rb, Library/Homebrew/tap/core_tap.rb. 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 Library/Homebrew/dev-cmd/bump-python-resources-pr.rb:58— `formula.deprecated? || formula.disabled?` appears character-identically in 2 files — Library/Homebrew/dev-cmd/bump-python-resources-pr.rb, Library/Homebrew/formula_auditor.rb. 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 Library/Homebrew/bottle_specification.rb:144— `key.is_a?(String) && key.match?(SHA256_REGEX) && value.is_a?(Symbol)` appears character-identically in 2 files — Library/Homebrew/bottle_specification.rb, Library/Homebrew/formula_versions.rb. 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 Library/Homebrew/cmd/outdated.rb:61— `minimum_version.present? && args.named.length != 1` appears character-identically in 2 files — Library/Homebrew/cmd/outdated.rb, Library/Homebrew/cmd/upgrade.rb. 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 Library/Homebrew/rubocops/install_steps_source_independence.rb:25— `parent.is_a?(RuboCop::AST::SendNode) && parent.receiver == node` appears character-identically in 2 files — Library/Homebrew/rubocops/install_steps_source_independence.rb, Library/Homebrew/rubocops/no_base64.rb. 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 Library/Homebrew/cask/artifact/generated_script.rb:32— `path.absolute? || path.each_filename.any?("..")` appears character-identically in 2 files — Library/Homebrew/cask/artifact/generated_script.rb, Library/Homebrew/cask/dsl/rename.rb. 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 Library/Homebrew/cask/dsl.rb:792— `replacement_cask.presence || replacement` appears character-identically in 2 files — Library/Homebrew/cask/dsl.rb, Library/Homebrew/formula.rb. 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 Library/Homebrew/cask/dsl.rb:791— `replacement_formula.presence || replacement` appears character-identically in 2 files — Library/Homebrew/cask/dsl.rb, Library/Homebrew/formula.rb. 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 Library/Homebrew/rubocops/public_api_cookbook.rb:81— `target_line.match(/\A(?:def\s+(?:self\.)?|attr_reader\s+:|attr_accessor\s+:)(\w+[!?]?)/) || target_line.match(/\Adelegate\s+(\w+[!?]?):/)` appears character-identically in 2 files — Library/Homebrew/rubocops/public_api_cookbook.rb, Library/Homebrew/rubocops/shared/api_annotation_helper.rb. 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 23 significant file(s) lose their only recent owner: Library/Homebrew/rubocops/shared/install_steps_helper.rb, Library/Homebrew/rubocops/install_steps.rb, Library/Homebrew/dev-cmd/release.rb, Library/Homebrew/rubocops/cask/install_steps.rb, Library/Homebrew/install/check.rb, Library/Homebrew/utils/phase_timings.rb, Library/Homebrew/bundle/subcommand/dump.rb, Library/Homebrew/download_strategy/vcs_download_strategy.rb (+15 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 4 significant file(s) lose their only recent owner: Library/Homebrew/vulns/repology.rb, Library/Homebrew/vulns/cpan_sec.rb, Library/Homebrew/vulns/cvss.rb, Library/Homebrew/vulns/purl.rb. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 4 significant file(s) lose their only recent owner: Library/Homebrew/vulns/advisory_overrides.rb, Library/Homebrew/vulns/history.rb, Library/Homebrew/rubocops/cask/no_nested_os_dependency.rb, Library/Homebrew/dev-cmd/generate-bottle-ci-matrix.rb. Pair on, review, or document these before any departure.
Silent fallback default on parse failure Library/Homebrew/cask/cask_loader.rb:810— `resolve_installed_artifacts` answers `[]` when `CaskError | MethodDeprecatedError | ParserError | KeyError | ErrorDuringExecution | SystemExit` 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 Library/Homebrew/trust.rb:475— `trust_store` answers `{}` when `ENOENT | 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.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 7 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 (39 single-owned of 508 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; 508 of the 1030 production source files in this repository met that bar). They are anonymized user #4 (2 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)), anonymized user #9 (1 file(s)) (+1 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: Library/Homebrew/rubocops/shared/homepage_helper.rb, Library/Homebrew/dependencies_helpers.rb, Library/Homebrew/livecheck/options.rb, Library/Homebrew/cask/appcast.rb, Library/Homebrew/semver.rb, Library/Homebrew/utils/github/patch_inclusion.rb, Library/Homebrew/cask/metadata.rb, Library/Homebrew/rubocops/cask/conditional_arguments_order.rb.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 3 project(s) overshoot their size bounds, lowering Project Cohesion to 3.3/10. The most over is `Library/Homebrew` (141999 LoC, 2870 module-visible types across 116 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 1 of 508 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (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; 508 of the 1030 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: Library/Homebrew/extend/file/atomic.rb. 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.
Orphaned file Library/Homebrew/extend/file/atomic.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.
Changelog looks stale/thin — The changelog this check read carries 0 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
Nullable reference types not enabled everywhere — 0/1 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.
Outdated: irb — `irb` is resolved to 1.18.0 in the committed Gemfile.lock but 1.19.0 is the current release on rubygems.org, and docs/Gemfile declares no version requirement for it, so nothing but the lockfile is holding it back. This build is therefore missing every fix published since, including any security fix. Run `bundle update irb` and commit the updated Gemfile.lock.
Outdated: minitest — `minitest` is resolved to 6.0.6 in the committed Gemfile.lock but 6.1.0 is the current release on rubygems.org, and Library/Homebrew/Gemfile declares no version requirement for it, so nothing but the lockfile is holding it back. This build is therefore missing every fix published since, including any security fix. Run `bundle update minitest` and commit the updated Gemfile.lock.
Outdated: rspec-core — `rspec-core` is resolved to 3.13.6 in the committed Gemfile.lock but 3.13.7 is the current release on rubygems.org, and Library/Homebrew/Gemfile declares no version requirement for it, so nothing but the lockfile is holding it back. This build is therefore missing every fix published since, including any security fix. Run `bundle update rspec-core` and commit the updated Gemfile.lock.
Outdated: rspec-expectations — `rspec-expectations` is resolved to 3.13.5 in the committed Gemfile.lock but 3.13.6 is the current release on rubygems.org, and Library/Homebrew/Gemfile declares no version requirement for it, so nothing but the lockfile is holding it back. This build is therefore missing every fix published since, including any security fix. Run `bundle update rspec-expectations` and commit the updated Gemfile.lock.
Outdated: rubocop-ast — `rubocop-ast` is resolved to 1.50.0 in the committed Gemfile.lock but 1.51.0 is the current release on rubygems.org, and Library/Homebrew/Gemfile declares no version requirement for it, so nothing but the lockfile is holding it back. This build is therefore missing every fix published since, including any security fix. Run `bundle update rubocop-ast` and commit the updated Gemfile.lock.
Outdated: rubocop-md — `rubocop-md` is resolved to 2.0.4 in the committed Gemfile.lock but 3.0.0 is the current release on rubygems.org, and Library/Homebrew/Gemfile declares no version requirement for it, so nothing but the lockfile is holding it back. This build is therefore missing every fix published since, including any security fix. This crosses a major version, so read the changelog before taking it. Run `bundle update rubocop-md` and commit the updated Gemfile.lock.
Outdated: sorbet-runtime — `sorbet-runtime` is resolved to 0.6.13640 in the committed Gemfile.lock but 0.6.13680 is the current release on rubygems.org, and Library/Homebrew/Gemfile declares no version requirement for it, so nothing but the lockfile is holding it back. This build is therefore missing every fix published since, including any security fix. Run `bundle update sorbet-runtime` and commit the updated Gemfile.lock.
Outdated: sorbet-static-and-runtime — `sorbet-static-and-runtime` is resolved to 0.6.13640 in the committed Gemfile.lock but 0.6.13680 is the current release on rubygems.org, and Library/Homebrew/Gemfile declares no version requirement for it, so nothing but the lockfile is holding it back. This build is therefore missing every fix published since, including any security fix. Run `bundle update sorbet-static-and-runtime` and commit the updated Gemfile.lock.
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.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1d823-4244-7aae-bdbe-32344b2d400b · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 29 · Warnings: 1007 · Recommendations: 39 · Info: 8 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 03:39 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.