Public report of pandas-dev/pandas, published 27 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog 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, 27 October 2026, 20:54 UTC · Survey ID cd_2942f8f3ac7345a6b26c69f8ecd0d88a
pandas-dev/pandas
Measured 27 October 2026, 20:51 UTC, at code version cb74e49
Regression: 1 dimension fell since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
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: 248,399 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 5.0 person-years · Weakest lens: Accessibility, 55
Findings by how serious they are
21 critical1776 serious68 minor
23 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
27 October 2026, 20:51 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
58of 58 dimensions measured by tools.
1850of 1865 findings point to an exact file and line, so you can open each one in the code. The other 15 concern the repository as a whole, such as missing documentation.
58dimensions across 7 lenses, read from 248,399 lines of product code in 1 project.
pandas-dev/pandas falls short of our standard for production, held back most by its Accessibility lens, the interface's usability with a keyboard or assistive technology. It scores 65 out of 100 and is rated Adequate, and 12 of its 21 critical findings are security problems.
Accessibility, at 55, is the weakest lens and counts most in the score. The best first step is automating accessibility checks, worth about 4 points. Fixing focus, motion and contrast comes next, worth about 3 points. Raising Accessibility to 70 would lift the score to about 71.
Seven pipeline steps install packages that can change without warning. Three pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with, and eight buttons or links have no name a screen reader can say. Pinning what the pipeline installs, pinning each tool to an exact version and naming the buttons and links would close these risks. The password or key in the code's history needs replacing, with the old one switched off. The place where the code runs text as code or as a command needs a direct call instead. The page that doesn't say its language needs its language set.
The product code is 248,399 lines, about €730,000 to rebuild. Two of our security checks couldn't finish, among them the one for known security holes in its packages, so those results are missing, not clean passes.
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.
Visual & motion safety · Focus outline removed in CSS without a :focus replacement doc/source/_static/css/getting_started.css
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 25 findings
These 25 critical or serious findings were in the previous survey, on 13 October 2026, and are gone from this one.
Security & performance tooling · SAST runs, but gates no merge
Rebuild cost: about €730,000 · Estimate
Cost to rebuild
€240,000 to €1,200,000, for 4,048 to 12,843 hours of work, about 5.0 person-years for 2 to 10 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.9 at a score of 65. 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: 248,399 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: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
Raises the score by about 4 points · Medium effort · A11y enforcement
2
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Raises the score by about 3 points · Medium effort · Forms & labels
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €730,000 to build again, about 5.0 person-years of work. Its weakest lens is Accessibility, at 55 (Adequate). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.7 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 3% to 7% on every change. The history of the code shows how much it changes: about 395,021 lines over the last 90 days, which is about 1,602,030 lines a year. At that pace, the extra work comes to an estimated 132.4 to 794.2 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, 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.
At a glance — Code Health · 80% · Adequate · gated by D2 ·
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
31
High / Critical
A03:2025 — Software Supply Chain Failures
4
Medium
A07:2025 — Authentication Failures
2
High / Critical
Roadmap
First, enforce accessibility in the test suite by asserting invariants on rendered HTML and gating the test in CI to prevent regressions. Next, ensure visual safety by maintaining visible focus styles, respecting reduced motion preferences, and correcting low-contrast colors, while also adding programmatic labels to all form controls and buttons. Finally, improve page structure by declaring language, title, and main landmarks, and expand the architecture decision records to twenty to document significant design choices.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
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.
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 — 21
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 — 1776
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 — 68
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 23
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 58 of 58 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.8 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 58 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, 1850 of 1865 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT READ here — but this repository measures it: a Codecov configuration (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 (.py), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.py) and this repository declares a Python test suite (repository root, 994 test files), 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.
D12 Dependency Hygiene — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. This repository's 3 shipped Python distribution(s) across 2 manifest(s) WERE read; what went unanswered is the currency half, because it grades an EXACT pin against the newest release and every declaration here is a floor or a range — which installs the newest release it admits and so cannot be behind one. So pypi.org was never asked. This is a true statement about the repository, and the healthy one, NOT a gap on our side: no reader we could write would find a currency question here.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D30 Dependency Vulnerabilities — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Osv: osv-scanner exited 1 with no findings — dependency CVEs were not measured. 'osv-scanner' exited 1 and produced no findings, and that exit code has no documented repo-side meaning — so this run measured nothing, and nothing here is a statement about the repository.
D43 Malicious Dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Osv: osv-scanner exited 1 with no findings — dependency CVEs were not measured. 'osv-scanner' exited 1 and produced no findings, and that exit code has no documented repo-side meaning — so this run measured nothing, and nothing here is a statement about the repository.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, 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.
AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: 3 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'pandas.io.sql' is imported (pandas/io/api.py:32), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'pandas.io.sql' is imported (pandas/io/api.py:32), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'pandas.io.sql' is imported (pandas/io/api.py:32), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python, c, cpp is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python, c, cpp is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
P8 Schema migrations — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The schema may be created by a runner, a deploy script or a config file outside what this check reads, so an absence here is our blind spot rather than a missing migration strategy. The card abstains instead of scoring. You can widen what we reach: if the schema is created and evolved by a tool this check does not name, naming it lets us teach the detector to read it.
X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's C, Cpp, Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
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.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
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 is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
251 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was readers._read_csv_chunks at 69. A further 1 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 missing.is_valid_na_for_dtype at 16 — they are counted neither in the figure above nor in this dimension's score.
+ 242 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with readers._read_csv_chunks (cyclomatic 69), cast.np_can_hold_element (cyclomatic 68), _MergeOperation._maybe_coerce_merge_keys (cyclomatic 65). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cyclomatic Complexity from 5.7 to about 5.9/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 478 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 30 bodies over 60 down to 60 or less in Cognitive Complexity — start with cast.np_can_hold_element (cognitive 172), MultiIndex._get_locs (cognitive 133), MultiIndex._get_loc_level (cognitive 116). — 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 30 together lifts Cognitive Complexity from 2.0 to about 3.9/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.6 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 63 FileTooLong finding(s) in God Classes — start with base.py (3), datetimes.py (3), generic.py (2). — One of this dimension's main actionable groups (63 warning-level).
Resolve the 36 TooManyMethods finding(s) in God Classes — start with base.py (2), array.py (2), datetimelike.py (2). — One of this dimension's main actionable groups (36 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
92 duplicated block group(s) detected. A further 5 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 55 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 6 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with masked.py, blocks.py, ewm.py. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 6 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with datetimelike.py, interval.py, generic.py. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 6 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with categorical.py, range.py, _openpyxl.py. — One of this dimension's main actionable groups (6 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
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 12 Low cohesion finding(s) in Cohesion (LCOM4) — start with base.py (2), frame.py, series.py. — One of this dimension's main actionable groups (12 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
Classify ADR enforcement: PDEP-1: Purpose and guidelines · ×11web/pandas/pdeps/0001-purpose-and-guidelines.md
What to do
Resolve the 11 Classify ADR enforcement finding(s) in Architectural Integrity — start with 0001-purpose-and-guidelines.md, 0004-consistent-to-datetime-parsing.md, 0005-no-default-index-mode.md. — One of this dimension's main actionable groups (11 recommendation-level).
Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d7_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
22581 test methods: 22581 unit, 0 integration, 0 BDD, 0 e2e. The Python suite contributes 22581 test function(s) across 993 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.
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 4 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 3 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (1 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. This repository publishes itself under BSD-3-Clause, which is its own choice and is not judged here.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: pandas/io/parsers/readers.py (39×69=2691); pandas/core/frame.py (71×35=2485); pandas/core/generic.py (43×46=1978) Repeated repair below the complexity floor: pandas/core/arrays/_arrow_string_mixins.py (9 of 12 changes were fixes); REDACTED (8 of 9 changes were fixes); pandas/plotting/_matplotlib/timeseries.py (5 of 6 changes were fixes)
Resolve the 50 Hotspot finding(s) in Churn × Complexity Hotspots — start with generic.py (2), array.py (2), pytables.py (2). — One of this dimension's main actionable groups (50 warning-level).
Resolve the 8 Repeated repair finding(s) in Churn × Complexity Hotspots — start with _arrow_string_mixins.py, REDACTED, timeseries.py. — One of this dimension's main actionable groups (8 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.0 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
29 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is pandas/io/clipboard/__init__.py. Counted over 282 of the 380 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 · ×2
Further sole-owners (lower concentration)
What to do
Resolve the 2 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (2 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
728 deducted task-comment markers across 248399 LoC (0.3/KLoC) → score 9.4. 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 710 TodoComment finding(s) in Explicit Debt — start with core.py (27), managers.py (24), array.py (23). — One of this dimension's main actionable groups (710 warning-level).
Resolve the 8 HackComment finding(s) in Explicit Debt — start with test_sql.py (2), test_get_dummies.py, test_coercion.py. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 8 FixmeComment finding(s) in Explicit Debt — start with test_constructors.py (3), multi.py (2), test_orc.py. — One of this dimension's main actionable groups (8 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
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: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
0 of 11 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). How well each record argues its case is not measured.
1 of 1 build units (Python) 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.
1 finding(s): 0 critical, 1 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 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
31 finding(s): 0 critical, 11 high, 19 medium, 1 low. semgrep hit a parse error in 11 file(s) — `doc/_templates/docs-announcement-banner.html` (line 1), `pandas/_libs/include/pandas/vendored/klib/khash.h` (line 300, line 302, lines 303–304, …), `pandas/_libs/include/pandas/vendored/ujson/lib/ultrajson.h` (line 294, line 324, line 326), `pandas/_libs/src/datetime/pd_datetime.c` (line 344, line 346), `pandas/_libs/src/parser/pd_parser.c` (line 144, line 146), … (+6 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 6 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (2). — One of this dimension's main actionable groups (7 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
16 of 282 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is pandas/core/_numba/extensions.py. Counted over 282 of the 380 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.
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 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 3 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
Do you agree with this assessment?
AC2 · Forms & labels5.1 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. (×8) — REDACTED:68, REDACTED:73, REDACTED:78, …
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — REDACTED:2
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. — REDACTED:19
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
`.gs-data .badge` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — doc/source/_static/css/getting_started.css:32
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 3 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
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.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
What to do
Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
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
Dependabot is configured but does not watch `pip` — add that `package-ecosystem` entry to .github/dependabot.yml so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Other · Security — Only what this repository's own non-C# files could be read for was assessed — markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
`https://views.scientific-python.org/js/script.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository. — REDACTED:4
What to do
Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document2.0 / 10Critical✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`get_callable_name` is public and takes `obj: object` from its caller, and it calls itself at line 376 (`get_callable_name`) with a piece of `obj` — and nowhere in `get_callable_name` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `get_callable_name` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pandas/core/common.py:376
`infer_dtype_from_scalar` is public and takes `val: object` from its caller, and it calls itself at line 784 (`infer_dtype_from_scalar`) with a piece of `val` — and nowhere in `infer_dtype_from_scalar` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `infer_dtype_from_scalar` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pandas/core/dtypes/cast.py:784
`np_can_hold_element` is public and takes `element: Any` from its caller, and it calls itself at line 1822 (`np_can_hold_element`) with a piece of `element` — and nowhere in `np_can_hold_element` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `np_can_hold_element` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pandas/core/dtypes/cast.py:1822
`shares_memory` is public and takes `left: Any` from its caller, and it calls itself at line 536 (`shares_memory`) with a piece of `left` (and at line 539, line 540, line 543, line 545, line 547, line 564, line 567, line 571) — and nowhere in `shares_memory` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `shares_memory` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — pandas/_testing/__init__.py:536
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×3) — pandas/plotting/_matplotlib/converter.py:392, pandas/plotting/_matplotlib/core.py:1824, pandas/io/json/_json.py:1757
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×7) — pandas/plotting/_matplotlib/converter.py:416, pandas/plotting/_matplotlib/converter.py:530, pandas/io/_util.py:400, …
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 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 — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: this repository stores data through 'pandas.io.sql' (pandas/io/api.py:32) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and MongoEngine model fields, Alembic and Django migration columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
C4 Data Retention — Not assessed: this repository stores data through 'pandas.io.sql' (pandas/io/api.py:32) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and mongoengine model fields, Alembic and Django migration columns, SQL schemas). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'pandas.io.sql' (pandas/io/api.py:32) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and mongoengine model fields, Alembic and Django migration columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 55 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.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads.
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface 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
AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository registers no route and starts no server another machine can reach (no Flask/FastAPI/Starlette route, Django urlpatterns or class-based view, Tornado handler). Access control is therefore N/A here — a library or command-line tool is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
D10 Test Quality — ~377184 lines of test source are present (.py) 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 .py suite was found but not re-run
D12 Dependency Hygiene — Dependency currency not established — no declaration carries an exact pin to grade
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency is measured on C# only; Python, html not measured.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .py, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — None of 8 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 — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.py), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D30 Dependency Vulnerabilities — Scanner failed to run — not a clean result
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 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.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Scanner failed to run — not a clean result
D5 Coupling — Not applicable — this Python build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
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 (7 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
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
M4 Documentation accuracy — Not applicable: the 200 current-state document(s) make no claim of a kind M4 checks. 25 claim(s) of kinds M4 does not check were not checked (path 15, command argument 2, environment variable 8); M4 checks only links and versions.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Python source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — SQLAlchemy is declared, but the schema-migration mechanism could not be identified. Our limit, not a verdict on this repository.
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF2 Allocation hygiene — Not applicable: Python runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
X16 Unfloored truncation loop — 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
X18 Disposal-pattern 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
X2 Cancellation propagation — no C# was loaded; this repository's Python was read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X29 Per-element action decided by a fixed element — 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
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — 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.
Critical — 21 finding(s)
AC2 · Forms & labels· Link with no accessible name · ×8
Link with no accessible name REDACTED:68— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name REDACTED:73— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name REDACTED:78— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name REDACTED:83— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name REDACTED:88— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name REDACTED:76— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name REDACTED:81— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name REDACTED:86— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
TodoComment scripts/validate_unwanted_patterns.py:42— # TODO(4.0): GH#55043 - remove upon removal of CoW option
TodoComment pandas/tests/test_downstream.py:41— # TODO(CoW) see https://github.com/pandas-dev/pandas/pull/51082
TodoComment pandas/tests/test_downstream.py:255— # TODO: could check with arraylike of Period objects — 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 pandas/tests/util/test_assert_almost_equal.py:473— # TODO: to get the same deprecation in assert_numpy_array_equal we need — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pandas/tests/util/test_assert_almost_equal.py:475— # TODO: to get the same deprecation in assert_index_equal we need to — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pandas/tests/tslibs/test_array_to_datetime.py:27— # TODO: tests that include tzs, ints — 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 pandas/tests/tseries/offsets/test_business_hour.py:996— # TODO(GH#55564): as_unit will be unnecessary
TodoComment pandas/tests/tseries/offsets/test_offsets.py:611— # TODO(GH#55564): as_unit will be unnecessary
TodoComment pandas/tests/arithmetic/test_datetime64.py:1349— # TODO(GH#55564): as_unit will be unnecessary
TodoComment pandas/tests/arithmetic/test_datetime64.py:1470— # TODO(GH#55564): as_unit will be unnecessary
TodoComment pandas/tests/tseries/offsets/test_offsets.py:594— # TODO: belongs in arithmetic tests? — 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 pandas/tests/tools/test_to_datetime.py:630— # TODO: Timestamp raises ValueError("could not convert string to Timestamp") — 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 pandas/tests/tools/test_to_datetime.py:1702— # TODO: should Index get "s" by default 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 pandas/tests/tools/test_to_datetime.py:2381— # TODO typed array code path fails this case - internal error — 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 pandas/tests/strings/test_cat.py:380— # TODO: Strimg option, this should return string dtype — 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 pandas/tests/strings/test_extract.py:14— # TODO: should this raise TypeError — 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 pandas/tests/strings/test_find_replace.py:282— # TODO this currently works for pyarrow-backed dtypes but raises for python — 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 pandas/tests/strings/test_find_replace.py:1631— # TODO this currently works for pyarrow-backed dtypes but raises for python — 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 pandas/tests/strings/test_find_replace.py:298— # TODO should this be supported? — 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 pandas/tests/strings/test_split_partition.py:443— # TODO see GH 18463 — 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 pandas/tests/series/test_arithmetic.py:882— # TODO: belongs in tests/arithmetic? — 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 pandas/tests/series/test_constructors.py:851— # TODO: try to align these — 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 pandas/tests/series/test_constructors.py:2209— # TODO: make this not cast to object in pandas 3.0 — 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 pandas/tests/frame/test_constructors.py:3518— # TODO: make this not cast to object in pandas 3.0 — 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 pandas/tests/series/test_logical_ops.py:417— # TODO(infer_string) should this behave differently? — 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: core/frame.py pandas/core/frame.py— FileTooLong — 11144 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 10644 over it, 22.29× 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: core/generic.py pandas/core/generic.py— FileTooLong — 4535 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4035 over it, 9.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: io/pytables.py pandas/io/pytables.py— FileTooLong — 3691 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3191 over it, 7.38× 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: indexes/base.py pandas/core/indexes/base.py— FileTooLong — 3542 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3042 over it, 7.08× 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: strings/accessor.py pandas/core/strings/accessor.py— FileTooLong — 3223 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2723 over it, 6.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: arrow/array.py pandas/core/arrays/arrow/array.py— FileTooLong — 3096 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2596 over it, 6.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 2452 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1952 over it, 4.90× 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: indexes/multi.py pandas/core/indexes/multi.py— FileTooLong — 2290 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1790 over it, 4.58× 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: core/series.py pandas/core/series.py— FileTooLong — 2238 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1738 over it, 4.48× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: io/stata.py pandas/io/stata.py— FileTooLong — 2137 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1637 over it, 4.27× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: reshape/merge.py pandas/core/reshape/merge.py— FileTooLong — 1905 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1405 over it, 3.81× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: groupby/groupby.py pandas/core/groupby/groupby.py— FileTooLong — 1834 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1334 over it, 3.67× 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: io/sql.py pandas/io/sql.py— FileTooLong — 1714 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1214 over it, 3.43× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: _matplotlib/core.py pandas/plotting/_matplotlib/core.py— FileTooLong — 1702 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1202 over it, 3.40× 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: sparse/array.py pandas/core/arrays/sparse/array.py— FileTooLong — 1589 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1089 over it, 3.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: core/indexing.py pandas/core/indexing.py— FileTooLong — 1550 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1050 over it, 3.10× 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: internals/blocks.py pandas/core/internals/blocks.py— FileTooLong — 1488 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 988 over it, 2.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: internals/managers.py pandas/core/internals/managers.py— FileTooLong — 1487 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 987 over it, 2.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1398 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 898 over it, 2.80× 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: formats/format.py pandas/io/formats/format.py— FileTooLong — 1370 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 870 over it, 2.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: parsers/readers.py pandas/io/parsers/readers.py— FileTooLong — 1364 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 864 over it, 2.73× 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: core/apply.py pandas/core/apply.py— 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: arrays/masked.py pandas/core/arrays/masked.py— FileTooLong — 1334 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 834 over it, 2.67× 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: window/rolling.py pandas/core/window/rolling.py— FileTooLong — 1313 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 813 over it, 2.63× 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: arrays/categorical.py pandas/core/arrays/categorical.py— FileTooLong — 1256 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 756 over it, 2.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Hotspot: pandas/io/parsers/readers.py pandas/io/parsers/readers.py:837— pandas/io/parsers/readers.py changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in readers._read_csv_chunks at line 837. 21 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/io/parsers/readers.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/frame.py pandas/core/frame.py:17035— pandas/core/frame.py changed 71 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in DataFrame._reduce at line 17035. 34 of those changes were fix/bug commits, and the other 37 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/frame.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/generic.py pandas/core/generic.py:10397— pandas/core/generic.py changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in NDFrame._where at line 10397. 14 of those changes were fix/bug commits, and the other 29 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/generic.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/arrays/arrow/array.py pandas/core/arrays/arrow/array.py:2793— pandas/core/arrays/arrow/array.py changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in ArrowExtensionArray._reduce_pyarrow at line 2793. 30 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/arrays/arrow/array.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/arrays/sparse/array.py pandas/core/arrays/sparse/array.py:650— pandas/core/arrays/sparse/array.py changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in SparseArray.__init__ at line 650. 41 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/arrays/sparse/array.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/indexes/base.py pandas/core/indexes/base.py:4585— pandas/core/indexes/base.py changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in Index.join at line 4585. 12 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/indexes/base.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/io/pytables.py pandas/io/pytables.py:4814— pandas/io/pytables.py changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in Table._create_axes at line 4814. 15 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/io/pytables.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/indexes/multi.py pandas/core/indexes/multi.py:4183— pandas/core/indexes/multi.py changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in MultiIndex._get_locs at line 4183. 11 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/indexes/multi.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/dtypes/cast.py pandas/core/dtypes/cast.py:894— pandas/core/dtypes/cast.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in cast.convert_dtypes at line 894. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/dtypes/cast.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/reshape/merge.py pandas/core/reshape/merge.py:1277— pandas/core/reshape/merge.py changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in _MergeOperation._maybe_add_join_keys at line 1277. 5 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/reshape/merge.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/plotting/_matplotlib/core.py pandas/plotting/_matplotlib/core.py:2099— pandas/plotting/_matplotlib/core.py changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in BarPlot._make_plot at line 2099. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/plotting/_matplotlib/core.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/_testing/asserters.py pandas/_testing/asserters.py:1037— pandas/_testing/asserters.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in asserters.assert_series_equal at line 1037. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/_testing/asserters.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:737— REDACTED changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in common.get_handle at line 737. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07: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: pandas/core/indexing.py pandas/core/indexing.py:2685— pandas/core/indexing.py changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in _iLocIndexer._setitem_with_indexer_split_path at line 2685. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/indexing.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/io/json/_json.py pandas/io/json/_json.py:158— pandas/io/json/_json.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in _json.to_json at line 158. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/io/json/_json.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/algorithms.py pandas/core/algorithms.py:549— pandas/core/algorithms.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in algorithms.isin at line 549. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/algorithms.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/internals/blocks.py pandas/core/internals/blocks.py:832— pandas/core/internals/blocks.py changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in Block.replace_list at line 832. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/internals/blocks.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/strings/accessor.py pandas/core/strings/accessor.py:261— pandas/core/strings/accessor.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in StringMethods._wrap_result at line 261. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/strings/accessor.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:758— REDACTED changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Styler.to_latex at line 758. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07: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: pandas/io/parsers/python_parser.py pandas/io/parsers/python_parser.py:587— pandas/io/parsers/python_parser.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in PythonParser._infer_columns at line 587. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/io/parsers/python_parser.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/nanops.py pandas/core/nanops.py:1054— pandas/core/nanops.py changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in nanops.nanmedian at line 1054. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/nanops.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/computation/eval.py pandas/core/computation/eval.py:205— pandas/core/computation/eval.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in eval.eval at line 205. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/computation/eval.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/arrays/datetimes.py pandas/core/arrays/datetimes.py:3138— pandas/core/arrays/datetimes.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in datetimes._generate_range at line 3138. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/arrays/datetimes.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/internals/managers.py pandas/core/internals/managers.py:1305— pandas/core/internals/managers.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in BlockManager.iset at line 1305. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/internals/managers.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pandas/core/arrays/timedeltas.py pandas/core/arrays/timedeltas.py:1223— pandas/core/arrays/timedeltas.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in timedeltas.sequence_to_td64ns at line 1223. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/arrays/timedeltas.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
TooManyMethods: DataFrame pandas/core/frame.py:283— TooManyMethods — 249 methods. The bar is 30 methods; this is 219 over it, 8.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: Index pandas/core/indexes/base.py:319— TooManyMethods — 207 methods. The bar is 30 methods; this is 177 over it, 6.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: NDFrame pandas/core/generic.py:264— TooManyMethods — 194 methods. The bar is 30 methods; this is 164 over it, 6.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Series pandas/core/series.py:219— TooManyMethods — 165 methods. The bar is 30 methods; this is 135 over it, 5.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ArrowExtensionArray pandas/core/arrays/arrow/array.py:508— TooManyMethods — 140 methods. The bar is 30 methods; this is 110 over it, 4.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MultiIndex pandas/core/indexes/multi.py:203— TooManyMethods — 100 methods. The bar is 30 methods; this is 70 over it, 3.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BaseMaskedArray pandas/core/arrays/masked.py:173— TooManyMethods — 85 methods. The bar is 30 methods; this is 55 over it, 2.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SparseArray pandas/core/arrays/sparse/array.py:561— TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ExtensionArray pandas/core/arrays/base.py:124— TooManyMethods — 75 methods. The bar is 30 methods; this is 45 over it, 2.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Categorical pandas/core/arrays/categorical.py:260— TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.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: RangeIndex pandas/core/indexes/range.py:157— TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GroupBy pandas/core/groupby/groupby.py:753— 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: StringMethods pandas/core/strings/accessor.py:151— TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DatetimeLikeArrayMixin pandas/core/arrays/datetimelike.py:193— TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Block pandas/core/internals/blocks.py:146— TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ObjectStringArrayMixin pandas/core/strings/object_array.py:36— TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Styler REDACTED:82— 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: IntervalArray pandas/core/arrays/interval.py:128— 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: ArrowStringArrayMixin pandas/core/arrays/_arrow_string_mixins.py:38— 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: BaseBlockManager pandas/core/internals/managers.py:146— 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: Expression pandas/core/col.py:81— TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× 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: StataReader pandas/io/stata.py:1031— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MPLPlot pandas/plotting/_matplotlib/core.py:124— 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: HDFStore pandas/io/pytables.py:558— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DatetimeTimedeltaMixin pandas/core/indexes/datetimelike.py:683— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Low cohesion: DataFrame (LCOM4 60) pandas/core/frame.py:283— DataFrame's methods fall into 60 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 60 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: Series (LCOM4 20) pandas/core/series.py:219— Series'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: NDFrame (LCOM4 19) pandas/core/generic.py:264— NDFrame's methods fall into 19 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 19 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: ExtensionArray (LCOM4 10) pandas/core/arrays/base.py:124— ExtensionArray'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: TimedeltaArray (LCOM4 10) pandas/core/arrays/timedeltas.py:141— TimedeltaArray'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: PeriodArray (LCOM4 9) pandas/core/arrays/period.py:125— PeriodArray'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: IntervalIndex (LCOM4 9) pandas/core/indexes/interval.py:146— IntervalIndex'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: ExtensionDtype (LCOM4 4) pandas/core/dtypes/base.py:49— ExtensionDtype's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DatetimeIndex (LCOM4 4) pandas/core/indexes/datetimes.py:116— DatetimeIndex's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ExcelWriter (LCOM4 4) pandas/io/excel/_base.py:1003— ExcelWriter's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: _TableBuilderVerboseMixin (LCOM4 4) pandas/io/formats/info.py:563— _TableBuilderVerboseMixin's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: GenericFixed (LCOM4 4) pandas/io/pytables.py:3563— GenericFixed's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Repeated repair: pandas/core/arrays/_arrow_string_mixins.py pandas/core/arrays/_arrow_string_mixins.py:113— pandas/core/arrays/_arrow_string_mixins.py changed 12 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ArrowStringArrayMixin._needs_python_regex at line 113), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “BUG: fix string regex operations with $ end indicator (always match Python behaviour) (#71387)”; “BUG: fix string regex operations with Python unicode escape sequence (#71383)”; “BUG: str regex \w, \d, \s and \b only matching ASCII for pyarrow-backed strings (#70773)”; “BUG: handle negative width in Arrow string padding (#69792)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/arrays/_arrow_string_mixins.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: REDACTED REDACTED:117— REDACTED changed 9 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is Term._resolve_name at line 117), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “BUG: eval/query with Timestamp or Timedelta scalar arithmetic (GH#52559) (#71234)”; “BUG: query with tz-aware column vs naive date string (GH#26236) (#71091)”; “TYP: fix stubtest failure in eval unary ops (#71154)”; “BUG: treat `not` as logical negation in eval/query (GH#11367) (#71095)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07: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.
Repeated repair: pandas/plotting/_matplotlib/timeseries.py pandas/plotting/_matplotlib/timeseries.py:87— pandas/plotting/_matplotlib/timeseries.py changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is timeseries.maybe_resample at line 87), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “BUG: warn when Period/PeriodIndex construction drops timezone (GH#47005) (#70130)”; “BUG: tz-aware plot raising when the index starts at a DST transition (#69960)”; “BUG: mixed-frequency plotting of business-day data raises TypeError (#66824)”; “BUG: bar plot raises AttributeError when the DatetimeIndex freq attribute is unset (#66771)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/plotting/_matplotlib/timeseries.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: pandas/core/computation/expr.py pandas/core/computation/expr.py:682— pandas/core/computation/expr.py changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is BaseExprVisitor.visit_Call at line 682), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “BUG: eval/query with numexpr on object or string columns (GH#27639) (#71228)”; “BUG: eval/query with Timestamp or Timedelta scalar arithmetic (GH#52559) (#71234)”; “BUG: query == string against datetimelike columns (GH#54199) (#70107)”; “BUG: slice and other subscript keys raised in query/eval expressions (GH#49905) (#68575)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/computation/expr.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: pandas/core/computation/expressions.py pandas/core/computation/expressions.py:97— pandas/core/computation/expressions.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is expressions._can_use_numexpr at line 97), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “BUG: don't use numexpr for integer pow (GH#54546) (#71096)”; “BUG: numexpr results use a nonstandard int64 type, breaking select_dtypes (GH#17945) (#69427)”; “BUG: defer the blocked-numexpr warning to first use (GH#66956) (#68465)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/computation/expressions.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: pandas/core/util/hashing.py pandas/core/util/hashing.py:365— pandas/core/util/hashing.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is hashing._hash_ndarray at line 365), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “BUG: hash_pandas_object raised on mixed-type values with non-ASCII bytes (GH#27215) (#70493)”; “BUG: hash_pandas_object on DataFrame with no columns and index=False (GH#24318) (#69489)”; “BUG: hash_pandas_object gave different hashes for equal float and complex values (GH#28363) (#66955)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/util/hashing.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: pandas/core/arrays/sparse/accessor.py pandas/core/arrays/sparse/accessor.py:412— pandas/core/arrays/sparse/accessor.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is SparseFrameAccessor.to_coo at line 412), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “BUG: DataFrame.sparse.from_spmatrix gave the unstored entries a missing value (GH#59212) (#69115)”; “BUG: DataFrame.sparse.density warned for a frame with no columns (#68564)”; “BUG: SparseArray.density raised ZeroDivisionError on an empty array (#68468)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/arrays/sparse/accessor.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: pandas/core/ops/invalid.py pandas/core/ops/invalid.py:134— pandas/core/ops/invalid.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is invalid._is_datetimelike_dtype at line 134), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “BUG: the logical ufuncs were not rejected against datetimelike data (GH#68524) (#68524)”; “BUG: sparse comparisons densified a masked operand and lost its NA (#68579)”; “BUG: bool operands were not rejected against datetimelike data (GH#68452) (#68452)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 10:42:46 -07:00' --until='2026-10-27 10:42:46 -07:00' --full-history --no-merges -- pandas/core/ops/invalid.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
HackComment pandas/tests/reshape/test_get_dummies.py:160— # hack (NaN handling in assert_index_equal) — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment pandas/tests/io/test_sql.py:1832— # HACK! — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment pandas/tests/io/test_sql.py:4632— # HACK! Change this once indexes are handled properly. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment pandas/tests/indexing/test_coercion.py:205— # Hack, in the 2nd test case, since 1.1 can be losslessly cast to float32 — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment pandas/plotting/_matplotlib/hist.py:445— # hack until the plotting interface is a bit more unified — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment pandas/io/html.py:822— # HACK: lxml does not clean up the clearly-erroneous — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment pandas/io/pytables.py:5287— # hack until we support reversed dim flags — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment pandas/io/formats/css.py:399— # hack for 'large' etc. — 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.
FixmeComment pandas/tests/io/test_orc.py:330— # FIXME: without casting to ns we do not round-trip correctly — 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 pandas/tests/indexes/test_any_index.py:53— # FIXME: doesn't belong in this file anymore! — 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 pandas/tests/indexes/datetimes/test_constructors.py:1026— # FIXME: The Timestamp constructor here behaves differently than all — 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 pandas/tests/frame/test_constructors.py:2938— # FIXME(GH#35417): until GH#35417, iloc.setitem into EA values does not preserve
FixmeComment pandas/tests/frame/test_constructors.py:2949— # FIXME(GH#35417): enable after GH#35417
FixmeComment pandas/core/reshape/merge.py:1641— # FIXME: what about other NAs? — 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 pandas/core/indexes/multi.py:3867— # FIXME: we should be only dropping levels on which we are — 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 pandas/core/indexes/multi.py:3976— # FIXME: this message can be inaccurate, e.g. — 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.
Swallowed exception (empty catch) pandas/plotting/_matplotlib/converter.py:416— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) pandas/plotting/_matplotlib/converter.py:530— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) pandas/io/_util.py:400— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) pandas/io/parsers/readers.py:1295— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) pandas/io/json/_json.py:1668— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) pandas/core/apply.py:1255— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) pandas/core/frame.py:15514— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Duplicated block (13 lines × 2) pandas/core/arrays/masked.py:1007— pandas/core/arrays/masked.py:1007-1019 | pandas/core/arrays/sparse/array.py:2972-2984 — 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. Note first that the copies are not typed on the same thing: `ExtensionArray` names `pandas.core.arrays` in one and `pandas.core.arrays.base` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13 lines × 2) pandas/core/internals/blocks.py:1910— pandas/core/internals/blocks.py:1910-1922 | pandas/core/internals/blocks.py:1988-2000 — both copies are in the same file, so extract the 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 `pandas/core/internals/blocks.py:1910` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) pandas/core/window/ewm.py:606— pandas/core/window/ewm.py:606-618 | pandas/core/window/ewm.py:697-709 — both copies are in the same file, so extract the 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 `pandas/core/window/ewm.py:606` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) REDACTED:417— REDACTED:417-429 | REDACTED:515-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:414` calls `items`, `isinstance`, `register_namespace` and `REDACTED:514` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) REDACTED:226— REDACTED:226-238 | REDACTED:345-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:226` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) pandas/core/arrays/_mixins.py:653— pandas/core/arrays/_mixins.py:653-665 | pandas/core/arrays/categorical.py:2146-2161 — 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `dtype` to `ExtensionDtype` in one and `CategoricalDtype` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 2) pandas/core/arrays/datetimelike.py:949— pandas/core/arrays/datetimelike.py:949-960 | pandas/core/arrays/interval.py:733-744 — 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 (12 lines × 2) pandas/core/arrays/interval.py:866— pandas/core/arrays/interval.py:866-877 | pandas/core/arrays/interval.py:883-894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) pandas/core/groupby/generic.py:3115— pandas/core/groupby/generic.py:3115-3126 | pandas/core/groupby/generic.py:3131-3142 — both copies are in the same file, so extract the 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 `pandas/core/groupby/generic.py:3115` 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) pandas/core/groupby/ops.py:944— pandas/core/groupby/ops.py:944-955 | pandas/core/groupby/ops.py:1011-1022 — both copies are in the same file, so extract the 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) pandas/core/nanops.py:826— pandas/core/nanops.py:826-837 | pandas/core/nanops.py:1832-1843 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) pandas/io/stata.py:2396— pandas/io/stata.py:2396-2407 | pandas/io/stata.py:3229-3240 — both copies are in the same file, so extract the 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 `pandas/io/stata.py:2396` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) pandas/core/arrays/categorical.py:2736— pandas/core/arrays/categorical.py:2736-2743 | pandas/core/arrays/categorical.py:2768-2775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) pandas/core/indexes/range.py:1363— pandas/core/indexes/range.py:1363-1370 | pandas/core/indexes/range.py:1378-1385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) pandas/io/excel/_openpyxl.py:767— pandas/io/excel/_openpyxl.py:767-775 | pandas/io/excel/_pyxlsb.py:141-148 — 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) REDACTED:593— REDACTED:593-600 | REDACTED:861-868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:593` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) pandas/plotting/_matplotlib/converter.py:989— pandas/plotting/_matplotlib/converter.py:989-996 | pandas/plotting/_matplotlib/converter.py:1038-1045 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) pandas/core/groupby/groupby.py:865— pandas/core/groupby/groupby.py:865-872 | pandas/core/window/rolling.py:301-308 — 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) doc/sphinxext/announce.py:92— doc/sphinxext/announce.py:92-101 | doc/sphinxext/announce.py:103-112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) pandas/core/arrays/timedeltas.py:717— pandas/core/arrays/timedeltas.py:717-726 | pandas/core/arrays/timedeltas.py:768-777 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) pandas/core/computation/expr.py:471— pandas/core/computation/expr.py:471-480 | pandas/core/computation/expr.py:481-490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) pandas/core/reshape/merge.py:2142— pandas/core/reshape/merge.py:2142-2151 | pandas/core/reshape/merge.py:2154-2163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×4
Recursive walk over a caller-supplied document has no depth cap pandas/core/common.py:376— `get_callable_name` is public and takes `obj: object` from its caller, and it calls itself at line 376 (`get_callable_name`) with a piece of `obj` — and nowhere in `get_callable_name` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `get_callable_name` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap pandas/core/dtypes/cast.py:784— `infer_dtype_from_scalar` is public and takes `val: object` from its caller, and it calls itself at line 784 (`infer_dtype_from_scalar`) with a piece of `val` — and nowhere in `infer_dtype_from_scalar` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `infer_dtype_from_scalar` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap pandas/core/dtypes/cast.py:1822— `np_can_hold_element` is public and takes `element: Any` from its caller, and it calls itself at line 1822 (`np_can_hold_element`) with a piece of `element` — and nowhere in `np_can_hold_element` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `np_can_hold_element` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap pandas/_testing/__init__.py:536— `shares_memory` is public and takes `left: Any` from its caller, and it calls itself at line 536 (`shares_memory`) with a piece of `left` (and at line 539, line 540, line 543, line 545, line 547, line 564, line 567, line 571) — and nowhere in `shares_memory` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `shares_memory` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Duplicated block (35 lines × 2) pandas/core/nanops.py:1679— pandas/core/nanops.py:1679-1713 | pandas/core/nanops.py:1740-1774 — both copies are in the same file, so extract the 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 (35 lines × 2) pandas/core/window/numba_.py:27— pandas/core/window/numba_.py:27-61 | pandas/core/window/numba_.py:182-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pandas/core/window/numba_.py:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `func` to `Callable[..., Scalar]` in one and `Callable[..., np.ndarray]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (35 lines × 2) REDACTED:1448— REDACTED:1448-1482 | REDACTED:1750-1784 — both copies are in the same file, so extract the 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 (15 lines × 2) pandas/core/frame.py:19441— pandas/core/frame.py:19441-19455 | pandas/core/frame.py:19540-19554 — both copies are in the same file, so extract the 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 `pandas/core/frame.py:19441` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (15 lines × 2) pandas/io/sql.py:2235— pandas/io/sql.py:2235-2249 | pandas/io/sql.py:2832-2846 — both copies are in the same file, so extract the 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. Note first that the copies are not typed on the same thing: `Error` names `adbc_driver_manager` in one and `sqlite3` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 2) pandas/plotting/_matplotlib/core.py:2159— pandas/plotting/_matplotlib/core.py:2159-2173 | pandas/plotting/_matplotlib/core.py:2201-2215 — both copies are in the same file, so extract the 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 × 2) pandas/core/arrays/datetimes.py:1356— pandas/core/arrays/datetimes.py:1356-1369 | pandas/core/arrays/datetimes.py:1440-1453 — both copies are in the same file, so extract the 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 (14 lines × 2) pandas/core/groupby/groupby.py:3302— pandas/core/groupby/groupby.py:3302-3315 | pandas/core/groupby/groupby.py:3373-3386 — both copies are in the same file, so extract the 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 (14 lines × 2) pandas/tseries/frequencies.py:560— pandas/tseries/frequencies.py:560-573 | pandas/tseries/frequencies.py:622-635 — both copies are in the same file, so extract the 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 `pandas/tseries/frequencies.py:560` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) pandas/core/_numba/kernels/sum_.py:177— pandas/core/_numba/kernels/sum_.py:177-187 | pandas/core/_numba/kernels/var_.py:188-198 — before extracting anything, compare `pandas/core/_numba/kernels/sum_.py` and `pandas/core/_numba/kernels/var_.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pandas/core/_numba/kernels/var_.py:187` calls `zeros` and `pandas/core/_numba/kernels/sum_.py:176` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) pandas/core/internals/blocks.py:1311— pandas/core/internals/blocks.py:1311-1321 | pandas/core/internals/blocks.py:1995-2005 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 2) pandas/core/window/ewm.py:594— pandas/core/window/ewm.py:594-604 | pandas/core/window/ewm.py:685-695 — both copies are in the same file, so extract the 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 `pandas/core/window/ewm.py:594` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) pandas/plotting/_matplotlib/converter.py:770— pandas/plotting/_matplotlib/converter.py:770-776 | pandas/plotting/_matplotlib/converter.py:780-786 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) pandas/plotting/_matplotlib/misc.py:277— pandas/plotting/_matplotlib/misc.py:277-283 | pandas/plotting/_matplotlib/misc.py:405-411 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pandas/plotting/_matplotlib/misc.py:276` calls `f` and `pandas/plotting/_matplotlib/misc.py:404` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) REDACTED:279— REDACTED:279-285 | REDACTED:397-403 — both copies are in the same file, so extract the 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) pandas/core/_numba/kernels/sum_.py:171— pandas/core/_numba/kernels/sum_.py:171-175 | pandas/core/_numba/kernels/var_.py:181-185 — before extracting anything, compare `pandas/core/_numba/kernels/sum_.py` and `pandas/core/_numba/kernels/var_.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pandas/core/_numba/kernels/var_.py:188` calls `zeros` and `pandas/core/_numba/kernels/sum_.py:179` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) pandas/core/reshape/merge.py:629— pandas/core/reshape/merge.py:629-633 | pandas/core/reshape/merge.py:636-641 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pandas/core/reshape/merge.py:636` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) pandas/core/arrays/numpy_.py:559— pandas/core/arrays/numpy_.py:559-563 | pandas/core/arrays/timedeltas.py:430-435 — 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Swallowed exception (caught, then discarded) pandas/plotting/_matplotlib/converter.py:392— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pandas/plotting/_matplotlib/core.py:1824— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pandas/io/json/_json.py:1757— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
DataFrame.set_index (cyclomatic 23) pandas/core/frame.py:7737— DataFrame.set_index has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (DataFrame.set_index) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DataFrame.set_index (cyclomatic 23) pandas/core/frame.py:7747— DataFrame.set_index has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (DataFrame.set_index) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
NDFrame._rename (cyclomatic 22) pandas/core/generic.py:1028— NDFrame._rename 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. This shape REPEATS in the file: one other method here (NDFrame._rename) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
NDFrame._rename (cyclomatic 22) pandas/core/generic.py:1041— NDFrame._rename 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. This shape REPEATS in the file: one other method here (NDFrame._rename) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Index.set_names (cyclomatic 20) pandas/core/indexes/base.py:2049— Index.set_names 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. This shape REPEATS in the file: one other method here (Index.set_names) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Index.set_names (cyclomatic 20) pandas/core/indexes/base.py:2057— Index.set_names 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. This shape REPEATS in the file: one other method here (Index.set_names) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DataFrame.quantile (cyclomatic 18) pandas/core/frame.py:19684— DataFrame.quantile has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (DataFrame.quantile) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DataFrame.quantile (cyclomatic 18) pandas/core/frame.py:19693— DataFrame.quantile has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (DataFrame.quantile) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
XxxComment pandas/io/stata.py:3439— # xxx...xxx — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment pandas/io/formats/format.py:1451— # xxx+nanj — 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.
DataFrame.set_index (cognitive 36) pandas/core/frame.py:7737— DataFrame.set_index has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (29 pts), error handling 1 (3 pts), loops 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (DataFrame.set_index) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DataFrame.set_index (cognitive 36) pandas/core/frame.py:7747— DataFrame.set_index has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (29 pts), error handling 1 (3 pts), loops 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (DataFrame.set_index) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
NDFrame._rename (cognitive 36) pandas/core/generic.py:1028— NDFrame._rename has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 6, loops 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. This shape REPEATS in the file: one other method here (NDFrame._rename) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
NDFrame._rename (cognitive 36) pandas/core/generic.py:1041— NDFrame._rename has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 6, loops 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. This shape REPEATS in the file: one other method here (NDFrame._rename) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DataFrame.quantile (cognitive 31) pandas/core/frame.py:19684— DataFrame.quantile has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 1, 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. This shape REPEATS in the file: one other method here (DataFrame.quantile) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DataFrame.quantile (cognitive 31) pandas/core/frame.py:19693— DataFrame.quantile has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 1, 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. This shape REPEATS in the file: one other method here (DataFrame.quantile) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
NDFrame.rename_axis (cognitive 23) pandas/core/generic.py:1138— NDFrame.rename_axis has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 1 (2 pts), 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. This shape REPEATS in the file: one other method here (NDFrame.rename_axis) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
NDFrame.rename_axis (cognitive 23) pandas/core/generic.py:1149— NDFrame.rename_axis has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 1 (2 pts), 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. This shape REPEATS in the file: one other method here (NDFrame.rename_axis) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Index.set_names (cognitive 23) pandas/core/indexes/base.py:2049— Index.set_names has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (Index.set_names) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Index.set_names (cognitive 23) pandas/core/indexes/base.py:2057— Index.set_names has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (Index.set_names) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
cast.find_common_type (cognitive 20) pandas/core/dtypes/cast.py:1321— cast.find_common_type has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (cast.find_common_type) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
cast.find_common_type (cognitive 20) pandas/core/dtypes/cast.py:1324— cast.find_common_type has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (cast.find_common_type) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BaseMaskedArray.astype (cognitive 18) pandas/core/arrays/masked.py:804— BaseMaskedArray.astype has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (BaseMaskedArray.astype) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BaseMaskedArray.astype (cognitive 18) pandas/core/arrays/masked.py:806— BaseMaskedArray.astype has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: one other method here (BaseMaskedArray.astype) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Categorical.astype (cognitive 17) pandas/core/arrays/categorical.py:589— Categorical.astype has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (4 pts), boolean chains 2, 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. This shape REPEATS in the file: one other method here (Categorical.astype) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Categorical.astype (cognitive 17) pandas/core/arrays/categorical.py:591— Categorical.astype has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (4 pts), boolean chains 2, 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. This shape REPEATS in the file: one other method here (Categorical.astype) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DataFrame.query (cognitive 17) pandas/core/frame.py:5045— DataFrame.query has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (DataFrame.query) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DataFrame.query (cognitive 17) pandas/core/frame.py:5058— DataFrame.query has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (DataFrame.query) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (4 members, 50+ identical tokens) pandas/core/internals/blocks.py:1257— pandas/core/internals/blocks.py:1257-1321 | pandas/core/internals/blocks.py:1324-1431 | pandas/core/internals/blocks.py:1868-1930 | pandas/core/internals/blocks.py:1934-2007 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) pandas/core/strings/accessor.py:752— pandas/core/strings/accessor.py:752-947 | pandas/core/strings/accessor.py:951-1084 | pandas/core/strings/accessor.py:1088-1176 | pandas/core/strings/accessor.py:1180-1268 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (22 lines × 2) pandas/core/_numba/kernels/mean_.py:82— pandas/core/_numba/kernels/mean_.py:82-103 | pandas/core/_numba/kernels/var_.py:91-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pandas/core/_numba/kernels/mean_.py:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pandas/core/_numba/kernels/var_.py:90` calls `max` and `pandas/core/_numba/kernels/mean_.py:80` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (22 lines × 2) pandas/core/generic.py:2296— pandas/core/generic.py:2296-2317 | REDACTED:690-711 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pandas/core/generic.py:2296` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 2) pandas/core/arrays/datetimelike.py:2420— pandas/core/arrays/datetimelike.py:2420-2437 | pandas/core/arrays/numpy_.py:405-423 — 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 (18–19 lines × 2) pandas/core/frame.py:1191— pandas/core/frame.py:1191-1208 | pandas/core/frame.py:3401-3419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) pandas/core/_numba/kernels/mean_.py:174— pandas/core/_numba/kernels/mean_.py:174-189 | pandas/core/_numba/kernels/sum_.py:234-249 — 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 (16 lines × 2) pandas/core/nanops.py:2037— pandas/core/nanops.py:2037-2052 | pandas/core/nanops.py:2138-2153 — both copies are in the same file, so extract the 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–14 lines × 2) pandas/core/arrays/arrow/array.py:1547— pandas/core/arrays/arrow/array.py:1547-1559 | pandas/core/arrays/string_.py:420-433 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pandas/core/arrays/arrow/array.py:1547` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13–14 lines × 2) pandas/core/reshape/merge.py:1097— pandas/core/reshape/merge.py:1097-1110 | pandas/core/reshape/merge.py:1112-1124 — both copies are in the same file, so extract the 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) pandas/core/array_algos/take.py:282— pandas/core/array_algos/take.py:282-290 | pandas/core/array_algos/take.py:296-304 — both copies are in the same file, so extract the 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) pandas/plotting/_matplotlib/boxplot.py:195— pandas/plotting/_matplotlib/boxplot.py:195-203 | pandas/plotting/_matplotlib/hist.py:141-149 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 3) pandas/core/nanops.py:1341— pandas/core/nanops.py:1341-1345 | pandas/core/nanops.py:1709-1713 | pandas/core/nanops.py:1770-1774 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) pandas/io/stata.py:223— pandas/io/stata.py:223-229 | pandas/io/stata.py:231-235 | pandas/io/stata.py:236-241 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
AC3 · Page structure· Heading level jumps from h1 to h5 · ×1
Heading level jumps from h1 to h5 REDACTED:19— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×1
Focus outline removed in CSS without a :focus replacement doc/source/_static/css/getting_started.css:32— `.gs-data .badge` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge. What was searched, so you can tell an absence from a miss: the 3 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
readers._read_csv_chunks (cyclomatic 69) pandas/io/parsers/readers.py:837— readers._read_csv_chunks has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cast.np_can_hold_element (cyclomatic 68) pandas/core/dtypes/cast.py:1708— cast.np_can_hold_element has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_MergeOperation._maybe_coerce_merge_keys (cyclomatic 65) pandas/core/reshape/merge.py:1700— _MergeOperation._maybe_coerce_merge_keys 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.
cast.convert_dtypes (cyclomatic 55) pandas/core/dtypes/cast.py:894— cast.convert_dtypes 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.
Table._create_axes (cyclomatic 51) pandas/io/pytables.py:4814— Table._create_axes has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MultiIndex._get_locs (cyclomatic 50) pandas/core/indexes/multi.py:4183— MultiIndex._get_locs has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
numeric.to_numeric (cyclomatic 50) pandas/core/tools/numeric.py:52— numeric.to_numeric has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
asserters.assert_series_equal (cyclomatic 47) pandas/_testing/asserters.py:1037— asserters.assert_series_equal 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.
NDFrame._where (cyclomatic 46) pandas/core/generic.py:10397— NDFrame._where 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.
Series.__init__ (cyclomatic 45) pandas/core/series.py:360— Series.__init__ has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
common.get_handle (cyclomatic 45) REDACTED:737— common.get_handle has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index.join (cyclomatic 44) pandas/core/indexes/base.py:4585— Index.join 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.
DatetimeArray._generate_range (cyclomatic 43) pandas/core/arrays/datetimes.py:395— DatetimeArray._generate_range 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.
MultiIndex._get_loc_level (cyclomatic 43) pandas/core/indexes/multi.py:3820— MultiIndex._get_loc_level 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.
readers._can_parallelize_csv (cyclomatic 43) pandas/io/parsers/readers.py:480— readers._can_parallelize_csv 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.
PythonParser._infer_columns (cyclomatic 42) pandas/io/parsers/python_parser.py:587— PythonParser._infer_columns 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.
TextFileReader._clean_options (cyclomatic 42) pandas/io/parsers/readers.py:2906— TextFileReader._clean_options 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.
construction.array (cyclomatic 41) pandas/core/construction.py:86— construction.array 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.
grouper.get_grouper (cyclomatic 40) pandas/core/groupby/grouper.py:745— grouper.get_grouper 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.
_MergeOperation._maybe_add_join_keys (cyclomatic 40) pandas/core/reshape/merge.py:1277— _MergeOperation._maybe_add_join_keys 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.
StataReader.read (cyclomatic 40) pandas/io/stata.py:1662— StataReader.read 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.
ArrowExtensionArray._reduce_pyarrow (cyclomatic 39) pandas/core/arrays/arrow/array.py:2793— ArrowExtensionArray._reduce_pyarrow has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
eval.eval (cyclomatic 39) pandas/core/computation/eval.py:205— eval.eval 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.
DataFrame.__init__ (cyclomatic 39) pandas/core/frame.py:467— DataFrame.__init__ 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.
construction.ndarray_to_mgr (cyclomatic 39) pandas/core/internals/construction.py:204— construction.ndarray_to_mgr 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.
algorithms.isin (cyclomatic 38) pandas/core/algorithms.py:549— algorithms.isin 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.
NDFrame.replace (cyclomatic 38) pandas/core/generic.py:7733— NDFrame.replace 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.
StringMethods._wrap_result (cyclomatic 38) pandas/core/strings/accessor.py:261— StringMethods._wrap_result 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.
numeric._coerce_to_data_and_mask (cyclomatic 37) pandas/core/arrays/numeric.py:137— numeric._coerce_to_data_and_mask has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pivot.__internal_pivot_table (cyclomatic 37) pandas/core/reshape/pivot.py:293— pivot.__internal_pivot_table has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
stata._cast_to_stata_types (cyclomatic 37) pandas/io/stata.py:450— stata._cast_to_stata_types has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_XMLFrameParser._iterparse_nodes (cyclomatic 37) REDACTED:287— _XMLFrameParser._iterparse_nodes has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ArrowExtensionArray._box_pa_array (cyclomatic 36) pandas/core/arrays/arrow/array.py:942— ArrowExtensionArray._box_pa_array 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.
cast._maybe_promote (cyclomatic 36) pandas/core/dtypes/cast.py:535— cast._maybe_promote 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.
ArrowParserWrapper._get_pyarrow_options (cyclomatic 36) pandas/io/parsers/arrow_parser_wrapper.py:152— ArrowParserWrapper._get_pyarrow_options 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.
ArrowExtensionArray._cast_pointwise_result (cyclomatic 35) pandas/core/arrays/arrow/array.py:748— ArrowExtensionArray._cast_pointwise_result has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
construction.sanitize_array (cyclomatic 35) pandas/core/construction.py:617— construction.sanitize_array 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.
DataFrame._reduce (cyclomatic 35) pandas/core/frame.py:17035— DataFrame._reduce 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.
NDFrame.fillna (cyclomatic 35) pandas/core/generic.py:7277— NDFrame.fillna 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.
WrappedCythonOp._call_cython_op (cyclomatic 35) pandas/core/groupby/ops.py:389— WrappedCythonOp._call_cython_op 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.
PlotAccessor.__call__ (cyclomatic 35) pandas/plotting/_core.py:1130— PlotAccessor.__call__ 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.
datetimes._assemble_from_unit_mappings (cyclomatic 34) pandas/core/tools/datetimes.py:1354— datetimes._assemble_from_unit_mappings 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.
NDFrame.to_latex (cyclomatic 33) pandas/core/generic.py:3454— NDFrame.to_latex 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.
Index.__new__ (cyclomatic 33) pandas/core/indexes/base.py:487— Index.__new__ 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.
_json.to_json (cyclomatic 33) pandas/io/json/_json.py:158— _json.to_json 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.
DataFrame.from_records (cyclomatic 32) pandas/core/frame.py:2061— DataFrame.from_records has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
merge._factorize_keys (cyclomatic 32) pandas/core/reshape/merge.py:2873— merge._factorize_keys has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
converter._daily_finder (cyclomatic 32) pandas/plotting/_matplotlib/converter.py:687— converter._daily_finder has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ArrowExtensionArray._evaluate_op_method (cyclomatic 31) pandas/core/arrays/arrow/array.py:1429— ArrowExtensionArray._evaluate_op_method 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.
DataFrame._reduce_axis1 (cyclomatic 31) pandas/core/frame.py:17214— DataFrame._reduce_axis1 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.
common._get_filepath_or_buffer (cyclomatic 31) REDACTED:301— common._get_filepath_or_buffer 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.
BaseExcelReader._parse_sheet (cyclomatic 31) pandas/io/excel/_base.py:843— BaseExcelReader._parse_sheet 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.
asserters.assert_index_equal (cyclomatic 30) pandas/_testing/asserters.py:219— asserters.assert_index_equal 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.
SparseArray.__init__ (cyclomatic 30) pandas/core/arrays/sparse/array.py:650— SparseArray.__init__ 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.
astype.astype_is_view (cyclomatic 30) pandas/core/dtypes/astype.py:313— astype.astype_is_view 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.
interval.interval_range (cyclomatic 30) pandas/core/indexes/interval.py:1696— interval.interval_range 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.
_MergeOperation._validate_left_right_on (cyclomatic 30) pandas/core/reshape/merge.py:1890— _MergeOperation._validate_left_right_on 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.
_iLocIndexer._align_series (cyclomatic 29) pandas/core/indexing.py:3148— _iLocIndexer._align_series has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
merge.get_join_indexers (cyclomatic 29) pandas/core/reshape/merge.py:2062— merge.get_join_indexers has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
datetimes._convert_listlike_datetimes (cyclomatic 29) pandas/core/tools/datetimes.py:370— datetimes._convert_listlike_datetimes has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ParserBase._infer_types (cyclomatic 29) pandas/io/parsers/base_parser.py:526— ParserBase._infer_types has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
arraylike.array_ufunc (cyclomatic 28) pandas/core/arraylike.py:278— arraylike.array_ufunc 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.
BaseMaskedArray._arith_method (cyclomatic 28) pandas/core/arrays/masked.py:1003— BaseMaskedArray._arith_method 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.
to_dict.to_dict (cyclomatic 28) pandas/core/methods/to_dict.py:101— to_dict.to_dict 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.
melt.melt (cyclomatic 28) pandas/core/reshape/melt.py:48— melt.melt 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.
_AsOfMerge._validate_left_right_on (cyclomatic 28) pandas/core/reshape/merge.py:2474— _AsOfMerge._validate_left_right_on 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.
Parser._try_convert_data (cyclomatic 28) pandas/io/json/_json.py:1538— Parser._try_convert_data 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.
algorithms.safe_sort (cyclomatic 27) pandas/core/algorithms.py:1705— algorithms.safe_sort 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.
DatetimeLikeArrayMixin._validate_listlike (cyclomatic 27) pandas/core/arrays/datetimelike.py:617— DatetimeLikeArrayMixin._validate_listlike 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.
IntervalArray._ensure_simple_new_inputs (cyclomatic 27) pandas/core/arrays/interval.py:283— IntervalArray._ensure_simple_new_inputs 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.
_iLocIndexer._setitem_with_indexer_split_path (cyclomatic 27) pandas/core/indexing.py:2685— _iLocIndexer._setitem_with_indexer_split_path 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.
_util._post_convert_dtypes (cyclomatic 27) pandas/io/_util.py:167— _util._post_convert_dtypes 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.
_normalize.json_normalize (cyclomatic 27) pandas/io/json/_normalize.py:303— _normalize.json_normalize 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.
min_max_.sliding_min_max (cyclomatic 26) pandas/core/_numba/kernels/min_max_.py:39— min_max_.sliding_min_max 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.
Categorical.__init__ (cyclomatic 26) pandas/core/arrays/categorical.py:399— Categorical.__init__ has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NDFrame.clip (cyclomatic 26) pandas/core/generic.py:8990— NDFrame.clip 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.
DatetimeIndexOpsMixin.equals (cyclomatic 26) pandas/core/indexes/datetimelike.py:308— DatetimeIndexOpsMixin.equals 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.
TimeGrouper.__init__ (cyclomatic 26) pandas/core/resample.py:2440— TimeGrouper.__init__ has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
concat.concat (cyclomatic 26) pandas/core/reshape/concat.py:163— concat.concat 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.
ArrowExtensionArray._from_sequence_of_strings (cyclomatic 25) pandas/core/arrays/arrow/array.py:599— ArrowExtensionArray._from_sequence_of_strings 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.
ArrowExtensionArray._groupby_op_pyarrow (cyclomatic 25) pandas/core/arrays/arrow/array.py:3697— ArrowExtensionArray._groupby_op_pyarrow 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.
timedeltas.sequence_to_td64ns (cyclomatic 25) pandas/core/arrays/timedeltas.py:1223— timedeltas.sequence_to_td64ns 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.
cast.maybe_downcast_numeric (cyclomatic 25) pandas/core/dtypes/cast.py:311— cast.maybe_downcast_numeric 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.
DataFrame._align_for_op (cyclomatic 25) pandas/core/frame.py:10374— DataFrame._align_for_op 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.
BaseGrouper._reduceat_aggregate (cyclomatic 25) pandas/core/groupby/ops.py:1087— BaseGrouper._reduceat_aggregate 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.
api.union_indexes (cyclomatic 25) pandas/core/indexes/api.py:203— api.union_indexes 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.
RangeIndex._difference (cyclomatic 25) pandas/core/indexes/range.py:1115— RangeIndex._difference 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.
encoding._get_dummies_1d (cyclomatic 25) pandas/core/reshape/encoding.py:286— encoding._get_dummies_1d 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.
datetimes.to_datetime (cyclomatic 25) pandas/core/tools/datetimes.py:847— datetimes.to_datetime 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.
printing.format_object_summary (cyclomatic 25) pandas/io/formats/printing.py:369— printing.format_object_summary has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Styler.to_latex (cyclomatic 25) REDACTED:758— Styler.to_latex 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.
parquet._get_path_or_handle (cyclomatic 25) pandas/io/parquet.py:97— parquet._get_path_or_handle 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.
datetimes.date_range (cyclomatic 24) pandas/core/indexes/datetimes.py:2500— datetimes.date_range 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.
MultiIndex._get_level_indexer (cyclomatic 24) pandas/core/indexes/multi.py:4007— MultiIndex._get_level_indexer 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.
RangeIndex._concat (cyclomatic 24) pandas/core/indexes/range.py:1317— RangeIndex._concat 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.
_LocIndexer._convert_to_indexer (cyclomatic 24) pandas/core/indexing.py:2003— _LocIndexer._convert_to_indexer 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.
construction.to_arrays (cyclomatic 24) pandas/core/internals/construction.py:776— construction.to_arrays 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.
tile._bins_to_cuts (cyclomatic 24) pandas/core/reshape/tile.py:473— tile._bins_to_cuts 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.
HTMLFormatter._write_col_header (cyclomatic 24) pandas/io/formats/html.py:278— HTMLFormatter._write_col_header 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.
asserters.assert_extension_array_equal (cyclomatic 23) pandas/_testing/asserters.py:876— asserters.assert_extension_array_equal 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.
IntervalArray._cmp_method (cyclomatic 23) pandas/core/arrays/interval.py:731— IntervalArray._cmp_method 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.
BinOp.convert_value (cyclomatic 23) pandas/core/computation/pytables.py:255— BinOp.convert_value 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.
ArrowDtype.type (cyclomatic 23) pandas/core/dtypes/dtypes.py:2293— ArrowDtype.type 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.
NDFrame.filter (cyclomatic 23) pandas/core/generic.py:5674— NDFrame.filter 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.
NDFrame.asof (cyclomatic 23) pandas/core/generic.py:8468— NDFrame.asof 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.
base.get_values_for_csv (cyclomatic 23) pandas/core/indexes/base.py:8624— base.get_values_for_csv 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.
indexing.infer_and_maybe_downcast (cyclomatic 23) pandas/core/indexing.py:3934— indexing.infer_and_maybe_downcast 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.
BaseBlockManager._slice_take_blocks_ax0 (cyclomatic 23) pandas/core/internals/managers.py:909— BaseBlockManager._slice_take_blocks_ax0 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.
BlockManager.iset (cyclomatic 23) pandas/core/internals/managers.py:1305— BlockManager.iset 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.
ArrowExtensionArray.__getitem__ (cyclomatic 22) pandas/core/arrays/arrow/array.py:1093— ArrowExtensionArray.__getitem__ 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.
boolean.coerce_to_array (cyclomatic 22) pandas/core/arrays/boolean.py:177— boolean.coerce_to_array 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.
DatetimeLikeArrayMixin.__add__ (cyclomatic 22) pandas/core/arrays/datetimelike.py:1323— DatetimeLikeArrayMixin.__add__ 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.
DatetimeLikeArrayMixin.__sub__ (cyclomatic 22) pandas/core/arrays/datetimelike.py:1394— DatetimeLikeArrayMixin.__sub__ 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.
datetimes._generate_range (cyclomatic 22) pandas/core/arrays/datetimes.py:3138— datetimes._generate_range 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.
SparseArray.__getitem__ (cyclomatic 22) pandas/core/arrays/sparse/array.py:1468— SparseArray.__getitem__ 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.
TimedeltaArray.__mul__ (cyclomatic 22) pandas/core/arrays/timedeltas.py:519— TimedeltaArray.__mul__ 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.
Index._maybe_downcast_for_indexing (cyclomatic 22) pandas/core/indexes/base.py:6684— Index._maybe_downcast_for_indexing 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.
RangeIndex._union (cyclomatic 22) pandas/core/indexes/range.py:1040— RangeIndex._union 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.
Block.replace_list (cyclomatic 22) pandas/core/internals/blocks.py:832— Block.replace_list 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.
concat._make_concat_multiindex (cyclomatic 22) pandas/core/reshape/concat.py:933— concat._make_concat_multiindex 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.
Parser._try_convert_to_date (cyclomatic 22) pandas/io/json/_json.py:1630— Parser._try_convert_to_date 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.
HDFStore._create_storer (cyclomatic 22) pandas/io/pytables.py:2269— HDFStore._create_storer 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.
GenericFixed.write_array (cyclomatic 22) pandas/io/pytables.py:3922— GenericFixed.write_array 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.
BarPlot._make_plot (cyclomatic 22) pandas/plotting/_matplotlib/core.py:2099— BarPlot._make_plot 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.
ArrowExtensionArray._box_pa_scalar (cyclomatic 21) pandas/core/arrays/arrow/array.py:870— ArrowExtensionArray._box_pa_scalar 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.
ArrowExtensionArray.to_numpy (cyclomatic 21) pandas/core/arrays/arrow/array.py:2466— ArrowExtensionArray.to_numpy 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.
StringArray._cmp_method (cyclomatic 21) pandas/core/arrays/string_.py:1230— StringArray._cmp_method 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.
cast.infer_dtype_from_scalar (cyclomatic 21) pandas/core/dtypes/cast.py:697— cast.infer_dtype_from_scalar 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.
DataFrame.__getitem__ (cyclomatic 21) pandas/core/frame.py:4292— DataFrame.__getitem__ 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.
DataFrame.shift (cyclomatic 21) pandas/core/frame.py:7495— DataFrame.shift 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.
MultiIndex._reorder_indexer (cyclomatic 21) pandas/core/indexes/multi.py:4471— MultiIndex._reorder_indexer 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.
_LocIndexer._getitem_axis (cyclomatic 21) pandas/core/indexing.py:1916— _LocIndexer._getitem_axis 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.
construction.dict_to_mgr (cyclomatic 21) pandas/core/internals/construction.py:389— construction.dict_to_mgr 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.
datetimes._to_datetime_with_unit (cyclomatic 21) pandas/core/tools/datetimes.py:547— datetimes._to_datetime_with_unit 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.
HTMLFormatter._write_hierarchical_rows (cyclomatic 21) pandas/io/formats/html.py:482— HTMLFormatter._write_hierarchical_rows 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.
PythonParser._rows_to_cols (cyclomatic 21) pandas/io/parsers/python_parser.py:1190— PythonParser._rows_to_cols 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.
IndexCol.convert (cyclomatic 21) pandas/io/pytables.py:2746— IndexCol.convert 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.
AppendableFrameTable.read (cyclomatic 21) pandas/io/pytables.py:5707— AppendableFrameTable.read 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.
_XMLFrameParser._parse_nodes (cyclomatic 21) REDACTED:201— _XMLFrameParser._parse_nodes 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.
MPLPlot.__init__ (cyclomatic 21) pandas/plotting/_matplotlib/core.py:149— MPLPlot.__init__ 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.
_testing.shares_memory (cyclomatic 20) pandas/_testing/__init__.py:523— _testing.shares_memory 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.
algorithms.diff (cyclomatic 20) pandas/core/algorithms.py:1584— algorithms.diff 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.
NDFrame.xs (cyclomatic 20) pandas/core/generic.py:4193— NDFrame.xs 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.
_MergeOperation._get_merge_keys (cyclomatic 20) pandas/core/reshape/merge.py:1573— _MergeOperation._get_merge_keys 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.
pivot._add_margins (cyclomatic 20) pandas/core/reshape/pivot.py:429— pivot._add_margins 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.
common.flex_binary_moment (cyclomatic 20) pandas/core/window/common.py:18— common.flex_binary_moment 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.
clipboard.determine_clipboard (cyclomatic 20) pandas/io/clipboard/__init__.py:535— clipboard.determine_clipboard 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.
StylerRenderer._translate_latex (cyclomatic 20) REDACTED:929— StylerRenderer._translate_latex 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.
ArrowParserWrapper._finalize_index (cyclomatic 20) pandas/io/parsers/arrow_parser_wrapper.py:399— ArrowParserWrapper._finalize_index 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.
ArrowExtensionArray._cmp_method (cyclomatic 19) pandas/core/arrays/arrow/array.py:1341— ArrowExtensionArray._cmp_method 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.
ArrowExtensionArray.__setitem__ (cyclomatic 19) pandas/core/arrays/arrow/array.py:3182— ArrowExtensionArray.__setitem__ 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.
PeriodArray._from_sequence (cyclomatic 19) pandas/core/arrays/period.py:261— PeriodArray._from_sequence 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.
missing.array_equivalent (cyclomatic 19) pandas/core/dtypes/missing.py:399— missing.array_equivalent 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.
missing._array_equivalent_object (cyclomatic 19) pandas/core/dtypes/missing.py:513— missing._array_equivalent_object 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.
DataFrame.join (cyclomatic 19) pandas/core/frame.py:15742— DataFrame.join 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.
SeriesGroupBy.value_counts (cyclomatic 19) pandas/core/groupby/generic.py:1045— SeriesGroupBy.value_counts 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.
GroupBy._value_counts (cyclomatic 19) pandas/core/groupby/groupby.py:2440— GroupBy._value_counts 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.
base.maybe_sequence_to_range (cyclomatic 19) pandas/core/indexes/base.py:8302— base.maybe_sequence_to_range 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.
BaseBlockManager.setitem (cyclomatic 19) pandas/core/internals/managers.py:566— BaseBlockManager.setitem 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.
sorting.lexsort_indexer (cyclomatic 19) pandas/core/sorting.py:310— sorting.lexsort_indexer 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.
StringMethods.cat (cyclomatic 19) pandas/core/strings/accessor.py:494— StringMethods.cat 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.
ExcelFormatter._format_hierarchical_rows (cyclomatic 19) pandas/io/formats/excel.py:776— ExcelFormatter._format_hierarchical_rows 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.
style._bar (cyclomatic 19) REDACTED:4444— style._bar 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.
_json._validate_pyarrow_engine_options (cyclomatic 19) pandas/io/json/_json.py:470— _json._validate_pyarrow_engine_options 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.
ParserBase._agg_index (cyclomatic 19) pandas/io/parsers/base_parser.py:380— ParserBase._agg_index 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.
CParserWrapper.__init__ (cyclomatic 19) pandas/io/parsers/c_parser_wrapper.py:76— CParserWrapper.__init__ 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.
PythonParser._next_line (cyclomatic 19) pandas/io/parsers/python_parser.py:888— PythonParser._next_line 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.
Table.create_index (cyclomatic 19) pandas/io/pytables.py:4633— Table.create_index 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.
pytables._maybe_convert_for_string_atom (cyclomatic 19) pandas/io/pytables.py:6337— pytables._maybe_convert_for_string_atom 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.
tools.create_subplots (cyclomatic 19) pandas/plotting/_matplotlib/tools.py:142— tools.create_subplots 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.
frequencies.is_subperiod (cyclomatic 19) pandas/tseries/frequencies.py:515— frequencies.is_subperiod 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. This shape REPEATS in the file: one other method here (frequencies.is_superperiod) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
frequencies.is_superperiod (cyclomatic 19) pandas/tseries/frequencies.py:576— frequencies.is_superperiod 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. This shape REPEATS in the file: one other method here (frequencies.is_subperiod) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
_utils.to_numpy_dtype_inference (cyclomatic 18) pandas/core/arrays/_utils.py:27— _utils.to_numpy_dtype_inference 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.
SparseArray._reduce (cyclomatic 18) pandas/core/arrays/sparse/array.py:2065— SparseArray._reduce 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.
astype._astype_nansafe (cyclomatic 18) pandas/core/dtypes/astype.py:66— astype._astype_nansafe 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.
DataFrame._set_item_frame_value (cyclomatic 18) pandas/core/frame.py:4801— DataFrame._set_item_frame_value 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.
DataFrame.reset_index (cyclomatic 18) pandas/core/frame.py:8049— DataFrame.reset_index 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.
Index.get_indexer (cyclomatic 18) pandas/core/indexes/base.py:3866— Index.get_indexer 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.
Index._join_level (cyclomatic 18) pandas/core/indexes/base.py:4949— Index._join_level 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.
_iLocIndexer._setitem_single_block (cyclomatic 18) pandas/core/indexing.py:2931— _iLocIndexer._setitem_single_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.
_iLocIndexer._align_frame (cyclomatic 18) pandas/core/indexing.py:3264— _iLocIndexer._align_frame 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.
ExtensionBlock._unwrap_setitem_indexer (cyclomatic 18) pandas/core/internals/blocks.py:2191— ExtensionBlock._unwrap_setitem_indexer 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.
construction._extract_index (cyclomatic 18) pandas/core/internals/construction.py:622— construction._extract_index 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.
encoding.from_dummies (cyclomatic 18) pandas/core/reshape/encoding.py:414— encoding.from_dummies 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.
datetimes._adjust_to_origin (cyclomatic 18) pandas/core/tools/datetimes.py:686— datetimes._adjust_to_origin 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.
style_render._get_level_lengths (cyclomatic 18) REDACTED:1856— style_render._get_level_lengths 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.
_HtmlFrameParser._expand_colspan_rowspan (cyclomatic 18) pandas/io/html.py:460— _HtmlFrameParser._expand_colspan_rowspan 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.
PythonParser._convert_to_ndarrays (cyclomatic 18) pandas/io/parsers/python_parser.py:395— PythonParser._convert_to_ndarrays 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.
PythonParser._get_lines (cyclomatic 18) pandas/io/parsers/python_parser.py:1277— PythonParser._get_lines 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.
readers._read (cyclomatic 18) pandas/io/parsers/readers.py:359— readers._read 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.
readers._refine_defaults_read (cyclomatic 18) pandas/io/parsers/readers.py:3421— readers._refine_defaults_read 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.
DataCol.convert (cyclomatic 18) pandas/io/pytables.py:3237— DataCol.convert 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.
SQLTable._sqlalchemy_type (cyclomatic 18) pandas/io/sql.py:1419— SQLTable._sqlalchemy_type 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.
tools.handle_shared_axes (cyclomatic 18) pandas/plotting/_matplotlib/tools.py:392— tools.handle_shared_axes 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.
take.take_2d_multi (cyclomatic 17) pandas/core/array_algos/take.py:183— take.take_2d_multi 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.
Categorical._maybe_convert_categories (cyclomatic 17) pandas/core/arrays/categorical.py:662— Categorical._maybe_convert_categories 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.
DatetimeLikeArrayMixin._cmp_method (cyclomatic 17) pandas/core/arrays/datetimelike.py:944— DatetimeLikeArrayMixin._cmp_method 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.
BaseMaskedArray.fillna (cyclomatic 17) pandas/core/arrays/masked.py:331— BaseMaskedArray.fillna 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.
array._sparse_array_op (cyclomatic 17) pandas/core/arrays/sparse/array.py:239— array._sparse_array_op 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.
parsing._split_by_backtick (cyclomatic 17) pandas/core/computation/parsing.py:166— parsing._split_by_backtick 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.
IntervalDtype.__init__ (cyclomatic 17) pandas/core/dtypes/dtypes.py:1294— IntervalDtype.__init__ 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.
MultiIndex._verify_integrity (cyclomatic 17) pandas/core/indexes/multi.py:382— MultiIndex._verify_integrity 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.
_iLocIndexer._setitem_with_indexer_missing (cyclomatic 17) pandas/core/indexing.py:3018— _iLocIndexer._setitem_with_indexer_missing 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.
Block.where (cyclomatic 17) pandas/core/internals/blocks.py:1323— Block.where 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.
concat._clean_keys_and_objs (cyclomatic 17) pandas/core/reshape/concat.py:817— concat._clean_keys_and_objs 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.
_MergeOperation._get_join_info (cyclomatic 17) pandas/core/reshape/merge.py:1429— _MergeOperation._get_join_info 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.
reshape._stack_multi_columns (cyclomatic 17) pandas/core/reshape/reshape.py:833— reshape._stack_multi_columns 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.
BaseWindow._validate (cyclomatic 17) pandas/core/window/rolling.py:163— BaseWindow._validate 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.
OpenpyxlWriter._write_cells_write_only (cyclomatic 17) pandas/io/excel/_openpyxl.py:505— OpenpyxlWriter._write_cells_write_only 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.
OpenpyxlWriter._write_cells_normal (cyclomatic 17) pandas/io/excel/_openpyxl.py:587— OpenpyxlWriter._write_cells_normal 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.
_XlsxStyler.convert (cyclomatic 17) pandas/io/excel/_xlsxwriter.py:98— _XlsxStyler.convert 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.
MPLPlot._parse_errorbars (cyclomatic 17) pandas/plotting/_matplotlib/core.py:1179— MPLPlot._parse_errorbars 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.
tools._get_layout (cyclomatic 17) pandas/plotting/_matplotlib/tools.py:91— tools._get_layout has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GitHubClient.iter_open_pull_requests_review_state (cyclomatic 17) scripts/issue_assignment/client.py:186— GitHubClient.iter_open_pull_requests_review_state 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.
mean_.sliding_mean (cyclomatic 16) pandas/core/_numba/kernels/mean_.py:68— mean_.sliding_mean 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.
apply.reconstruct_func (cyclomatic 16) pandas/core/apply.py:1957— apply.reconstruct_func 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.
ArrowStringArray._from_sequence (cyclomatic 16) pandas/core/arrays/string_arrow.py:231— ArrowStringArray._from_sequence 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.
DataFrame.dropna (cyclomatic 16) pandas/core/frame.py:8628— DataFrame.dropna 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.
grouper._factorize_monotonic (cyclomatic 16) pandas/core/groupby/grouper.py:966— grouper._factorize_monotonic 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.
Index._cmp_method (cyclomatic 16) pandas/core/indexes/base.py:7779— Index._cmp_method 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.
DatetimeTimedeltaMixin._get_arithmetic_result_freq (cyclomatic 16) pandas/core/indexes/datetimelike.py:893— DatetimeTimedeltaMixin._get_arithmetic_result_freq 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.
MultiIndex._partial_tup_index (cyclomatic 16) pandas/core/indexes/multi.py:3534— MultiIndex._partial_tup_index 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.
MultiIndex.get_loc (cyclomatic 16) pandas/core/indexes/multi.py:3620— MultiIndex.get_loc 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.
range._exact_int64_targets (cyclomatic 16) pandas/core/indexes/range.py:94— range._exact_int64_targets 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.
_iLocIndexer._validate_key (cyclomatic 16) pandas/core/indexing.py:2267— _iLocIndexer._validate_key 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.
_iLocIndexer._setitem_new_column (cyclomatic 16) pandas/core/indexing.py:2532— _iLocIndexer._setitem_new_column 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.
BlockManager.as_array (cyclomatic 16) pandas/core/internals/managers.py:1863— BlockManager.as_array 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.
select.select (cyclomatic 16) pandas/core/methods/select.py:60— select.select 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.
nanops._sum_timedelta_i8 (cyclomatic 16) pandas/core/nanops.py:858— nanops._sum_timedelta_i8 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.
array_ops.comparison_op (cyclomatic 16) pandas/core/ops/array_ops.py:318— array_ops.comparison_op 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.
resample._adjust_dates_anchored (cyclomatic 16) pandas/core/resample.py:3098— resample._adjust_dates_anchored 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.
pivot.pivot (cyclomatic 16) pandas/core/reshape/pivot.py:748— pivot.pivot 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.
reshape.stack_v3 (cyclomatic 16) pandas/core/reshape/reshape.py:1002— reshape.stack_v3 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.
StringMethods.replace (cyclomatic 16) pandas/core/strings/accessor.py:1711— StringMethods.replace 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.
SeriesFormatter._get_footer (cyclomatic 16) pandas/io/formats/format.py:205— SeriesFormatter._get_footer 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.
printing._pprint_seq (cyclomatic 16) pandas/io/formats/printing.py:116— printing._pprint_seq 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.
readers.read_fwf (cyclomatic 16) pandas/io/parsers/readers.py:2610— readers.read_fwf 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.
HDFStore.append_to_multiple (cyclomatic 16) pandas/io/pytables.py:1734— HDFStore.append_to_multiple 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.
pytables._convert_index (cyclomatic 16) pandas/io/pytables.py:6166— pytables._convert_index 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.
XportReader._read_header (cyclomatic 16) pandas/io/sas/sas_xport.py:293— XportReader._read_header 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.
MPLPlot._adorn_subplots (cyclomatic 16) pandas/plotting/_matplotlib/core.py:820— MPLPlot._adorn_subplots 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.
hist.hist_series (cyclomatic 16) pandas/plotting/_matplotlib/hist.py:423— hist.hist_series 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.
unassign_inactive._stale_clock_anchor (cyclomatic 16) scripts/issue_assignment/unassign_inactive.py:90— unassign_inactive._stale_clock_anchor 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.
cast.np_can_hold_element (cognitive 172) pandas/core/dtypes/cast.py:1708— cast.np_can_hold_element has cognitive complexity 172 (threshold 15). Drivers by points: if/else 51 (142 pts), ternaries 3 (13 pts), boolean chains 12, error handling 1 (5 pts) (nesting depth added 105). 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.
MultiIndex._get_locs (cognitive 133) pandas/core/indexes/multi.py:4183— MultiIndex._get_locs has cognitive complexity 133 (threshold 15). Drivers by points: if/else 34 (100 pts), ternaries 2 (10 pts), loops 4 (9 pts), boolean chains 7, error handling 2 (7 pts) (nesting depth added 84). 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.
MultiIndex._get_loc_level (cognitive 116) pandas/core/indexes/multi.py:3820— MultiIndex._get_loc_level has cognitive complexity 116 (threshold 15). Drivers by points: if/else 30 (85 pts), error handling 5 (14 pts), boolean chains 7, loops 3 (7 pts), ternaries 1 (3 pts) (nesting depth added 70). 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.
PythonParser._infer_columns (cognitive 112) pandas/io/parsers/python_parser.py:587— PythonParser._infer_columns has cognitive complexity 112 (threshold 15). Drivers by points: if/else 29 (76 pts), ternaries 3 (13 pts), boolean chains 9, loops 3 (8 pts), error handling 2 (6 pts) (nesting depth added 66). 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.
_MergeOperation._maybe_add_join_keys (cognitive 108) pandas/core/reshape/merge.py:1277— _MergeOperation._maybe_add_join_keys has cognitive complexity 108 (threshold 15). Drivers by points: if/else 26 (77 pts), ternaries 4 (20 pts), boolean chains 10, loops 1 (nesting depth added 67). 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.
NDFrame._where (cognitive 101) pandas/core/generic.py:10397— NDFrame._where has cognitive complexity 101 (threshold 15). Drivers by points: if/else 41 (87 pts), boolean chains 9, loops 1 (4 pts), ternaries 1 (nesting depth added 49). 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.
readers._read_csv_chunks (cognitive 100) pandas/io/parsers/readers.py:837— readers._read_csv_chunks has cognitive complexity 100 (threshold 15). Drivers by points: if/else 36 (50 pts), loops 13 (24 pts), boolean chains 13, error handling 4 (8 pts), ternaries 4 (5 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_XMLFrameParser._iterparse_nodes (cognitive 94) REDACTED:287— _XMLFrameParser._iterparse_nodes has cognitive complexity 94 (threshold 15). Drivers by points: if/else 20 (57 pts), ternaries 5 (16 pts), loops 4 (13 pts), boolean chains 8 (nesting depth added 57). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_MergeOperation._maybe_coerce_merge_keys (cognitive 92) pandas/core/reshape/merge.py:1700— _MergeOperation._maybe_coerce_merge_keys has cognitive complexity 92 (threshold 15). Drivers by points: if/else 19 (53 pts), boolean chains 29, ternaries 3 (9 pts), loops 1 (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.
HTMLFormatter._write_col_header (cognitive 89) pandas/io/formats/html.py:278— HTMLFormatter._write_col_header has cognitive complexity 89 (threshold 15). Drivers by points: if/else 25 (72 pts), loops 4 (15 pts), boolean chains 2 (nesting depth added 58). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cast.convert_dtypes (cognitive 88) pandas/core/dtypes/cast.py:894— cast.convert_dtypes has cognitive complexity 88 (threshold 15). Drivers by points: if/else 30 (65 pts), boolean chains 23 (nesting depth added 35). 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.
NDFrame.fillna (cognitive 78) pandas/core/generic.py:7277— NDFrame.fillna has cognitive complexity 78 (threshold 15). Drivers by points: if/else 27 (60 pts), loops 2 (8 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 43). 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.
StringMethods._wrap_result (cognitive 77) pandas/core/strings/accessor.py:261— StringMethods._wrap_result has cognitive complexity 77 (threshold 15). Drivers by points: if/else 27 (56 pts), ternaries 3 (13 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 41). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Table._create_axes (cognitive 77) pandas/io/pytables.py:4814— Table._create_axes has cognitive complexity 77 (threshold 15). Drivers by points: if/else 33 (54 pts), boolean chains 14, ternaries 2 (4 pts), error handling 1 (3 pts), loops 2 (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.
eval.eval (cognitive 75) pandas/core/computation/eval.py:205— eval.eval has cognitive complexity 75 (threshold 15). Drivers by points: if/else 24 (48 pts), boolean chains 13, error handling 2 (7 pts), loops 2 (5 pts), ternaries 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NDFrame.replace (cognitive 74) pandas/core/generic.py:7733— NDFrame.replace has cognitive complexity 74 (threshold 15). Drivers by points: if/else 30 (61 pts), boolean chains 7, loops 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 35). 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.
DatetimeArray._generate_range (cognitive 73) pandas/core/arrays/datetimes.py:395— DatetimeArray._generate_range has cognitive complexity 73 (threshold 15). Drivers by points: if/else 29 (50 pts), boolean chains 10, ternaries 5 (10 pts), error handling 1 (3 pts) (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.
grouper.get_grouper (cognitive 70) pandas/core/groupby/grouper.py:745— grouper.get_grouper has cognitive complexity 70 (threshold 15). Drivers by points: if/else 30 (58 pts), boolean chains 9, ternaries 1 (2 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stata._cast_to_stata_types (cognitive 70) pandas/io/stata.py:450— stata._cast_to_stata_types has cognitive complexity 70 (threshold 15). Drivers by points: if/else 19 (54 pts), boolean chains 10, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
common.flex_binary_moment (cognitive 69) pandas/core/window/common.py:18— common.flex_binary_moment has cognitive complexity 69 (threshold 15). Drivers by points: if/else 16 (47 pts), loops 4 (19 pts), boolean chains 3 (nesting depth added 46). 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.
DataFrame._reduce (cognitive 68) pandas/core/frame.py:17035— DataFrame._reduce has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (50 pts), boolean chains 11, error handling 1 (4 pts), ternaries 2 (3 pts) (nesting depth added 37). 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.
DataFrame.from_records (cognitive 65) pandas/core/frame.py:2061— DataFrame.from_records has cognitive complexity 65 (threshold 15). Drivers by points: if/else 31 (51 pts), loops 2 (6 pts), error handling 2 (5 pts), boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
common.get_handle (cognitive 65) REDACTED:737— common.get_handle has cognitive complexity 65 (threshold 15). Drivers by points: if/else 27 (48 pts), boolean chains 12, loops 2 (5 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTMLFormatter._write_hierarchical_rows (cognitive 65) pandas/io/formats/html.py:482— HTMLFormatter._write_hierarchical_rows has cognitive complexity 65 (threshold 15). Drivers by points: if/else 15 (47 pts), loops 6 (17 pts), boolean chains 1 (nesting depth added 43). 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.
numeric._coerce_to_data_and_mask (cognitive 64) pandas/core/arrays/numeric.py:137— numeric._coerce_to_data_and_mask has cognitive complexity 64 (threshold 15). Drivers by points: if/else 34 (57 pts), boolean chains 7 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataFrame.__init__ (cognitive 64) pandas/core/frame.py:467— DataFrame.__init__ has cognitive complexity 64 (threshold 15). Drivers by points: if/else 30 (50 pts), ternaries 4 (9 pts), boolean chains 5 (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.
numeric.to_numeric (cognitive 64) pandas/core/tools/numeric.py:52— numeric.to_numeric has cognitive complexity 64 (threshold 15). Drivers by points: if/else 27 (44 pts), boolean chains 13, error handling 1 (4 pts), loops 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlotAccessor.__call__ (cognitive 64) pandas/plotting/_core.py:1130— PlotAccessor.__call__ has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (41 pts), boolean chains 12, error handling 1 (5 pts), loops 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Series.__init__ (cognitive 63) pandas/core/series.py:360— Series.__init__ has cognitive complexity 63 (threshold 15). Drivers by points: if/else 33 (54 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.join (cognitive 61) pandas/core/indexes/base.py:4585— Index.join has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 17, ternaries 4 (12 pts), error handling 3 (8 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrowExtensionArray._box_pa_array (cognitive 60) pandas/core/arrays/arrow/array.py:942— ArrowExtensionArray._box_pa_array has cognitive complexity 60 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 11, error handling 3 (8 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
construction.ndarray_to_mgr (cognitive 60) pandas/core/internals/construction.py:204— construction.ndarray_to_mgr has cognitive complexity 60 (threshold 15). Drivers by points: if/else 28 (42 pts), boolean chains 12, ternaries 2 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pivot.__internal_pivot_table (cognitive 60) pandas/core/reshape/pivot.py:293— pivot.__internal_pivot_table has cognitive complexity 60 (threshold 15). Drivers by points: if/else 24 (38 pts), boolean chains 8, loops 4 (8 pts), error handling 2 (6 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextFileReader._clean_options (cognitive 60) pandas/io/parsers/readers.py:2906— TextFileReader._clean_options has cognitive complexity 60 (threshold 15). Drivers by points: if/else 28 (43 pts), boolean chains 8, loops 3 (6 pts), error handling 1 (2 pts), ternaries 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.
asserters.assert_series_equal (cognitive 59) pandas/_testing/asserters.py:1037— asserters.assert_series_equal has cognitive complexity 59 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 16, ternaries 6 (14 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
construction.array (cognitive 59) pandas/core/construction.py:86— construction.array has cognitive complexity 59 (threshold 15). Drivers by points: if/else 25 (45 pts), boolean chains 11, error handling 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WrappedCythonOp._call_cython_op (cognitive 59) pandas/core/groupby/ops.py:389— WrappedCythonOp._call_cython_op has cognitive complexity 59 (threshold 15). Drivers by points: if/else 28 (51 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_MergeOperation._get_merge_keys (cognitive 59) pandas/core/reshape/merge.py:1573— _MergeOperation._get_merge_keys has cognitive complexity 59 (threshold 15). Drivers by points: if/else 22 (51 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 32). 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.
_util._post_convert_dtypes (cognitive 58) pandas/io/_util.py:167— _util._post_convert_dtypes has cognitive complexity 58 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 4 (10 pts), boolean chains 7, error handling 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StataReader.read (cognitive 57) pandas/io/stata.py:1662— StataReader.read has cognitive complexity 57 (threshold 15). Drivers by points: if/else 32 (47 pts), loops 5 (8 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.
BaseExcelReader._parse_sheet (cognitive 56) pandas/io/excel/_base.py:843— BaseExcelReader._parse_sheet has cognitive complexity 56 (threshold 15). Drivers by points: if/else 20 (36 pts), loops 4 (12 pts), boolean chains 6, error handling 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrowParserWrapper._get_pyarrow_options (cognitive 56) pandas/io/parsers/arrow_parser_wrapper.py:152— ArrowParserWrapper._get_pyarrow_options has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (42 pts), boolean chains 10, loops 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
melt.melt (cognitive 54) pandas/core/reshape/melt.py:48— melt.melt has cognitive complexity 54 (threshold 15). Drivers by points: if/else 30 (46 pts), boolean chains 3, ternaries 1 (3 pts), loops 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.
datetimes._assemble_from_unit_mappings (cognitive 54) pandas/core/tools/datetimes.py:1354— datetimes._assemble_from_unit_mappings has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (37 pts), boolean chains 7, error handling 2 (5 pts), loops 4 (5 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.
PythonParser._get_lines (cognitive 54) pandas/io/parsers/python_parser.py:1277— PythonParser._get_lines has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 2 (8 pts), ternaries 1 (4 pts), error handling 1 (3 pts) (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_iLocIndexer._align_series (cognitive 53) pandas/core/indexing.py:3148— _iLocIndexer._align_series has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (42 pts), boolean chains 9, loops 1 (2 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BaseBlockManager._slice_take_blocks_ax0 (cognitive 53) pandas/core/internals/managers.py:909— BaseBlockManager._slice_take_blocks_ax0 has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (31 pts), loops 5 (17 pts), boolean chains 5 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
merge._factorize_keys (cognitive 52) pandas/core/reshape/merge.py:2873— merge._factorize_keys has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (39 pts), boolean chains 10, ternaries 1 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_json.to_json (cognitive 51) pandas/io/json/_json.py:158— _json.to_json has cognitive complexity 51 (threshold 15). Drivers by points: if/else 20 (38 pts), boolean chains 7, loops 1 (4 pts), ternaries 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api.union_indexes (cognitive 50) pandas/core/indexes/api.py:203— api.union_indexes has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (40 pts), ternaries 2 (5 pts), loops 2 (4 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.
tools.handle_shared_axes (cognitive 50) pandas/plotting/_matplotlib/tools.py:392— tools.handle_shared_axes has cognitive complexity 50 (threshold 15). Drivers by points: if/else 9 (31 pts), loops 4 (13 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Categorical.__init__ (cognitive 49) pandas/core/arrays/categorical.py:399— Categorical.__init__ has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (42 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
interval.interval_range (cognitive 48) pandas/core/indexes/interval.py:1696— interval.interval_range has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (38 pts), boolean chains 5, ternaries 2 (3 pts), error handling 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.
datetimes._to_datetime_with_unit (cognitive 48) pandas/core/tools/datetimes.py:547— datetimes._to_datetime_with_unit has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (41 pts), error handling 2 (5 pts), ternaries 1 (2 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
PythonParser._rows_to_cols (cognitive 48) pandas/io/parsers/python_parser.py:1190— PythonParser._rows_to_cols has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (39 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (2 pts) (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.
readers._can_parallelize_csv (cognitive 48) pandas/io/parsers/readers.py:480— readers._can_parallelize_csv has cognitive complexity 48 (threshold 15). Drivers by points: if/else 29 (32 pts), boolean chains 8, error handling 3 (5 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SparseArray.__init__ (cognitive 47) pandas/core/arrays/sparse/array.py:650— SparseArray.__init__ has cognitive complexity 47 (threshold 15). Drivers by points: if/else 26 (39 pts), boolean chains 3, error handling 2 (3 pts), ternaries 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.
DataFrame._reduce_axis1 (cognitive 47) pandas/core/frame.py:17214— DataFrame._reduce_axis1 has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 6, loops 2 (4 pts), ternaries 2 (4 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.
to_dict.to_dict (cognitive 47) pandas/core/methods/to_dict.py:101— to_dict.to_dict has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (22 pts), ternaries 6 (13 pts), loops 2 (9 pts), boolean chains 3 (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.
concat._make_concat_multiindex (cognitive 47) pandas/core/reshape/concat.py:933— concat._make_concat_multiindex has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (36 pts), loops 3 (7 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.
algorithms.isin (cognitive 46) pandas/core/algorithms.py:549— algorithms.isin has cognitive complexity 46 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 13 (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.
ExcelFormatter._format_hierarchical_rows (cognitive 46) pandas/io/formats/excel.py:776— ExcelFormatter._format_hierarchical_rows has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 5 (17 pts), boolean chains 4 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParserBase._infer_types (cognitive 46) pandas/io/parsers/base_parser.py:526— ParserBase._infer_types has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (38 pts), boolean chains 6, error handling 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.
HDFStore._create_storer (cognitive 46) pandas/io/pytables.py:2269— HDFStore._create_storer has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (41 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
min_max_.sliding_min_max (cognitive 45) pandas/core/_numba/kernels/min_max_.py:39— min_max_.sliding_min_max has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 6 (15 pts), boolean chains 9, ternaries 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.
algorithms.safe_sort (cognitive 45) pandas/core/algorithms.py:1705— algorithms.safe_sort has cognitive complexity 45 (threshold 15). Drivers by points: if/else 23 (33 pts), boolean chains 8, error handling 1 (2 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.
RangeIndex._concat (cognitive 45) pandas/core/indexes/range.py:1317— RangeIndex._concat has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 4, loops 2, ternaries 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.
construction.dict_to_mgr (cognitive 45) pandas/core/internals/construction.py:389— construction.dict_to_mgr has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (22 pts), ternaries 4 (10 pts), boolean chains 5, loops 2 (5 pts), error handling 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.
arraylike.array_ufunc (cognitive 44) pandas/core/arraylike.py:278— arraylike.array_ufunc has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (21 pts), loops 3 (8 pts), ternaries 3 (8 pts), boolean chains 7 (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.
SparseArray.__getitem__ (cognitive 44) pandas/core/arrays/sparse/array.py:1468— SparseArray.__getitem__ has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (36 pts), ternaries 2 (6 pts), boolean chains 2 (nesting depth added 23). 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.
construction.sanitize_array (cognitive 44) pandas/core/construction.py:617— construction.sanitize_array has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (35 pts), boolean chains 9 (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.
cast._maybe_promote (cognitive 44) pandas/core/dtypes/cast.py:535— cast._maybe_promote has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (37 pts), error handling 2 (5 pts), boolean chains 2 (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.
construction.to_arrays (cognitive 44) pandas/core/internals/construction.py:776— construction.to_arrays has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (34 pts), boolean chains 5, loops 1 (5 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
datetimes.to_datetime (cognitive 44) pandas/core/tools/datetimes.py:847— datetimes.to_datetime has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (38 pts), boolean chains 2, error handling 1 (2 pts), 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.
parquet._get_path_or_handle (cognitive 44) pandas/io/parquet.py:97— parquet._get_path_or_handle has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (27 pts), error handling 3 (9 pts), boolean chains 8 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrowParserWrapper._finalize_index (cognitive 44) pandas/io/parsers/arrow_parser_wrapper.py:399— ArrowParserWrapper._finalize_index has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (29 pts), ternaries 2 (7 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
asserters.assert_index_equal (cognitive 43) pandas/_testing/asserters.py:219— asserters.assert_index_equal has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (26 pts), error handling 2 (6 pts), boolean chains 5, ternaries 2 (4 pts), loops 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.
MultiIndex._get_level_indexer (cognitive 43) pandas/core/indexes/multi.py:4007— MultiIndex._get_level_indexer has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 5, ternaries 1 (3 pts), 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.
_LocIndexer._getitem_axis (cognitive 43) pandas/core/indexing.py:1916— _LocIndexer._getitem_axis has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (29 pts), error handling 1 (6 pts), boolean chains 4, loops 1 (4 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_MergeOperation._validate_left_right_on (cognitive 43) pandas/core/reshape/merge.py:1890— _MergeOperation._validate_left_right_on has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (35 pts), boolean chains 8 (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.
OpenpyxlWriter._write_cells_normal (cognitive 43) pandas/io/excel/_openpyxl.py:587— OpenpyxlWriter._write_cells_normal has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 5 (19 pts), boolean chains 2 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrowExtensionArray._evaluate_op_method (cognitive 42) pandas/core/arrays/arrow/array.py:1429— ArrowExtensionArray._evaluate_op_method has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 9, error handling 3 (5 pts) (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.
datetimes._generate_range (cognitive 42) pandas/core/arrays/datetimes.py:3138— datetimes._generate_range has cognitive complexity 42 (threshold 15). Drivers by points: if/else 23 (35 pts), loops 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.
DataFrame.reset_index (cognitive 42) pandas/core/frame.py:8049— DataFrame.reset_index has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (33 pts), ternaries 2 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 23). 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.
Index.__new__ (cognitive 42) pandas/core/indexes/base.py:487— Index.__new__ has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 6, error handling 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
base.get_values_for_csv (cognitive 42) pandas/core/indexes/base.py:8624— base.get_values_for_csv has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LocIndexer._convert_to_indexer (cognitive 42) pandas/core/indexing.py:2003— _LocIndexer._convert_to_indexer has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (29 pts), error handling 4 (8 pts), boolean chains 5 (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.
PythonParser._next_line (cognitive 42) pandas/io/parsers/python_parser.py:888— PythonParser._next_line has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 4 (8 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
timedeltas.sequence_to_td64ns (cognitive 41) pandas/core/arrays/timedeltas.py:1223— timedeltas.sequence_to_td64ns has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 4, error handling 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cast.maybe_downcast_numeric (cognitive 41) pandas/core/dtypes/cast.py:311— cast.maybe_downcast_numeric has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 6, error handling 1 (3 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_AsOfMerge._validate_left_right_on (cognitive 41) pandas/core/reshape/merge.py:2474— _AsOfMerge._validate_left_right_on has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 8, ternaries 2 (6 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.
Parser._try_convert_data (cognitive 41) pandas/io/json/_json.py:1538— Parser._try_convert_data has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (21 pts), error handling 5 (12 pts), boolean chains 5, ternaries 1 (3 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.
ArrowExtensionArray._from_sequence_of_strings (cognitive 40) pandas/core/arrays/arrow/array.py:599— ArrowExtensionArray._from_sequence_of_strings has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 3, error handling 1 (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.
DataFrame.join (cognitive 40) pandas/core/frame.py:15742— DataFrame.join has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (29 pts), ternaries 3 (8 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DatetimeIndexOpsMixin.equals (cognitive 40) pandas/core/indexes/datetimelike.py:308— DatetimeIndexOpsMixin.equals has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (22 pts), error handling 4 (14 pts), boolean chains 4 (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.
printing.format_object_summary (cognitive 40) pandas/io/formats/printing.py:369— printing.format_object_summary has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (27 pts), loops 3 (7 pts), boolean chains 6 (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.
Parser._try_convert_to_date (cognitive 40) pandas/io/json/_json.py:1630— Parser._try_convert_to_date has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 4 (10 pts), boolean chains 5, loops 2 (4 pts), 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.
PythonParser._convert_to_ndarrays (cognitive 40) pandas/io/parsers/python_parser.py:395— PythonParser._convert_to_ndarrays has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 5, error handling 1 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BarPlot._make_plot (cognitive 40) pandas/plotting/_matplotlib/core.py:2099— BarPlot._make_plot has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 4 (10 pts), boolean chains 4 (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.
DataFrame.shift (cognitive 39) pandas/core/frame.py:7495— DataFrame.shift has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 3 (10 pts), boolean chains 4, ternaries 1 (3 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.
BlockManager.iset (cognitive 39) pandas/core/internals/managers.py:1305— BlockManager.iset has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22 (33 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
common._get_filepath_or_buffer (cognitive 39) REDACTED:301— common._get_filepath_or_buffer has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 11, error handling 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_HtmlFrameParser._expand_colspan_rowspan (cognitive 39) pandas/io/html.py:460— _HtmlFrameParser._expand_colspan_rowspan has cognitive complexity 39 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 7 (16 pts), boolean chains 3, ternaries 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.
AppendableFrameTable.read (cognitive 39) pandas/io/pytables.py:5707— AppendableFrameTable.read has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 3, error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tools.create_subplots (cognitive 39) pandas/plotting/_matplotlib/tools.py:142— tools.create_subplots has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (35 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RangeIndex._union (cognitive 38) pandas/core/indexes/range.py:1040— RangeIndex._union has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (31 pts), boolean chains 7 (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.
concat.concat (cognitive 38) pandas/core/reshape/concat.py:163— concat.concat has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (22 pts), ternaries 4 (9 pts), boolean chains 7 (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.
merge.get_join_indexers (cognitive 38) pandas/core/reshape/merge.py:2062— merge.get_join_indexers has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 11 (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.
Styler.to_latex (cognitive 38) REDACTED:758— Styler.to_latex has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 6 (14 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StylerRenderer._translate_latex (cognitive 38) REDACTED:929— StylerRenderer._translate_latex has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 3 (6 pts), ternaries 2 (5 pts), boolean chains 4 (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.
ParserBase._agg_index (cognitive 38) pandas/io/parsers/base_parser.py:380— ParserBase._agg_index has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NDFrame.asof (cognitive 37) pandas/core/generic.py:8468— NDFrame.asof has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (29 pts), ternaries 3 (4 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
datetimes._convert_listlike_datetimes (cognitive 37) pandas/core/tools/datetimes.py:370— datetimes._convert_listlike_datetimes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 2, error handling 2, ternaries 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.
_normalize.json_normalize (cognitive 37) pandas/io/json/_normalize.py:303— _normalize.json_normalize has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (26 pts), loops 3 (6 pts), boolean chains 4, 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.
ArrowExtensionArray._cast_pointwise_result (cognitive 36) pandas/core/arrays/arrow/array.py:748— ArrowExtensionArray._cast_pointwise_result has cognitive complexity 36 (threshold 15). Drivers by points: error handling 7 (15 pts), if/else 9 (13 pts), boolean chains 8 (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.
ArrowExtensionArray._reduce_pyarrow (cognitive 36) pandas/core/arrays/arrow/array.py:2793— ArrowExtensionArray._reduce_pyarrow has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 13, error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
NDFrame.to_latex (cognitive 36) pandas/core/generic.py:3454— NDFrame.to_latex has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (24 pts), ternaries 6, boolean chains 4, loops 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.
Block.replace_list (cognitive 36) pandas/core/internals/blocks.py:832— Block.replace_list has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 4 (8 pts), boolean chains 7 (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.
TimeGrouper.__init__ (cognitive 36) pandas/core/resample.py:2440— TimeGrouper.__init__ has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 5, error handling 2 (3 pts), ternaries 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
encoding._get_dummies_1d (cognitive 36) pandas/core/reshape/encoding.py:286— encoding._get_dummies_1d has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (28 pts), boolean chains 4, loops 2 (4 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.
sorting.lexsort_indexer (cognitive 36) pandas/core/sorting.py:310— sorting.lexsort_indexer has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
datetimes._adjust_to_origin (cognitive 36) pandas/core/tools/datetimes.py:686— datetimes._adjust_to_origin has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (24 pts), error handling 4 (8 pts), boolean chains 4 (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.
MPLPlot._adorn_subplots (cognitive 36) pandas/plotting/_matplotlib/core.py:820— MPLPlot._adorn_subplots has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 2 (5 pts) (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DataFrame._align_for_op (cognitive 35) pandas/core/frame.py:10374— DataFrame._align_for_op has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 5, ternaries 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.
NDFrame.filter (cognitive 35) pandas/core/generic.py:5674— NDFrame.filter has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (26 pts), ternaries 2 (6 pts), boolean chains 3 (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.
_iLocIndexer._setitem_with_indexer_missing (cognitive 35) pandas/core/indexing.py:3018— _iLocIndexer._setitem_with_indexer_missing has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (35 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_utils.to_numpy_dtype_inference (cognitive 34) pandas/core/arrays/_utils.py:27— _utils.to_numpy_dtype_inference has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 3, error handling 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.
ArrowExtensionArray._cmp_method (cognitive 34) pandas/core/arrays/arrow/array.py:1341— ArrowExtensionArray._cmp_method has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 4 (12 pts), boolean chains 7 (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.
ArrowExtensionArray._groupby_op_pyarrow (cognitive 34) pandas/core/arrays/arrow/array.py:3697— ArrowExtensionArray._groupby_op_pyarrow has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 8, error handling 2 (5 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.
DataFrame.apply (cognitive 34) pandas/core/frame.py:15239— DataFrame.apply has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (30 pts), error handling 1 (3 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.
NDFrame.clip (cognitive 34) pandas/core/generic.py:8990— NDFrame.clip has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 7, 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.
datetimes.date_range (cognitive 34) pandas/core/indexes/datetimes.py:2500— datetimes.date_range has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 6 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_iLocIndexer._align_frame (cognitive 34) pandas/core/indexing.py:3264— _iLocIndexer._align_frame has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 6, loops 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.
select.select (cognitive 34) pandas/core/methods/select.py:60— select.select has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 3 (6 pts), boolean chains 3 (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.
Table.create_index (cognitive 34) pandas/io/pytables.py:4633— Table.create_index has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 3, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatetimeLikeArrayMixin._validate_listlike (cognitive 33) pandas/core/arrays/datetimelike.py:617— DatetimeLikeArrayMixin._validate_listlike has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 8, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseMaskedArray._arith_method (cognitive 33) pandas/core/arrays/masked.py:1003— BaseMaskedArray._arith_method has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (27 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.
StringArray._cmp_method (cognitive 33) pandas/core/arrays/string_.py:1230— StringArray._cmp_method has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (27 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.
TimedeltaArray.__mul__ (cognitive 33) pandas/core/arrays/timedeltas.py:519— TimedeltaArray.__mul__ has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 4 (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.
IntervalDtype.__init__ (cognitive 33) pandas/core/dtypes/dtypes.py:1294— IntervalDtype.__init__ has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
GroupBy._value_counts (cognitive 33) pandas/core/groupby/groupby.py:2440— GroupBy._value_counts has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (26 pts), ternaries 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseBlockManager.setitem (cognitive 33) pandas/core/internals/managers.py:566— BaseBlockManager.setitem has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 6, ternaries 1 (5 pts) (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.
style_render._get_level_lengths (cognitive 33) REDACTED:1856— style_render._get_level_lengths has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 3 (5 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.
DataFrame._set_item_frame_value (cognitive 32) pandas/core/frame.py:4801— DataFrame._set_item_frame_value has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 4, loops 1 (4 pts), ternaries 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.
NDFrame.__setstate__ (cognitive 32) pandas/core/generic.py:2059— NDFrame.__setstate__ has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
NDFrame.xs (cognitive 32) pandas/core/generic.py:4193— NDFrame.xs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (30 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CParserWrapper._read_arrays (cognitive 32) pandas/io/parsers/c_parser_wrapper.py:281— CParserWrapper._read_arrays has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), ternaries 1 (4 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StataReader._do_convert_missing (cognitive 32) pandas/io/stata.py:1845— StataReader._do_convert_missing has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StataReader._do_convert_categoricals (cognitive 32) pandas/io/stata.py:1948— StataReader._do_convert_categoricals has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (5 pts), error handling 1 (3 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.
_XMLFrameParser._parse_nodes (cognitive 32) REDACTED:201— _XMLFrameParser._parse_nodes has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 10 (21 pts), if/else 6 (7 pts), boolean chains 4 (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.
asserters.assert_extension_array_equal (cognitive 31) pandas/_testing/asserters.py:876— asserters.assert_extension_array_equal has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 9, ternaries 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.
_LocationIndexer._post_expansion_casting (cognitive 31) pandas/core/indexing.py:1025— _LocationIndexer._post_expansion_casting has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_iLocIndexer._setitem_single_block (cognitive 31) pandas/core/indexing.py:2931— _iLocIndexer._setitem_single_block has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 7 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
encoding.from_dummies (cognitive 31) pandas/core/reshape/encoding.py:414— encoding.from_dummies has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (27 pts), loops 2 (3 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
clipboard.determine_clipboard (cognitive 31) pandas/io/clipboard/__init__.py:535— clipboard.determine_clipboard has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 4 (11 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Categorical._maybe_convert_categories (cognitive 30) pandas/core/arrays/categorical.py:662— Categorical._maybe_convert_categories has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 5, ternaries 1 (3 pts), error handling 1 (2 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.
IntervalArray._ensure_simple_new_inputs (cognitive 30) pandas/core/arrays/interval.py:283— IntervalArray._ensure_simple_new_inputs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 10 (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.
missing._array_equivalent_object (cognitive 30) pandas/core/dtypes/missing.py:513— missing._array_equivalent_object has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 3 (7 pts), boolean chains 4, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseGrouper._reduceat_aggregate (cognitive 30) pandas/core/groupby/ops.py:1087— BaseGrouper._reduceat_aggregate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 4, 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.
Index._join_level (cognitive 30) pandas/core/indexes/base.py:4949— Index._join_level has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (23 pts), ternaries 3 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.get_slice_bound (cognitive 30) pandas/core/indexes/base.py:7264— Index.get_slice_bound has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (20 pts), error handling 4 (9 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.
pivot._add_margins (cognitive 30) pandas/core/reshape/pivot.py:429— pivot._add_margins has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenpyxlWriter._write_cells_write_only (cognitive 30) pandas/io/excel/_openpyxl.py:505— OpenpyxlWriter._write_cells_write_only has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 5 (10 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.
Tooltips._translate (cognitive 30) REDACTED:2350— Tooltips._translate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (12 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.
converter._daily_finder (cognitive 30) pandas/plotting/_matplotlib/converter.py:687— converter._daily_finder has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (30 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.
MPLPlot.__init__ (cognitive 30) pandas/plotting/_matplotlib/core.py:149— MPLPlot.__init__ has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 4, 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.
IntervalArray._cmp_method (cognitive 29) pandas/core/arrays/interval.py:731— IntervalArray._cmp_method has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (25 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseMaskedArray.fillna (cognitive 29) pandas/core/arrays/masked.py:331— BaseMaskedArray.fillna has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 4, ternaries 1 (3 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.
DataFrame.__getitem__ (cognitive 29) pandas/core/frame.py:4292— DataFrame.__getitem__ has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4, error handling 1 (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.
construction._homogenize (cognitive 29) pandas/core/internals/construction.py:570— construction._homogenize has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AsOfMerge._get_join_indexers (cognitive 29) pandas/core/reshape/merge.py:2662— _AsOfMerge._get_join_indexers has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4, ternaries 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tile._bins_to_cuts (cognitive 29) pandas/core/reshape/tile.py:473— tile._bins_to_cuts has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ODFReader.get_sheet_data (cognitive 29) pandas/io/excel/_odfreader.py:108— ODFReader.get_sheet_data has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (4 pts), boolean chains 3 (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.
readers.read_fwf (cognitive 29) pandas/io/parsers/readers.py:2610— readers.read_fwf has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 5, loops 1 (2 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.
DataCol.convert (cognitive 29) pandas/io/pytables.py:3237— DataCol.convert has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (22 pts), error handling 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sum_.sliding_sum (cognitive 28) pandas/core/_numba/kernels/sum_.py:66— sum_.sliding_sum has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4 (10 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
algorithms.diff (cognitive 28) pandas/core/algorithms.py:1584— algorithms.diff has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (22 pts), ternaries 3 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
apply.reconstruct_func (cognitive 28) pandas/core/apply.py:1957— apply.reconstruct_func has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrowExtensionArray.to_numpy (cognitive 28) pandas/core/arrays/arrow/array.py:2466— ArrowExtensionArray.to_numpy has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 8 (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.
align._align_core (cognitive 28) pandas/core/computation/align.py:90— align._align_core has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (6 pts), ternaries 1 (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.
parsing._split_by_backtick (cognitive 28) pandas/core/computation/parsing.py:166— parsing._split_by_backtick has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 1 (4 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BinOp.convert_value (cognitive 28) pandas/core/computation/pytables.py:255— BinOp.convert_value has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 5, 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.
NDFrame.astype (cognitive 28) pandas/core/generic.py:6636— NDFrame.astype has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 1 (4 pts), loops 2 (4 pts), boolean chains 3 (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.
utils.check_setitem_lengths (cognitive 28) pandas/core/indexers/utils.py:125— utils.check_setitem_lengths has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (25 pts), boolean chains 3 (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.
MultiIndex._reorder_indexer (cognitive 28) pandas/core/indexes/multi.py:4471— MultiIndex._reorder_indexer has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RangeIndex._difference (cognitive 28) pandas/core/indexes/range.py:1115— RangeIndex._difference has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 5, 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.
indexing.infer_and_maybe_downcast (cognitive 28) pandas/core/indexing.py:3934— indexing.infer_and_maybe_downcast has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 7, error handling 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pivot._generate_marginal_results (cognitive 28) pandas/core/reshape/pivot.py:568— pivot._generate_marginal_results has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 2 (6 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.
pivot.pivot (cognitive 28) pandas/core/reshape/pivot.py:748— pivot.pivot has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
reshape._stack_multi_columns (cognitive 28) pandas/core/reshape/reshape.py:833— reshape._stack_multi_columns has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (22 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_XlsxStyler.convert (cognitive 28) pandas/io/excel/_xlsxwriter.py:98— _XlsxStyler.convert has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 2 (7 pts), loops 4 (7 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.
PythonParser._handle_usecols (cognitive 28) pandas/io/parsers/python_parser.py:763— PythonParser._handle_usecols has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), error handling 1 (5 pts), loops 1 (3 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.
IndexCol.convert (cognitive 28) pandas/io/pytables.py:2746— IndexCol.convert has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 5, error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenericFixed.write_array (cognitive 28) pandas/io/pytables.py:3922— GenericFixed.write_array has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SAS7BDATReader._read_amd_column_text (cognitive 28) pandas/io/sas/sas7bdat.py:933— SAS7BDATReader._read_amd_column_text has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 2 (4 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.
boolean.coerce_to_array (cognitive 27) pandas/core/arrays/boolean.py:177— boolean.coerce_to_array has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (22 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.
DatetimeLikeArrayMixin._cmp_method (cognitive 27) pandas/core/arrays/datetimelike.py:944— DatetimeLikeArrayMixin._cmp_method has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), error handling 2 (5 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.
SparseArray._reduce (cognitive 27) pandas/core/arrays/sparse/array.py:2065— SparseArray._reduce has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NDFrame._drop_axis (cognitive 27) pandas/core/generic.py:4774— NDFrame._drop_axis has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_iLocIndexer._setitem_with_indexer_split_path (cognitive 27) pandas/core/indexing.py:2685— _iLocIndexer._setitem_with_indexer_split_path has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 10, loops 2 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nanops._wrap_results (cognitive 27) pandas/core/nanops.py:360— nanops._wrap_results has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AsOfMerge._validate_tolerance (cognitive 27) pandas/core/reshape/merge.py:2599— _AsOfMerge._validate_tolerance has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExcelFormatter.write (cognitive 27) pandas/io/formats/excel.py:917— ExcelFormatter.write has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
style_render._parse_latex_header_span (cognitive 27) REDACTED:2512— style_render._parse_latex_header_span has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 4 (16 pts), if/else 6 (11 pts) (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.
PythonParser._get_index_name (cognitive 27) pandas/io/parsers/python_parser.py:1104— PythonParser._get_index_name has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (4 pts), error handling 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
readers._read (cognitive 27) pandas/io/parsers/readers.py:359— readers._read has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mean_.sliding_mean (cognitive 26) pandas/core/_numba/kernels/mean_.py:68— mean_.sliding_mean has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (10 pts), boolean chains 5 (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.
var_.sliding_var (cognitive 26) pandas/core/_numba/kernels/var_.py:75— var_.sliding_var has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (10 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
astype.astype_is_view (cognitive 26) pandas/core/dtypes/astype.py:313— astype.astype_is_view has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 14, if/else 9 (12 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.
DataFrame.update (cognitive 26) pandas/core/frame.py:13442— DataFrame.update has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataFrame._append_internal (cognitive 26) pandas/core/frame.py:15647— DataFrame._append_internal has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (2 pts), 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.
GroupBy.shift (cognitive 26) pandas/core/groupby/groupby.py:5190— GroupBy.shift has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Grouping._codes_and_uniques (cognitive 26) pandas/core/groupby/grouper.py:636— Grouping._codes_and_uniques has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (26 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.
grouper._factorize_monotonic (cognitive 26) pandas/core/groupby/grouper.py:966— grouper._factorize_monotonic has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (23 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.
_LocationIndexer._maybe_mask_setitem_value (cognitive 26) pandas/core/indexing.py:883— _LocationIndexer._maybe_mask_setitem_value has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 5 (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.
nanops.nanmedian (cognitive 26) pandas/core/nanops.py:1054— nanops.nanmedian has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 6, 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.
Styler.set_sticky (cognitive 26) REDACTED:2637— Styler.set_sticky has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (6 pts), ternaries 3, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitHubClient.iter_open_pull_requests_review_state (cognitive 26) scripts/issue_assignment/client.py:186— GitHubClient.iter_open_pull_requests_review_state has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (8 pts), ternaries 2 (6 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
algorithms.value_counts_internal (cognitive 25) pandas/core/algorithms.py:1048— algorithms.value_counts_internal has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, error handling 1 (2 pts), ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrowExtensionArray.__getitem__ (cognitive 25) pandas/core/arrays/arrow/array.py:1093— ArrowExtensionArray.__getitem__ has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cast.infer_dtype_from_scalar (cognitive 25) pandas/core/dtypes/cast.py:697— cast.infer_dtype_from_scalar has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), error handling 3 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeriesGroupBy.value_counts (cognitive 25) pandas/core/groupby/generic.py:1045— SeriesGroupBy.value_counts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (20 pts), ternaries 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MultiIndex._verify_integrity (cognitive 25) pandas/core/indexes/multi.py:382— MultiIndex._verify_integrity has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Block.where (cognitive 25) pandas/core/internals/blocks.py:1323— Block.where has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 4, loops 1 (3 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
reshape.stack_reshape (cognitive 25) pandas/core/reshape/reshape.py:1089— reshape.stack_reshape has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CParserWrapper.__init__ (cognitive 25) pandas/io/parsers/c_parser_wrapper.py:76— CParserWrapper.__init__ has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 5, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HDFStore.copy (cognitive 25) pandas/io/pytables.py:2101— HDFStore.copy has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 1 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
pytables._maybe_convert_for_string_atom (cognitive 25) pandas/io/pytables.py:6337— pytables._maybe_convert_for_string_atom has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5, ternaries 1 (4 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StataReader._read_old_header (cognitive 25) pandas/io/stata.py:1411— StataReader._read_old_header has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 2 (4 pts), error handling 2, 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.
ArrowExtensionArray._box_pa_scalar (cognitive 24) pandas/core/arrays/arrow/array.py:870— ArrowExtensionArray._box_pa_scalar has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 9 (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.
ArrowExtensionArray.__setitem__ (cognitive 24) pandas/core/arrays/arrow/array.py:3182— ArrowExtensionArray.__setitem__ has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (21 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.
array._sparse_array_op (cognitive 24) pandas/core/arrays/sparse/array.py:239— array._sparse_array_op has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (19 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.
GroupBy._insert_inaxis_grouper (cognitive 24) pandas/core/groupby/groupby.py:1015— GroupBy._insert_inaxis_grouper has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Grouper._set_grouper (cognitive 24) pandas/core/groupby/grouper.py:327— Grouper._set_grouper has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index._maybe_downcast_for_indexing (cognitive 24) pandas/core/indexes/base.py:6684— Index._maybe_downcast_for_indexing has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 9, error handling 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiIndex._partial_tup_index (cognitive 24) pandas/core/indexes/multi.py:3534— MultiIndex._partial_tup_index has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, error handling 1 (3 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_LocationIndexer._getitem_lowerdim (cognitive 24) pandas/core/indexing.py:1204— _LocationIndexer._getitem_lowerdim has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_iLocIndexer._validate_key (cognitive 24) pandas/core/indexing.py:2267— _iLocIndexer._validate_key has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EABackedBlock.where (cognitive 24) pandas/core/internals/blocks.py:1867— EABackedBlock.where has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (3 pts), boolean chains 2, error handling 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EABackedBlock.putmask (cognitive 24) pandas/core/internals/blocks.py:1933— EABackedBlock.putmask has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (3 pts), boolean chains 2, error handling 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlockManager.as_array (cognitive 24) pandas/core/internals/managers.py:1863— BlockManager.as_array has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (20 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.
StringMethods.cat (cognitive 24) pandas/core/strings/accessor.py:494— StringMethods.cat has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 4, ternaries 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.
style._bar (cognitive 24) REDACTED:4444— style._bar has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 8 (10 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.
PythonParser._make_reader (cognitive 24) pandas/io/parsers/python_parser.py:206— PythonParser._make_reader has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (7 pts), boolean chains 2 (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.
HDFStore.append_to_multiple (cognitive 24) pandas/io/pytables.py:1734— HDFStore.append_to_multiple has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_unwanted_patterns.doesnt_use_pandas_warnings (cognitive 24) scripts/validate_unwanted_patterns.py:336— validate_unwanted_patterns.doesnt_use_pandas_warnings has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataFrame.explode (cognitive 23) pandas/core/frame.py:14444— DataFrame.explode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, 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.
VariableOffsetWindowIndexer.get_window_bounds (cognitive 23) pandas/core/indexers/objects.py:297— VariableOffsetWindowIndexer.get_window_bounds has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiIndex.get_loc (cognitive 23) pandas/core/indexes/multi.py:3620— MultiIndex.get_loc has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 3 (6 pts), loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
resample._adjust_dates_anchored (cognitive 23) pandas/core/resample.py:3098— resample._adjust_dates_anchored has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (20 pts), ternaries 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
concat._sanitize_mixed_ndim (cognitive 23) pandas/core/reshape/concat.py:527— concat._sanitize_mixed_ndim has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
concat._get_result (cognitive 23) pandas/core/reshape/concat.py:577— concat._get_result has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
concat._get_concat_axis_series (cognitive 23) pandas/core/reshape/concat.py:738— concat._get_concat_axis_series has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 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.
reshape.stack_v3 (cognitive 23) pandas/core/reshape/reshape.py:1002— reshape.stack_v3 has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (20 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, 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.
tile._nbins_to_bins (cognitive 23) pandas/core/reshape/tile.py:408— tile._nbins_to_bins has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 2 (6 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ODSWriter._write_cells (cognitive 23) pandas/io/excel/_odswriter.py:93— ODSWriter._write_cells has cognitive complexity 23 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 8 (10 pts), boolean chains 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
readers._iter_physical_lines (cognitive 23) pandas/io/parsers/readers.py:3672— readers._iter_physical_lines has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (9 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hist.hist_series (cognitive 23) pandas/plotting/_matplotlib/hist.py:423— hist.hist_series has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
misc.scatter_matrix (cognitive 23) pandas/plotting/_matplotlib/misc.py:33— misc.scatter_matrix has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_testing.shares_memory (cognitive 22) pandas/_testing/__init__.py:523— _testing.shares_memory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (17 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.
min_max_.grouped_min_max (cognitive 22) pandas/core/_numba/kernels/min_max_.py:133— min_max_.grouped_min_max has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrameApply._agg_list_like_frame_reductions (cognitive 22) pandas/core/apply.py:1148— FrameApply._agg_list_like_frame_reductions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (4 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
datetimes._validate_tz_from_dtype (cognitive 22) pandas/core/arrays/datetimes.py:2996— datetimes._validate_tz_from_dtype has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PeriodArray._from_sequence (cognitive 22) pandas/core/arrays/period.py:261— PeriodArray._from_sequence has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrowStringArray._from_sequence (cognitive 22) pandas/core/arrays/string_arrow.py:231— ArrowStringArray._from_sequence has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 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.
BaseExprVisitor.visit_Call (cognitive 22) pandas/core/computation/expr.py:682— BaseExprVisitor.visit_Call has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 2 (5 pts), loops 1 (2 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.
GroupBy._concat_objects (cognitive 22) pandas/core/groupby/groupby.py:909— GroupBy._concat_objects has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseGrouper.result_index_and_ids (cognitive 22) pandas/core/groupby/ops.py:881— BaseGrouper.result_index_and_ids has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index._cmp_method (cognitive 22) pandas/core/indexes/base.py:7779— Index._cmp_method has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 6 (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.
MultiIndex.isin (cognitive 22) pandas/core/indexes/multi.py:4938— MultiIndex.isin has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_AtIndexer._warn_if_expanding (cognitive 22) pandas/core/indexing.py:3433— _AtIndexer._warn_if_expanding has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Block._replace_coerce (cognitive 22) pandas/core/internals/blocks.py:957— Block._replace_coerce has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (5 pts), boolean chains 2 (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.
concat.concatenate_managers (cognitive 22) pandas/core/internals/concat.py:59— concat.concatenate_managers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 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.
nanops._maybe_null_out (cognitive 22) pandas/core/nanops.py:1943— nanops._maybe_null_out has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (21 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.
pivot._compute_grand_margin (cognitive 22) pandas/core/reshape/pivot.py:536— pivot._compute_grand_margin has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Series.__setitem__ (cognitive 22) pandas/core/series.py:1218— Series.__setitem__ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 4 (6 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseWindow._validate (cognitive 22) pandas/core/window/rolling.py:163— BaseWindow._validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StylerRenderer._generate_body_row (cognitive 22) REDACTED:819— StylerRenderer._generate_body_row has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, loops 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.
StylerRenderer.relabel_index (cognitive 22) REDACTED:1489— StylerRenderer.relabel_index has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (7 pts), loops 2 (4 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.
html._parse (cognitive 22) pandas/io/html.py:955— html._parse has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 3 (6 pts), boolean chains 3, ternaries 1 (3 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrowParserWrapper.read (cognitive 22) pandas/io/parsers/arrow_parser_wrapper.py:571— ArrowParserWrapper.read has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), error handling 2, loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextFileReader._get_options_with_defaults (cognitive 22) pandas/io/parsers/readers.py:2848— TextFileReader._get_options_with_defaults has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HDFStore.info (cognitive 22) pandas/io/pytables.py:2190— HDFStore.info has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (8 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pytables.read_hdf (cognitive 22) pandas/io/pytables.py:369— pytables.read_hdf has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), error handling 1 (2 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SQLTable.insert_data (cognitive 22) pandas/io/sql.py:1101— SQLTable.insert_data has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StataWriter._check_column_names (cognitive 22) pandas/io/stata.py:2729— StataWriter._check_column_names has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (8 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.
_warnings.assert_produces_warning (cognitive 21) pandas/_testing/_warnings.py:29— _warnings.assert_produces_warning has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (6 pts), loops 1 (3 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.
Apply.wrap_results_dict_like (cognitive 21) pandas/core/apply.py:693— Apply.wrap_results_dict_like has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 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.
take.take_2d_multi (cognitive 21) pandas/core/array_algos/take.py:183— take.take_2d_multi 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, 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.
cast.common_dtype_categorical_compat (cognitive 21) pandas/core/dtypes/cast.py:1246— cast.common_dtype_categorical_compat has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 1 (2 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.
DataFrame.sort_values (cognitive 21) pandas/core/frame.py:9134— DataFrame.sort_values has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
range._exact_int64_targets (cognitive 21) pandas/core/indexes/range.py:94— range._exact_int64_targets has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, error handling 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_iLocIndexer._setitem_with_indexer_frame_value (cognitive 21) pandas/core/indexing.py:2808— _iLocIndexer._setitem_with_indexer_frame_value has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (6 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.
BaseBlockManager.apply (cognitive 21) pandas/core/internals/managers.py:413— BaseBlockManager.apply has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlockManager.fast_xs (cognitive 21) pandas/core/internals/managers.py:1171— BlockManager.fast_xs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_MergeOperation._get_join_info (cognitive 21) pandas/core/reshape/merge.py:1429— _MergeOperation._get_join_info has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
merge._convert_arrays_and_get_rizer_klass (cognitive 21) pandas/core/reshape/merge.py:3102— merge._convert_arrays_and_get_rizer_klass has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (21 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.
_Unstacker.get_new_values (cognitive 21) pandas/core/reshape/reshape.py:311— _Unstacker.get_new_values has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (20 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.
reshape._unstack_multiple (cognitive 21) pandas/core/reshape/reshape.py:489— reshape._unstack_multiple has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 1 (4 pts), loops 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExponentialMovingWindow.__init__ (cognitive 21) pandas/core/window/ewm.py:324— ExponentialMovingWindow.__init__ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, 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.
SeriesFormatter._get_footer (cognitive 21) pandas/io/formats/format.py:205— SeriesFormatter._get_footer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_normalize.nested_to_record (cognitive 21) pandas/io/json/_normalize.py:71— _normalize.nested_to_record has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenericFixed.read_array (cognitive 21) pandas/io/pytables.py:3674— GenericFixed.read_array has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SAS7BDATReader._process_columntext_subheader (cognitive 21) pandas/io/sas/sas7bdat.py:744— SAS7BDATReader._process_columntext_subheader has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SAS7BDATReader._chunk_to_dataframe (cognitive 21) pandas/io/sas/sas7bdat.py:1183— SAS7BDATReader._chunk_to_dataframe has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MPLPlot._validate_color_args (cognitive 21) pandas/plotting/_matplotlib/core.py:464— MPLPlot._validate_color_args has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, 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.
take._take_preprocess_indexer_and_fill_value (cognitive 20) pandas/core/array_algos/take.py:576— take._take_preprocess_indexer_and_fill_value has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseMaskedArray._pad_or_backfill (cognitive 20) pandas/core/arrays/masked.py:285— BaseMaskedArray._pad_or_backfill has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 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.
SparseArray.__array_ufunc__ (cognitive 20) pandas/core/arrays/sparse/array.py:2823— SparseArray.__array_ufunc__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
concat.concat_compat (cognitive 20) pandas/core/dtypes/concat.py:56— concat.concat_compat has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataFrame.to_records (cognitive 20) pandas/core/frame.py:2298— DataFrame.to_records has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataFrame._getitem_multilevel (cognitive 20) pandas/core/frame.py:4394— DataFrame._getitem_multilevel has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Index.intersection (cognitive 20) pandas/core/indexes/base.py:3419— Index.intersection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatetimeTimedeltaMixin._pin_freq (cognitive 20) pandas/core/indexes/datetimelike.py:827— DatetimeTimedeltaMixin._pin_freq has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MultiIndex.drop (cognitive 20) pandas/core/indexes/multi.py:2901— MultiIndex.drop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (4 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_iLocIndexer._setitem_new_column (cognitive 20) pandas/core/indexing.py:2532— _iLocIndexer._setitem_new_column has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
construction._extract_index (cognitive 20) pandas/core/internals/construction.py:622— construction._extract_index has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nanops._sum_timedelta_i8 (cognitive 20) pandas/core/nanops.py:858— nanops._sum_timedelta_i8 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 3 (5 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Series.reset_index (cognitive 20) pandas/core/series.py:1451— Series.reset_index has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 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.
ObjectStringArrayMixin._str_split (cognitive 20) pandas/core/strings/object_array.py:360— ObjectStringArrayMixin._str_split 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.
_json._validate_pyarrow_engine_options (cognitive 20) pandas/io/json/_json.py:470— _json._validate_pyarrow_engine_options has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HDFStore._identify_group (cognitive 20) pandas/io/pytables.py:2438— HDFStore._identify_group has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (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.
pytables._convert_index (cognitive 20) pandas/io/pytables.py:6166— pytables._convert_index has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XportReader._read_header (cognitive 20) pandas/io/sas/sas_xport.py:293— XportReader._read_header has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 1 (3 pts), loops 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.
StataReader._read_new_value_labels (cognitive 20) pandas/io/stata.py:1527— StataReader._read_new_value_labels has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts), ternaries 1 (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.
boxplot.boxplot (cognitive 20) pandas/plotting/_matplotlib/boxplot.py:343— boxplot.boxplot has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MPLPlot._make_legend (cognitive 20) pandas/plotting/_matplotlib/core.py:940— MPLPlot._make_legend has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 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.
misc.parallel_coordinates (cognitive 20) pandas/plotting/_matplotlib/misc.py:344— misc.parallel_coordinates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 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.
unassign_inactive._stale_clock_anchor (cognitive 20) scripts/issue_assignment/unassign_inactive.py:90— unassign_inactive._stale_clock_anchor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
unassign_inactive.run_pr_stale_sweep (cognitive 20) scripts/issue_assignment/unassign_inactive.py:142— unassign_inactive.run_pr_stale_sweep has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_unwanted_patterns.private_function_across_module (cognitive 20) scripts/validate_unwanted_patterns.py:90— validate_unwanted_patterns.private_function_across_module has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), ternaries 1 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_unwanted_patterns.nodefault_used_not_only_for_typing (cognitive 20) scripts/validate_unwanted_patterns.py:284— validate_unwanted_patterns.nodefault_used_not_only_for_typing has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Apply.compute_dict_like (cognitive 19) pandas/core/apply.py:593— Apply.compute_dict_like has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 4 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
masked_reductions._minmax (cognitive 19) pandas/core/array_algos/masked_reductions.py:136— masked_reductions._minmax has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrowExtensionArray.__array_ufunc__ (cognitive 19) pandas/core/arrays/arrow/array.py:1219— ArrowExtensionArray.__array_ufunc__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 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.
array._first_truncated_to_integer (cognitive 19) pandas/core/arrays/arrow/array.py:4883— array._first_truncated_to_integer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
datetimes._sequence_to_dt64 (cognitive 19) pandas/core/arrays/datetimes.py:2618— datetimes._sequence_to_dt64 has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 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.
missing.array_equivalent (cognitive 19) pandas/core/dtypes/missing.py:399— missing.array_equivalent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
DataFrame.dropna (cognitive 19) pandas/core/frame.py:8628— DataFrame.dropna has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DataFrame.corr (cognitive 19) pandas/core/frame.py:16551— DataFrame.corr has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts), ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NDFrame._align_series (cognitive 19) pandas/core/generic.py:10334— NDFrame._align_series has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Grouping.__init__ (cognitive 19) pandas/core/groupby/grouper.py:456— Grouping.__init__ 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.
Index.get_indexer (cognitive 19) pandas/core/indexes/base.py:3866— Index.get_indexer 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.
DatetimeTimedeltaMixin._get_delete_freq (cognitive 19) pandas/core/indexes/datetimelike.py:1562— DatetimeTimedeltaMixin._get_delete_freq has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MultiIndex._format_multi (cognitive 19) pandas/core/indexes/multi.py:1655— MultiIndex._format_multi has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (3 pts), loops 2, 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.
RangeIndex.take (cognitive 19) pandas/core/indexes/range.py:1627— RangeIndex.take has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (19 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.
Block.fillna (cognitive 19) pandas/core/internals/blocks.py:1433— Block.fillna has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ExtensionBlock._unwrap_setitem_indexer (cognitive 19) pandas/core/internals/blocks.py:2191— ExtensionBlock._unwrap_setitem_indexer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7 (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.
BaseBlockManager.reindex_indexer (cognitive 19) pandas/core/internals/managers.py:822— BaseBlockManager.reindex_indexer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 1 (4 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
missing._index_to_interp_indices (cognitive 19) pandas/core/missing.py:461— missing._index_to_interp_indices has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 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.
sample.preprocess_weights (cognitive 19) pandas/core/sample.py:27— sample.preprocess_weights has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 1 (4 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Series.combine (cognitive 19) pandas/core/series.py:3714— Series.combine has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 2 (6 pts), boolean chains 3, 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.
accessor.str_extractall (cognitive 19) pandas/core/strings/accessor.py:4924— accessor.str_extractall has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), ternaries 1 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
printing._pprint_seq (cognitive 19) pandas/io/formats/printing.py:116— printing._pprint_seq has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 2 (4 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
c_parser_wrapper._concatenate_chunks (cognitive 19) pandas/io/parsers/c_parser_wrapper.py:474— c_parser_wrapper._concatenate_chunks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppendableTable.delete (cognitive 19) pandas/io/pytables.py:5627— AppendableTable.delete has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MPLPlot._parse_errorbars (cognitive 19) pandas/plotting/_matplotlib/core.py:1179— MPLPlot._parse_errorbars has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_warnings._assert_caught_expected_warnings (cognitive 18) pandas/_testing/_warnings.py:174— _warnings._assert_caught_expected_warnings has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_warnings._assert_caught_no_extra_warnings (cognitive 18) pandas/_testing/_warnings.py:215— _warnings._assert_caught_no_extra_warnings has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArrowExtensionArray._rank_calc (cognitive 18) pandas/core/arrays/arrow/array.py:3278— ArrowExtensionArray._rank_calc has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 3, 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.
DatetimeArray._add_offset (cognitive 18) pandas/core/arrays/datetimes.py:798— DatetimeArray._add_offset has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, 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.
BaseMaskedArray.__iter__ (cognitive 18) pandas/core/arrays/masked.py:552— BaseMaskedArray.__iter__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (8 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NumpyExtensionArray.__array_ufunc__ (cognitive 18) pandas/core/arrays/numpy_.py:256— NumpyExtensionArray.__array_ufunc__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 1 (3 pts), ternaries 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexOpsMixin.to_numpy (cognitive 18) pandas/core/base.py:604— IndexOpsMixin.to_numpy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataFrame.select_dtypes (cognitive 18) pandas/core/frame.py:5484— DataFrame.select_dtypes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataFrame.combine (cognitive 18) pandas/core/frame.py:13181— DataFrame.combine has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataFrame.stack (cognitive 18) pandas/core/frame.py:14227— DataFrame.stack has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NDFrame._drop_labels_or_levels (cognitive 18) pandas/core/generic.py:1766— NDFrame._drop_labels_or_levels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 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.
NDFrame.reindex (cognitive 18) pandas/core/generic.py:5319— NDFrame.reindex has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NDFrame._clip_with_one_bound (cognitive 18) pandas/core/generic.py:8953— NDFrame._clip_with_one_bound has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index.__repr__ (cognitive 18) pandas/core/indexes/base.py:1454— Index.__repr__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index._join_via_get_indexer (cognitive 18) pandas/core/indexes/base.py:4778— Index._join_via_get_indexer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 2 (5 pts), 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.
_iLocIndexer._setitem_with_indexer (cognitive 18) pandas/core/indexing.py:2611— _iLocIndexer._setitem_with_indexer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_iLocIndexer._setitem_with_indexer_2d_value (cognitive 18) pandas/core/indexing.py:2774— _iLocIndexer._setitem_with_indexer_2d_value has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (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.
Block.putmask (cognitive 18) pandas/core/internals/blocks.py:1256— Block.putmask has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
concat._clean_keys_and_objs (cognitive 18) pandas/core/reshape/concat.py:817— concat._clean_keys_and_objs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
encoding.get_dummies (cognitive 18) pandas/core/reshape/encoding.py:44— encoding.get_dummies has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
merge._fuse_key_view (cognitive 18) pandas/core/reshape/merge.py:3190— merge._fuse_key_view has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 1 (3 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.
ExcelFormatter._format_regular_rows (cognitive 18) pandas/io/formats/excel.py:730— ExcelFormatter._format_regular_rows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Styler._apply (cognitive 18) REDACTED:1979— Styler._apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 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.
JsonReader.__init__ (cognitive 18) pandas/io/json/_json.py:1123— JsonReader.__init__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 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.
_table_schema.build_table_schema (cognitive 18) pandas/io/json/_table_schema.py:240— _table_schema.build_table_schema has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 2 (5 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, 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.
readers._refine_defaults_read (cognitive 18) pandas/io/parsers/readers.py:3421— readers._refine_defaults_read has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 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.
Table.validate (cognitive 18) pandas/io/pytables.py:4298— Table.validate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 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.
Table.validate_data_columns (cognitive 18) pandas/io/pytables.py:4758— Table.validate_data_columns has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Selection.__init__ (cognitive 18) pandas/io/pytables.py:6633— Selection.__init__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (5 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SAS7BDATReader._parse_metadata (cognitive 18) pandas/io/sas/sas7bdat.py:614— SAS7BDATReader._parse_metadata has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sas7bdat._utf8_translation_table (cognitive 18) pandas/io/sas/sas7bdat.py:79— sas7bdat._utf8_translation_table has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 3 (6 pts), loops 4 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SQLTable._harmonize_columns (cognitive 18) pandas/io/sql.py:1358— SQLTable._harmonize_columns has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 5, error handling 2 (5 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hist.hist_frame (cognitive 18) pandas/plotting/_matplotlib/hist.py:499— hist.hist_frame has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tools._get_layout (cognitive 18) pandas/plotting/_matplotlib/tools.py:91— tools._get_layout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
var_.grouped_var (cognitive 17) pandas/core/_numba/kernels/var_.py:172— var_.grouped_var has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
take._take_2d_multi_object (cognitive 17) pandas/core/array_algos/take.py:547— take._take_2d_multi_object has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IntervalArray.astype (cognitive 17) pandas/core/arrays/interval.py:939— IntervalArray.astype has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 3 (6 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.
period._get_ordinal_range (cognitive 17) pandas/core/arrays/period.py:1567— period._get_ordinal_range has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SparseArray.__array__ (cognitive 17) pandas/core/arrays/sparse/array.py:921— SparseArray.__array__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseStringArray._str_map_nan_semantics (cognitive 17) pandas/core/arrays/string_.py:559— BaseStringArray._str_map_nan_semantics 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.
expressions._can_use_numexpr (cognitive 17) pandas/core/computation/expressions.py:97— expressions._can_use_numexpr has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (3 pts), boolean chains 2, 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.
astype._astype_nansafe (cognitive 17) pandas/core/dtypes/astype.py:66— astype._astype_nansafe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cast.maybe_cast_to_integer_array (cognitive 17) pandas/core/dtypes/cast.py:1543— cast.maybe_cast_to_integer_array 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.
NDFrame.sort_index (cognitive 17) pandas/core/generic.py:5263— NDFrame.sort_index has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (17 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NDFrame.interpolate (cognitive 17) pandas/core/generic.py:8241— NDFrame.interpolate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index._check_indexing_method (cognitive 17) pandas/core/indexes/base.py:4058— Index._check_indexing_method has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (17 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.
Index.slice_locs (cognitive 17) pandas/core/indexes/base.py:7370— Index.slice_locs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 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.
Index.min (cognitive 17) pandas/core/indexes/base.py:8113— Index.min has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Index.max) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Index.max (cognitive 17) pandas/core/indexes/base.py:8192— Index.max has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Index.min) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
base.maybe_sequence_to_range (cognitive 17) pandas/core/indexes/base.py:8302— base.maybe_sequence_to_range has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, 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.
TimedeltaIndex._get_arith_result_freq (cognitive 17) pandas/core/indexes/timedeltas.py:811— TimedeltaIndex._get_arith_result_freq has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
timedeltas.timedelta_range (cognitive 17) pandas/core/indexes/timedeltas.py:937— timedeltas.timedelta_range 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.
_iLocIndexer._decide_split_path (cognitive 17) pandas/core/indexing.py:2481— _iLocIndexer._decide_split_path has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nanops.nansum (cognitive 17) pandas/core/nanops.py:784— nanops.nansum has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 1 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_MergeOperation._validate_validate_kwd (cognitive 17) pandas/core/reshape/merge.py:1973— _MergeOperation._validate_validate_kwd has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pivot._normalize (cognitive 17) pandas/core/reshape/pivot.py:1210— pivot._normalize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (4 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.
Series.case_when (cognitive 17) pandas/core/series.py:6733— Series.case_when has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (4 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.
sorting.get_group_index (cognitive 17) pandas/core/sorting.py:126— sorting.get_group_index has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StringMethods.match (cognitive 17) pandas/core/strings/accessor.py:1556— StringMethods.match has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 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.
datetimes.should_cache (cognitive 17) pandas/core/tools/datetimes.py:172— datetimes.should_cache has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Rolling._validate (cognitive 17) pandas/core/window/rolling.py:2005— Rolling._validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 2 (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.
ODFReader._get_cell_string_value (cognitive 17) pandas/io/excel/_odfreader.py:231— ODFReader._get_cell_string_value has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
_GenericArrayFormatter._format_strings (cognitive 17) pandas/io/formats/format.py:1250— _GenericArrayFormatter._format_strings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StylerRenderer._render_typst (cognitive 17) REDACTED:255— StylerRenderer._render_typst has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParserBase._clean_index_names (cognitive 17) pandas/io/parsers/base_parser.py:747— ParserBase._clean_index_names has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
readers._clean_na_values (cognitive 17) pandas/io/parsers/readers.py:3344— readers._clean_na_values has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppendableTable.write_data (cognitive 17) pandas/io/pytables.py:5524— AppendableTable.write_data has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (6 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StataWriter._prepare_categoricals (cognitive 17) pandas/io/stata.py:2637— StataWriter._prepare_categoricals has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitHubClient.open_pr_authors_exact (cognitive 17) scripts/issue_assignment/client.py:366— GitHubClient.open_pr_authors_exact has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
unassign_inactive.run_sweep (cognitive 17) scripts/issue_assignment/unassign_inactive.py:52— unassign_inactive.run_sweep has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
asserters.assert_almost_equal (cognitive 16) pandas/_testing/asserters.py:81— asserters.assert_almost_equal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
algorithms.map_array (cognitive 16) pandas/core/algorithms.py:1966— algorithms.map_array has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Apply.transform (cognitive 16) pandas/core/apply.py:362— Apply.transform has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ArrowExtensionArray.factorize (cognitive 16) pandas/core/arrays/arrow/array.py:2138— ArrowExtensionArray.factorize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, 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.
ArrowExtensionArray._validate_setitem_value (cognitive 16) pandas/core/arrays/arrow/array.py:3469— ArrowExtensionArray._validate_setitem_value has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExtensionArray._groupby_op (cognitive 16) pandas/core/arrays/base.py:3186— ExtensionArray._groupby_op has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseMaskedArray.__array_ufunc__ (cognitive 16) pandas/core/arrays/masked.py:890— BaseMaskedArray.__array_ufunc__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseMaskedArray._reduce (cognitive 16) pandas/core/arrays/masked.py:1759— BaseMaskedArray._reduce has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PeriodArray.to_timestamp (cognitive 16) pandas/core/arrays/period.py:964— PeriodArray.to_timestamp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 2 (6 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.
SparseArray._cmp_or_logical_op (cognitive 16) pandas/core/arrays/sparse/array.py:2970— SparseArray._cmp_or_logical_op has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
common.is_bool_indexer (cognitive 16) pandas/core/common.py:112— common.is_bool_indexer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 1 (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.
BaseExprVisitor.visit_Compare (cognitive 16) pandas/core/computation/expr.py:736— BaseExprVisitor.visit_Compare has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (8 pts), if/else 3 (6 pts), boolean chains 1, loops 1 (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.
construction._try_cast (cognitive 16) pandas/core/construction.py:877— construction._try_cast has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 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.
concat.union_categoricals (cognitive 16) pandas/core/dtypes/concat.py:231— concat.union_categoricals has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 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.
DataFrame.from_dict (cognitive 16) pandas/core/frame.py:1693— DataFrame.from_dict has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeriesGroupBy.aggregate (cognitive 16) pandas/core/groupby/generic.py:352— SeriesGroupBy.aggregate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataFrameGroupBy.aggregate (cognitive 16) pandas/core/groupby/generic.py:2130— DataFrameGroupBy.aggregate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GroupBy.size (cognitive 16) pandas/core/groupby/groupby.py:2677— GroupBy.size has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
utils.check_array_indexer (cognitive 16) pandas/core/indexers/utils.py:443— utils.check_array_indexer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), 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.
Index.take (cognitive 16) pandas/core/indexes/base.py:1228— Index.take 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, 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.
Index.insert (cognitive 16) pandas/core/indexes/base.py:7532— Index.insert has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiIndex._union (cognitive 16) pandas/core/indexes/multi.py:4675— MultiIndex._union has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TimedeltaIndex.__new__ (cognitive 16) pandas/core/indexes/timedeltas.py:708— TimedeltaIndex.__new__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, 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.
Block._replace_regex (cognitive 16) pandas/core/internals/blocks.py:764— Block._replace_regex has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Block.setitem (cognitive 16) pandas/core/internals/blocks.py:1180— Block.setitem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, error handling 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
managers._form_blocks (cognitive 16) pandas/core/internals/managers.py:2445— managers._form_blocks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 1 (2 pts), loops 2, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
missing.mask_missing (cognitive 16) pandas/core/missing.py:84— missing.mask_missing has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
missing._interpolate_scipy_wrapper (cognitive 16) pandas/core/missing.py:613— missing._interpolate_scipy_wrapper has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nanops.nanvar (cognitive 16) pandas/core/nanops.py:1286— nanops.nanvar has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 3 (5 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
array_ops.comparison_op (cognitive 16) pandas/core/ops/array_ops.py:318— array_ops.comparison_op has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
concat._get_sample_object (cognitive 16) pandas/core/reshape/concat.py:893— concat._get_sample_object has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
common.mangle_dupe_names (cognitive 16) REDACTED:1416— common.mangle_dupe_names has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CSSResolver.size_to_pt (cognitive 16) pandas/io/formats/css.py:379— CSSResolver.size_to_pt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 2 (4 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CSSToExcelConverter._border_style (cognitive 16) pandas/io/formats/excel.py:293— CSSToExcelConverter._border_style has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StylerRenderer._translate (cognitive 16) REDACTED:329— StylerRenderer._translate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StylerRenderer._generate_col_header_row (cognitive 16) REDACTED:516— StylerRenderer._generate_col_header_row has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 4 (5 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
style_render._parse_latex_css_conversion (cognitive 16) REDACTED:2577— style_render._parse_latex_css_conversion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 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.
PythonParser._cast_types (cognitive 16) pandas/io/parsers/python_parser.py:483— PythonParser._cast_types has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 2 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenericFixed.read_index_node (cognitive 16) pandas/io/pytables.py:3832— GenericFixed.read_index_node has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, error handling 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.
SQLTable._sqlalchemy_type (cognitive 16) pandas/io/sql.py:1419— SQLTable._sqlalchemy_type has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sql._handle_date_column (cognitive 16) pandas/io/sql.py:135— sql._handle_date_column 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.
StataReader._read_strls (cognitive 16) pandas/io/stata.py:1611— StataReader._read_strls has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TimeSeries_DateFormatter.__call__ (cognitive 16) pandas/plotting/_matplotlib/converter.py:1197— TimeSeries_DateFormatter.__call__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MPLPlot._get_errorbars (cognitive 16) pandas/plotting/_matplotlib/core.py:1274— MPLPlot._get_errorbars has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PiePlot._make_plot (cognitive 16) pandas/plotting/_matplotlib/core.py:2400— PiePlot._make_plot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_min_versions_in_sync._get_required_dependencies_from_pixi_content (cognitive 16) scripts/validate_min_versions_in_sync.py:259— validate_min_versions_in_sync._get_required_dependencies_from_pixi_content has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_unwanted_patterns.bare_pipe_alternation_in_message (cognitive 16) scripts/validate_unwanted_patterns.py:448— validate_unwanted_patterns.bare_pipe_alternation_in_message has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) pandas/core/frame.py:1095— pandas/core/frame.py:1095-1213 | pandas/core/frame.py:3234-3429 | pandas/core/frame.py:3495-3706 | pandas/core/generic.py:3898-4087 | pandas/io/excel/_base.py:203-563 | pandas/io/html.py:1054-1264 | pandas/io/json/_json.py:660-1020 | REDACTED:884-1225 — These 8 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 8 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 8 times.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) pandas/core/arrays/arrow/array.py:1220— pandas/core/arrays/arrow/array.py:1220-1279 | pandas/core/arrays/base.py:3113-3138 | pandas/core/arrays/categorical.py:1980-2005 | pandas/core/arrays/masked.py:896-971 | pandas/core/arrays/numpy_.py:263-322 | pandas/core/indexes/base.py:968-1009 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) pandas/core/groupby/generic.py:4132— pandas/core/groupby/generic.py:4132-4241 | pandas/io/excel/_base.py:766-841 | pandas/io/excel/_base.py:1759-1933 | pandas/plotting/_core.py:172-279 | pandas/plotting/_matplotlib/hist.py:517-585 — 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.
Duplicated block (507–515 lines × 2) pandas/io/parsers/readers.py:1446— pandas/io/parsers/readers.py:1446-1960 | pandas/io/parsers/readers.py:2061-2567 — both copies are in the same file, so extract the 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 `pandas/io/parsers/readers.py:1446` 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 (162–163 lines × 2) pandas/core/generic.py:10632— pandas/core/generic.py:10632-10794 | pandas/core/generic.py:10807-10968 — both copies are in the same file, so extract the 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 (92–100 lines × 2) pandas/core/generic.py:7529— pandas/core/generic.py:7529-7620 | pandas/core/generic.py:7631-7730 — both copies are in the same file, so extract the 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 (79 lines × 2) pandas/core/frame.py:19361— pandas/core/frame.py:19361-19439 | pandas/core/frame.py:19460-19538 — both copies are in the same file, so extract the 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 `pandas/core/frame.py:19361` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (68–70 lines × 2) pandas/core/window/ewm.py:826— pandas/core/window/ewm.py:826-895 | pandas/core/window/ewm.py:921-988 — both copies are in the same file, so extract the 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 (35–59 lines × 2) pandas/core/arrays/_mixins.py:452— pandas/core/arrays/_mixins.py:452-486 | pandas/core/arrays/base.py:1454-1512 — 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 (39 lines × 2) pandas/core/groupby/numba_.py:72— pandas/core/groupby/numba_.py:72-110 | pandas/core/groupby/numba_.py:129-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `func` to `Callable[..., Scalar]` in one and `Callable[..., np.ndarray]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (37 lines × 2) pandas/core/series.py:3029— pandas/core/series.py:3029-3104 | pandas/core/series.py:3126-3162 — both copies are in the same file, so extract the 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 (32 lines × 2) pandas/core/window/numba_.py:88— pandas/core/window/numba_.py:88-119 | pandas/core/window/numba_.py:270-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pandas/core/window/numba_.py:120` calls `empty` and `pandas/core/window/numba_.py:302` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (25–29 lines × 2) pandas/io/stata.py:3063— pandas/io/stata.py:3063-3091 | pandas/io/stata.py:3610-3634 — both copies are in the same file, so extract the 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 `pandas/io/stata.py:3063` 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 (28 lines × 2) pandas/core/indexes/base.py:1288— pandas/core/indexes/base.py:1288-1315 | pandas/core/indexes/range.py:1635-1662 — 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 (19–26 lines × 2) pandas/core/arrays/arrow/array.py:1229— pandas/core/arrays/arrow/array.py:1229-1254 | pandas/core/arrays/base.py:3113-3131 — 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 (23 lines × 2) pandas/core/window/rolling.py:1918— pandas/core/window/rolling.py:1918-1940 | pandas/core/window/rolling.py:1958-1980 — both copies are in the same file, so extract the 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–20 lines × 2) pandas/core/arrays/datetimelike.py:1368— pandas/core/arrays/datetimelike.py:1368-1387 | pandas/core/arrays/datetimelike.py:1443-1456 — both copies are in the same file, so extract the 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 `pandas/core/arrays/datetimelike.py:1368` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17–19 lines × 6) pandas/core/arrays/arrow/array.py:1243— pandas/core/arrays/arrow/array.py:1243-1259 | pandas/core/arrays/base.py:3120-3136 | pandas/core/arrays/categorical.py:1980-1998 | pandas/core/arrays/masked.py:905-922 | pandas/core/arrays/numpy_.py:267-285 | pandas/core/indexes/base.py:975-992 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `method` to `str` in one and `str_t` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pandas/core/arrays/masked.py:901` calls `isinstance` and `pandas/core/arrays/numpy_.py:265` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19 lines × 2) pandas/core/reshape/merge.py:1772— pandas/core/reshape/merge.py:1772-1790 | pandas/core/reshape/merge.py:1794-1812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 5) pandas/core/groupby/generic.py:4225— pandas/core/groupby/generic.py:4225-4240 | pandas/io/excel/_base.py:818-833 | pandas/io/excel/_base.py:1918-1933 | pandas/plotting/_core.py:264-279 | pandas/plotting/_matplotlib/hist.py:527-542 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `pandas/core/groupby/generic.py:4225` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) pandas/io/excel/_openpyxl.py:537— pandas/io/excel/_openpyxl.py:537-551 | pandas/io/excel/_openpyxl.py:605-620 — both copies are in the same file, so extract the 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 `pandas/io/excel/_openpyxl.py:605` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 8) pandas/core/frame.py:1194— pandas/core/frame.py:1194-1208 | pandas/core/frame.py:3405-3419 | pandas/core/frame.py:3690-3704 | pandas/core/generic.py:4073-4087 | pandas/io/excel/_base.py:544-558 | pandas/io/html.py:1250-1264 | pandas/io/json/_json.py:1001-1015 | REDACTED:1211-1225 — there are 8 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `pandas/core/frame.py:1194` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) pandas/core/_numba/kernels/mean_.py:88— pandas/core/_numba/kernels/mean_.py:88-102 | pandas/core/_numba/kernels/sum_.py:92-106 | pandas/core/_numba/kernels/var_.py:97-111 — before extracting anything, compare `pandas/core/_numba/kernels/sum_.py` and `pandas/core/_numba/kernels/var_.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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 `pandas/core/_numba/kernels/mean_.py:88` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `sum_x` to `float` in one and `Any` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13–15 lines × 2) REDACTED:379— REDACTED:379-393 | REDACTED:477-489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:379` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: `SubElement` names `lxml.etree` in one and `xml.etree.ElementTree` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14–15 lines × 2) pandas/plotting/_matplotlib/converter.py:929— pandas/plotting/_matplotlib/converter.py:929-943 | pandas/plotting/_matplotlib/converter.py:1001-1014 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pandas/plotting/_matplotlib/converter.py:999` calls `nonzero` and `pandas/plotting/_matplotlib/converter.py:927` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–15 lines × 2) REDACTED:179— REDACTED:179-193 | REDACTED:344-354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) pandas/core/arrays/masked.py:1133— pandas/core/arrays/masked.py:1133-1144 | pandas/core/arrays/sparse/array.py:2927-2939 — 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. Note first that the copies are not typed on the same thing: `ExtensionArray` names `pandas.core.arrays` in one and `pandas.core.arrays.base` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11–13 lines × 2) REDACTED:4405— REDACTED:4405-4417 | REDACTED:4418-4428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4405` 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–12 lines × 3) pandas/core/internals/blocks.py:1372— pandas/core/internals/blocks.py:1372-1382 | pandas/core/internals/blocks.py:1913-1924 | pandas/core/internals/blocks.py:1991-2002 — 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 `pandas/core/internals/blocks.py:1372` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–12 lines × 2) pandas/core/indexes/datetimes.py:101— pandas/core/indexes/datetimes.py:101-112 | pandas/core/indexes/timedeltas.py:83-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10–12 lines × 2) pandas/core/reshape/concat.py:752— pandas/core/reshape/concat.py:752-761 | pandas/core/reshape/concat.py:803-814 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10–11 lines × 2) pandas/core/arrays/base.py:1648— pandas/core/arrays/base.py:1648-1657 | pandas/core/arrays/sparse/array.py:1310-1320 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8–10 lines × 2) pandas/plotting/_matplotlib/converter.py:912— pandas/plotting/_matplotlib/converter.py:912-921 | pandas/plotting/_matplotlib/converter.py:986-993 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) pandas/tseries/frequencies.py:542— pandas/tseries/frequencies.py:542-550 | pandas/tseries/frequencies.py:605-612 — both copies are in the same file, so extract the 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 `pandas/tseries/frequencies.py:542` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6–8 lines × 2) pandas/core/reshape/merge.py:1753— pandas/core/reshape/merge.py:1753-1760 | pandas/core/reshape/merge.py:1762-1767 — both copies are in the same file, so extract the 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 `pandas/core/reshape/merge.py:1753` 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–8 lines × 2) pandas/core/window/numba_.py:310— pandas/core/window/numba_.py:310-316 | pandas/core/window/online.py:62-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 4) pandas/core/strings/accessor.py:941— pandas/core/strings/accessor.py:941-947 | pandas/core/strings/accessor.py:1078-1084 | pandas/core/strings/accessor.py:1170-1176 | pandas/core/strings/accessor.py:1262-1268 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 3) pandas/plotting/_matplotlib/converter.py:916— pandas/plotting/_matplotlib/converter.py:916-922 | pandas/plotting/_matplotlib/converter.py:989-994 | pandas/plotting/_matplotlib/converter.py:1038-1043 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 2) pandas/core/arrays/base.py:627— pandas/core/arrays/base.py:627-632 | pandas/core/dtypes/base.py:178-183 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (107 lines × 2) pandas/core/frame.py:9480— pandas/core/frame.py:9480-9586 | pandas/core/series.py:4330-4470 — 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 (40 lines × 2) pandas/core/indexes/datetimes.py:975— pandas/core/indexes/datetimes.py:975-1018 | pandas/core/indexes/timedeltas.py:623-662 — 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 (33 lines × 2) pandas/core/indexes/datetimes.py:1024— pandas/core/indexes/datetimes.py:1024-1067 | pandas/core/indexes/period.py:279-311 — 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (74 lines × 2) pandas/core/window/expanding.py:263— pandas/core/window/expanding.py:263-336 | pandas/core/window/rolling.py:2213-2318 — 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.
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.
Third-party script without Subresource Integrity REDACTED:4— `https://views.scientific-python.org/js/script.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. The URL also names no version, so it resolves to whatever that origin serves at fetch time — the executed bytes can change with nobody touching this repository.
Duplicated predicate pandas/io/excel/_odswriter.py:186— `cell.mergestart is not None and cell.mergeend is not None` appears character-identically in 3 files — pandas/io/excel/_odswriter.py, pandas/io/excel/_openpyxl.py, pandas/io/excel/_xlsxwriter.py. 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 pandas/io/excel/_openpyxl.py:749— `converted_row and converted_row[-1] == ""` appears character-identically in 2 files — pandas/io/excel/_openpyxl.py, pandas/io/excel/_pyxlsb.py. 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 pandas/core/indexes/base.py:5601— `dtype is None or astype_is_view(data.dtype, pandas_dtype(dtype))` appears character-identically in 2 files — pandas/core/indexes/base.py, pandas/core/series.py. 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 pandas/core/generic.py:525— `dtype.kind == "V" and not isinstance(dtype, ExtensionDtype)` appears character-identically in 2 files — pandas/core/generic.py, pandas/core/indexes/base.py. 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 pandas/io/excel/_openpyxl.py:755— `file_rows_needed is not None and len(data) >= file_rows_needed` appears character-identically in 2 files — pandas/io/excel/_openpyxl.py, pandas/io/excel/_pyxlsb.py. 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 pandas/core/indexes/datetimes.py:2725— `freq is None and com.any_none(periods, start, end)` appears character-identically in 3 files — pandas/core/indexes/datetimes.py, pandas/core/indexes/interval.py, pandas/core/indexes/timedeltas.py. 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 pandas/core/frame.py:7616— `freq is not None and fill_value is not lib.no_default` appears character-identically in 2 files — pandas/core/frame.py, pandas/core/generic.py. 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 pandas/core/frame.py:1675— `hasattr(data, "__arrow_c_array__") or hasattr(data, "__arrow_c_stream__")` appears character-identically in 2 files — pandas/core/frame.py, pandas/core/series.py. 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 pandas/core/_numba/kernels/mean_.py:91— `i == 0 or not is_monotonic_increasing_bounds` appears character-identically in 3 files — pandas/core/_numba/kernels/mean_.py, pandas/core/_numba/kernels/sum_.py, pandas/core/_numba/kernels/var_.py. 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 pandas/core/indexes/base.py:1327— `indices.ndim == 1 and lib.is_range_indexer(indices, len(self))` appears character-identically in 2 files — pandas/core/indexes/base.py, pandas/core/indexes/multi.py. 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 pandas/core/frame.py:14919— `is_float(periods) and periods.is_integer()` appears character-identically in 2 files — pandas/core/frame.py, pandas/core/series.py. 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 pandas/core/arrays/masked.py:1008— `is_list_like(other) and not isinstance(other, (list, np.ndarray, ExtensionArray)) and not ops.has_castable_attr(other)` appears character-identically in 2 files — pandas/core/arrays/masked.py, pandas/core/arrays/sparse/array.py. 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 pandas/core/_numba/kernels/mean_.py:82— `is_monotonic_increasing( start ) and is_monotonic_increasing(end)` appears character-identically in 3 files — pandas/core/_numba/kernels/mean_.py, pandas/core/_numba/kernels/sum_.py, pandas/core/_numba/kernels/var_.py. 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 pandas/io/parsers/base_parser.py:371— `isinstance(col, int) and col not in self.orig_names` appears character-identically in 2 files — pandas/io/parsers/base_parser.py, pandas/io/parsers/python_parser.py. 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 pandas/core/construction.py:369— `isinstance(data, np.ndarray) and data.dtype.names is not None` appears character-identically in 2 files — pandas/core/construction.py, pandas/core/internals/construction.py. 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 pandas/core/arrays/categorical.py:835— `isinstance(dtype, CategoricalDtype) and dtype.categories is not None` appears character-identically in 2 files — pandas/core/arrays/categorical.py, pandas/core/ops/invalid.py. 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 pandas/core/arrays/string_.py:765— `isinstance(dtype, str) and dtype == "string"` appears character-identically in 2 files — pandas/core/arrays/string_.py, pandas/core/arrays/string_arrow.py. 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 pandas/core/arrays/arrow/array.py:3207— `isinstance(key, tuple) and len(key) == 1` appears character-identically in 2 files — pandas/core/arrays/arrow/array.py, pandas/core/indexing.py. 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 pandas/core/groupby/groupby.py:742— `isinstance(keys, list) and len(keys) == 1` appears character-identically in 2 files — pandas/core/groupby/groupby.py, pandas/plotting/_matplotlib/misc.py. 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 pandas/_testing/__init__.py:527— `isinstance(left, np.ndarray) and isinstance(right, np.ndarray)` appears character-identically in 2 files — pandas/_testing/__init__.py, pandas/_testing/asserters.py. 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 pandas/_testing/asserters.py:337— `isinstance(left.dtype, CategoricalDtype) and isinstance( right.dtype, CategoricalDtype )` appears character-identically in 2 files — pandas/_testing/asserters.py, pandas/core/reshape/merge.py. 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 pandas/core/arrays/boolean.py:246— `isinstance(mask, np.ndarray) and mask.dtype == np.bool_` appears character-identically in 2 files — pandas/core/arrays/boolean.py, pandas/core/arrays/masked.py. 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 pandas/core/arrays/_arrow_string_mixins.py:366— `isinstance(repl, str) and r"\g<" in repl` appears character-identically in 3 files — pandas/core/arrays/_arrow_string_mixins.py, pandas/core/arrays/arrow/array.py, pandas/core/arrays/string_arrow.py. 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 pandas/core/arrays/base.py:628— `isinstance(state, dict) and "_cache" in state` appears character-identically in 2 files — pandas/core/arrays/base.py, pandas/core/dtypes/base.py. 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 pandas/core/computation/expr.py:676— `isinstance(value, ast.Name) and value.id == attr` appears character-identically in 2 files — pandas/core/computation/expr.py, pandas/core/computation/pytables.py. 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.
Orphaned file pandas/core/_numba/extensions.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pandas/core/interchange/dataframe_protocol.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file asv_bench/benchmarks/strings.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pandas/core/ops/mask_ops.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file scripts/check_test_naming.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pandas/plotting/_matplotlib/groupby.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file scripts/check_for_inconsistent_pandas_namespace.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file asv_bench/benchmarks/array.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pandas/core/interchange/dataframe.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file scripts/validate_exception_location.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file asv_bench/benchmarks/strftime.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pandas/core/interchange/buffer.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pandas/io/spss.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file asv_bench/benchmarks/io/style.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file asv_bench/benchmarks/io/excel.py:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file scripts/sort_whatsnew_note.py: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.
Classify ADR enforcement: PDEP-1: Purpose and guidelines web/pandas/pdeps/0001-purpose-and-guidelines.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: PDEP-4: Consistent datetime parsing web/pandas/pdeps/0004-consistent-to-datetime-parsing.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: PDEP-5: NoRowIndex web/pandas/pdeps/0005-no-default-index-mode.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: PDEP-6: Ban upcasting in setitem-like operations web/pandas/pdeps/0006-ban-upcasting.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: PDEP-7: Consistent copy/view semantics in pandas with Copy-on-Write web/pandas/pdeps/0007-copy-on-write.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: PDEP-8: In-place methods in pandas web/pandas/pdeps/0008-inplace-methods-in-pandas.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: PDEP-9: Allow third-party projects to register pandas connectors with a standard API web/pandas/pdeps/0009-io-extensions.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: PDEP-10: PyArrow as a required dependency for default string inference implementation web/pandas/pdeps/0010-required-pyarrow-dependency.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: PDEP-12: Compact and reversible JSON interface web/pandas/pdeps/0012-compact-and-reversible-JSON-interface.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: PDEP-14: Dedicated string data type for pandas 3.0 web/pandas/pdeps/0014-string-dtype.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: PDEP-17: Backwards compatibility and deprecation policy web/pandas/pdeps/0017-backwards-compatibility-and-deprecation-policy.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 19 significant file(s) lose their only recent owner: pandas/io/clipboard/__init__.py, pandas/core/array_algos/take.py, asv_bench/benchmarks/rolling.py, pandas/io/sas/sas_constants.py, asv_bench/benchmarks/algos/isin.py, pandas/core/computation/scope.py, pandas/core/arrays/_ranges.py, asv_bench/benchmarks/inference.py (+11 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: scripts/issue_assignment/client.py, scripts/issue_assignment/core.py, scripts/issue_assignment/messages.py, scripts/issue_assignment/label_awaiting_review.py. Pair on, review, or document these before any departure.
Silent fallback default on parse failure pandas/core/dtypes/common.py:707— `condition` (in `is_string_dtype`) returns `False` when `TypeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure scripts/validate_unwanted_patterns.py:83— `_get_literal_string_prefix_len` returns `0` when `ValueError` 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 handler or in the docstring, and the row stops firing.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 6 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 (29 single-owned of 282 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; 282 of the 380 production source files in this repository met that bar). They are anonymized user #3 (1 file(s)), anonymized user #4 (1 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)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: pandas/plotting/_matplotlib/tools.py, asv_bench/benchmarks/reshape.py, asv_bench/benchmarks/index_object.py, asv_bench/benchmarks/stat_ops.py, pandas/core/arrays/arrow/extension_types.py, pandas/api/typing/aliases.py.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (248399 LoC, 1199 module-visible types across 53 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
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 16 of 282 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; 282 of the 380 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: pandas/core/_numba/extensions.py, pandas/core/interchange/dataframe_protocol.py, asv_bench/benchmarks/strings.py, pandas/core/ops/mask_ops.py, scripts/check_test_naming.py, pandas/plotting/_matplotlib/groupby.py, scripts/check_for_inconsistent_pandas_namespace.py, asv_bench/benchmarks/array.py (and 8 more). 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.
No src/ separation — Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
Silent fallback default in catch pandas/plotting/_matplotlib/core.py:1824— `get_label` (in `_post_plot_logic`) swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Dependency hygiene PARTLY measured — Python dependencies read, no exact pin to grade for currency — This repository's Python dependencies were read: 3 shipped distribution(s) across 2 manifest(s) (84 development or optional declaration(s) excluded, because a consumer does not install them). Whether any of them is behind its current release is the dependency-CURRENCY question, and no declaration here carries an EXACT pin to ask it about — every one is a floor or a range, which installs the newest release it admits and therefore cannot be behind one. That is a healthy declaration style, NOT a defect and NOT a gap in this analyzer; there is simply no currency question to answer. This is NOT a finding that these dependencies are current or healthy. Lockfiles are deliberately not read (poetry.lock, uv.lock, Pipfile.lock, pdm.lock): the four disagree about dev/optional membership, and misreading one would charge a test-only package a consumer never receives. Known CVEs in the same dependency graph are a separate question, reported under D30.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
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 01a17f21-aec6-7d12-8995-3fa298a272d4 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 21 · Warnings: 1776 · Recommendations: 67 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 27-10-2026 @ 20:51 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.