Public report — yii2, published 5 Aug 2026.
Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version;
ask the repo owner for the full report.
348findings with an exact file:lineof 355 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
33/106dimensions across the health lenses109086 LoC — wide & deep
Executive summary
Read through the Production lens — the standard calibration. *Green* means good enough to run in production. The score is absolute and comparable across repos.
yiisoft/yii2 is sound in substance but carries real gaps (59%). It is not in crisis, but the issues below raise the cost of changing it — friction its consumers ultimately inherit.
It is strongest in Architecture (100%) — the structure is clean and changes stay contained. Security (97%) is solid too.
The area that most needs attention is Code Health (42%) — changes there are slower and more error-prone. Maturity (65%) is the next concern — onboarding is slow — key decisions and the architecture aren't written down, so contributors have to reverse-engineer the intent.
Leadership focus, highest impact first: TypeScript for the frontend (Type Safety); each oversized file along the responsibilities already in it (Large Files); Record significant decisions one document per decision (Architecture documentation).
For scale: Large (~109,086 production lines); rebuilding it from scratch would take roughly ~1.4 person-years (~1–3 engineers). Approximate, ±~30%.
It builds on a genuinely strong Architecture foundation (100%); the priorities above are the highest-leverage way to bring the rest up to that level.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
0.8× (at 59% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~1.4 person-years of build effort (about ~€200,000 to rebuild). Its weakest lens is Code Health at 42% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.8× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~1.4 person-years to rebuild), and its weakest lens is Code Health at 42%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Code Health first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 1.4–8.3 engineer-days every year, paid as drag on the ~21,052 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 4–87 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 3–6% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 5,191 line(s) changed over a 90-day window ⇒ ~21,052/year · D1/D2/D4 code quality: averaging 6.9/10 ⇒ a 3–6% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 87 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.9/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 3–6% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 6.9/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency matrix
36 modules, 47 dependencies — 1 dependency cycle, shown as the red cell(s) above the diagonal. Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
At a glance — Code Health · 42% · Weak · gated by R1, R3
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:2021 — Security Misconfiguration
5
Medium
A03:2021 — Injection
1
Medium
Roadmap
Begin by adopting TypeScript for the frontend, starting with a typecheck step and converting the highest-traffic modules first. Next, split the three largest files into smaller, focused modules to improve maintainability. Then, establish architecture decision records in a dedicated directory to document significant design choices. Finally, update the root README with a quick-start section and stamp versions in the build manifest to ensure traceable releases.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.
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. 32 of 33 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 1 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.6 — 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 — 33 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, 348 of 355 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.
D19 Documentation Quality — LLM provider failed — The model provider returned an unusable result, so this LLM-assisted dimension fell back to a measurement gap (confidence 0) rather than a penalty. Re-run with a reachable provider to score it.
D30 Dependency Vulnerabilities — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.
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 (jscpd) — 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.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
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.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
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").
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D33 JS/npm Dependency Vulnerabilities: JS/npm CVE matching reads package manifests and lockfiles — risk from how a dependency is used, and advisories not yet published, fall outside this scan.
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.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
The LLM boundary
LLM-set scores this run (2): D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
+ 59 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 MessageFormatter.parseToken (cyclomatic 42) finding(s) in Cyclomatic Complexity — start with MessageFormatter.php. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Container.resolveCallableDependencies (cyclomatic 33) finding(s) in Cyclomatic Complexity — start with Container.php. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 UrlRule.createUrl (cyclomatic 31) finding(s) in Cyclomatic Complexity — start with UrlRule.php. — One of this dimension's main actionable groups (1 warning-level).
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.
+ 168 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 Schema.loadColumnSchema (cognitive 40) finding(s) in Cognitive Complexity — start with Schema.php (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 InConditionBuilder.buildCompositeInCondition (cognitive 26) finding(s) in Cognitive Complexity — start with InConditionBuilder.php (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 MessageController.extractMessagesFromTokens (cognitive 81) finding(s) in Cognitive Complexity — start with MessageController.php. — One of this dimension's main actionable groups (1 warning-level).
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 Classes9.2 / 10Exemplary✓ 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.
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.
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: 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.
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.9 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
3 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is framework/base/Controller.php.
Off-boarding risk: anonymized user #1
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.
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.
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).
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.
115 of 257 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is framework/views/errorHandler/exception.php.
Resolve the 11 Orphaned knowledge finding(s) in Knowledge Freshness — start with exception.php, BaseConsole.php, ActiveField.php. — One of this dimension's main actionable groups (11 issue-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling; coupling through a build step, config, or non-source file isn't seen.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether dependencies have known published vulnerabilities (CVEs) per the OSV database — read natively from whatever lockfile the repository ships (Cargo, npm, Go, Python, Maven, RubyGems, …). D33 and D30 add ecosystem-specific scanners on top for npm and .NET.
Method: Multi-ecosystem dependency-CVE scan via osv-scanner --recursive (queries the osv.dev database + parses lockfiles natively across ecosystems: npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven/Gradle pom.xml/gradle.lockfile, PyPI requirements.txt/poetry.lock/Pipfile.lock, Composer composer.lock, RubyGems Gemfile.lock, Hex mix.lock, pub pubspec.lock, Swift Package.resolved); severity tally (Critical/High/Medium/Low) to 0-10 tight normalizer (8.0). NotApplicable only when the repo declares no supported non-.NET dependency lockfile (a NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain); coverage needs a resolved lockfile. Additive to D33 (trivy fs); exhaustive + deterministic, DB kept fresh.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
Add a 'Testing' section to the root README — how to run the test suite.
Add a README to the 1 of 2 project(s) that lack one — worth up to 1 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no `NNNN-title.md` documents and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
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.
What to do
Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
0 typed · 10 plain JS — the untyped files are framework/assets/yii.activeForm.js, framework/assets/yii.captcha.js, framework/assets/yii.gridView.js, framework/assets/yii.js, framework/assets/yii.validation.js, tests/js/tests/yii.activeForm.test.js (+4 more).
What to do
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
React / JS · Code Health — Copy-pasted token-identical blocks across the frontend (the D4 clone algorithm over JS/TS tokens, D-386).
Method: Copy-pasted token-identical blocks across the frontend (the D4 clone algorithm run over JS/TS tokens). Deterministic.
framework/assets/yii.captcha.js:16 · framework/assets/yii.gridView.js:16 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — yii.captcha.js:16
framework/assets/yii.validation.js:47 · framework/assets/yii.validation.js:209 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — yii.validation.js:47
framework/assets/yii.validation.js:133 · framework/assets/yii.validation.js:163 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — yii.validation.js:133
framework/assets/yii.validation.js:207 · framework/assets/yii.validation.js:329 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — yii.validation.js:207
framework/assets/yii.validation.js:365 · framework/assets/yii.validation.js:372 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — yii.validation.js:365
framework/assets/yii.validation.js:445 · framework/assets/yii.validation.js:475 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — yii.validation.js:445
framework/assets/yii.activeForm.js:12 · framework/assets/yii.captcha.js:12 · framework/assets/yii.gridView.js:12 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — yii.activeForm.js:12
What to do
Extract the duplicated blocks into shared functions/components.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
Branch-heavy code is where defects cluster — extract decisions into smaller functions. (×7) — yii.js:153, yii.activeForm.js:329, yii.validation.js:336, …
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files0.0 / 10Critical✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
3 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: framework/assets/yii.activeForm.js (852), framework/assets/yii.js (486), framework/assets/yii.validation.js (426).
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
Do you agree with this assessment?
R6 · Tooling6.7 / 10Adequate✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
test ✓ · lint ✓ · typecheck ✗
What to do
Add type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI.
Do you agree with this assessment?
R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Not included — 73 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — no DI registrations detected
AX10 Code composition — not assessed — code composition is computed by ROLE over a document set that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — no singleton implementations detected
AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository 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
AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository 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
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 — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) that was not loaded for this repository, because the repository 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
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D10 Test Quality — ~82203 lines of test source are present (.php, .js) but the test-quality collector reads C# only, 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
D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
D14 License Compliance — Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (composer.json and package.json), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D19 Documentation Quality — LLM evaluation failed
D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
D22 Internal API Consistency — No exposed public API
D23 Boundary Type-Coupling — Production source is present (.php) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. 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 — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (composer.json and package.json — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
D36 Supply-chain Provenance & Signing — The CI pipeline builds and tests but publishes no released artifact — no package publish, container push, GitHub release or deployment step. Supply-chain provenance, signing and SBOM attest RELEASED artifacts, so there is nothing to attest here. Add them to the release pipeline when this repo starts shipping artifacts (a published package, a container image, a deployed service or a tagged release).
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.
D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a C#/VB class graph, and this repository's production source is .php, which this pass does not read — so no class could be assessed. Not scored — this is a gap in the analyzer, not a finding about this repository.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
D9 Test Distribution — Test source is present (.php, .js) but the test-pyramid classifier reads C# only, so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this check looks for (5 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit))
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this check 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 check looks for
GD1 Unfinished & placeholder code — no source files
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
P8 Schema migrations — not assessed — schema-migration practice is read from 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
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (Clover XML — `vendor/bin/phpunit --coverage-clover coverage.xml`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D33 (JS/npm Dependency Vulnerabilities)
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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
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.
Orphaned knowledge framework/views/errorHandler/exception.php— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge framework/helpers/BaseConsole.php— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge framework/widgets/ActiveField.php— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge framework/console/controllers/AssetController.php— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge framework/helpers/BaseFormatConverter.php— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge framework/db/Migration.php— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge framework/caching/Cache.php— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge framework/helpers/BaseInflector.php— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge framework/db/sqlite/QueryBuilder.php— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge framework/db/ActiveRecordInterface.php— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge framework/validators/DateValidator.php— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
TooManyMethods: Request framework/web/Request.php:92— TooManyMethods — 83 methods. 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: QueryBuilder framework/db/QueryBuilder.php:37— TooManyMethods — 77 methods. 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: BaseHtml framework/helpers/BaseHtml.php:26— TooManyMethods — 74 methods. 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: BaseActiveRecord framework/db/BaseActiveRecord.php:43— TooManyMethods — 69 methods. 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: Command framework/db/Command.php:58— TooManyMethods — 61 methods. 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: Session framework/web/Session.php:78— TooManyMethods — 59 methods. 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: BaseConsole framework/helpers/BaseConsole.php:23— TooManyMethods — 54 methods. 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: Query framework/db/Query.php:52— TooManyMethods — 51 methods. 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: DbManager framework/rbac/DbManager.php:40— TooManyMethods — 49 methods. 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: PhpManager framework/rbac/PhpManager.php:38— TooManyMethods — 47 methods. 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: Formatter framework/i18n/Formatter.php:55— TooManyMethods — 46 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Model framework/base/Model.php:74— TooManyMethods — 43 methods. 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: Connection framework/db/Connection.php:139— TooManyMethods — 35 methods. 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: Migration framework/db/Migration.php:47— TooManyMethods — 35 methods. 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: DataFilter framework/data/DataFilter.php:127— TooManyMethods — 34 methods. 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: Response framework/web/Response.php:63— TooManyMethods — 33 methods. 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: Application framework/base/Application.php:48— TooManyMethods — 32 methods. 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.
Hotspot: framework/i18n/MessageFormatter.php framework/i18n/MessageFormatter.php— framework/i18n/MessageFormatter.php changed 2 times in last 90 days, max complexity 42. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: framework/db/BaseActiveRecord.php framework/db/BaseActiveRecord.php— framework/db/BaseActiveRecord.php changed 3 times in last 90 days, max complexity 23. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: framework/di/Container.php framework/di/Container.php— framework/di/Container.php changed 2 times in last 90 days, max complexity 33. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: framework/web/Request.php framework/web/Request.php— framework/web/Request.php changed 4 times in last 90 days, max complexity 16. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: framework/web/UrlRule.php framework/web/UrlRule.php— framework/web/UrlRule.php changed 2 times in last 90 days, max complexity 31. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: framework/db/mysql/Schema.php framework/db/mysql/Schema.php— framework/db/mysql/Schema.php changed 3 times in last 90 days, max complexity 20. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: framework/web/ErrorHandler.php framework/web/ErrorHandler.php— framework/web/ErrorHandler.php changed 4 times in last 90 days, max complexity 15. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: framework/console/controllers/MessageController.php framework/console/controllers/MessageController.php— framework/console/controllers/MessageController.php changed 2 times in last 90 days, max complexity 29. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: framework/db/mssql/Schema.php framework/db/mssql/Schema.php— framework/db/mssql/Schema.php changed 3 times in last 90 days, max complexity 19. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: framework/db/ActiveRelationTrait.php framework/db/ActiveRelationTrait.php— framework/db/ActiveRelationTrait.php changed 2 times in last 90 days, max complexity 28. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Duplicated block (8 lines × 2) framework/base/Event.php:154— framework/base/Event.php:154-161 | framework/base/Event.php:169-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `framework/base/Event.php:154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) framework/caching/Cache.php:247— framework/caching/Cache.php:247-254 | framework/caching/Cache.php:383-390 — both copies are in the same file, so extract the 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 `framework/caching/Cache.php:247` 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) framework/db/BaseActiveRecord.php:313— framework/db/BaseActiveRecord.php:313-320 | framework/db/BaseActiveRecord.php:531-538 — both copies are in the same file, so extract the 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 `framework/db/BaseActiveRecord.php:313` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) framework/db/QueryBuilder.php:766— framework/db/QueryBuilder.php:766-774 | framework/db/QueryBuilder.php:947-954 — both copies are in the same file, so extract the 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) framework/db/QueryBuilder.php:878— framework/db/QueryBuilder.php:878-885 | framework/db/oci/QueryBuilder.php:177-184 — 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 `framework/db/QueryBuilder.php:878` 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) framework/db/mssql/Schema.php:110— framework/db/mssql/Schema.php:110-117 | framework/db/mssql/Schema.php:350-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 `framework/db/mssql/Schema.php:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) framework/helpers/BaseFileHelper.php:550— framework/helpers/BaseFileHelper.php:550-557 | framework/helpers/BaseFileHelper.php:592-599 — both copies are in the same file, so extract the 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 `framework/helpers/BaseFileHelper.php:550` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) framework/i18n/Formatter.php:999— framework/i18n/Formatter.php:999-1006 | framework/i18n/Formatter.php:1021-1028 — both copies are in the same file, so extract the 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 `framework/i18n/Formatter.php:999` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) framework/rbac/migrations/m180523_151638_rbac_updates_indexes_without_prefix.php:42— framework/rbac/migrations/m180523_151638_rbac_updates_indexes_without_prefix.php:42-49 | framework/rbac/migrations/m180523_151638_rbac_updates_indexes_without_prefix.php:57-65 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) framework/widgets/ActiveField.php:563— framework/widgets/ActiveField.php:563-570 | framework/widgets/ActiveField.php:615-622 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `framework/widgets/ActiveField.php:563` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) framework/console/controllers/BaseMigrateController.php:226— framework/console/controllers/BaseMigrateController.php:226-237 | framework/console/controllers/BaseMigrateController.php:290-300 — both copies are in the same file, so extract the 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 `framework/console/controllers/BaseMigrateController.php: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. 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) framework/console/controllers/FixtureController.php:352— framework/console/controllers/FixtureController.php:352-362 | framework/console/controllers/FixtureController.php:384-394 — both copies are in the same file, so extract the 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 `framework/console/controllers/FixtureController.php:352` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) framework/data/ActiveDataProvider.php:125— framework/data/ActiveDataProvider.php:125-135 | framework/data/SqlDataProvider.php:146-156 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `framework/data/ActiveDataProvider.php:125` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) framework/db/mysql/QueryBuilder.php:267— framework/db/mysql/QueryBuilder.php:267-277 | framework/db/pgsql/QueryBuilder.php:338-348 — 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 `framework/db/mysql/QueryBuilder.php:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) framework/helpers/BaseFormatConverter.php:105— framework/helpers/BaseFormatConverter.php:105-115 | framework/helpers/BaseFormatConverter.php:349-359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `framework/helpers/BaseFormatConverter.php:105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) framework/i18n/GettextMessageSource.php:112— framework/i18n/GettextMessageSource.php:112-122 | framework/i18n/PhpMessageSource.php:118-128 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `framework/i18n/GettextMessageSource.php:112` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) framework/rbac/DbManager.php:541— framework/rbac/DbManager.php:541-551 | framework/rbac/DbManager.php:615-626 — both copies are in the same file, so extract the 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 `framework/rbac/DbManager.php:541` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) framework/web/MultipartFormDataParser.php:267— framework/web/MultipartFormDataParser.php:267-277 | framework/web/MultipartFormDataParser.php:325-335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `framework/web/MultipartFormDataParser.php:267` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) framework/console/controllers/BaseMigrateController.php:769— framework/console/controllers/BaseMigrateController.php:769-777 | framework/console/controllers/BaseMigrateController.php:797-805 — both copies are in the same file, so extract the 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 `framework/console/controllers/BaseMigrateController.php:769` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) framework/console/controllers/FixtureController.php:281— framework/console/controllers/FixtureController.php:281-289 | framework/console/controllers/FixtureController.php:303-311 — both copies are in the same file, so extract the 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 `framework/console/controllers/FixtureController.php:281` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) framework/db/ActiveRecord.php:785— framework/db/ActiveRecord.php:785-793 | framework/db/BaseActiveRecord.php:910-918 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) framework/db/BaseActiveRecord.php:1525— framework/db/BaseActiveRecord.php:1525-1533 | framework/db/BaseActiveRecord.php:1562-1570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `framework/db/BaseActiveRecord.php:1525` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) framework/db/mssql/QueryBuilder.php:316— framework/db/mssql/QueryBuilder.php:316-324 | framework/db/mssql/QueryBuilder.php:382-390 — both copies are in the same file, so extract the 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) framework/db/mssql/conditions/InConditionBuilder.php:42— framework/db/mssql/conditions/InConditionBuilder.php:42-50 | framework/db/sqlite/conditions/InConditionBuilder.php:42-50 — 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 `framework/db/mssql/conditions/InConditionBuilder.php:42` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) framework/rbac/migrations/m200409_110543_rbac_update_mssql_trigger.php:66— framework/rbac/migrations/m200409_110543_rbac_update_mssql_trigger.php:66-74 | framework/rbac/migrations/m200409_110543_rbac_update_mssql_trigger.php:119-127 — both copies are in the same file, so extract the 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 `framework/rbac/migrations/m200409_110543_rbac_update_mssql_trigger.php:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) framework/web/Response.php:568— framework/web/Response.php:568-577 | framework/web/Response.php:628-636 — both copies are in the same file, so extract the 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 `framework/web/Response.php:568` 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.
FileTooLong: i18n/Formatter.php framework/i18n/Formatter.php:0— FileTooLong — 780 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: Formatter (55-2197). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: helpers/BaseHtml.php framework/helpers/BaseHtml.php:0— FileTooLong — 691 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: BaseHtml (26-2411). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: web/Request.php framework/web/Request.php:0— FileTooLong — 643 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: Request (92-2036). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: db/BaseActiveRecord.php framework/db/BaseActiveRecord.php:0— FileTooLong — 589 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: BaseActiveRecord (43-1863). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: db/QueryBuilder.php framework/db/QueryBuilder.php:0— FileTooLong — 544 significant lines (blank, comment-only and punctuation-only lines excluded). 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: rbac/DbManager.php framework/rbac/DbManager.php:0— FileTooLong — 515 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: DbManager (40-1137). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
Duplicated block (10 lines × 2) framework/db/mssql/Schema.php:417— framework/db/mssql/Schema.php:417-426 | framework/db/sqlite/Schema.php:339-348 — 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 `framework/db/mssql/Schema.php:417` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) framework/db/mysql/QueryBuilder.php:84— framework/db/mysql/QueryBuilder.php:84-93 | framework/db/mysql/QueryBuilder.php:363-372 — both copies are in the same file, so extract the 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 `framework/db/mysql/QueryBuilder.php:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) framework/i18n/Formatter.php:1179— framework/i18n/Formatter.php:1179-1188 | framework/i18n/Formatter.php:1227-1236 — both copies are in the same file, so extract the 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 `framework/i18n/Formatter.php:1179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) framework/i18n/Formatter.php:1429— framework/i18n/Formatter.php:1429-1438 | framework/i18n/Formatter.php:1485-1494 — both copies are in the same file, so extract the 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 `framework/i18n/Formatter.php:1429` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) framework/rbac/PhpManager.php:446— framework/rbac/PhpManager.php:446-455 | framework/rbac/PhpManager.php:520-530 — both copies are in the same file, so extract the 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 `framework/rbac/PhpManager.php:446` 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 (10 lines × 2) framework/validators/ExistValidator.php:157— framework/validators/ExistValidator.php:157-166 | framework/validators/UniqueValidator.php:126-135 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (7 lines × 2) framework/base/Security.php:202— framework/base/Security.php:202-208 | framework/base/Security.php:252-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `framework/base/Security.php:202` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) framework/caching/DbCache.php:118— framework/caching/DbCache.php:118-124 | framework/caching/DbCache.php:142-148 — both copies are in the same file, so extract the 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 `framework/caching/DbCache.php:118` 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) framework/data/Pagination.php:280— framework/data/Pagination.php:280-286 | framework/data/Sort.php:431-437 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) framework/db/mysql/Schema.php:304— framework/db/mysql/Schema.php:304-310 | framework/db/sqlite/Schema.php:325-332 — 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 `framework/db/mysql/Schema.php:304` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) framework/grid/GridView.php:284— framework/grid/GridView.php:284-290 | framework/widgets/DetailView.php:136-142 — 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 `framework/grid/GridView.php:284` 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) framework/helpers/BaseHtml.php:982— framework/helpers/BaseHtml.php:982-988 | framework/helpers/BaseHtml.php:1072-1078 — both copies are in the same file, so extract the 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) framework/console/controllers/FixtureController.php:117— framework/console/controllers/FixtureController.php:117-128 | framework/console/controllers/FixtureController.php:193-204 — both copies are in the same file, so extract the 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 `framework/console/controllers/FixtureController.php:117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) framework/db/QueryBuilder.php:1488— framework/db/QueryBuilder.php:1488-1499 | framework/db/sqlite/QueryBuilder.php:536-547 — 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 `framework/db/QueryBuilder.php:1488` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 2) framework/rbac/DbManager.php:169— framework/rbac/DbManager.php:169-180 | framework/rbac/PhpManager.php:140-151 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `framework/rbac/DbManager.php:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) framework/db/mssql/Schema.php:407— framework/db/mssql/Schema.php:407-413 | framework/db/sqlite/Schema.php:332-337 — 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 `framework/db/mssql/Schema.php:407` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) framework/i18n/GettextMessageSource.php:74— framework/i18n/GettextMessageSource.php:74-79 | framework/i18n/PhpMessageSource.php:80-85 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `framework/i18n/GettextMessageSource.php:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) framework/validators/DateValidator.php:251— framework/validators/DateValidator.php:251-256 | framework/validators/NumberValidator.php:76-81 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Schema.loadColumnSchema (cognitive 40) framework/db/cubrid/Schema.php:266— Schema.loadColumnSchema has cognitive complexity 40 (threshold 15). Drivers by points: if/else 25, boolean chains 9, loops 4, ternaries 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.
Schema.loadColumnSchema (cognitive 40) framework/db/mysql/Schema.php:291— Schema.loadColumnSchema has cognitive complexity 40 (threshold 15). Drivers by points: if/else 26, ternaries 6, boolean chains 4, loops 4 (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.
InConditionBuilder.buildCompositeInCondition (cognitive 26) framework/db/mssql/conditions/InConditionBuilder.php:38— InConditionBuilder.buildCompositeInCondition has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 13, if/else 9, loops 4 (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.
InConditionBuilder.buildCompositeInCondition (cognitive 26) framework/db/sqlite/conditions/InConditionBuilder.php:38— InConditionBuilder.buildCompositeInCondition has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 13, if/else 9, loops 4 (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.
Duplicated block (15 lines × 2) framework/db/QueryBuilder.php:230— framework/db/QueryBuilder.php:230-244 | framework/db/sqlite/QueryBuilder.php:486-500 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15 lines × 2) framework/requirements/YiiRequirementChecker.php:255— framework/requirements/YiiRequirementChecker.php:255-269 | framework/web/MultipartFormDataParser.php:357-371 — 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 `framework/requirements/YiiRequirementChecker.php:255` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 3) framework/db/ActiveRecord.php:572— framework/db/ActiveRecord.php:572-585 | framework/db/ActiveRecord.php:710-723 | framework/db/ActiveRecord.php:754-767 — 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 `framework/db/ActiveRecord.php:572` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 3) framework/db/cubrid/Schema.php:300— framework/db/cubrid/Schema.php:300-313 | framework/db/mssql/Schema.php:418-431 | framework/db/mysql/Schema.php:325-338 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `framework/db/cubrid/Schema.php:300` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 2) framework/db/BaseActiveRecord.php:1433— framework/db/BaseActiveRecord.php:1433-1445 | framework/db/BaseActiveRecord.php:1534-1546 — both copies are in the same file, so extract the 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 `framework/db/BaseActiveRecord.php:1433` 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) framework/validators/ExistValidator.php:213— framework/validators/ExistValidator.php:213-225 | framework/validators/UniqueValidator.php:277-289 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `framework/validators/ExistValidator.php:213` 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 × 3) framework/db/cubrid/QueryBuilder.php:69— framework/db/cubrid/QueryBuilder.php:69-80 | framework/db/mssql/QueryBuilder.php:550-561 | framework/db/oci/QueryBuilder.php:217-228 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `framework/db/cubrid/QueryBuilder.php:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) framework/db/cubrid/QueryBuilder.php:96— framework/db/cubrid/QueryBuilder.php:96-107 | framework/db/mssql/QueryBuilder.php:587-598 | framework/db/oci/QueryBuilder.php:254-265 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `framework/db/cubrid/QueryBuilder.php:96` 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.
MessageFormatter.parseToken (cyclomatic 42) framework/i18n/MessageFormatter.php:342— MessageFormatter.parseToken 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.
Container.resolveCallableDependencies (cyclomatic 33) framework/di/Container.php:660— Container.resolveCallableDependencies 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.
UrlRule.createUrl (cyclomatic 31) framework/web/UrlRule.php:457— UrlRule.createUrl 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.
MessageController.saveMessagesToDb (cyclomatic 29) framework/console/controllers/MessageController.php:355— MessageController.saveMessagesToDb 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.
handleAction (cyclomatic 29) framework/assets/yii.js:153— handleAction has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ActiveRelationTrait.populateRelation (cyclomatic 28) framework/db/ActiveRelationTrait.php:226— ActiveRelationTrait.populateRelation 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.
ColumnSchema.typecast (cyclomatic 28) framework/db/ColumnSchema.php:116— ColumnSchema.typecast has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
IpValidator.validateSubnet (cyclomatic 28) framework/validators/IpValidator.php:322— IpValidator.validateSubnet 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.
BaseFileHelper.changeOwnership (cyclomatic 27) framework/helpers/BaseFileHelper.php:973— BaseFileHelper.changeOwnership 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.
MessageController.extractMessagesFromTokens (cyclomatic 26) framework/console/controllers/MessageController.php:533— MessageController.extractMessagesFromTokens 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.
BaseHtml.renderSelectOptions (cyclomatic 26) framework/helpers/BaseHtml.php:1892— BaseHtml.renderSelectOptions 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.
UrlManager.createUrl (cyclomatic 25) framework/web/UrlManager.php:411— UrlManager.createUrl 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.
InConditionBuilder.build (cyclomatic 24) framework/db/conditions/InConditionBuilder.php:36— InConditionBuilder.build 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.
Schema.loadColumnSchema (cyclomatic 24) framework/db/cubrid/Schema.php:266— Schema.loadColumnSchema 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.
Formatter.asDecimalStringFallback (cyclomatic 24) framework/i18n/Formatter.php:2004— Formatter.asDecimalStringFallback 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.
BaseActiveRecord.unlink (cyclomatic 23) framework/db/BaseActiveRecord.php:1406— BaseActiveRecord.unlink 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.
UrlRule.translatePattern (cyclomatic 23) framework/web/UrlRule.php:270— UrlRule.translatePattern 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.
Controller.bindActionParams (cyclomatic 22) framework/console/Controller.php:204— Controller.bindActionParams 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.
BaseFileHelper.copyDirectory (cyclomatic 22) framework/helpers/BaseFileHelper.php:376— BaseFileHelper.copyDirectory 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.
ActiveField.getClientOptions (cyclomatic 22) framework/widgets/ActiveField.php:822— ActiveField.getClientOptions 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.
DetailView.normalizeAttributes (cyclomatic 22) framework/widgets/DetailView.php:194— DetailView.normalizeAttributes 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.
MessageController.saveMessagesCategoryToPHP (cyclomatic 21) framework/console/controllers/MessageController.php:741— MessageController.saveMessagesCategoryToPHP 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.
MessageController.saveMessagesToPO (cyclomatic 21) framework/console/controllers/MessageController.php:822— MessageController.saveMessagesToPO 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.
ActiveRelationTrait.populateInverseRelation (cyclomatic 21) framework/db/ActiveRelationTrait.php:337— ActiveRelationTrait.populateInverseRelation 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.
BaseHtml.renderTagAttributes (cyclomatic 21) framework/helpers/BaseHtml.php:1997— BaseHtml.renderTagAttributes 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.
Controller.filterUnionTypeActionParam (cyclomatic 21) framework/web/Controller.php:253— Controller.filterUnionTypeActionParam 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.
UrlRule.parseRequest (cyclomatic 21) framework/web/UrlRule.php:381— UrlRule.parseRequest 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.
User.renewAuthStatus (cyclomatic 21) framework/web/User.php:689— User.renewAuthStatus 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.
Controller.runAction (cyclomatic 20) framework/console/Controller.php:121— Controller.runAction 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.
Controller.getActionArgsHelp (cyclomatic 20) framework/console/Controller.php:594— Controller.getActionArgsHelp 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.
BaseActiveRecord.link (cyclomatic 20) framework/db/BaseActiveRecord.php:1310— BaseActiveRecord.link 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.
Schema.loadColumnSchema (cyclomatic 20) framework/db/mysql/Schema.php:291— Schema.loadColumnSchema 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.
BaseVarDumper.dumpInternal (cyclomatic 20) framework/helpers/BaseVarDumper.php:69— BaseVarDumper.dumpInternal 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.
Formatter.formatDateTimeValue (cyclomatic 20) framework/i18n/Formatter.php:759— Formatter.formatDateTimeValue 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.
DateValidator.init (cyclomatic 20) framework/validators/DateValidator.php:228— DateValidator.init 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.
(anonymous) (cyclomatic 20) framework/assets/yii.activeForm.js:329— (anonymous) has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
QueryTrait.filterCondition (cyclomatic 19) framework/db/QueryTrait.php:232— QueryTrait.filterCondition 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.
Schema.loadColumnSchema (cyclomatic 19) framework/db/mssql/Schema.php:381— Schema.loadColumnSchema 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.
CompositeAuth.authenticate (cyclomatic 19) framework/filters/auth/CompositeAuth.php:70— CompositeAuth.authenticate 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.
Formatter.normalizeDatetimeValue (cyclomatic 19) framework/i18n/Formatter.php:866— Formatter.normalizeDatetimeValue 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.
Menu.normalizeItems (cyclomatic 19) framework/widgets/Menu.php:257— Menu.normalizeItems 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.
ActiveQuery.joinWithRelation (cyclomatic 18) framework/db/ActiveQuery.php:635— ActiveQuery.joinWithRelation 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.
BaseActiveRecord.unlinkAll (cyclomatic 18) framework/db/BaseActiveRecord.php:1509— BaseActiveRecord.unlinkAll 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.
FileValidator.validateValue (cyclomatic 18) framework/validators/FileValidator.php:255— FileValidator.validateValue has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity· ip (cyclomatic 18) · ×1
ip (cyclomatic 18) framework/assets/yii.validation.js:336— ip has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Application.bootstrap (cyclomatic 17) framework/base/Application.php:279— Application.bootstrap 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.
Model.scenarios (cyclomatic 17) framework/base/Model.php:202— Model.scenarios has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ErrorHandler.renderException (cyclomatic 17) framework/console/ErrorHandler.php:31— ErrorHandler.renderException 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.
ActiveRelationTrait.filterByModels (cyclomatic 17) framework/db/ActiveRelationTrait.php:524— ActiveRelationTrait.filterByModels 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.
Schema.findColumns (cyclomatic 17) framework/db/pgsql/Schema.php:467— Schema.findColumns 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.
Schema.loadColumnSchema (cyclomatic 17) framework/db/sqlite/Schema.php:315— Schema.loadColumnSchema 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.
Container.getDependencies (cyclomatic 17) framework/di/Container.php:510— Container.getDependencies 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.
BaseConsole.ansiToHtml (cyclomatic 17) framework/helpers/BaseConsole.php:431— BaseConsole.ansiToHtml 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.
BaseConsole.getScreenSize (cyclomatic 17) framework/helpers/BaseConsole.php:687— BaseConsole.getScreenSize 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.
Formatter.asRelativeTime (cyclomatic 17) framework/i18n/Formatter.php:963— Formatter.asRelativeTime 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.
compare (cyclomatic 17) framework/assets/yii.validation.js:280— compare has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Component.__set (cyclomatic 16) framework/base/Component.php:179— Component.__set 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.
Command.getRawSql (cyclomatic 16) framework/db/Command.php:201— Command.getRawSql 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.
Schema.loadTableConstraints (cyclomatic 16) framework/db/sqlite/Schema.php:409— Schema.loadTableConstraints 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.
Instance.ensure (cyclomatic 16) framework/di/Instance.php:121— Instance.ensure 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.
BaseArrayHelper.toArray (cyclomatic 16) framework/helpers/BaseArrayHelper.php:62— BaseArrayHelper.toArray 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.
BaseJson.processData (cyclomatic 16) framework/helpers/BaseJson.php:167— BaseJson.processData 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.
Controller.bindActionParams (cyclomatic 16) framework/web/Controller.php:133— Controller.bindActionParams 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.
Request.parseAcceptHeader (cyclomatic 16) framework/web/Request.php:1607— Request.parseAcceptHeader 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.
LLM evaluation failed — JSON parse error: Expected end of string, but instead reached end of data. Path: $.findings[1].issue | LineNumber: 0 | BytePositionInLine: 1281.
MessageController.extractMessagesFromTokens (cognitive 81) framework/console/controllers/MessageController.php:533— MessageController.extractMessagesFromTokens has cognitive complexity 81 (threshold 15). Drivers by points: if/else 66, loops 8, boolean chains 7 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActiveRelationTrait.populateRelation (cognitive 61) framework/db/ActiveRelationTrait.php:226— ActiveRelationTrait.populateRelation has cognitive complexity 61 (threshold 15). Drivers by points: if/else 34, loops 12, ternaries 12, boolean chains 3 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseActiveRecord.unlink (cognitive 58) framework/db/BaseActiveRecord.php:1406— BaseActiveRecord.unlink has cognitive complexity 58 (threshold 15). Drivers by points: if/else 39, loops 15, ternaries 3, boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Container.getDependencies (cognitive 57) framework/di/Container.php:510— Container.getDependencies has cognitive complexity 57 (threshold 15). Drivers by points: if/else 36, ternaries 13, error handling 5, loops 2, boolean chains 1 (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.
BaseHtml.renderSelectOptions (cognitive 56) framework/helpers/BaseHtml.php:1892— BaseHtml.renderSelectOptions has cognitive complexity 56 (threshold 15). Drivers by points: if/else 33, ternaries 19, loops 3, boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActiveRelationTrait.populateInverseRelation (cognitive 54) framework/db/ActiveRelationTrait.php:337— ActiveRelationTrait.populateInverseRelation has cognitive complexity 54 (threshold 15). Drivers by points: if/else 20, loops 18, ternaries 15, boolean chains 1 (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.
Controller.runAction (cognitive 52) framework/console/Controller.php:121— Controller.runAction has cognitive complexity 52 (threshold 15). Drivers by points: if/else 37, loops 11, boolean chains 2, ternaries 2 (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.
MessageController.saveMessagesToPO (cognitive 52) framework/console/controllers/MessageController.php:822— MessageController.saveMessagesToPO has cognitive complexity 52 (threshold 15). Drivers by points: if/else 29, loops 17, boolean chains 6 (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.
Container.resolveCallableDependencies (cognitive 52) framework/di/Container.php:660— Container.resolveCallableDependencies has cognitive complexity 52 (threshold 15). Drivers by points: if/else 29, boolean chains 13, loops 6, error handling 4 (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.
MessageFormatter.parseToken (cognitive 52) framework/i18n/MessageFormatter.php:342— MessageFormatter.parseToken has cognitive complexity 52 (threshold 15). Drivers by points: if/else 30, boolean chains 13, loops 4, ternaries 4, match/switch 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UrlManager.createUrl (cognitive 49) framework/web/UrlManager.php:411— UrlManager.createUrl has cognitive complexity 49 (threshold 15). Drivers by points: if/else 36, boolean chains 5, loops 5, ternaries 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UrlRule.createUrl (cognitive 48) framework/web/UrlRule.php:457— UrlRule.createUrl has cognitive complexity 48 (threshold 15). Drivers by points: if/else 30, boolean chains 8, loops 5, ternaries 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.
Controller.bindActionParams (cognitive 45) framework/console/Controller.php:204— Controller.bindActionParams has cognitive complexity 45 (threshold 15). Drivers by points: if/else 27, boolean chains 5, loops 5, ternaries 5, error handling 3 (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.
Formatter.asDecimalStringFallback (cognitive 45) framework/i18n/Formatter.php:2004— Formatter.asDecimalStringFallback has cognitive complexity 45 (threshold 15). Drivers by points: if/else 36, loops 6, boolean chains 3 (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.
BaseFileHelper.copyDirectory (cognitive 44) framework/helpers/BaseFileHelper.php:376— BaseFileHelper.copyDirectory has cognitive complexity 44 (threshold 15). Drivers by points: if/else 30, ternaries 7, boolean chains 6, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseHtml.renderTagAttributes (cognitive 44) framework/helpers/BaseHtml.php:1997— BaseHtml.renderTagAttributes has cognitive complexity 44 (threshold 15). Drivers by points: if/else 36, loops 7, boolean chains 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.
MessageController.saveMessagesToDb (cognitive 43) framework/console/controllers/MessageController.php:355— MessageController.saveMessagesToDb has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19, loops 19, ternaries 4, 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.
Table.renderRow (cognitive 43) framework/console/widgets/Table.php:250— Table.renderRow has cognitive complexity 43 (threshold 15). Drivers by points: if/else 31, ternaries 8, loops 3, boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IpValidator.validateSubnet (cognitive 43) framework/validators/IpValidator.php:322— IpValidator.validateSubnet has cognitive complexity 43 (threshold 15). Drivers by points: if/else 31, boolean chains 8, ternaries 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.
BaseActiveRecord.unlinkAll (cognitive 42) framework/db/BaseActiveRecord.php:1509— BaseActiveRecord.unlinkAll has cognitive complexity 42 (threshold 15). Drivers by points: if/else 33, loops 5, 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.
DetailView.normalizeAttributes (cognitive 41) framework/widgets/DetailView.php:194— DetailView.normalizeAttributes has cognitive complexity 41 (threshold 15). Drivers by points: if/else 25, ternaries 13, boolean chains 2, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseActiveRecord.link (cognitive 40) framework/db/BaseActiveRecord.php:1310— BaseActiveRecord.link has cognitive complexity 40 (threshold 15). Drivers by points: if/else 29, loops 9, 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.
Model.scenarios (cognitive 39) framework/base/Model.php:202— Model.scenarios has cognitive complexity 39 (threshold 15). Drivers by points: loops 29, if/else 9, boolean chains 1 (nesting depth added 23). 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.
Controller.getActionArgsHelp (cognitive 39) framework/console/Controller.php:594— Controller.getActionArgsHelp has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15, ternaries 14, loops 6, 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.
handleAction (cognitive 39) framework/assets/yii.js:153— handleAction has cognitive complexity 39 (threshold 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.
BaseArrayHelper.toArray (cognitive 38) framework/helpers/BaseArrayHelper.php:62— BaseArrayHelper.toArray has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21, loops 10, ternaries 6, boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageController.saveMessagesCategoryToPHP (cognitive 37) framework/console/controllers/MessageController.php:741— MessageController.saveMessagesCategoryToPHP has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21, boolean chains 8, loops 8 (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.
FileCache.gcRecursive (cognitive 36) framework/caching/FileCache.php:272— FileCache.gcRecursive has cognitive complexity 36 (threshold 15). Drivers by points: if/else 31, boolean chains 3, loops 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.
BaseFileHelper.changeOwnership (cognitive 36) framework/helpers/BaseFileHelper.php:973— BaseFileHelper.changeOwnership has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24, boolean chains 6, ternaries 6 (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.
UrlRule.translatePattern (cognitive 36) framework/web/UrlRule.php:270— UrlRule.translatePattern has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16, boolean chains 11, ternaries 7, loops 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.
ActiveRelationTrait.filterByModels (cognitive 35) framework/db/ActiveRelationTrait.php:524— ActiveRelationTrait.filterByModels has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20, loops 9, boolean chains 3, ternaries 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Sort.getAttributeOrders (cognitive 33) framework/data/Sort.php:264— Sort.getAttributeOrders has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20, ternaries 8, loops 3, 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.
Controller.filterUnionTypeActionParam (cognitive 33) framework/web/Controller.php:253— Controller.filterUnionTypeActionParam has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18, boolean chains 7, ternaries 5, loops 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.
MultipartFormDataParser.parse (cognitive 33) framework/web/MultipartFormDataParser.php:130— MultipartFormDataParser.parse has cognitive complexity 33 (threshold 15). Drivers by points: if/else 31, boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Menu.normalizeItems (cognitive 33) framework/widgets/Menu.php:257— Menu.normalizeItems has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23, boolean chains 5, ternaries 4, 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.
InConditionBuilder.build (cognitive 31) framework/db/conditions/InConditionBuilder.php:36— InConditionBuilder.build has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18, ternaries 10, 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.
UrlManager.parseRequest (cognitive 31) framework/web/UrlManager.php:321— UrlManager.parseRequest has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24, ternaries 4, loops 2, 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.
Schema.loadColumnSchema (cognitive 30) framework/db/mssql/Schema.php:381— Schema.loadColumnSchema has cognitive complexity 30 (threshold 15). Drivers by points: if/else 24, boolean chains 5, 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.
Formatter.formatDateTimeValue (cognitive 30) framework/i18n/Formatter.php:759— Formatter.formatDateTimeValue has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, boolean chains 7 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
updateInputs (cognitive 30) framework/assets/yii.activeForm.js:727— updateInputs has cognitive complexity 30 (threshold 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.
Application.bootstrap (cognitive 29) framework/base/Application.php:279— Application.bootstrap has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, loops 5, ternaries 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.
AssetController.loadTargets (cognitive 29) framework/console/controllers/AssetController.php:286— AssetController.loadTargets has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21, loops 6, ternaries 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageFormatter.replaceNamedArguments (cognitive 29) framework/i18n/MessageFormatter.php:210— MessageFormatter.replaceNamedArguments has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21, loops 4, boolean chains 2, ternaries 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActiveField.getClientOptions (cognitive 29) framework/widgets/ActiveField.php:822— ActiveField.getClientOptions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15, ternaries 7, boolean chains 4, loops 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.
(anonymous) (cognitive 29) framework/assets/yii.activeForm.js:329— (anonymous) has cognitive complexity 29 (threshold 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.
ActiveQuery.prepare (cognitive 28) framework/db/ActiveQuery.php:149— ActiveQuery.prepare has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, ternaries 4, 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.
ColumnSchema.typecast (cognitive 28) framework/db/ColumnSchema.php:116— ColumnSchema.typecast has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 14, if/else 13, match/switch 1 (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
BaseVarDumper.exportInternal (cognitive 28) framework/helpers/BaseVarDumper.php:167— BaseVarDumper.exportInternal has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15, loops 8, error handling 3, boolean chains 1, match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Logger.getProfiling (cognitive 28) framework/log/Logger.php:257— Logger.getProfiling has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13, loops 10, boolean chains 5 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompositeAuth.authenticate (cognitive 27) framework/filters/auth/CompositeAuth.php:70— CompositeAuth.authenticate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20, boolean chains 6, 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.
BaseArrayHelper.filter (cognitive 27) framework/helpers/BaseArrayHelper.php:966— BaseArrayHelper.filter has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 8, 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.
BaseJson.processData (cognitive 27) framework/helpers/BaseJson.php:167— BaseJson.processData has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 8, boolean chains 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.
UrlRule.parseRequest (cognitive 27) framework/web/UrlRule.php:381— UrlRule.parseRequest has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19, boolean chains 3, ternaries 3, loops 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.
Event.off (cognitive 26) framework/base/Event.php:139— Event.off has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, loops 4, 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.
Request.resolve (cognitive 26) framework/console/Request.php:59— Request.resolve has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, ternaries 8, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseMigrateController.getNewMigrations (cognitive 26) framework/console/controllers/BaseMigrateController.php:913— BaseMigrateController.getNewMigrations has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, loops 7, 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.
QueryTrait.filterCondition (cognitive 26) framework/db/QueryTrait.php:232— QueryTrait.filterCondition has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, loops 4, boolean chains 3, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseConsole.getScreenSize (cognitive 26) framework/helpers/BaseConsole.php:687— BaseConsole.getScreenSize has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, boolean chains 6 (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.
BaseStringHelper.truncateHtml (cognitive 26) framework/helpers/BaseStringHelper.php:202— BaseStringHelper.truncateHtml has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15, loops 5, ternaries 5, 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.
Request.parseAcceptHeader (cognitive 26) framework/web/Request.php:1607— Request.parseAcceptHeader has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, ternaries 5, loops 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseMigrateController.actionUp (cognitive 25) framework/console/controllers/BaseMigrateController.php:189— BaseMigrateController.actionUp has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11, if/else 10, loops 3, 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.
ActiveRelationTrait.buildBuckets (cognitive 25) framework/db/ActiveRelationTrait.php:401— ActiveRelationTrait.buildBuckets has cognitive complexity 25 (threshold 15). Drivers by points: loops 14, if/else 7, ternaries 3, boolean chains 1 (nesting depth added 12). 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.
QueryBuilder.insert (cognitive 25) framework/db/mssql/QueryBuilder.php:491— QueryBuilder.insert has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11, ternaries 10, boolean chains 2, loops 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.
AccessRule.matchRole (cognitive 25) framework/filters/AccessRule.php:222— AccessRule.matchRole has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, ternaries 5, 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.
Formatter.asRelativeTime (cognitive 25) framework/i18n/Formatter.php:963— Formatter.asRelativeTime has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25 (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.
Target.filterMessages (cognitive 25) framework/log/Target.php:266— Target.filterMessages has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, boolean chains 6, loops 6 (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.
Response.sendContent (cognitive 25) framework/web/Response.php:440— Response.sendContent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15, loops 6, boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
User.renewAuthStatus (cognitive 25) framework/web/User.php:689— User.renewAuthStatus has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, boolean chains 7, ternaries 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.
XmlResponseFormatter.buildXml (cognitive 25) framework/web/XmlResponseFormatter.php:110— XmlResponseFormatter.buildXml has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15, boolean chains 5, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Schema.loadColumnSchema (cognitive 24) framework/db/sqlite/Schema.php:315— Schema.loadColumnSchema has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, boolean chains 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseVarDumper.dumpInternal (cognitive 24) framework/helpers/BaseVarDumper.php:69— BaseVarDumper.dumpInternal has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, loops 6, ternaries 2, boolean chains 1, match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Event.trigger (cognitive 23) framework/base/Event.php:263— Event.trigger has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, loops 6, 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.
AssetController.adjustCssUrl (cognitive 23) framework/console/controllers/AssetController.php:618— AssetController.adjustCssUrl has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, boolean chains 4, loops 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ActiveQuery.removeDuplicatedModels (cognitive 23) framework/db/ActiveQuery.php:257— ActiveQuery.removeDuplicatedModels has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, loops 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.
ActiveQuery.joinWithRelation (cognitive 23) framework/db/ActiveQuery.php:635— ActiveQuery.joinWithRelation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, loops 6, 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.
Cors.prepareHeaders (cognitive 23) framework/filters/Cors.php:170— Cors.prepareHeaders has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, boolean chains 2, ternaries 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Logger.flush (cognitive 23) framework/log/Logger.php:188— Logger.flush has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, loops 2, 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.
PhpManager.load (cognitive 23) framework/rbac/PhpManager.php:721— PhpManager.load has cognitive complexity 23 (threshold 15). Drivers by points: loops 9, ternaries 8, if/else 6 (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.
Controller.bindActionParams (cognitive 23) framework/web/Controller.php:133— Controller.bindActionParams has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, error handling 6, boolean chains 3, 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.
Response.sendCookies (cognitive 23) framework/web/Response.php:390— Response.sendCookies has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, boolean chains 3, ternaries 3, 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.
Component.off (cognitive 22) framework/base/Component.php:568— Component.off has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 4, 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.
Event.hasHandlers (cognitive 22) framework/base/Event.php:210— Event.hasHandlers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, loops 7, 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.
AssetController.buildTarget (cognitive 22) framework/console/controllers/AssetController.php:350— AssetController.buildTarget has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 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.
ActiveDataFilter.buildAttributeCondition (cognitive 22) framework/data/ActiveDataFilter.php:159— ActiveDataFilter.buildAttributeCondition has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, loops 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.
Sort.createSortParam (cognitive 22) framework/data/Sort.php:448— Sort.createSortParam has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, ternaries 7, 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.
ActiveQuery.buildJoinWith (cognitive 22) framework/db/ActiveQuery.php:462— ActiveQuery.buildJoinWith has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, loops 6, ternaries 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.
ActiveQuery.joinWithRelations (cognitive 22) framework/db/ActiveQuery.php:539— ActiveQuery.joinWithRelations has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, ternaries 5, loops 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Schema.createColumn (cognitive 22) framework/db/oci/Schema.php:408— Schema.createColumn has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, boolean chains 3, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseConsole.ansiColorizedSubstr (cognitive 22) framework/helpers/BaseConsole.php:366— BaseConsole.ansiColorizedSubstr has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 3, loops 1, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseHtml.getAttributeValue (cognitive 22) framework/helpers/BaseHtml.php:2291— BaseHtml.getAttributeValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10, ternaries 6, loops 4, 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.
Formatter.normalizeDatetimeValue (cognitive 22) framework/i18n/Formatter.php:866— Formatter.normalizeDatetimeValue has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8, boolean chains 7, if/else 6, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UrlRule.parseRequest (cognitive 22) framework/rest/UrlRule.php:217— UrlRule.parseRequest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, ternaries 5, loops 4, 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.
UniqueValidator.validateAttribute (cognitive 22) framework/validators/UniqueValidator.php:124— UniqueValidator.validateAttribute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, ternaries 5, loops 3, 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.
AssetBundle.publish (cognitive 22) framework/web/AssetBundle.php:186— AssetBundle.publish has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, loops 4, 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.
AssetManager.publishDirectory (cognitive 22) framework/web/AssetManager.php:563— AssetManager.publishDirectory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, boolean chains 4, error handling 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ErrorHandler.renderException (cognitive 22) framework/web/ErrorHandler.php:102— ErrorHandler.renderException has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 3, ternaries 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.
Request.getHeaders (cognitive 22) framework/web/Request.php:396— Request.getHeaders has cognitive complexity 22 (threshold 15). Drivers by points: loops 13, if/else 9 (nesting depth added 14). 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.
ErrorHandler.renderException (cognitive 21) framework/console/ErrorHandler.php:31— ErrorHandler.renderException has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, 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.
BaseMigrateController.actionRedo (cognitive 21) framework/console/controllers/BaseMigrateController.php:321— BaseMigrateController.actionRedo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, loops 5, ternaries 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.
BaseMigrateController.actionMark (cognitive 21) framework/console/controllers/BaseMigrateController.php:429— BaseMigrateController.actionMark has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, loops 10 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Table.calculateRowsSize (cognitive 21) framework/console/widgets/Table.php:341— Table.calculateRowsSize has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 6 (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.
QueryBuilder.oldUpsert (cognitive 21) framework/db/pgsql/QueryBuilder.php:370— QueryBuilder.oldUpsert has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, loops 7, ternaries 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.
Schema.findColumns (cognitive 21) framework/db/pgsql/Schema.php:467— Schema.findColumns has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Schema.loadTableConstraints (cognitive 21) framework/db/sqlite/Schema.php:409— Schema.loadTableConstraints has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 4, 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.
ContentNegotiator.negotiateLanguage (cognitive 21) framework/filters/ContentNegotiator.php:232— ContentNegotiator.negotiateLanguage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, loops 5, 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.
PhpManager.removeAllItems (cognitive 21) framework/rbac/PhpManager.php:573— PhpManager.removeAllItems has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, loops 8 (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.
DateValidator.init (cognitive 21) framework/validators/DateValidator.php:228— DateValidator.init has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BaseMigrateController.actionDown (cognitive 20) framework/console/controllers/BaseMigrateController.php:257— BaseMigrateController.actionDown has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, ternaries 8, loops 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.
ActiveDataProvider.prepareKeys (cognitive 20) framework/data/ActiveDataProvider.php:122— ActiveDataProvider.prepareKeys has cognitive complexity 20 (threshold 15). Drivers by points: loops 12, if/else 8 (nesting depth added 11). 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.
Connection.openFromPoolSequentially (cognitive 20) framework/db/Connection.php:1192— Connection.openFromPoolSequentially has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, error handling 5, loops 3, boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseConsole.ansiToHtml (cognitive 20) framework/helpers/BaseConsole.php:431— BaseConsole.ansiToHtml has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 5, 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.
BaseHtml.checkboxList (cognitive 20) framework/helpers/BaseHtml.php:977— BaseHtml.checkboxList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, ternaries 5, boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultipartFormDataParser.addFile (cognitive 20) framework/web/MultipartFormDataParser.php:286— MultipartFormDataParser.addFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, loops 7 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
View.registerFile (cognitive 20) framework/web/View.php:509— View.registerFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, ternaries 6, boolean chains 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ip (cognitive 20) framework/assets/yii.validation.js:336— ip has cognitive complexity 20 (threshold 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.
SqlToken.tokensMatch (cognitive 19) framework/db/SqlToken.php:240— SqlToken.tokensMatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 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.
QueryBuilder.upsert (cognitive 19) framework/db/oci/QueryBuilder.php:214— QueryBuilder.upsert has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, loops 8, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseArrayHelper.index (cognitive 19) framework/helpers/BaseArrayHelper.php:478— BaseArrayHelper.index has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseVarDumper.exportClosure (cognitive 19) framework/helpers/BaseVarDumper.php:233— BaseVarDumper.exportClosure has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 3, ternaries 3, 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.
Formatter.formatNumber (cognitive 19) framework/i18n/Formatter.php:1704— Formatter.formatNumber has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, 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.
ExistValidator.checkTargetAttributeExistence (cognitive 19) framework/validators/ExistValidator.php:155— ExistValidator.checkTargetAttributeExistence has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, ternaries 5, loops 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.
UniqueValidator.modelExists (cognitive 19) framework/validators/UniqueValidator.php:188— UniqueValidator.modelExists has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, loops 7, 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.
ErrorHandler.argumentsToString (cognitive 19) framework/web/ErrorHandler.php:481— ErrorHandler.argumentsToString has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, ternaries 3, 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.
Request.loadCookies (cognitive 19) framework/web/Request.php:1753— Request.loadCookies has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 4, 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.
Menu.isItemActive (cognitive 19) framework/widgets/Menu.php:310— Menu.isItemActive has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, boolean chains 5, loops 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.
validateFile (cognitive 19) framework/assets/yii.validation.js:419— validateFile has cognitive complexity 19 (threshold 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.
BaseYii.setAlias (cognitive 18) framework/BaseYii.php:221— BaseYii.setAlias has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, ternaries 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.
Cache.multiGet (cognitive 18) framework/caching/Cache.php:198— Cache.multiGet has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, ternaries 4, boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MemCache.getMemcache (cognitive 18) framework/caching/MemCache.php:216— MemCache.getMemcache has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, ternaries 5, 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.
Controller.getActionOptionsHelp (cognitive 18) framework/console/Controller.php:670— Controller.getActionOptionsHelp has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, ternaries 3, 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.
BaseMigrateController.beforeAction (cognitive 18) framework/console/controllers/BaseMigrateController.php:137— BaseMigrateController.beforeAction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 5, 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.
DataFilter.validateAttributeCondition (cognitive 18) framework/data/DataFilter.php:581— DataFilter.validateAttributeCondition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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.
ActiveRelationTrait.prefixKeyColumns (cognitive 18) framework/db/ActiveRelationTrait.php:496— ActiveRelationTrait.prefixKeyColumns has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, loops 6, 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.
Command.getRawSql (cognitive 18) framework/db/Command.php:201— Command.getRawSql has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7, if/else 6, boolean chains 3, loops 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.
Query.cleanUpTableNames (cognitive 18) framework/db/Query.php:543— Query.cleanUpTableNames has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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.
QueryBuilder.buildSelect (cognitive 18) framework/db/QueryBuilder.php:1239— QueryBuilder.buildSelect has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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.
InConditionBuilder.buildCompositeInCondition (cognitive 18) framework/db/conditions/InConditionBuilder.php:198— InConditionBuilder.buildCompositeInCondition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, loops 4, ternaries 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.
Instance.ensure (cognitive 18) framework/di/Instance.php:121— Instance.ensure has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 3, error handling 2, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageFormatter.tokenizePattern (cognitive 18) framework/i18n/MessageFormatter.php:292— MessageFormatter.tokenizePattern has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 3, 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.
Logger.log (cognitive 18) framework/log/Logger.php:154— Logger.log has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 2, 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.
IndexAction.prepareDataProvider (cognitive 18) framework/rest/IndexAction.php:128— IndexAction.prepareDataProvider has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18 (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.
DateValidator.validateAttribute (cognitive 18) framework/validators/DateValidator.php:282— DateValidator.validateAttribute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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.
Controller.filterSingleTypeActionParam (cognitive 18) framework/web/Controller.php:208— Controller.filterSingleTypeActionParam has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 5, ternaries 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.
View.renderBodyEndHtml (cognitive 18) framework/web/View.php:671— View.renderBodyEndHtml has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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.
ErrorHandler.handleError (cognitive 17) framework/base/ErrorHandler.php:252— ErrorHandler.handleError has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseMigrateController.actionHistory (cognitive 17) framework/console/controllers/BaseMigrateController.php:550— BaseMigrateController.actionHistory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, ternaries 6, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseMigrateController.actionNew (cognitive 17) framework/console/controllers/BaseMigrateController.php:596— BaseMigrateController.actionNew has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 6, 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.
HelpController.getModuleCommands (cognitive 17) framework/console/controllers/HelpController.php:237— HelpController.getModuleCommands has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 6, 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.
MessageController.actionExtract (cognitive 17) framework/console/controllers/MessageController.php:300— MessageController.actionExtract has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 5, loops 3, 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.
MigrateController.generateMigrationSourceCode (cognitive 17) framework/console/controllers/MigrateController.php:410— MigrateController.generateMigrationSourceCode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, error handling 3, ternaries 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MigrateController.parseFields (cognitive 17) framework/console/controllers/MigrateController.php:537— MigrateController.parseFields has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8, if/else 6, loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ActiveRelationTrait.addInverseRelations (cognitive 17) framework/db/ActiveRelationTrait.php:196— ActiveRelationTrait.addInverseRelations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, ternaries 6, 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.
Query.column (cognitive 17) framework/db/Query.php:314— Query.column has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, 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.
QueryBuilder.upsert (cognitive 17) framework/db/mssql/QueryBuilder.php:545— QueryBuilder.upsert has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 6, 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.
BaseFileHelper.normalizePath (cognitive 17) framework/helpers/BaseFileHelper.php:66— BaseFileHelper.normalizePath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, loops 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.
BaseFileHelper.removeDirectory (cognitive 17) framework/helpers/BaseFileHelper.php:445— BaseFileHelper.removeDirectory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 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.
BaseFileHelper.lastExcludeMatchingFromList (cognitive 17) framework/helpers/BaseFileHelper.php:833— BaseFileHelper.lastExcludeMatchingFromList has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, 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.
BaseHtml.beginForm (cognitive 17) framework/helpers/BaseHtml.php:348— BaseHtml.beginForm has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, 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.
GettextMoFile.load (cognitive 17) framework/i18n/GettextMoFile.php:61— GettextMoFile.load has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 4, loops 3 (nesting depth added 3). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
EmailValidator.validateValue (cognitive 17) framework/validators/EmailValidator.php:92— EmailValidator.validateValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Response.redirect (cognitive 17) framework/web/Response.php:898— Response.redirect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, 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.
ErrorException.__construct (cognitive 16) framework/base/ErrorException.php:40— ErrorException.__construct has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 2, 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.
HelpController.getDefaultHelp (cognitive 16) framework/console/controllers/HelpController.php:300— HelpController.getDefaultHelp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 6 (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.
Command.queryInternal (cognitive 16) framework/db/Command.php:1164— Command.queryInternal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 4, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Query.getUniqueColumns (cognitive 16) framework/db/Query.php:728— Query.getUniqueColumns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryBuilder.upsert (cognitive 16) framework/db/cubrid/QueryBuilder.php:66— QueryBuilder.upsert has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 6, 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.
BaseArrayHelper.getValue (cognitive 16) framework/helpers/BaseArrayHelper.php:188— BaseArrayHelper.getValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 2, error handling 2, loops 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BaseFileHelper.matchPathname (cognitive 16) framework/helpers/BaseFileHelper.php:775— BaseFileHelper.matchPathname has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseHtml.radioList (cognitive 16) framework/helpers/BaseHtml.php:1070— BaseHtml.radioList has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 4, ternaries 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.
Formatter.asCurrency (cognitive 16) framework/i18n/Formatter.php:1308— Formatter.asCurrency has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, ternaries 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NumberValidator.validateAttribute (cognitive 16) framework/validators/NumberValidator.php:87— NumberValidator.validateAttribute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 3, ternaries 3, 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.
Change coupling: mimeExtensions.php ↔ mimeTypes.php framework/helpers/mimeExtensions.php— `framework/helpers/mimeExtensions.php` and `framework/helpers/mimeTypes.php` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking.
Duplicated block (16 lines × 2) framework/console/controllers/BaseMigrateController.php:261— framework/console/controllers/BaseMigrateController.php:261-276 | framework/console/controllers/BaseMigrateController.php:325-340 — both copies are in the same file, so extract the 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 `framework/console/controllers/BaseMigrateController.php:261` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) framework/db/Migration.php:117— framework/db/Migration.php:117-130 | framework/db/Migration.php:146-159 — both copies are in the same file, so extract the 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 `framework/db/Migration.php:117` 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 × 3) framework/db/QueryBuilder.php:458— framework/db/QueryBuilder.php:458-470 | framework/db/oci/QueryBuilder.php:301-313 | framework/db/pgsql/QueryBuilder.php:493-505 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `framework/db/QueryBuilder.php:458` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) framework/db/BaseActiveRecord.php:1319— framework/db/BaseActiveRecord.php:1319-1329 | framework/db/BaseActiveRecord.php:1412-1421 | framework/db/BaseActiveRecord.php:1515-1524 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) framework/db/mysql/Schema.php:107— framework/db/mysql/Schema.php:107-114 | framework/db/oci/Schema.php:79-86 | framework/db/oci/Schema.php:291-299 | framework/db/pgsql/Schema.php:146-153 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. 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) framework/console/controllers/HelpController.php:157— framework/console/controllers/HelpController.php:157-161 | framework/console/controllers/HelpController.php:422-426 — both copies are in the same file, so extract the 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 `framework/console/controllers/HelpController.php:157` 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.
Recommendation — 5 finding(s)
D11 · Test Reliability· Test reliability not included · ×1
Test reliability not included — Test source is present (.php, .js) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 3 significant file(s) lose their only recent owner: framework/base/Controller.php, framework/requirements/YiiRequirementChecker.php, framework/behaviors/TimestampBehavior.php. Pair on, review, or document these before any departure.
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 104 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than listed individually (115 orphaned of 257 analysed files in total, counted over production source files of roughly 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first).
Coverage not included — suite not readable by the collector — Coverage NOT MEASURED: test source is present (.php, .js) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (Clover XML — `vendor/bin/phpunit --coverage-clover coverage.xml`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored.
Info — 2 finding(s)
D12 · Dependency Hygiene· Dependency hygiene not measured · ×1
Dependency hygiene not measured — dependency manifest found but not parsed for hygiene — This repository's dependency manifests (composer.json and package.json) were found, but this pass cannot parse them for hygiene, so no package was assessed. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. This row is about dependency HYGIENE — outdated, deprecated or unmaintained direct dependencies; known CVEs in the same dependency graph are a separate question, reported under D38 wherever the manifest is OSV-readable. Your package.json IS read in this same run: the frontend dependency lens (R8) parses it for unused declarations, undeclared imports and misplaced production dependencies — what is missing here is the outdated/deprecated/unmaintained signal for those npm packages, not the manifest.
D22 · Internal API Consistency· No exposed public API · ×1
No exposed public API — No intentionally-exposed types (IsPackable or .Contracts) to evaluate.
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.
provenance: not applicable — The CI pipeline builds and tests but publishes no released artifact — no package publish, container push, GitHub release or deployment step. Supply-chain provenance, signing and SBOM attest RELEASED artifacts, so there is nothing to attest here. Add them to the release pipeline when this repo starts shipping artifacts (a published package, a container image, a deployed service or a tagged release).
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.
0
—
Run 019fd06c-8673-740e-8a4f-7e43fa4f453d · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 11 · Warnings: 337 · Recommendations: 5 · Info: 2 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 05-08-2026 @ 05:36 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.