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.
Watchdog 05-08-2026 @ 05:36 UTC Public
Code Health Audit

Yiisoft/yii2

No baseline yet — first run
59% Adequate
CriticalWeakAdequateStrongExemplary
middle

Large · 109,086 LoC · rebuild ~1.4 person-years · weakest lens: Code Health (42%)

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

32/33dimensions tool-verifieddeterministic · confidence 1.0 · 1 LLM-assisted, advisory
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 headline Width 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.
Code Health 42% · 47% weightMaturity 65% · 26% weightReadiness 75% · 14% weightSecurity 97% · 8% weightArchitecture 100% · 4% weight

Raise Code Health 42 → 70 (the Healthy floor) ⇒ headline 59 → ~72.

Code composition — where the lines go
Tests 100%
Rebuild cost & value ~ Modeled — €68,000–€340,000
Cost to rebuild€68,000–€340,000 (0.7–2.1 person-years (1,129–3,581 h), ~1–3 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.8× (at 59% quality) — the last 20% of quality is most of the work
Size & shapeLarge · 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.
+17.0 pts · Medium effort · Type Safety
2
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
+17.0 pts · Medium effort · Large Files
3
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).
+5.9 pts · Medium effort · Architecture documentation

Diagnosis — what's actually going on

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.
Evidence: valuation: Large, ~1.4 person-years rebuild (109,086 LoC) · weakest lens: Code Health 42%
→ 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.)

yiiyii.helpersyii.diyii.baseyii.behaviorsyii.cachingyii.consoleyii.console.widgetsyii.dbyii.filters.authyii.i18nyii.logyii.mailyii.mutexyii.rbacyii.web(global)…i.console.controllersyii.db.conditionsyii.db.cubridyii.db.mssqlyii.db.mysqlyii.db.ociyii.db.pgsqlyii.db.sqliteyii.filtersyii.restyii.validatorsyii.widgetsyii.captchayii.data….db.cubrid.conditions…i.db.mssql.conditionsyii.db.oci.conditions….db.sqlite.conditionsyii.gridyii1yii.helpers2yii.di3yii.base4yii.behaviors5yii.caching6yii.console7yii.console.widgets8yii.db9yii.filters.auth10yii.i18n11yii.log12yii.mail13yii.mutex14yii.rbac15yii.web16(global)17…i.console.controllers18yii.db.conditions19yii.db.cubrid20yii.db.mssql21yii.db.mysql22yii.db.oci23yii.db.pgsql24yii.db.sqlite25yii.filters26yii.rest27yii.validators28yii.widgets29yii.captcha30yii.data31….db.cubrid.conditions32…i.db.mssql.conditions33yii.db.oci.conditions34….db.sqlite.conditions35yii.grid3631436120174414321871946851071213212153111141112232111

At a glance — Code Health · 42% · Weak · gated by R1, R3

At a glance — Architecture · 100% · Exemplary

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

At a glance — Readiness · 75% · Strong

At a glance — Security · 97% · Exemplary

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2021 — Security Misconfiguration5Medium
A03:2021 — Injection1Medium

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 thisHelpsEffortDimension
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.+17.0 ptsMediumType Safety
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+17.0 ptsMediumLarge Files
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).+5.9 ptsMediumArchitecture documentation
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.+4.4 ptsMediumDocumentation (README)
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.+3.4 ptsMediumRelease Hygiene
Add type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI.+3.4 ptsMediumTooling
Resolve the 11 Orphaned knowledge finding(s) in Knowledge Freshness — start with exception.php, BaseConsole.php, ActiveField.php.+3.1 ptsMediumKnowledge Freshness
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness.+0.3 ptsLowKnowledge Freshness

File quality

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

FileScoreBandWorst signal
Dockerfile5.4MixedIaC & Container Security: Medium IaC: CKV_DOCKER_4
framework/helpers/BaseHtml.php7.0MixedCyclomatic Complexity: BaseHtml.renderSelectOptions (cyclomatic 26)
framework/i18n/Formatter.php7.0MixedCyclomatic Complexity: Formatter.asDecimalStringFallback (cyclomatic 24)
framework/db/BaseActiveRecord.php7.0MixedCyclomatic Complexity: BaseActiveRecord.unlink (cyclomatic 23)
framework/console/controllers/BaseMigrateController.php7.0MixedCognitive Complexity: BaseMigrateController.getNewMigrations (cognitive 26)
framework/console/controllers/MessageController.php7.0MixedCyclomatic Complexity: MessageController.saveMessagesToDb (cyclomatic 29)
framework/db/ActiveRelationTrait.php7.0MixedCyclomatic Complexity: ActiveRelationTrait.populateRelation (cyclomatic 28)
framework/helpers/BaseFileHelper.php7.0MixedCyclomatic Complexity: BaseFileHelper.changeOwnership (cyclomatic 27)
framework/db/QueryBuilder.php7.0MixedCognitive Complexity: QueryBuilder.buildSelect (cognitive 18)
framework/console/Controller.php7.0MixedCyclomatic Complexity: Controller.bindActionParams (cyclomatic 22)
framework/web/UrlRule.php7.1MixedCyclomatic Complexity: UrlRule.createUrl (cyclomatic 31)
framework/db/ActiveQuery.php7.1MixedCyclomatic Complexity: ActiveQuery.joinWithRelation (cyclomatic 18)
framework/helpers/BaseConsole.php7.1MixedCyclomatic Complexity: BaseConsole.ansiToHtml (cyclomatic 17)
framework/web/Request.php7.1MixedCyclomatic Complexity: Request.parseAcceptHeader (cyclomatic 16)
framework/web/Controller.php7.1MixedCyclomatic Complexity: Controller.filterUnionTypeActionParam (cyclomatic 21)
framework/db/mssql/Schema.php7.1MixedCyclomatic Complexity: Schema.loadColumnSchema (cyclomatic 19)
framework/helpers/BaseArrayHelper.php7.1MixedCyclomatic Complexity: BaseArrayHelper.toArray (cyclomatic 16)
framework/web/Response.php7.1MixedCognitive Complexity: Response.sendContent (cognitive 25)
framework/i18n/MessageFormatter.php7.2MixedCyclomatic Complexity: MessageFormatter.parseToken (cyclomatic 42)
framework/di/Container.php7.2MixedCyclomatic Complexity: Container.resolveCallableDependencies (cyclomatic 33)

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 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
D1D2D3D4D13D15D16D21D28D29D31D33D34D35D37D38M1M2M3M4P1P3P4P6R1R10R2R3R4R6R7R8R9

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

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 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.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 019fd06c-8673-740e-8a4f-7e43fa4f453d.

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

Run transparency — what happened this run

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

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

Dimensions

D1 · Cyclomatic Complexity6.9 / 10Adequate✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 6.9 / 10 · rule-coverage 100% · ceiling Prevented

64 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was MessageFormatter.parseToken at 42.

MessageFormatter.parseToken (cyclomatic 42)framework/i18n/MessageFormatter.php:342
Container.resolveCallableDependencies (cyclomatic 33)framework/di/Container.php:660
UrlRule.createUrl (cyclomatic 31)framework/web/UrlRule.php:457
MessageController.saveMessagesToDb (cyclomatic 29)framework/console/controllers/MessageController.php:355
handleAction (cyclomatic 29)framework/assets/yii.js:153

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

What to do

  1. 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).
  2. 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).
  3. 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).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity4.2 / 10Weak✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 4.2 / 10 · rule-coverage 100% · ceiling Prevented

175 method(s) exceeded the cognitive complexity threshold of 15; the worst was MessageController.extractMessagesFromTokens at 81.

Schema.loadColumnSchema (cognitive 40) · ×2framework/db/cubrid/Schema.php:266
InConditionBuilder.buildCompositeInCondition (cognitive 26) · ×2framework/db/mssql/conditions/InConditionBuilder.php:38
MessageController.extractMessagesFromTokens (cognitive 81)framework/console/controllers/MessageController.php:533
ActiveRelationTrait.populateRelation (cognitive 61)framework/db/ActiveRelationTrait.php:226
BaseActiveRecord.unlink (cognitive 58)framework/db/BaseActiveRecord.php:1406

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

What to do

  1. 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).
  2. 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).
  3. 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).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God 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.

Maturity: DocumentedVerifiedPrevented · effective 9.2 / 10 · rule-coverage 100% · ceiling Prevented

23 god class(es) detected.

TooManyMethods: Request · ×17framework/web/Request.php:92
FileTooLong: i18n/Formatter.php · ×6framework/i18n/Formatter.php:0

✓ On the Gold path — maintain.

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

D4 · Code Duplication9.7 / 10Exemplary✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Verified

58 duplicated block group(s) detected.

Duplicated block (8 lines × 2) · ×10framework/base/Event.php:154
Duplicated block (11 lines × 2) · ×8framework/console/controllers/BaseMigrateController.php:226
Duplicated block (9 lines × 2) · ×8framework/console/controllers/BaseMigrateController.php:769
Duplicated block (10 lines × 2) · ×6framework/db/mssql/Schema.php:417
Duplicated block (7 lines × 2) · ×6framework/base/Security.php:202

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

✓ On the Gold path — maintain.

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

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

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

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

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D15 · Churn × Complexity Hotspots9.9 / 10Exemplary✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: framework/i18n/MessageFormatter.php (2×42=84); framework/db/BaseActiveRecord.php (3×23=69); framework/di/Container.php (2×33=66)

Hotspot: framework/i18n/MessageFormatter.php · ×10framework/i18n/MessageFormatter.php

✓ On the Gold path — maintain.

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

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.

Maturity: DocumentedVerifiedPrevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

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.

D21 · Naming Consistency / 10Exemplary◐ Sampled · advisory

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.

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D28 · Secrets (history)9.0 / 10Exemplary✓ Tool-verified

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.

Maturity: DocumentedVerifiedPrevented · effective 9.0 / 10 · rule-coverage 100% · ceiling Documented

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.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)9.5 / 10Exemplary✓ Tool-verified

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Documented

1 finding(s): 0 critical, 0 high, 1 medium, 0 low.

Medium: tainted-filenameframework/console/Application.php:108detected by semgrep finding

✓ On the Gold path — maintain.

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

D31 · IaC & Container Security9.5 / 10Exemplary✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Documented

6 finding(s): 0 critical, 0 high, 4 medium, 2 low.

Medium IaC: CKV_DOCKER_4 · ×4Dockerfile:6detected by trivy finding
Low IaC: DS-0005Dockerfiledetected by trivy finding

✓ On the Gold path — maintain.

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

D33 · JS/npm Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether JavaScript/npm dependencies have known published vulnerabilities (CVEs) — the npm ecosystem's biggest risk.

Method: JS/npm CVE scan via trivy fs --scanners vuln over JS manifests (package.json/yarn.lock/pnpm-lock/bun.lockb); 0-10 tight normalizer. NotApplicable without JS manifests. Exhaustive, deterministic.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No known-vulnerable JS/npm dependencies.

✓ On the Gold path — maintain.

Detailed fixes: d33_recommendation.md.

D34 · Knowledge Freshness5.4 / 10Adequate✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: DocumentedVerifiedPrevented · effective 5.4 / 10 · rule-coverage 100% · ceiling Documented

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.

Orphaned knowledge · ×11framework/views/errorHandler/exception.php
Further orphaned files (smaller)

What to do

  1. 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).
  2. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

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

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

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling; coupling through a build step, config, or non-source file isn't seen.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: mimeExtensions.php↔mimeTypes.php 50%

Change coupling: mimeExtensions.php ↔ mimeTypes.phpframework/helpers/mimeExtensions.php

✓ On the Gold path — maintain.

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

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D38 · OSV Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

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: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No known-vulnerable dependencies (OSV).

✓ On the Gold path — maintain.

Detailed fixes: d38_recommendation.md.

Frontend & cross-cutting dimensions

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

M1 · Documentation (README)7.7 / 10Strong✓ Tool-verified

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

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

What to do

  • Add 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.
M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

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

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

  • No Architecture Decision Records found — no conventional ADR directory, no `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).
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy10.0 / 10Exemplary◐ Sampled · advisory

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.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

P3 · Security & performance tooling7.0 / 10Strong✓ Tool-verified

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

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

What to do

  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

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.
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.
R10 · Code Duplication9.5 / 10Exemplary✓ Tool-verified

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.
R2 · Cyclomatic Complexity9.9 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

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

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

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

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

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

R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

Reference — by lens

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

LensScoreRatingImpact
Code Health42%Weak — gated by R1, R3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture100%ExemplaryStrongest area.
Maturity65%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness75%StrongSolid.
Security97%ExemplarySolid.
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.

Issue — 11 finding(s)
D34 · Knowledge Freshness · Orphaned knowledge · ×11
  • 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.
Warning — 337 finding(s)
D3 · God Classes · TooManyMethods · ×17
  • 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.
D15 · Churn × Complexity Hotspots · Hotspot · ×10
  • 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×10
  • 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×8
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×8
  • 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.
D3 · God Classes · FileTooLong · ×6
  • 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×6
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×6
  • 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.
D31 · IaC & Container Security · Medium IaC · ×4
  • Medium IaC: CKV_DOCKER_4 Dockerfile:6 — Ensure that COPY is used instead of ADD in Dockerfiles
  • Medium IaC: CKV_DOCKER_4 Dockerfile:9 — Ensure that COPY is used instead of ADD in Dockerfiles
  • Medium IaC: CKV_DOCKER_7 Dockerfile:2 — Ensure the base image uses a non latest version tag
  • Medium IaC: CKV_DOCKER_3 Dockerfile:1 — Ensure that a user for the container has been created
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×3
  • 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.
D2 · Cognitive Complexity · Schema.loadColumnSchema (cognitive 40) · ×2
  • 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.
D2 · Cognitive Complexity · InConditionBuilder.buildCompositeInCondition (cognitive 26) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×2
  • 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.
D1 · Cyclomatic Complexity · MessageFormatter.parseToken (cyclomatic 42) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.resolveCallableDependencies (cyclomatic 33) · ×1
  • 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.
D1 · Cyclomatic Complexity · UrlRule.createUrl (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · MessageController.saveMessagesToDb (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · handleAction (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · ActiveRelationTrait.populateRelation (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · ColumnSchema.typecast (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · IpValidator.validateSubnet (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · BaseFileHelper.changeOwnership (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · MessageController.extractMessagesFromTokens (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · BaseHtml.renderSelectOptions (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · UrlManager.createUrl (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · InConditionBuilder.build (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · Schema.loadColumnSchema (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · Formatter.asDecimalStringFallback (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · BaseActiveRecord.unlink (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · UrlRule.translatePattern (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · Controller.bindActionParams (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · BaseFileHelper.copyDirectory (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · ActiveField.getClientOptions (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · DetailView.normalizeAttributes (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · MessageController.saveMessagesCategoryToPHP (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · MessageController.saveMessagesToPO (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · ActiveRelationTrait.populateInverseRelation (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · BaseHtml.renderTagAttributes (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · Controller.filterUnionTypeActionParam (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · UrlRule.parseRequest (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · User.renewAuthStatus (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · Controller.runAction (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · Controller.getActionArgsHelp (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · BaseActiveRecord.link (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · Schema.loadColumnSchema (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · BaseVarDumper.dumpInternal (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · Formatter.formatDateTimeValue (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · DateValidator.init (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 20) · ×1
  • (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.
D1 · Cyclomatic Complexity · QueryTrait.filterCondition (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · Schema.loadColumnSchema (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · CompositeAuth.authenticate (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · Formatter.normalizeDatetimeValue (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · Menu.normalizeItems (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · ActiveQuery.joinWithRelation (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · BaseActiveRecord.unlinkAll (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · FileValidator.validateValue (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · Application.bootstrap (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Model.scenarios (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · ErrorHandler.renderException (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · ActiveRelationTrait.filterByModels (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Schema.findColumns (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Schema.loadColumnSchema (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.getDependencies (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · BaseConsole.ansiToHtml (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · BaseConsole.getScreenSize (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Formatter.asRelativeTime (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · compare (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Component.__set (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Command.getRawSql (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Schema.loadTableConstraints (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Instance.ensure (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · BaseArrayHelper.toArray (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · BaseJson.processData (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Controller.bindActionParams (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Request.parseAcceptHeader (cyclomatic 16) · ×1
  • 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.
D19 · Documentation Quality · LLM evaluation failed · ×1
  • LLM evaluation failed — JSON parse error: Expected end of string, but instead reached end of data. Path: $.findings[1].issue | LineNumber: 0 | BytePositionInLine: 1281.
D2 · Cognitive Complexity · MessageController.extractMessagesFromTokens (cognitive 81) · ×1
  • 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.
D2 · Cognitive Complexity · ActiveRelationTrait.populateRelation (cognitive 61) · ×1
  • 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.
D2 · Cognitive Complexity · BaseActiveRecord.unlink (cognitive 58) · ×1
  • 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.
D2 · Cognitive Complexity · Container.getDependencies (cognitive 57) · ×1
  • 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.
D2 · Cognitive Complexity · BaseHtml.renderSelectOptions (cognitive 56) · ×1
  • 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.
D2 · Cognitive Complexity · ActiveRelationTrait.populateInverseRelation (cognitive 54) · ×1
  • 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.
D2 · Cognitive Complexity · Controller.runAction (cognitive 52) · ×1
  • 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.
D2 · Cognitive Complexity · MessageController.saveMessagesToPO (cognitive 52) · ×1
  • 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.
D2 · Cognitive Complexity · Container.resolveCallableDependencies (cognitive 52) · ×1
  • 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.
D2 · Cognitive Complexity · MessageFormatter.parseToken (cognitive 52) · ×1
  • 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.
D2 · Cognitive Complexity · UrlManager.createUrl (cognitive 49) · ×1
  • 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.
D2 · Cognitive Complexity · UrlRule.createUrl (cognitive 48) · ×1
  • 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.
D2 · Cognitive Complexity · Controller.bindActionParams (cognitive 45) · ×1
  • 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.
D2 · Cognitive Complexity · Formatter.asDecimalStringFallback (cognitive 45) · ×1
  • 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.
D2 · Cognitive Complexity · BaseFileHelper.copyDirectory (cognitive 44) · ×1
  • 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.
D2 · Cognitive Complexity · BaseHtml.renderTagAttributes (cognitive 44) · ×1
  • 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.
D2 · Cognitive Complexity · MessageController.saveMessagesToDb (cognitive 43) · ×1
  • 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.
D2 · Cognitive Complexity · Table.renderRow (cognitive 43) · ×1
  • 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.
D2 · Cognitive Complexity · IpValidator.validateSubnet (cognitive 43) · ×1
  • 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.
D2 · Cognitive Complexity · BaseActiveRecord.unlinkAll (cognitive 42) · ×1
  • 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.
D2 · Cognitive Complexity · DetailView.normalizeAttributes (cognitive 41) · ×1
  • 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.
D2 · Cognitive Complexity · BaseActiveRecord.link (cognitive 40) · ×1
  • 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.
D2 · Cognitive Complexity · Model.scenarios (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · Controller.getActionArgsHelp (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · handleAction (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · BaseArrayHelper.toArray (cognitive 38) · ×1
  • 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.
D2 · Cognitive Complexity · MessageController.saveMessagesCategoryToPHP (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · FileCache.gcRecursive (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · BaseFileHelper.changeOwnership (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · UrlRule.translatePattern (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · ActiveRelationTrait.filterByModels (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · Sort.getAttributeOrders (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · Controller.filterUnionTypeActionParam (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · MultipartFormDataParser.parse (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · Menu.normalizeItems (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · InConditionBuilder.build (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · UrlManager.parseRequest (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · Schema.loadColumnSchema (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · Formatter.formatDateTimeValue (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · updateInputs (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · Application.bootstrap (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · AssetController.loadTargets (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · MessageFormatter.replaceNamedArguments (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · ActiveField.getClientOptions (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · (anonymous) (cognitive 29) · ×1
  • (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.
D2 · Cognitive Complexity · ActiveQuery.prepare (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · ColumnSchema.typecast (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · BaseVarDumper.exportInternal (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · Logger.getProfiling (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · CompositeAuth.authenticate (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · BaseArrayHelper.filter (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · BaseJson.processData (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · UrlRule.parseRequest (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · Event.off (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · Request.resolve (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · BaseMigrateController.getNewMigrations (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · QueryTrait.filterCondition (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · BaseConsole.getScreenSize (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · BaseStringHelper.truncateHtml (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · Request.parseAcceptHeader (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · BaseMigrateController.actionUp (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · ActiveRelationTrait.buildBuckets (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · QueryBuilder.insert (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · AccessRule.matchRole (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · Formatter.asRelativeTime (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · Target.filterMessages (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · Response.sendContent (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · User.renewAuthStatus (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · XmlResponseFormatter.buildXml (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · Schema.loadColumnSchema (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · BaseVarDumper.dumpInternal (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · Event.trigger (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · AssetController.adjustCssUrl (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · ActiveQuery.removeDuplicatedModels (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · ActiveQuery.joinWithRelation (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · Cors.prepareHeaders (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · Logger.flush (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · PhpManager.load (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · Controller.bindActionParams (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · Response.sendCookies (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · Component.off (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · Event.hasHandlers (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · AssetController.buildTarget (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · ActiveDataFilter.buildAttributeCondition (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · Sort.createSortParam (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · ActiveQuery.buildJoinWith (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · ActiveQuery.joinWithRelations (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · Schema.createColumn (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · BaseConsole.ansiColorizedSubstr (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · BaseHtml.getAttributeValue (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · Formatter.normalizeDatetimeValue (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · UrlRule.parseRequest (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · UniqueValidator.validateAttribute (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · AssetBundle.publish (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · AssetManager.publishDirectory (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · ErrorHandler.renderException (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · Request.getHeaders (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · ErrorHandler.renderException (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · BaseMigrateController.actionRedo (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · BaseMigrateController.actionMark (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · Table.calculateRowsSize (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · QueryBuilder.oldUpsert (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · Schema.findColumns (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · Schema.loadTableConstraints (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · ContentNegotiator.negotiateLanguage (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · PhpManager.removeAllItems (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · DateValidator.init (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · BaseMigrateController.actionDown (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · ActiveDataProvider.prepareKeys (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · Connection.openFromPoolSequentially (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · BaseConsole.ansiToHtml (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · BaseHtml.checkboxList (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · MultipartFormDataParser.addFile (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · View.registerFile (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · ip (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · SqlToken.tokensMatch (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · QueryBuilder.upsert (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · BaseArrayHelper.index (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · BaseVarDumper.exportClosure (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · Formatter.formatNumber (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · ExistValidator.checkTargetAttributeExistence (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · UniqueValidator.modelExists (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · ErrorHandler.argumentsToString (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · Request.loadCookies (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · Menu.isItemActive (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · validateFile (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · BaseYii.setAlias (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · Cache.multiGet (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · MemCache.getMemcache (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · Controller.getActionOptionsHelp (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · BaseMigrateController.beforeAction (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · DataFilter.validateAttributeCondition (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · ActiveRelationTrait.prefixKeyColumns (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · Command.getRawSql (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · Query.cleanUpTableNames (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · QueryBuilder.buildSelect (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · InConditionBuilder.buildCompositeInCondition (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · Instance.ensure (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · MessageFormatter.tokenizePattern (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · Logger.log (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · IndexAction.prepareDataProvider (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · DateValidator.validateAttribute (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · Controller.filterSingleTypeActionParam (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · View.renderBodyEndHtml (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · ErrorHandler.handleError (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · BaseMigrateController.actionHistory (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · BaseMigrateController.actionNew (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · HelpController.getModuleCommands (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · MessageController.actionExtract (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · MigrateController.generateMigrationSourceCode (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · MigrateController.parseFields (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · ActiveRelationTrait.addInverseRelations (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · Query.column (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · QueryBuilder.upsert (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · BaseFileHelper.normalizePath (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · BaseFileHelper.removeDirectory (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · BaseFileHelper.lastExcludeMatchingFromList (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · BaseHtml.beginForm (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · GettextMoFile.load (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · EmailValidator.validateValue (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · Response.redirect (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · ErrorException.__construct (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · HelpController.getDefaultHelp (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Command.queryInternal (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Query.getUniqueColumns (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · QueryBuilder.upsert (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · BaseArrayHelper.getValue (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · BaseFileHelper.matchPathname (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · BaseHtml.radioList (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Formatter.asCurrency (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · NumberValidator.validateAttribute (cognitive 16) · ×1
  • 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.
D29 · Static Analysis (SAST) · Medium · ×1
  • Medium: tainted-filename framework/console/Application.php:108 — File name based on user input risks server-side request forgery.
D35 · Change Coupling · Change coupling · ×1
  • 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.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×1
  • 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.
D16 · Bus Factor · Off-boarding risk · ×1
  • 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.
D31 · IaC & Container Security · Low IaC · ×1
  • Low IaC: DS-0005 Dockerfile — ADD instead of COPY
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).
D8 · Code Coverage · Coverage not included · ×1
  • 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.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaksgitleaks detect --no-banner --report-format json --report-path /dev/stdout --exit-code 0 --source .1artifacts/raw/gitleaks-history.json
D29 · Static Analysis (SAST)semgrepsemgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --json --quiet --timeout 0 --metrics off .1artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (no readable dependency manifest)none (no readable dependency manifest): not present in this environment0
D31 · IaC & Container Securitytrivytrivy config --format json --quiet .6artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrepsemgrep: not applicable — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.0
D33 · JS/npm Dependency Vulnerabilitiestrivytrivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0
D36 · Supply-chain Provenance & Signingprovenanceprovenance: 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).0
D38 · OSV Dependency Vulnerabilitiesosv-scannerosv-scanner --format json --recursive .0artifacts/raw/osv-scanner.json
D40 · Network Egress Confinementruntime-hardeningruntime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0
D41 · Kernel & Syscall Confinementruntime-hardeningruntime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0
D42 · Runtime Threat Enforcementruntime-hardeningruntime-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.

Downloadable artifacts

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

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