Public report — grav, 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 @ 04:26 UTC Public
Code Health Audit

Getgrav/grav

No baseline yet — first run
59% At Risk

Medium · 96,615 LoC · rebuild ~0.8 person-years · weakest lens: Maturity (52%)

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

22/24dimensions tool-verifieddeterministic · confidence 1.0 · 2 LLM-assisted, advisory
453findings with an exact file:lineof 465 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
24/93dimensions across the health lenses96615 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.

getgrav/grav 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.

Most urgent: a critical security exposure was detected (see the Security & Compliance lens). Treat it as a priority regardless of the overall grade.

The area that most needs attention is Maturity (52%) — onboarding is slow — key decisions and the architecture aren't written down, so contributors have to reverse-engineer the intent. Security (58%) is the next concern — exposure to security and compliance incidents is elevated.

Leadership focus, highest impact first: Record significant decisions one document per decision (Architecture documentation); 'Architecture' / 'How it works' section to the root README (Documentation (README)); Reconcile the README with reality (Documentation accuracy).

For scale: Medium (~96,615 production lines); rebuilding it from scratch would take roughly ~0.8 person-years (~1–2 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.
Maturity 52% · 47% weightSecurity 58% · 26% weightReadiness 65% · 14% weightCode Health 71% · 8% weightArchitecture 100% · 4% weight

Raise Maturity 52 → 70 (the Healthy floor) ⇒ headline 59 → ~64.

Code composition — where the lines go
Tests 100%
Rebuild cost & value ~ Modeled — €38,000–€190,000
Cost to rebuild€38,000–€190,000 (0.4–1.2 person-years (635–2,013 h), ~1–2 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 & shapeMedium · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

This codebase represents roughly ~0.8 person-years of build effort (about ~€110,000 to rebuild). Its weakest lens is Maturity at 52% — 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
Resolve the 6 Orphaned knowledge finding(s) in Knowledge Freshness — start with PageIndex.php, FlexIndex.php, MediaUploadTrait.php.
+4.8 pts · Low effort · Knowledge Freshness
2
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).
+7.8 pts · Medium effort · Architecture documentation
3
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
+6.1 pts · Medium effort · Documentation (README)

Diagnosis — what's actually going on

The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 1–3 engineer-days once. Not doing it costs about 10.4–62.6 engineer-days every year, paid as drag on the ~125,386 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–3 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–7% 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: 30,917 line(s) changed over a 90-day window ⇒ ~125,386/year · D1/D2/D4 code quality: averaging 6.7/10 ⇒ a 3–7% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 3 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Medium asset (~0.8 person-years to rebuild), and its weakest lens is Maturity at 52%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Medium, ~0.8 person-years rebuild (96,615 LoC) · weakest lens: Maturity 52%
→ Direct remediation budget at Maturity first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: 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). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ 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).
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.7/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 3–7% 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.7/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

121 modules, 173 dependencies — 3 dependency cycles, 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.)

Doctrine.Common.CacheGrav.Console…work.Contracts.Object…ork.Object.Interfaces…etTheme.Toolbox.EventGrav.Common.Language…ntracts.Relationships…work.Media.InterfacesGrav.Framework.ObjectGrav.Framework.Route…av.Common.Page.Medium…mon.Processors.Events…mmon.Media.Interfaces…ommon.Page.Interfaces…ommon.User.InterfacesGrav.Common.DataGrav.Console.CliGrav.Common.ConfigGrav.Common.User…ework.Form.Interfaces…v.Common.Twig.Sandbox…ework.Flex.InterfacesGrav.Framework.FormGrav.Framework.FlexGrav.Common.FlexGrav.Common.Page….Framework.Flex.Pages…Framework.Flex.TraitsGrav.Framework.MediaGrav.Common…mmon.Flex.Types.Pages…Flex.Types.UserGroupsGrav.Common.Assets…av.Common.Flex.Traits…mmon.Flex.Types.UsersGrav.Common.GPM.Common…v.Common.Media.TraitsGrav.Common.ProcessorsGrav.Common.TwigGrav.EventsDoctrine.Common.Cache1Grav.Console2…work.Contracts.Object3…ork.Object.Interfaces4…etTheme.Toolbox.Event5Grav.Common.Language6…ntracts.Relationships7…work.Media.Interfaces8Grav.Framework.Object9Grav.Framework.Route10…av.Common.Page.Medium11…mon.Processors.Events12…mmon.Media.Interfaces13…ommon.Page.Interfaces14…ommon.User.Interfaces15Grav.Common.Data16Grav.Console.Cli17Grav.Common.Config18Grav.Common.User19…ework.Form.Interfaces20…v.Common.Twig.Sandbox21…ework.Flex.Interfaces22Grav.Framework.Form23Grav.Framework.Flex24Grav.Common.Flex25Grav.Common.Page26….Framework.Flex.Pages27…Framework.Flex.Traits28Grav.Framework.Media29Grav.Common30…mmon.Flex.Types.Pages31…Flex.Types.UserGroups32Grav.Common.Assets33…av.Common.Flex.Traits34…mmon.Flex.Types.Users35Grav.Common.GPM.Common36…v.Common.Media.Traits37Grav.Common.Processors38Grav.Common.Twig39Grav.Events4014151111612113111111213131111311511122332011314112113111121222153115211131132111215111131121212114111212+81 more modules (most-connected shown)

At a glance — Code Health · 71% · Adequate · gated by D2

At a glance — Architecture · 100% · Exemplary

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

At a glance — Readiness · 65% · Adequate · gated by P3

At a glance — Security · 58% · Adequate · gated by D29, D36

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
A03:2021 — Injection17High / Critical
A06:2021 — Vulnerable & Outdated Components2High / Critical

Roadmap

First, establish a formal record of significant architectural decisions by creating dated documents in a dedicated directory to capture context, choices, and consequences. Next, update the root README to include a high-level 'Architecture' or 'How it works' section that outlines the system's shape. Then, reconcile the README with reality by removing references to non-existent Docker configurations. After that, enhance the overall quality and structure of the documentation to ensure it is comprehensive and accurate. Finally, address the six orphaned knowledge items, starting with PageIndex.php, FlexIndex.php, and MediaUploadTrait.php, to ensure all knowledge is current and accessible.

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

Do thisHelpsEffortDimension
Resolve the 6 Orphaned knowledge finding(s) in Knowledge Freshness — start with PageIndex.php, FlexIndex.php, MediaUploadTrait.php.+4.8 ptsLowKnowledge Freshness
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).+7.8 ptsMediumArchitecture documentation
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.+6.1 ptsMediumDocumentation (README)
Reconcile the README with reality: README advertises Docker containerisation, but no Dockerfile/compose file exists.+5.6 ptsMediumDocumentation accuracy
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor.+2.7 ptsLowBus Factor
Resolve the 1 Off-boarding risk finding(s) in Bus Factor.+2.7 ptsLowBus Factor
Improve Documentation Quality — currently 7.0/10.+4.9 ptsMediumDocumentation Quality
Your ecosystem's static analyzer is declared as a dependency but is not wired into CI — run it as a required step on push/PR (e.g. `composer phpstan` / `mix sobelow` / `bundle exec brakeman` / the spotbugs Gradle task / `sbt scalafixAll --check` / `golangci-lint run` / `rebar3 lint`) so a regression fails the build instead of relying on someone running it locally.+3.2 ptsMediumSecurity & performance tooling

File quality

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

FileScoreBandWorst signal
system/src/Grav/Common/Config/Env.php4.0MixedStatic Analysis (SAST): Medium: tainted-filename
.github/workflows/build.yaml4.6MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/claude-code-review.yml5.1MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
.github/workflows/claude.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
composer.lock5.8MixedOSV Dependency Vulnerabilities: Critical CVE: [GHSA redacted]
system/src/Grav/Common/Page/Pages.php7.0MixedCyclomatic Complexity: Pages.getCollection (cyclomatic 50)
system/src/Grav/Common/Page/Page.php7.0MixedCyclomatic Complexity: Page.header (cyclomatic 45)
system/src/Grav/Common/Uri.php7.0MixedCyclomatic Complexity: Uri.convertUrl (cyclomatic 35)
system/src/Grav/Common/Data/Validation.php7.0MixedCyclomatic Complexity: Validation.arrayFilterRecurse (cyclomatic 22)
system/src/Grav/Common/Security.php7.0MixedCyclomatic Complexity: Security.resolveTwigContentEvents (cyclomatic 22)
system/src/Grav/Common/Debugger.php7.0MixedCyclomatic Complexity: Debugger.deprecatedErrorHandler (cyclomatic 49)
system/src/Grav/Common/Scheduler/Scheduler.php7.0MixedCyclomatic Complexity: Scheduler.processJobsWithWorkers (cyclomatic 34)
system/src/Grav/Console/Gpm/SelfupgradeCommand.php7.0MixedCyclomatic Complexity: SelfupgradeCommand.handlePreflightReport (cyclomatic 33)
system/src/Grav/Common/GPM/GPM.php7.0MixedCyclomatic Complexity: GPM.getDependencies (cyclomatic 27)
system/src/Grav/Common/Utils.php7.0MixedCyclomatic Complexity: Utils.url (cyclomatic 26)
system/src/Grav/Framework/Flex/FlexCollection.php7.0MixedCyclomatic Complexity: FlexCollection.render (cyclomatic 21)
system/src/Grav/Framework/Flex/FlexObject.php7.0MixedCyclomatic Complexity: FlexObject.render (cyclomatic 20)
system/src/Grav/Common/Flex/Types/Pages/PageCollection.php7.0MixedCyclomatic Complexity: PageCollection.buildSort (cyclomatic 32)
system/src/Grav/Common/GPM/Installer.php7.0MixedCyclomatic Complexity: Installer.install (cyclomatic 23)
system/src/Grav/Installer/Install.php7.0MixedCyclomatic Complexity: Install.detectPendingPackageUpdates (cyclomatic 18)

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. 22 of 24 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 2 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 — 24 dimensions across the health lenses
D1D2D3D4D13D15D16D19D21D28D29D34D35D36D37D38M1M2M3M4P1P3P4P6

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, 453 of 465 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 · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ 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 019fd02b-d588-7812-b4a8-7640f1e4aac2.

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.

  • 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.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement.
  • 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").
  • 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 (3): D19, 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.7 / 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.7 / 10 · rule-coverage 100% · ceiling Prevented

90 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Pages.getCollection at 50. A further 1 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being Installer.lastErrorMsg at 21 — they are counted neither in the figure above nor in this dimension's score.

Pages.getCollection (cyclomatic 50)system/src/Grav/Common/Page/Pages.php:582
Debugger.deprecatedErrorHandler (cyclomatic 49)system/src/Grav/Common/Debugger.php:948
Page.header (cyclomatic 45)system/src/Grav/Common/Page/Page.php:535
PageIndex.getLevelListingRecurse (cyclomatic 41)system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:518
Media.init (cyclomatic 38)system/src/Grav/Common/Page/Media.php:128

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

What to do

  1. Resolve the 1 Pages.getCollection (cyclomatic 50) finding(s) in Cyclomatic Complexity — start with Pages.php. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Debugger.deprecatedErrorHandler (cyclomatic 49) finding(s) in Cyclomatic Complexity — start with Debugger.php. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Page.header (cyclomatic 45) finding(s) in Cyclomatic Complexity — start with Page.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 Complexity3.7 / 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 3.7 / 10 · rule-coverage 100% · ceiling Prevented

199 method(s) exceeded the cognitive complexity threshold of 15; the worst was Scheduler.processJobsWithWorkers at 118.

Scheduler.processJobsWithWorkers (cognitive 118)system/src/Grav/Common/Scheduler/Scheduler.php:741
Debugger.deprecatedErrorHandler (cognitive 98)system/src/Grav/Common/Debugger.php:948
PageIndex.getLevelListingRecurse (cognitive 96)system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:518
Page.header (cognitive 94)system/src/Grav/Common/Page/Page.php:535
SchedulerCommand.serve (cognitive 85)system/src/Grav/Console/Cli/SchedulerCommand.php:73

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

What to do

  1. Resolve the 1 Scheduler.processJobsWithWorkers (cognitive 118) finding(s) in Cognitive Complexity — start with Scheduler.php. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Debugger.deprecatedErrorHandler (cognitive 98) finding(s) in Cognitive Complexity — start with Debugger.php. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 PageIndex.getLevelListingRecurse (cognitive 96) finding(s) in Cognitive Complexity — start with PageIndex.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 Classes8.4 / 10Strong✓ Tool-verified

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

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

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

42 god class(es) detected.

TooManyMethods: Page · ×31system/src/Grav/Common/Page/Page.php:51
FileTooLong: Page/Pages.php · ×11system/src/Grav/Common/Page/Pages.php:0

What to do

  1. Resolve the 31 TooManyMethods finding(s) in God Classes — start with Page.php, GravExtension.php, Utils.php. — One of this dimension's main actionable groups (31 warning-level).
  2. Resolve the 11 FileTooLong finding(s) in God Classes — start with Pages.php, Page.php, Utils.php. — One of this dimension's main actionable groups (11 warning-level).
  3. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.6 / 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.6 / 10 · rule-coverage 100% · ceiling Verified

87 duplicated block group(s) detected.

Duplicated block (14 lines × 2) · ×15system/src/DOMLettersIterator.php:112
Duplicated block (11 lines × 2) · ×12system/src/Grav/Common/Filesystem/ZipArchiver.php:289
Duplicated block (9 lines × 2) · ×9system/src/Grav/Common/Filesystem/Folder.php:88
Duplicated block (12 lines × 2) · ×8system/src/Grav/Common/Data/Data.php:109
Duplicated block (13 lines × 2) · ×6system/src/Grav/Common/Assets/Pipeline.php:378

+ 18 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.3 / 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.3 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: system/src/Grav/Common/Page/Page.php (14×45=630); system/src/Grav/Common/Page/Pages.php (8×50=400); system/src/Grav/Common/Twig/Twig.php (12×30=360)

Hotspot: system/src/Grav/Common/Page/Page.php · ×10system/src/Grav/Common/Page/Page.php

✓ On the Gold path — maintain.

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

D16 · Bus Factor6.5 / 10Adequate✓ 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 6.5 / 10 · rule-coverage 100% · ceiling Documented

98 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is system/src/Grav/Common/Page/Page.php.

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

What to do

  1. Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

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

D19 · Documentation Quality / 10Strong◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

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

Grav's documentation is strong and well-structured: a single README with an excellent overview of the platform's features, architecture, and package system; a dedicated conformance test harness README that explains how to run tests against CommonMark/GFM specifications, lists all four fixture files, and explains the two-number grading scheme (strict vs. loose normalization) while noting the engine-only baseline and absolute-percent honesty; both documents are clipped mid-sentence but carry full outlines so no section is flagged as missing. The conformance test harness is particularly thorough for a single-file project.

What to do

  1. Improve Documentation Quality — currently 7.0/10. — Grav's documentation is strong and well-structured: a single README with an excellent overview of the platform's features, architecture, and package system; a dedicated conformance test harness README that explains how to run tests against CommonMark/GFM specifications, lists all four fixture files, and explains the two-number grading scheme (strict vs. loose normalization) while noting the engine-only baseline and absolute-percent honesty; both documents are clipped mid-sentence but carry full outlines so no section is flagged as missing. The conformance test harness is particularly thorough for a single-file project.

Detailed fixes: d19_recommendation.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)10.0 / 10Exemplary○ Nothing flagged

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

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

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

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

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

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

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

17 finding(s): 0 critical, 12 high, 5 medium, 0 low.

High: github-actions-mutable-action-tag · ×12.github/workflows/build.yaml:18detected by semgrep finding
Medium: tainted-filename · ×5system/router.php:18detected by semgrep finding

What to do

  1. Resolve the 12 High finding(s) in Static Analysis (SAST) — start with build.yaml (5), claude-code-review.yml (3), claude.yml (2). — One of this dimension's main actionable groups (12 issue-level).
  2. Resolve the 5 Medium finding(s) in Static Analysis (SAST) — start with Env.php (4), router.php. — One of this dimension's main actionable groups (5 warning-level).

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

D34 · Knowledge Freshness5.2 / 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.2 / 10 · rule-coverage 100% · ceiling Documented

135 of 280 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is system/src/Grav/Common/Flex/Types/Pages/PageIndex.php.

Orphaned knowledge · ×6system/src/Grav/Common/Flex/Types/Pages/PageIndex.php
Further orphaned files (smaller)

What to do

  1. Resolve the 6 Orphaned knowledge finding(s) in Knowledge Freshness — start with PageIndex.php, FlexIndex.php, MediaUploadTrait.php. — One of this dimension's main actionable groups (6 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

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

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

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

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

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

Unpinned build actions
Secret passed as a command-line argument
No build provenance
No artifact signing
No SBOM

What to do

  1. Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Secret passed as a command-line argument finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D38 · OSV Dependency Vulnerabilities8.1 / 10Strong✓ Tool-verified

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 8.1 / 10 · rule-coverage 100% · ceiling Documented

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

Critical CVE: [GHSA redacted]composer.lockdetected by osv-scanner finding
High CVE: [GHSA redacted]composer.lockdetected by osv-scanner finding

What to do

  1. Resolve the 1 Critical CVE finding(s) in OSV Dependency Vulnerabilities — start with composer.lock. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 High CVE finding(s) in OSV Dependency Vulnerabilities — start with composer.lock. — One of this dimension's main actionable groups (1 issue-level).

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

Frontend & cross-cutting dimensions

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

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

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

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

What to do

  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
M2 · Architecture documentation0.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.
  • No C4/PlantUML/Mermaid diagram or architecture.md — the high-level shape isn't documented.

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).
  • Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

M4 · Documentation accuracy8.0 / 10Strong◐ 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.

  • README advertises Docker containerisation, but no Dockerfile/compose file exists

What to do

  • Reconcile the README with reality: README advertises Docker containerisation, but no Dockerfile/compose file exists.
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 tooling3.0 / 10Weak✓ Tool-verified

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

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

What to do

  • Your ecosystem's static analyzer is declared as a dependency but is not wired into CI — run it as a required step on push/PR (e.g. `composer phpstan` / `mix sobelow` / `bundle exec brakeman` / the spotbugs Gradle task / `sbt scalafixAll --check` / `golangci-lint run` / `rebar3 lint`) so a regression fails the build instead of relying on someone running it locally.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • 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.

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 Health71%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture100%ExemplaryStrongest area.
Maturity52%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness65%Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security58%Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 69 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
  • 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 — ~11525 lines of test source are present (.php) 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), 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.
  • 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 — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Terraform, Kubernetes/Helm, CloudFormation); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
  • D33 JS/npm Dependency Vulnerabilities — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.
  • 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) 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 none of the 3 signals this check looks for
  • 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 — and nothing was matched here. The coverage check applies to any stack, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • 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.
  • 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.
  • 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 — 20 finding(s)
D29 · Static Analysis (SAST) · High · ×12
  • High: github-actions-mutable-action-tag .github/workflows/build.yaml:18 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v2`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v2 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yaml:28 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: shivammathur/setup-php@<40-character SHA>`. This step references `shivammathur/setup-php@v2`; resolve the SHA it points at today with `gh api repos/shivammathur/setup-php/commits/v2 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yaml:65 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: svenstaro/upload-release-action@<40-character SHA>`. This step references `svenstaro/upload-release-action@v2`; resolve the SHA it points at today with `gh api repos/svenstaro/upload-release-action/commits/v2 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yaml:82 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: technote-space/workflow-conclusion-action@<40-character SHA>`. This step references `technote-space/workflow-conclusion-action@v2`; resolve the SHA it points at today with `gh api repos/technote-space/workflow-conclusion-action/commits/v2 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/build.yaml:83 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: 8398a7/action-slack@<40-character SHA>`. This step references `8398a7/action-slack@v3`; resolve the SHA it points at today with `gh api repos/8398a7/action-slack/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/claude-code-review.yml:38 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
  • High: run-shell-injection .github/workflows/claude-code-review.yml:44 — Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: github-actions-mutable-action-tag .github/workflows/claude-code-review.yml:48 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: anthropics/claude-code-action@<40-character SHA>`. This step references `anthropics/claude-code-action@v1`; resolve the SHA it points at today with `gh api repos/anthropics/claude-code-action/commits/v1 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/claude.yml:29 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/claude.yml:35 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: anthropics/claude-code-action@<40-character SHA>`. This step references `anthropics/claude-code-action@v1`; resolve the SHA it points at today with `gh api repos/anthropics/claude-code-action/commits/v1 --jq .sha`.
  • High: run-shell-injection .github/workflows/trigger-docker.yml:27 — Using variable interpolation `${{...}}` with a workflow input / an expression value in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. A workflow input / an expression value is not bounded by this step and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: github-actions-mutable-action-tag .github/workflows/trigger-skeletons.yml:25 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v2`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v2 --jq .sha`.
D34 · Knowledge Freshness · Orphaned knowledge · ×6
  • Orphaned knowledge system/src/Grav/Common/Flex/Types/Pages/PageIndex.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 system/src/Grav/Framework/Flex/FlexIndex.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 system/src/Grav/Common/Media/Traits/MediaUploadTrait.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 system/src/Grav/Common/Flex/Types/Pages/PageCollection.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 system/src/Grav/Framework/Form/Traits/FormTrait.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 system/src/Grav/Framework/Flex/Storage/FolderStorage.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.
D38 · OSV Dependency Vulnerabilities · Critical CVE · ×1
  • Critical CVE: [GHSA redacted] composer.lock — twig/twig 3.x-dev: [GHSA redacted] — upgrade to 3.26.0. This is 1 of 12 advisories with a published fix this scan raises against twig/twig 3.x-dev, and their fixed versions do not agree — anything below 3.27.0 still leaves at least one of them open. Take this package to 3.27.0 or later: that is the floor for the package, not this row's target alone. This one row stands for the 12 advisories this scan raises against twig/twig 3.x-dev: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
D38 · OSV Dependency Vulnerabilities · High CVE · ×1
  • High CVE: [GHSA redacted] composer.lock — guzzlehttp/guzzle 7.13.1: [GHSA redacted] — guzzlehttp/guzzle is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or require guzzlehttp/guzzle:^7.15.2 explicitly so composer resolves the patched copy). This is 1 of 6 advisories with a published fix this scan raises against guzzlehttp/guzzle 7.13.1, and their fixed versions do not agree — anything below 7.15.2 still leaves at least one of them open. Take this package to 7.15.2 or later: that is the floor for the package, not this row's target alone. This one row stands for the 6 advisories this scan raises against guzzlehttp/guzzle 7.13.1: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
Warning — 435 finding(s)
D3 · God Classes · TooManyMethods · ×31
  • TooManyMethods: Page system/src/Grav/Common/Page/Page.php:51 — TooManyMethods — 132 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: GravExtension system/src/Grav/Common/Twig/Extension/GravExtension.php:75 — TooManyMethods — 90 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: Utils system/src/Grav/Common/Utils.php:46 — TooManyMethods — 78 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: Pages system/src/Grav/Common/Page/Pages.php:58 — 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: FlexObject system/src/Grav/Framework/Flex/FlexObject.php:54 — TooManyMethods — 66 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: Validation system/src/Grav/Common/Data/Validation.php:35 — TooManyMethods — 65 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: Uri system/src/Grav/Common/Uri.php:33 — 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: Job system/src/Grav/Common/Scheduler/Job.php:30 — TooManyMethods — 58 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: GPM system/src/Grav/Common/GPM/GPM.php:34 — TooManyMethods — 57 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: FormTrait system/src/Grav/Framework/Form/Traits/FormTrait.php:46 — TooManyMethods — 57 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: PageLegacyTrait system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:44 — TooManyMethods — 56 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: FlexIndex system/src/Grav/Framework/Flex/FlexIndex.php:44 — 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: PageIndex system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:51 — TooManyMethods — 53 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: FlexDirectory system/src/Grav/Framework/Flex/FlexDirectory.php:51 — 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: AbstractIndexCollection system/src/Grav/Framework/Collection/AbstractIndexCollection.php:29 — TooManyMethods — 50 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: UserObject system/src/Grav/Common/Flex/Types/Users/UserObject.php:73 — TooManyMethods — 48 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: Collection system/src/Grav/Common/Page/Collection.php:32 — TooManyMethods — 40 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: PageCollection system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:53 — TooManyMethods — 39 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: Install system/src/Grav/Installer/Install.php:50 — TooManyMethods — 39 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: Scheduler system/src/Grav/Common/Scheduler/Scheduler.php:30 — TooManyMethods — 38 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: FlexCollection system/src/Grav/Framework/Flex/FlexCollection.php:45 — TooManyMethods — 38 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: PageContentTrait system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php:34 — TooManyMethods — 38 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: MediaObjectTrait system/src/Grav/Common/Media/Traits/MediaObjectTrait.php:30 — TooManyMethods — 36 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: Debugger system/src/Grav/Common/Debugger.php:63 — 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: ParsedownGravTrait system/src/Grav/Common/Markdown/ParsedownGravTrait.php:22 — 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.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×15
  • Duplicated block (14 lines × 2) system/src/DOMLettersIterator.php:112 — system/src/DOMLettersIterator.php:112-125 | system/src/DOMWordsIterator.php:111-124 — 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 `system/src/DOMLettersIterator.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 (14 lines × 2) system/src/Grav/Common/Filesystem/ZipArchiver.php:192 — system/src/Grav/Common/Filesystem/ZipArchiver.php:192-206 | system/src/Grav/Common/GPM/Installer.php:355-368 — 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 (14 lines × 2) system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:352 — system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:352-365 | system/src/Grav/Common/Page/Pages.php:2463-2476 — 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 `system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:352` 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 (14 lines × 2) system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:378 — system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:378-391 | system/src/Grav/Common/Page/Pages.php:2493-2506 — 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 `system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:378` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:466 — system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:466-479 | system/src/Grav/Framework/Flex/Storage/FolderStorage.php:446-459 — 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 `system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:466` 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 × 2) system/src/Grav/Common/Flex/Types/Users/UserObject.php:931 — system/src/Grav/Common/Flex/Types/Users/UserObject.php:931-944 | system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php:417-430 — 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 `system/src/Grav/Common/Flex/Types/Users/UserObject.php:931` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) system/src/Grav/Common/Form/FormFlash.php:55 — system/src/Grav/Common/Form/FormFlash.php:55-68 | system/src/Grav/Common/Form/FormFlash.php:87-100 — 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 `system/src/Grav/Common/Form/FormFlash.php:55` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) system/src/Grav/Common/Inflector.php:68 — system/src/Grav/Common/Inflector.php:68-81 | system/src/Grav/Common/Inflector.php:113-126 — 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 `system/src/Grav/Common/Inflector.php:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) system/src/Grav/Common/Page/Pages.php:1712 — system/src/Grav/Common/Page/Pages.php:1712-1725 | system/src/Grav/Common/Service/AccountsServiceProvider.php:109-122 — 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 `system/src/Grav/Common/Page/Pages.php:1712` 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 (14 lines × 2) system/src/Grav/Common/Service/ConfigServiceProvider.php:95 — system/src/Grav/Common/Service/ConfigServiceProvider.php:95-108 | system/src/Grav/Common/Service/ConfigServiceProvider.php:137-150 — 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 `system/src/Grav/Common/Service/ConfigServiceProvider.php:95` 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 (14 lines × 2) system/src/Grav/Framework/Flex/FlexCollection.php:707 — system/src/Grav/Framework/Flex/FlexCollection.php:707-720 | system/src/Grav/Framework/Flex/FlexObject.php:1168-1181 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (14 lines × 2) system/src/Grav/Framework/Flex/FlexDirectoryForm.php:312 — system/src/Grav/Framework/Flex/FlexDirectoryForm.php:312-325 | system/src/Grav/Framework/Flex/FlexForm.php:374-387 — 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 `system/src/Grav/Framework/Flex/FlexDirectoryForm.php:312` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) system/src/Grav/Framework/Flex/FlexObject.php:787 — system/src/Grav/Framework/Flex/FlexObject.php:787-800 | system/src/Grav/Framework/Flex/FlexObject.php:819-832 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) system/src/Grav/Framework/Flex/FlexObject.php:876 — system/src/Grav/Framework/Flex/FlexObject.php:876-889 | system/src/Grav/Framework/Form/Traits/FormTrait.php:226-239 — 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 `system/src/Grav/Framework/Flex/FlexObject.php:876` 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 (14 lines × 2) system/src/Grav/Installer/Versions.php:301 — system/src/Grav/Installer/Versions.php:301-314 | system/src/Grav/Installer/YamlUpdater.php:452-465 — 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 `system/src/Grav/Installer/Versions.php:301` 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) · ×12
  • Duplicated block (11 lines × 2) system/src/Grav/Common/Filesystem/ZipArchiver.php:289 — system/src/Grav/Common/Filesystem/ZipArchiver.php:289-299 | system/src/Grav/Common/Filesystem/ZipArchiver.php:350-360 — 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 `system/src/Grav/Common/Filesystem/ZipArchiver.php:289` 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 (11 lines × 2) system/src/Grav/Common/Flex/Traits/FlexCollectionTrait.php:39 — system/src/Grav/Common/Flex/Traits/FlexCollectionTrait.php:39-49 | system/src/Grav/Common/Flex/Traits/FlexObjectTrait.php:50-60 — 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 `system/src/Grav/Common/Flex/Traits/FlexCollectionTrait.php:39` 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) system/src/Grav/Common/GPM/GPM.php:120 — system/src/Grav/Common/GPM/GPM.php:120-130 | system/src/Grav/Common/GPM/GPM.php:280-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) system/src/Grav/Common/Grav.php:312 — system/src/Grav/Common/Grav.php:312-322 | system/src/Grav/Common/Grav.php:479-489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `system/src/Grav/Common/Grav.php:312` 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) system/src/Grav/Common/Page/Page.php:749 — system/src/Grav/Common/Page/Page.php:749-759 | system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:145-155 — 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 `system/src/Grav/Common/Page/Page.php:749` 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) system/src/Grav/Common/Scheduler/Scheduler.php:811 — system/src/Grav/Common/Scheduler/Scheduler.php:811-823 | system/src/Grav/Common/Scheduler/Scheduler.php:919-929 — 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 `system/src/Grav/Common/Scheduler/Scheduler.php:811` 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) system/src/Grav/Console/Gpm/SelfupgradeCommand.php:110 — system/src/Grav/Console/Gpm/SelfupgradeCommand.php:110-120 | system/src/Grav/Console/Gpm/UpdateCommand.php:106-116 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (11 lines × 2) system/src/Grav/Framework/ContentBlock/HtmlBlock.php:161 — system/src/Grav/Framework/ContentBlock/HtmlBlock.php:161-171 | system/src/Grav/Framework/ContentBlock/HtmlBlock.php:205-215 — 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 (11 lines × 2) system/src/Grav/Framework/ContentBlock/HtmlBlock.php:239 — system/src/Grav/Framework/ContentBlock/HtmlBlock.php:239-249 | system/src/Grav/Framework/ContentBlock/HtmlBlock.php:281-291 — 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 (11 lines × 2) system/src/Grav/Framework/Flex/FlexCollection.php:621 — system/src/Grav/Framework/Flex/FlexCollection.php:621-631 | system/src/Grav/Framework/Flex/FlexObject.php:1056-1066 — 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 `system/src/Grav/Framework/Flex/FlexCollection.php:621` 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) system/src/Grav/Framework/Flex/Storage/FolderStorage.php:427 — system/src/Grav/Framework/Flex/Storage/FolderStorage.php:427-437 | system/src/Grav/Framework/Flex/Storage/SimpleStorage.php:364-374 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (11 lines × 2) system/src/Grav/Installer/Versions.php:278 — system/src/Grav/Installer/Versions.php:278-288 | system/src/Grav/Installer/YamlUpdater.php:429-439 — 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.
D3 · God Classes · FileTooLong · ×11
  • FileTooLong: Page/Pages.php system/src/Grav/Common/Page/Pages.php:0 — FileTooLong — 1232 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Pages (58-2634). 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: Page/Page.php system/src/Grav/Common/Page/Page.php:0 — FileTooLong — 1195 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Page (51-3153). 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: Common/Utils.php system/src/Grav/Common/Utils.php:0 — FileTooLong — 981 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Utils (46-2272). 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: Extension/GravExtension.php system/src/Grav/Common/Twig/Extension/GravExtension.php:0 — FileTooLong — 736 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: GravExtension (75-1987). 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: Common/Security.php system/src/Grav/Common/Security.php:0 — FileTooLong — 647 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: Common/Uri.php system/src/Grav/Common/Uri.php:0 — FileTooLong — 647 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Uri (33-1559). 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: Installer/Install.php system/src/Grav/Installer/Install.php:0 — FileTooLong — 620 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: Install (50-1155). 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: Common/Debugger.php system/src/Grav/Common/Debugger.php:0 — FileTooLong — 608 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: Debugger (63-1252). 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: GPM/GPM.php system/src/Grav/Common/GPM/GPM.php:0 — FileTooLong — 540 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: GPM (34-1396). 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: Flex/FlexDirectory.php system/src/Grav/Framework/Flex/FlexDirectory.php:0 — FileTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: FlexDirectory (51-1242). 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: Flex/FlexObject.php system/src/Grav/Framework/Flex/FlexObject.php:0 — FileTooLong — 527 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: FlexObject (54-1278). 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.
D15 · Churn × Complexity Hotspots · Hotspot · ×10
  • Hotspot: system/src/Grav/Common/Page/Page.php system/src/Grav/Common/Page/Page.php — system/src/Grav/Common/Page/Page.php changed 14 times in last 90 days, max complexity 45. 7 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: system/src/Grav/Common/Page/Pages.php system/src/Grav/Common/Page/Pages.php — system/src/Grav/Common/Page/Pages.php changed 8 times in last 90 days, max complexity 50. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: system/src/Grav/Common/Twig/Twig.php system/src/Grav/Common/Twig/Twig.php — system/src/Grav/Common/Twig/Twig.php changed 12 times in last 90 days, max complexity 30. 4 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: system/src/Grav/Common/Security.php system/src/Grav/Common/Security.php — system/src/Grav/Common/Security.php changed 16 times in last 90 days, max complexity 22. 4 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: system/src/Grav/Common/Markdown/ParsedownGravTrait.php system/src/Grav/Common/Markdown/ParsedownGravTrait.php — system/src/Grav/Common/Markdown/ParsedownGravTrait.php changed 10 times in last 90 days, max complexity 19. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php — system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php changed 6 times in last 90 days, max complexity 28. 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: system/src/Grav/Common/Debugger.php system/src/Grav/Common/Debugger.php — system/src/Grav/Common/Debugger.php changed 3 times in last 90 days, max complexity 49. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: system/src/Grav/Common/Uri.php system/src/Grav/Common/Uri.php — system/src/Grav/Common/Uri.php changed 3 times in last 90 days, max complexity 35. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: system/src/Grav/Common/GPM/Installer.php system/src/Grav/Common/GPM/Installer.php — system/src/Grav/Common/GPM/Installer.php changed 4 times in last 90 days, max complexity 23. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: system/src/Grav/Common/Grav.php system/src/Grav/Common/Grav.php — system/src/Grav/Common/Grav.php changed 3 times in last 90 days, max complexity 26. 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 (9 lines × 2) · ×9
  • Duplicated block (9 lines × 2) system/src/Grav/Common/Filesystem/Folder.php:88 — system/src/Grav/Common/Filesystem/Folder.php:88-96 | system/src/Grav/Common/Helpers/YamlLinter.php:131-139 — 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 `system/src/Grav/Common/Filesystem/Folder.php:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) system/src/Grav/Common/Flex/Types/Pages/PageObject.php:306 — system/src/Grav/Common/Flex/Types/Pages/PageObject.php:306-315 | system/src/Grav/Common/Flex/Types/Users/UserObject.php:637-645 — 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 (9 lines × 2) system/src/Grav/Common/Page/Page.php:1991 — system/src/Grav/Common/Page/Page.php:1991-1999 | system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:660-668 — 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 `system/src/Grav/Common/Page/Page.php:1991` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) system/src/Grav/Common/Service/TaskServiceProvider.php:31 — system/src/Grav/Common/Service/TaskServiceProvider.php:31-39 | system/src/Grav/Common/Service/TaskServiceProvider.php:44-52 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:98 — system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:98-106 | system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:179-187 — 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 `system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:98` 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) system/src/Grav/Console/Cli/PageSystemValidatorCommand.php:168 — system/src/Grav/Console/Cli/PageSystemValidatorCommand.php:168-177 | system/src/Grav/Console/Cli/PageSystemValidatorCommand.php:179-187 — 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) system/src/Grav/Console/Gpm/InfoCommand.php:148 — system/src/Grav/Console/Gpm/InfoCommand.php:148-156 | system/src/Grav/Console/Gpm/UpdateCommand.php:220-228 — 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 `system/src/Grav/Console/Gpm/InfoCommand.php:148` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) system/src/Grav/Framework/Flex/FlexDirectory.php:963 — system/src/Grav/Framework/Flex/FlexDirectory.php:963-971 | system/src/Grav/Framework/Flex/FlexDirectory.php:999-1007 — 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) system/src/Grav/Framework/Flex/Storage/FolderStorage.php:496 — system/src/Grav/Framework/Flex/Storage/FolderStorage.php:496-504 | system/src/Grav/Framework/Flex/Storage/FolderStorage.php:516-524 — 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 `system/src/Grav/Framework/Flex/Storage/FolderStorage.php:496` 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 (12 lines × 2) · ×8
  • Duplicated block (12 lines × 2) system/src/Grav/Common/Data/Data.php:109 — system/src/Grav/Common/Data/Data.php:109-120 | system/src/Grav/Common/Flex/Types/Users/UserObject.php:421-432 — 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 `system/src/Grav/Common/Data/Data.php:109` 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) system/src/Grav/Common/Filesystem/Folder.php:39 — system/src/Grav/Common/Filesystem/Folder.php:39-50 | system/src/Grav/Common/Filesystem/Folder.php:77-88 — 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 `system/src/Grav/Common/Filesystem/Folder.php:39` 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) system/src/Grav/Common/Filesystem/Folder.php:466 — system/src/Grav/Common/Filesystem/Folder.php:466-477 | system/src/Grav/Framework/Cache/Adapter/FileCache.php:260-271 — 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 `system/src/Grav/Common/Filesystem/Folder.php:466` 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) system/src/Grav/Common/GPM/Remote/GravCore.php:87 — system/src/Grav/Common/GPM/Remote/GravCore.php:87-98 | system/src/Grav/Common/GPM/Remote/Package.php:53-64 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (12 lines × 2) system/src/Grav/Common/Page/Medium/AbstractMedia.php:359 — system/src/Grav/Common/Page/Medium/AbstractMedia.php:359-370 | system/src/Grav/Common/Page/Medium/AbstractMedia.php:467-478 — 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 `system/src/Grav/Common/Page/Medium/AbstractMedia.php:359` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) system/src/Grav/Common/Plugin.php:395 — system/src/Grav/Common/Plugin.php:395-406 | system/src/Grav/Common/Theme.php:52-63 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (12 lines × 2) system/src/Grav/Common/Twig/TokenParser/TwigTokenParserScript.php:72 — system/src/Grav/Common/Twig/TokenParser/TwigTokenParserScript.php:72-83 | system/src/Grav/Common/Twig/TokenParser/TwigTokenParserStyle.php:65-76 — 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 `system/src/Grav/Common/Twig/TokenParser/TwigTokenParserScript.php:72` 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) system/src/Grav/Framework/Flex/FlexCollection.php:371 — system/src/Grav/Framework/Flex/FlexCollection.php:371-382 | system/src/Grav/Framework/Flex/FlexObject.php:545-556 — 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 (13 lines × 2) · ×6
  • Duplicated block (13 lines × 2) system/src/Grav/Common/Assets/Pipeline.php:378 — system/src/Grav/Common/Assets/Pipeline.php:378-390 | system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php:72-85 — 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 `system/src/Grav/Common/Assets/Pipeline.php:378` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) system/src/Grav/Common/Flex/Types/Users/UserObject.php:980 — system/src/Grav/Common/Flex/Types/Users/UserObject.php:980-992 | system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php:491-503 — 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 `system/src/Grav/Common/Flex/Types/Users/UserObject.php:980` 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) system/src/Grav/Common/GPM/Local/Package.php:86 — system/src/Grav/Common/GPM/Local/Package.php:86-98 | system/src/Grav/Installer/Install.php:1108-1120 — 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 `system/src/Grav/Common/GPM/Local/Package.php:86` 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) system/src/Grav/Common/Twig/Node/TwigNodeScript.php:89 — system/src/Grav/Common/Twig/Node/TwigNodeScript.php:89-101 | system/src/Grav/Common/Twig/Node/TwigNodeStyle.php:88-100 — 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 `system/src/Grav/Common/Twig/Node/TwigNodeScript.php:89` 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) system/src/Grav/Framework/Cache/CacheTrait.php:140 — system/src/Grav/Framework/Cache/CacheTrait.php:140-152 | system/src/Grav/Framework/Cache/CacheTrait.php:216-228 — 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 `system/src/Grav/Framework/Cache/CacheTrait.php:140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) system/src/Grav/Framework/Flex/FlexCollection.php:646 — system/src/Grav/Framework/Flex/FlexCollection.php:646-658 | system/src/Grav/Framework/Flex/FlexObject.php:1224-1236 — 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 `system/src/Grav/Framework/Flex/FlexCollection.php:646` 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.
D29 · Static Analysis (SAST) · Medium · ×5
  • Medium: tainted-filename system/router.php:18 — File name based on user input risks server-side request forgery.
  • Medium: tainted-filename system/src/Grav/Common/Config/Env.php:76 — File name based on user input risks server-side request forgery.
  • Medium: tainted-filename system/src/Grav/Common/Config/Env.php:104 — File name based on user input risks server-side request forgery.
  • Medium: tainted-filename system/src/Grav/Common/Config/Env.php:107 — File name based on user input risks server-side request forgery.
  • Medium: tainted-filename system/src/Grav/Common/Config/Env.php:133 — File name based on user input risks server-side request forgery.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×5
  • Duplicated block (7 lines × 2) system/src/Grav/Common/Data/Blueprint.php:106 — system/src/Grav/Common/Data/Blueprint.php:106-112 | system/src/Grav/Common/Page/Page.php:1286-1292 — 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 `system/src/Grav/Common/Data/Blueprint.php:106` 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 (7 lines × 2) system/src/Grav/Common/Flex/Types/Pages/Traits/PageLegacyTrait.php:149 — system/src/Grav/Common/Flex/Types/Pages/Traits/PageLegacyTrait.php:149-155 | system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:1002-1008 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) system/src/Grav/Common/Flex/Types/Users/UserCollection.php:82 — system/src/Grav/Common/Flex/Types/Users/UserCollection.php:82-88 | system/src/Grav/Common/Flex/Types/Users/UserIndex.php:136-142 — 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 `system/src/Grav/Common/Flex/Types/Users/UserCollection.php:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) system/src/Grav/Common/Markdown/Parsedown.php:32 — system/src/Grav/Common/Markdown/Parsedown.php:32-38 | system/src/Grav/Common/Markdown/ParsedownExtra.php:33-39 — 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 `system/src/Grav/Common/Markdown/Parsedown.php:32` 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) system/src/Grav/Common/Uri.php:1025 — system/src/Grav/Common/Uri.php:1025-1031 | system/src/Grav/Common/Uri.php:1545-1551 — 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 `system/src/Grav/Common/Uri.php:1025` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×4
  • Duplicated block (10 lines × 3) system/src/Grav/Common/Flex/Traits/FlexCommonTrait.php:39 — system/src/Grav/Common/Flex/Traits/FlexCommonTrait.php:39-48 | system/src/Grav/Framework/Flex/FlexCollection.php:649-658 | system/src/Grav/Framework/Flex/FlexObject.php:1227-1236 — 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 `system/src/Grav/Common/Flex/Traits/FlexCommonTrait.php:39` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 3) system/src/Grav/Common/Flex/Types/Pages/Traits/PageRoutableTrait.php:100 — system/src/Grav/Common/Flex/Types/Pages/Traits/PageRoutableTrait.php:100-109 | system/src/Grav/Common/Page/Page.php:2771-2780 | system/src/Grav/Framework/Flex/Pages/Traits/PageRoutableTrait.php:500-509 — 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 `system/src/Grav/Common/Flex/Types/Pages/Traits/PageRoutableTrait.php:100` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) system/src/Grav/Common/Service/ConfigServiceProvider.php:354 — system/src/Grav/Common/Service/ConfigServiceProvider.php:354-363 | system/src/Grav/Common/Service/ConfigServiceProvider.php:384-393 | system/src/Grav/Common/Service/ConfigServiceProvider.php:400-409 — 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 `system/src/Grav/Common/Service/ConfigServiceProvider.php:354` 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 × 3) system/src/Grav/Framework/Flex/FlexCollection.php:131 — system/src/Grav/Framework/Flex/FlexCollection.php:131-140 | system/src/Grav/Framework/Flex/FlexIndex.php:143-152 | system/src/Grav/Framework/Flex/FlexObject.php:164-173 — 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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×3
  • Duplicated block (18 lines × 2) system/src/Grav/Common/Page/Page.php:2114 — system/src/Grav/Common/Page/Page.php:2114-2131 | system/src/Grav/Framework/Flex/Pages/Traits/PageRoutableTrait.php:129-146 — 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 `system/src/Grav/Common/Page/Page.php:2114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) system/src/Grav/Console/Gpm/InstallCommand.php:690 — system/src/Grav/Console/Gpm/InstallCommand.php:690-707 | system/src/Grav/Console/Gpm/UninstallCommand.php:271-288 — 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 `system/src/Grav/Console/Gpm/InstallCommand.php:690` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) system/src/Grav/Framework/Flex/FlexDirectoryForm.php:269 — system/src/Grav/Framework/Flex/FlexDirectoryForm.php:269-286 | system/src/Grav/Framework/Flex/FlexForm.php:320-337 — 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 (10 lines × 2) · ×3
  • Duplicated block (10 lines × 2) system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:476 — system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:476-485 | system/src/Grav/Framework/Flex/Pages/Traits/PageTranslateTrait.php:251-260 — 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 (10 lines × 2) system/src/Grav/Common/Media/Traits/MediaObjectTrait.php:287 — system/src/Grav/Common/Media/Traits/MediaObjectTrait.php:287-296 | system/src/Grav/Common/Media/Traits/MediaObjectTrait.php:307-316 — 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 `system/src/Grav/Common/Media/Traits/MediaObjectTrait.php:287` 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) system/src/Grav/Installer/Install.php:1000 — system/src/Grav/Installer/Install.php:1000-1009 | system/src/Grav/Installer/Install.php:1027-1036 — 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 `system/src/Grav/Installer/Install.php:1000` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×3
  • Duplicated block (8 lines × 2) system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:692 — system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:692-699 | system/src/Grav/Common/Page/Collection.php:650-657 — 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 `system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:692` 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 (8 lines × 2) system/src/Grav/Common/Scheduler/Cron.php:538 — system/src/Grav/Common/Scheduler/Cron.php:538-545 | system/src/Grav/Common/Scheduler/Cron.php:546-553 — 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 `system/src/Grav/Common/Scheduler/Cron.php:538` 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 (8 lines × 2) system/src/Grav/Console/Gpm/SelfupgradeCommand.php:303 — system/src/Grav/Console/Gpm/SelfupgradeCommand.php:303-310 | system/src/Grav/Console/Gpm/UpdateCommand.php:122-130 — 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 (5 lines × 2) · ×3
  • Duplicated block (5 lines × 2) system/src/Grav/Common/Filesystem/ZipArchiver.php:125 — system/src/Grav/Common/Filesystem/ZipArchiver.php:125-129 | system/src/Grav/Common/GPM/Installer.php:323-327 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) system/src/Grav/Common/Flex/Types/Pages/Traits/PageRoutableTrait.php:85 — system/src/Grav/Common/Flex/Types/Pages/Traits/PageRoutableTrait.php:85-89 | system/src/Grav/Framework/Flex/Pages/Traits/PageRoutableTrait.php:485-489 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) system/src/Twig/DeferredExtension/DeferredNodeVisitor.php:37 — system/src/Twig/DeferredExtension/DeferredNodeVisitor.php:37-41 | system/src/Twig/DeferredExtension/DeferredNodeVisitorCompat.php:49-53 — 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 `system/src/Twig/DeferredExtension/DeferredNodeVisitor.php:37` 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 (22 lines × 2) · ×2
  • Duplicated block (22 lines × 2) system/src/Grav/Common/Scheduler/JobQueue.php:137 — system/src/Grav/Common/Scheduler/JobQueue.php:137-158 | system/src/Grav/Common/Scheduler/JobQueue.php:204-225 — 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 `system/src/Grav/Common/Scheduler/JobQueue.php:137` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) system/src/Grav/Framework/Controller/Traits/ControllerResponseTrait.php:214 — system/src/Grav/Framework/Controller/Traits/ControllerResponseTrait.php:214-236 | system/src/Grav/Framework/RequestHandler/Middlewares/Exceptions.php:49-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) system/src/Grav/Common/Security.php:111 — system/src/Grav/Common/Security.php:111-130 | system/src/Grav/Common/Security.php:1056-1072 — 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 `system/src/Grav/Common/Security.php:111` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) system/src/Grav/Framework/Flex/FlexDirectoryForm.php:157 — system/src/Grav/Framework/Flex/FlexDirectoryForm.php:157-173 | system/src/Grav/Framework/Flex/FlexForm.php:200-216 — 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 `system/src/Grav/Framework/Flex/FlexDirectoryForm.php:157` 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 (16 lines × 2) · ×2
  • Duplicated block (16 lines × 2) system/src/Grav/Common/Data/Data.php:208 — system/src/Grav/Common/Data/Data.php:208-223 | system/src/Grav/Common/Flex/Types/Users/UserObject.php:490-505 — 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 `system/src/Grav/Common/Data/Data.php:208` 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. 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 (16 lines × 2) system/src/Grav/Common/Flex/Types/Users/UserObject.php:887 — system/src/Grav/Common/Flex/Types/Users/UserObject.php:887-902 | system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php:386-401 — 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 `system/src/Grav/Common/Flex/Types/Users/UserObject.php:887` 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 (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) system/src/Grav/Common/GPM/GPM.php:301 — system/src/Grav/Common/GPM/GPM.php:301-315 | system/src/Grav/Common/GPM/GPM.php:446-460 — 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 `system/src/Grav/Common/GPM/GPM.php:301` 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 (15 lines × 2) system/src/Grav/Common/Twig/Node/TwigNodeLink.php:98 — system/src/Grav/Common/Twig/Node/TwigNodeLink.php:98-112 | system/src/Grav/Common/Twig/Node/TwigNodeStyle.php:98-112 — 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 `system/src/Grav/Common/Twig/Node/TwigNodeLink.php:98` 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.
D1 · Cyclomatic Complexity · Pages.getCollection (cyclomatic 50) · ×1
  • Pages.getCollection (cyclomatic 50) system/src/Grav/Common/Page/Pages.php:582 — Pages.getCollection has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Debugger.deprecatedErrorHandler (cyclomatic 49) · ×1
  • Debugger.deprecatedErrorHandler (cyclomatic 49) system/src/Grav/Common/Debugger.php:948 — Debugger.deprecatedErrorHandler has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent 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 · Page.header (cyclomatic 45) · ×1
  • Page.header (cyclomatic 45) system/src/Grav/Common/Page/Page.php:535 — Page.header has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PageIndex.getLevelListingRecurse (cyclomatic 41) · ×1
  • PageIndex.getLevelListingRecurse (cyclomatic 41) system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:518 — PageIndex.getLevelListingRecurse has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Media.init (cyclomatic 38) · ×1
  • Media.init (cyclomatic 38) system/src/Grav/Common/Page/Media.php:128 — Media.init has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Pages.recurse (cyclomatic 36) · ×1
  • Pages.recurse (cyclomatic 36) system/src/Grav/Common/Page/Pages.php:2138 — Pages.recurse has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Pages.buildSort (cyclomatic 36) · ×1
  • Pages.buildSort (cyclomatic 36) system/src/Grav/Common/Page/Pages.php:2394 — Pages.buildSort has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Pages.evaluate (cyclomatic 35) · ×1
  • Pages.evaluate (cyclomatic 35) system/src/Grav/Common/Page/Pages.php:779 — Pages.evaluate has cyclomatic complexity 35 (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 · Uri.convertUrl (cyclomatic 35) · ×1
  • Uri.convertUrl (cyclomatic 35) system/src/Grav/Common/Uri.php:829 — Uri.convertUrl has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Scheduler.processJobsWithWorkers (cyclomatic 34) · ×1
  • Scheduler.processJobsWithWorkers (cyclomatic 34) system/src/Grav/Common/Scheduler/Scheduler.php:741 — Scheduler.processJobsWithWorkers has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SelfupgradeCommand.handlePreflightReport (cyclomatic 33) · ×1
  • SelfupgradeCommand.handlePreflightReport (cyclomatic 33) system/src/Grav/Console/Gpm/SelfupgradeCommand.php:287 — SelfupgradeCommand.handlePreflightReport 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 · PageCollection.buildSort (cyclomatic 32) · ×1
  • PageCollection.buildSort (cyclomatic 32) system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:301 — PageCollection.buildSort has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SchedulerCommand.serve (cyclomatic 32) · ×1
  • SchedulerCommand.serve (cyclomatic 32) system/src/Grav/Console/Cli/SchedulerCommand.php:73 — SchedulerCommand.serve has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Twig.init (cyclomatic 30) · ×1
  • Twig.init (cyclomatic 30) system/src/Grav/Common/Twig/Twig.php:125 — Twig.init has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConfigServiceProvider.saveCachedFileList (cyclomatic 29) · ×1
  • ConfigServiceProvider.saveCachedFileList (cyclomatic 29) system/src/Grav/Common/Service/ConfigServiceProvider.php:331 — ConfigServiceProvider.saveCachedFileList 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 · Cache.clearCache (cyclomatic 28) · ×1
  • Cache.clearCache (cyclomatic 28) system/src/Grav/Common/Cache.php:582 — Cache.clearCache 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 · PageStorage.getObjectMeta (cyclomatic 28) · ×1
  • PageStorage.getObjectMeta (cyclomatic 28) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:539 — PageStorage.getObjectMeta 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 · DirectInstallCommand.serve (cyclomatic 28) · ×1
  • DirectInstallCommand.serve (cyclomatic 28) system/src/Grav/Console/Gpm/DirectInstallCommand.php:71 — DirectInstallCommand.serve 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 · PageContentTrait.processContent (cyclomatic 28) · ×1
  • PageContentTrait.processContent (cyclomatic 28) system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php:666 — PageContentTrait.processContent 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 · GPM.getDependencies (cyclomatic 27) · ×1
  • GPM.getDependencies (cyclomatic 27) system/src/Grav/Common/GPM/GPM.php:1041 — GPM.getDependencies 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 · Cache.getCacheAdapter (cyclomatic 26) · ×1
  • Cache.getCacheAdapter (cyclomatic 26) system/src/Grav/Common/Cache.php:297 — Cache.getCacheAdapter 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 · BlueprintSchema.validateArray (cyclomatic 26) · ×1
  • BlueprintSchema.validateArray (cyclomatic 26) system/src/Grav/Common/Data/BlueprintSchema.php:181 — BlueprintSchema.validateArray 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 · Folder.all (cyclomatic 26) · ×1
  • Folder.all (cyclomatic 26) system/src/Grav/Common/Filesystem/Folder.php:225 — Folder.all 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 · Grav.fallbackUrl (cyclomatic 26) · ×1
  • Grav.fallbackUrl (cyclomatic 26) system/src/Grav/Common/Grav.php:828 — Grav.fallbackUrl 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 · Uri.createFromEnvironment (cyclomatic 26) · ×1
  • Uri.createFromEnvironment (cyclomatic 26) system/src/Grav/Common/Uri.php:1240 — Uri.createFromEnvironment has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Utils.url (cyclomatic 26) · ×1
  • Utils.url (cyclomatic 26) system/src/Grav/Common/Utils.php:63 — Utils.url 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 · InstallCommand.serve (cyclomatic 26) · ×1
  • InstallCommand.serve (cyclomatic 26) system/src/Grav/Console/Gpm/InstallCommand.php:105 — InstallCommand.serve 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 · Page.content (cyclomatic 25) · ×1
  • Page.content (cyclomatic 25) system/src/Grav/Common/Page/Page.php:888 — Page.content 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 · UninstallCommand.uninstallPackage (cyclomatic 25) · ×1
  • UninstallCommand.uninstallPackage (cyclomatic 25) system/src/Grav/Console/Gpm/UninstallCommand.php:157 — UninstallCommand.uninstallPackage 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 · UpdateCommand.serve (cyclomatic 25) · ×1
  • UpdateCommand.serve (cyclomatic 25) system/src/Grav/Console/Gpm/UpdateCommand.php:104 — UpdateCommand.serve 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 · Setup.__construct (cyclomatic 24) · ×1
  • Setup.__construct (cyclomatic 24) system/src/Grav/Common/Config/Setup.php:172 — Setup.__construct 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 · CompiledFile.content (cyclomatic 24) · ×1
  • CompiledFile.content (cyclomatic 24) system/src/Grav/Common/File/CompiledFile.php:34 — CompiledFile.content 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 · MediaUploadTrait.checkFileMetadata (cyclomatic 24) · ×1
  • MediaUploadTrait.checkFileMetadata (cyclomatic 24) system/src/Grav/Common/Media/Traits/MediaUploadTrait.php:118 — MediaUploadTrait.checkFileMetadata 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 · Page.value (cyclomatic 24) · ×1
  • Page.value (cyclomatic 24) system/src/Grav/Common/Page/Page.php:1225 — Page.value has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PagesServiceProvider.register (cyclomatic 24) · ×1
  • PagesServiceProvider.register (cyclomatic 24) system/src/Grav/Common/Service/PagesServiceProvider.php:33 — PagesServiceProvider.register 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 · InfoCommand.serve (cyclomatic 24) · ×1
  • InfoCommand.serve (cyclomatic 24) system/src/Grav/Console/Gpm/InfoCommand.php:63 — InfoCommand.serve 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 · Flex.getObjects (cyclomatic 24) · ×1
  • Flex.getObjects (cyclomatic 24) system/src/Grav/Framework/Flex/Flex.php:165 — Flex.getObjects 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 · Installer.install (cyclomatic 23) · ×1
  • Installer.install (cyclomatic 23) system/src/Grav/Common/GPM/Installer.php:82 — Installer.install has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FileReader.read (cyclomatic 23) · ×1
  • FileReader.read (cyclomatic 23) system/src/Grav/Common/Helpers/FileReader.php:62 — FileReader.read has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MediaObjectTrait.parsedownElement (cyclomatic 23) · ×1
  • MediaObjectTrait.parsedownElement (cyclomatic 23) system/src/Grav/Common/Media/Traits/MediaObjectTrait.php:261 — MediaObjectTrait.parsedownElement 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 · Session.start (cyclomatic 23) · ×1
  • Session.start (cyclomatic 23) system/src/Grav/Framework/Session/Session.php:189 — Session.start 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 · Validation.arrayFilterRecurse (cyclomatic 22) · ×1
  • Validation.arrayFilterRecurse (cyclomatic 22) system/src/Grav/Common/Data/Validation.php:910 — Validation.arrayFilterRecurse 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 · Pages.buildRoutes (cyclomatic 22) · ×1
  • Pages.buildRoutes (cyclomatic 22) system/src/Grav/Common/Page/Pages.php:2308 — Pages.buildRoutes 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 · Scheduler.run (cyclomatic 22) · ×1
  • Scheduler.run (cyclomatic 22) system/src/Grav/Common/Scheduler/Scheduler.php:288 — Scheduler.run has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Security.resolveTwigContentEvents (cyclomatic 22) · ×1
  • Security.resolveTwigContentEvents (cyclomatic 22) system/src/Grav/Common/Security.php:953 — Security.resolveTwigContentEvents 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 · BlueprintSchema.filterArray (cyclomatic 21) · ×1
  • BlueprintSchema.filterArray (cyclomatic 21) system/src/Grav/Common/Data/BlueprintSchema.php:263 — BlueprintSchema.filterArray 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 · Security.extractTwigTokens (cyclomatic 21) · ×1
  • Security.extractTwigTokens (cyclomatic 21) system/src/Grav/Common/Security.php:1171 — Security.extractTwigTokens 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 · Security.scanContentTwigUsage (cyclomatic 21) · ×1
  • Security.scanContentTwigUsage (cyclomatic 21) system/src/Grav/Common/Security.php:1259 — Security.scanContentTwigUsage has cyclomatic complexity 21 (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 · FlexCollection.render (cyclomatic 21) · ×1
  • FlexCollection.render (cyclomatic 21) system/src/Grav/Framework/Flex/FlexCollection.php:369 — FlexCollection.render 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 · Validation.typeArray (cyclomatic 20) · ×1
  • Validation.typeArray (cyclomatic 20) system/src/Grav/Common/Data/Validation.php:788 — Validation.typeArray 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 · PageStorage.saveRow (cyclomatic 20) · ×1
  • PageStorage.saveRow (cyclomatic 20) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:371 — PageStorage.saveRow 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 · Language.setActiveFromUri (cyclomatic 20) · ×1
  • Language.setActiveFromUri (cyclomatic 20) system/src/Grav/Common/Language/Language.php:245 — Language.setActiveFromUri 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 · FlexIndex.updateIndexFile (cyclomatic 20) · ×1
  • FlexIndex.updateIndexFile (cyclomatic 20) system/src/Grav/Framework/Flex/FlexIndex.php:706 — FlexIndex.updateIndexFile 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 · FlexObject.render (cyclomatic 20) · ×1
  • FlexObject.render (cyclomatic 20) system/src/Grav/Framework/Flex/FlexObject.php:543 — FlexObject.render 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 · Env.load (cyclomatic 19) · ×1
  • Env.load (cyclomatic 19) system/src/Grav/Common/Config/Env.php:65 — Env.load has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Validation.validate (cyclomatic 19) · ×1
  • Validation.validate (cyclomatic 19) system/src/Grav/Common/Data/Validation.php:53 — Validation.validate 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 · PageObject.reorderSiblings (cyclomatic 19) · ×1
  • PageObject.reorderSiblings (cyclomatic 19) system/src/Grav/Common/Flex/Types/Pages/PageObject.php:408 — PageObject.reorderSiblings 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 · Truncator.truncate (cyclomatic 19) · ×1
  • Truncator.truncate (cyclomatic 19) system/src/Grav/Common/Helpers/Truncator.php:246 — Truncator.truncate has cyclomatic complexity 19 (threshold 15). 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.
D1 · Cyclomatic Complexity · ParsedownGravTrait.blockTableContinue (cyclomatic 19) · ×1
  • ParsedownGravTrait.blockTableContinue (cyclomatic 19) system/src/Grav/Common/Markdown/ParsedownGravTrait.php:690 — ParsedownGravTrait.blockTableContinue 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 · ParsedownGravTrait.blockTableComplete (cyclomatic 19) · ×1
  • ParsedownGravTrait.blockTableComplete (cyclomatic 19) system/src/Grav/Common/Markdown/ParsedownGravTrait.php:803 — ParsedownGravTrait.blockTableComplete 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 · VectorImageMedium.__construct (cyclomatic 19) · ×1
  • VectorImageMedium.__construct (cyclomatic 19) system/src/Grav/Common/Page/Medium/VectorImageMedium.php:27 — VectorImageMedium.__construct has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Page.metadata (cyclomatic 19) · ×1
  • Page.metadata (cyclomatic 19) system/src/Grav/Common/Page/Page.php:1937 — Page.metadata 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 · Pages.buildFlexPages (cyclomatic 19) · ×1
  • Pages.buildFlexPages (cyclomatic 19) system/src/Grav/Common/Page/Pages.php:1753 — Pages.buildFlexPages 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 · Utils.getPathFromToken (cyclomatic 19) · ×1
  • Utils.getPathFromToken (cyclomatic 19) system/src/Grav/Common/Utils.php:1691 — Utils.getPathFromToken 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 · IndexCommand.filter (cyclomatic 19) · ×1
  • IndexCommand.filter (cyclomatic 19) system/src/Grav/Console/Gpm/IndexCommand.php:274 — IndexCommand.filter 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 · PageContentTrait.pageContentValue (cyclomatic 19) · ×1
  • PageContentTrait.pageContentValue (cyclomatic 19) system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php:545 — PageContentTrait.pageContentValue has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Debugger.init (cyclomatic 18) · ×1
  • Debugger.init (cyclomatic 18) system/src/Grav/Common/Debugger.php:133 — Debugger.init 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 · Cron.cronToArray (cyclomatic 18) · ×1
  • Cron.cronToArray (cyclomatic 18) system/src/Grav/Common/Scheduler/Cron.php:524 — Cron.cronToArray 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 · Security.detectXss (cyclomatic 18) · ×1
  • Security.detectXss (cyclomatic 18) system/src/Grav/Common/Security.php:190 — Security.detectXss 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 · Uri.convertUrlOld (cyclomatic 18) · ×1
  • Uri.convertUrlOld (cyclomatic 18) system/src/Grav/Common/Uri.php:1051 — Uri.convertUrlOld 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 · CacheCleanupCommand.serve (cyclomatic 18) · ×1
  • CacheCleanupCommand.serve (cyclomatic 18) system/src/Grav/Console/Cli/CacheCleanupCommand.php:68 — CacheCleanupCommand.serve 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 · Install.detectPendingPackageUpdates (cyclomatic 18) · ×1
  • Install.detectPendingPackageUpdates (cyclomatic 18) system/src/Grav/Installer/Install.php:670 — Install.detectPendingPackageUpdates 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 · PageIndex.filterBy (cyclomatic 17) · ×1
  • PageIndex.filterBy (cyclomatic 17) system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:287 — PageIndex.filterBy 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 · Uri.isExternal (cyclomatic 17) · ×1
  • Uri.isExternal (cyclomatic 17) system/src/Grav/Common/Uri.php:770 — Uri.isExternal has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PreflightCommand.serve (cyclomatic 17) · ×1
  • PreflightCommand.serve (cyclomatic 17) system/src/Grav/Console/Gpm/PreflightCommand.php:21 — PreflightCommand.serve 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 · SelfupgradeCommand.serve (cyclomatic 17) · ×1
  • SelfupgradeCommand.serve (cyclomatic 17) system/src/Grav/Console/Gpm/SelfupgradeCommand.php:108 — SelfupgradeCommand.serve 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 · PageLegacyTrait.metadata (cyclomatic 17) · ×1
  • PageLegacyTrait.metadata (cyclomatic 17) system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:612 — PageLegacyTrait.metadata 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 · Backups.backup (cyclomatic 16) · ×1
  • Backups.backup (cyclomatic 16) system/src/Grav/Common/Backup/Backups.php:221 — Backups.backup 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 · Validation.filterArray (cyclomatic 16) · ×1
  • Validation.filterArray (cyclomatic 16) system/src/Grav/Common/Data/Validation.php:866 — Validation.filterArray 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 · PageObject.filterBy (cyclomatic 16) · ×1
  • PageObject.filterBy (cyclomatic 16) system/src/Grav/Common/Flex/Types/Pages/PageObject.php:603 — PageObject.filterBy has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PageTranslateTrait.translatedLanguages (cyclomatic 16) · ×1
  • PageTranslateTrait.translatedLanguages (cyclomatic 16) system/src/Grav/Common/Flex/Types/Pages/Traits/PageTranslateTrait.php:32 — PageTranslateTrait.translatedLanguages 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 · Installer.unZip (cyclomatic 16) · ×1
  • Installer.unZip (cyclomatic 16) system/src/Grav/Common/GPM/Installer.php:178 — Installer.unZip 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 · Language.getFallbackLanguages (cyclomatic 16) · ×1
  • Language.getFallbackLanguages (cyclomatic 16) system/src/Grav/Common/Language/Language.php:443 — Language.getFallbackLanguages 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 · Excerpts.processLinkExcerpt (cyclomatic 16) · ×1
  • Excerpts.processLinkExcerpt (cyclomatic 16) system/src/Grav/Common/Page/Markdown/Excerpts.php:96 — Excerpts.processLinkExcerpt 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 · Page.summary (cyclomatic 16) · ×1
  • Page.summary (cyclomatic 16) system/src/Grav/Common/Page/Page.php:808 — Page.summary 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 · Scheduler.executeJob (cyclomatic 16) · ×1
  • Scheduler.executeJob (cyclomatic 16) system/src/Grav/Common/Scheduler/Scheduler.php:873 — Scheduler.executeJob 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 · SessionServiceProvider.register (cyclomatic 16) · ×1
  • SessionServiceProvider.register (cyclomatic 16) system/src/Grav/Common/Service/SessionServiceProvider.php:32 — SessionServiceProvider.register 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 · Uri.init (cyclomatic 16) · ×1
  • Uri.init (cyclomatic 16) system/src/Grav/Common/Uri.php:154 — Uri.init 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 · Utils.download (cyclomatic 16) · ×1
  • Utils.download (cyclomatic 16) system/src/Grav/Common/Utils.php:705 — Utils.download 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 · FlexDirectory.loadObjects (cyclomatic 16) · ×1
  • FlexDirectory.loadObjects (cyclomatic 16) system/src/Grav/Framework/Flex/FlexDirectory.php:671 — FlexDirectory.loadObjects 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.
D2 · Cognitive Complexity · Scheduler.processJobsWithWorkers (cognitive 118) · ×1
  • Scheduler.processJobsWithWorkers (cognitive 118) system/src/Grav/Common/Scheduler/Scheduler.php:741 — Scheduler.processJobsWithWorkers has cognitive complexity 118 (threshold 15). Drivers by points: if/else 64, ternaries 41, loops 7, boolean chains 6 (nesting depth added 84). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Debugger.deprecatedErrorHandler (cognitive 98) · ×1
  • Debugger.deprecatedErrorHandler (cognitive 98) system/src/Grav/Common/Debugger.php:948 — Debugger.deprecatedErrorHandler has cognitive complexity 98 (threshold 15). Drivers by points: if/else 65, loops 19, ternaries 8, boolean chains 6 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageIndex.getLevelListingRecurse (cognitive 96) · ×1
  • PageIndex.getLevelListingRecurse (cognitive 96) system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:518 — PageIndex.getLevelListingRecurse has cognitive complexity 96 (threshold 15). Drivers by points: ternaries 55, if/else 29, boolean chains 8, loops 4 (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Page.header (cognitive 94) · ×1
  • Page.header (cognitive 94) system/src/Grav/Common/Page/Page.php:535 — Page.header has cognitive complexity 94 (threshold 15). Drivers by points: if/else 86, error handling 3, loops 3, boolean chains 2 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SchedulerCommand.serve (cognitive 85) · ×1
  • SchedulerCommand.serve (cognitive 85) system/src/Grav/Console/Cli/SchedulerCommand.php:73 — SchedulerCommand.serve has cognitive complexity 85 (threshold 15). Drivers by points: if/else 63, ternaries 12, loops 7, boolean chains 3 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Media.init (cognitive 82) · ×1
  • Media.init (cognitive 82) system/src/Grav/Common/Page/Media.php:128 — Media.init has cognitive complexity 82 (threshold 15). Drivers by points: if/else 60, loops 11, boolean chains 10, ternaries 1 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pages.getCollection (cognitive 82) · ×1
  • Pages.getCollection (cognitive 82) system/src/Grav/Common/Page/Pages.php:582 — Pages.getCollection has cognitive complexity 82 (threshold 15). Drivers by points: if/else 52, loops 13, ternaries 8, boolean chains 7, match/switch 2 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Uri.convertUrl (cognitive 76) · ×1
  • Uri.convertUrl (cognitive 76) system/src/Grav/Common/Uri.php:829 — Uri.convertUrl has cognitive complexity 76 (threshold 15). Drivers by points: if/else 62, boolean chains 10, ternaries 4 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GPM.getDependencies (cognitive 75) · ×1
  • GPM.getDependencies (cognitive 75) system/src/Grav/Common/GPM/GPM.php:1041 — GPM.getDependencies has cognitive complexity 75 (threshold 15). Drivers by points: if/else 63, loops 7, boolean chains 5 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageStorage.getObjectMeta (cognitive 72) · ×1
  • PageStorage.getObjectMeta (cognitive 72) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:539 — PageStorage.getObjectMeta has cognitive complexity 72 (threshold 15). Drivers by points: if/else 46, ternaries 10, boolean chains 8, error handling 5, loops 3 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pages.buildSort (cognitive 69) · ×1
  • Pages.buildSort (cognitive 69) system/src/Grav/Common/Page/Pages.php:2394 — Pages.buildSort has cognitive complexity 69 (threshold 15). Drivers by points: if/else 47, ternaries 14, loops 4, boolean chains 2, match/switch 2 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DirectInstallCommand.serve (cognitive 69) · ×1
  • DirectInstallCommand.serve (cognitive 69) system/src/Grav/Console/Gpm/DirectInstallCommand.php:71 — DirectInstallCommand.serve has cognitive complexity 69 (threshold 15). Drivers by points: if/else 56, ternaries 5, loops 4, boolean chains 2, error handling 2 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Page.content (cognitive 66) · ×1
  • Page.content (cognitive 66) system/src/Grav/Common/Page/Page.php:888 — Page.content has cognitive complexity 66 (threshold 15). Drivers by points: if/else 60, boolean chains 6 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigServiceProvider.saveCachedFileList (cognitive 64) · ×1
  • ConfigServiceProvider.saveCachedFileList (cognitive 64) system/src/Grav/Common/Service/ConfigServiceProvider.php:331 — ConfigServiceProvider.saveCachedFileList has cognitive complexity 64 (threshold 15). Drivers by points: if/else 38, loops 23, boolean chains 3 (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 · InstallCommand.serve (cognitive 64) · ×1
  • InstallCommand.serve (cognitive 64) system/src/Grav/Console/Gpm/InstallCommand.php:105 — InstallCommand.serve has cognitive complexity 64 (threshold 15). Drivers by points: if/else 39, error handling 9, ternaries 8, loops 6, boolean chains 2 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Grav.fallbackUrl (cognitive 62) · ×1
  • Grav.fallbackUrl (cognitive 62) system/src/Grav/Common/Grav.php:828 — Grav.fallbackUrl has cognitive complexity 62 (threshold 15). Drivers by points: if/else 35, ternaries 15, boolean chains 8, loops 4 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Page.metadata (cognitive 58) · ×1
  • Page.metadata (cognitive 58) system/src/Grav/Common/Page/Page.php:1937 — Page.metadata has cognitive complexity 58 (threshold 15). Drivers by points: if/else 25, ternaries 23, loops 6, boolean chains 4 (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 · Twig.init (cognitive 58) · ×1
  • Twig.init (cognitive 58) system/src/Grav/Common/Twig/Twig.php:125 — Twig.init has cognitive complexity 58 (threshold 15). Drivers by points: if/else 38, ternaries 12, boolean chains 6, loops 2 (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 · Pages.recurse (cognitive 57) · ×1
  • Pages.recurse (cognitive 57) system/src/Grav/Common/Page/Pages.php:2138 — Pages.recurse has cognitive complexity 57 (threshold 15). Drivers by points: if/else 45, boolean chains 8, loops 4 (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 · Security.extractTwigTokens (cognitive 55) · ×1
  • Security.extractTwigTokens (cognitive 55) system/src/Grav/Common/Security.php:1171 — Security.extractTwigTokens has cognitive complexity 55 (threshold 15). Drivers by points: if/else 28, loops 22, ternaries 3, boolean chains 2 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageCollection.buildSort (cognitive 54) · ×1
  • PageCollection.buildSort (cognitive 54) system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:301 — PageCollection.buildSort has cognitive complexity 54 (threshold 15). Drivers by points: if/else 32, ternaries 15, loops 3, boolean chains 2, match/switch 2 (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 · Utils.url (cognitive 51) · ×1
  • Utils.url (cognitive 51) system/src/Grav/Common/Utils.php:63 — Utils.url has cognitive complexity 51 (threshold 15). Drivers by points: if/else 42, boolean chains 7, ternaries 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 · UninstallCommand.uninstallPackage (cognitive 51) · ×1
  • UninstallCommand.uninstallPackage (cognitive 51) system/src/Grav/Console/Gpm/UninstallCommand.php:157 — UninstallCommand.uninstallPackage has cognitive complexity 51 (threshold 15). Drivers by points: if/else 35, ternaries 7, loops 5, boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageContentTrait.processContent (cognitive 51) · ×1
  • PageContentTrait.processContent (cognitive 51) system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php:666 — PageContentTrait.processContent has cognitive complexity 51 (threshold 15). Drivers by points: if/else 41, boolean chains 9, ternaries 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 · Folder.all (cognitive 49) · ×1
  • Folder.all (cognitive 49) system/src/Grav/Common/Filesystem/Folder.php:225 — Folder.all has cognitive complexity 49 (threshold 15). Drivers by points: if/else 34, ternaries 9, boolean chains 5, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Truncator.truncate (cognitive 49) · ×1
  • Truncator.truncate (cognitive 49) system/src/Grav/Common/Helpers/Truncator.php:246 — Truncator.truncate has cognitive complexity 49 (threshold 15). Drivers by points: if/else 40, loops 9 (nesting depth added 30). 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 · PagesServiceProvider.register (cognitive 49) · ×1
  • PagesServiceProvider.register (cognitive 49) system/src/Grav/Common/Service/PagesServiceProvider.php:33 — PagesServiceProvider.register has cognitive complexity 49 (threshold 15). Drivers by points: if/else 38, boolean chains 6, ternaries 5 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Flex.getObjects (cognitive 49) · ×1
  • Flex.getObjects (cognitive 49) system/src/Grav/Framework/Flex/Flex.php:165 — Flex.getObjects has cognitive complexity 49 (threshold 15). Drivers by points: if/else 28, loops 13, ternaries 5, boolean chains 3 (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 · SelfupgradeCommand.handlePreflightReport (cognitive 48) · ×1
  • SelfupgradeCommand.handlePreflightReport (cognitive 48) system/src/Grav/Console/Gpm/SelfupgradeCommand.php:287 — SelfupgradeCommand.handlePreflightReport has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18, loops 17, boolean chains 7, ternaries 6 (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 · Cache.clearCache (cognitive 47) · ×1
  • Cache.clearCache (cognitive 47) system/src/Grav/Common/Cache.php:582 — Cache.clearCache has cognitive complexity 47 (threshold 15). Drivers by points: if/else 36, error handling 4, loops 4, boolean chains 2, match/switch 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdateCommand.serve (cognitive 47) · ×1
  • UpdateCommand.serve (cognitive 47) system/src/Grav/Console/Gpm/UpdateCommand.php:104 — UpdateCommand.serve has cognitive complexity 47 (threshold 15). Drivers by points: if/else 39, boolean chains 5, loops 3 (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 · BlueprintSchema.validateArray (cognitive 46) · ×1
  • BlueprintSchema.validateArray (cognitive 46) system/src/Grav/Common/Data/BlueprintSchema.php:181 — BlueprintSchema.validateArray has cognitive complexity 46 (threshold 15). Drivers by points: if/else 31, boolean chains 9, ternaries 5, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageCollection.ofOneOfTheseAccessLevels (cognitive 45) · ×1
  • PageCollection.ofOneOfTheseAccessLevels (cognitive 45) system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:687 — PageCollection.ofOneOfTheseAccessLevels has cognitive complexity 45 (threshold 15). Drivers by points: if/else 33, loops 11, boolean chains 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Collection.ofOneOfTheseAccessLevels (cognitive 45) · ×1
  • Collection.ofOneOfTheseAccessLevels (cognitive 45) system/src/Grav/Common/Page/Collection.php:642 — Collection.ofOneOfTheseAccessLevels has cognitive complexity 45 (threshold 15). Drivers by points: if/else 33, loops 11, boolean chains 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageLegacyTrait.metadata (cognitive 45) · ×1
  • PageLegacyTrait.metadata (cognitive 45) system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:612 — PageLegacyTrait.metadata has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 20, if/else 16, loops 6, 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 · Cache.getCacheAdapter (cognitive 43) · ×1
  • Cache.getCacheAdapter (cognitive 43) system/src/Grav/Common/Cache.php:297 — Cache.getCacheAdapter has cognitive complexity 43 (threshold 15). Drivers by points: if/else 34, boolean chains 5, error handling 3, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Utils.getPathFromToken (cognitive 43) · ×1
  • Utils.getPathFromToken (cognitive 43) system/src/Grav/Common/Utils.php:1691 — Utils.getPathFromToken has cognitive complexity 43 (threshold 15). Drivers by points: if/else 35, ternaries 7, match/switch 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CacheCleanupCommand.serve (cognitive 43) · ×1
  • CacheCleanupCommand.serve (cognitive 43) system/src/Grav/Console/Cli/CacheCleanupCommand.php:68 — CacheCleanupCommand.serve has cognitive complexity 43 (threshold 15). Drivers by points: if/else 34, error handling 4, loops 3, boolean chains 1, ternaries 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndexCommand.filter (cognitive 43) · ×1
  • IndexCommand.filter (cognitive 43) system/src/Grav/Console/Gpm/IndexCommand.php:274 — IndexCommand.filter has cognitive complexity 43 (threshold 15). Drivers by points: if/else 32, boolean chains 6, loops 5 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageStorage.saveRow (cognitive 41) · ×1
  • PageStorage.saveRow (cognitive 41) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:371 — PageStorage.saveRow has cognitive complexity 41 (threshold 15). Drivers by points: if/else 30, ternaries 7, boolean chains 3, error handling 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Scheduler.run (cognitive 41) · ×1
  • Scheduler.run (cognitive 41) system/src/Grav/Common/Scheduler/Scheduler.php:288 — Scheduler.run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 26, loops 8, boolean chains 5, ternaries 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Language.setActiveFromUri (cognitive 40) · ×1
  • Language.setActiveFromUri (cognitive 40) system/src/Grav/Common/Language/Language.php:245 — Language.setActiveFromUri has cognitive complexity 40 (threshold 15). Drivers by points: if/else 27, boolean chains 9, ternaries 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 · Pages.buildRoutes (cognitive 40) · ×1
  • Pages.buildRoutes (cognitive 40) system/src/Grav/Common/Page/Pages.php:2308 — Pages.buildRoutes has cognitive complexity 40 (threshold 15). Drivers by points: if/else 30, boolean chains 6, loops 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 · Cron.cronToArray (cognitive 40) · ×1
  • Cron.cronToArray (cognitive 40) system/src/Grav/Common/Scheduler/Cron.php:524 — Cron.cronToArray has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20, loops 16, boolean chains 4 (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 · InfoCommand.serve (cognitive 39) · ×1
  • InfoCommand.serve (cognitive 39) system/src/Grav/Console/Gpm/InfoCommand.php:63 — InfoCommand.serve has cognitive complexity 39 (threshold 15). Drivers by points: if/else 28, boolean chains 4, ternaries 4, 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 · Setup.__construct (cognitive 38) · ×1
  • Setup.__construct (cognitive 38) system/src/Grav/Common/Config/Setup.php:172 — Setup.__construct has cognitive complexity 38 (threshold 15). Drivers by points: if/else 25, ternaries 12, 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 · CompiledFile.content (cognitive 38) · ×1
  • CompiledFile.content (cognitive 38) system/src/Grav/Common/File/CompiledFile.php:34 — CompiledFile.content has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17, boolean chains 12, error handling 7, 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 · Debugger.init (cognitive 37) · ×1
  • Debugger.init (cognitive 37) system/src/Grav/Common/Debugger.php:133 — Debugger.init has cognitive complexity 37 (threshold 15). Drivers by points: if/else 34, match/switch 2, boolean chains 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 · Validation.arrayFilterRecurse (cognitive 36) · ×1
  • Validation.arrayFilterRecurse (cognitive 36) system/src/Grav/Common/Data/Validation.php:910 — Validation.arrayFilterRecurse has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23, match/switch 7, boolean chains 5, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Installer.unZip (cognitive 36) · ×1
  • Installer.unZip (cognitive 36) system/src/Grav/Common/GPM/Installer.php:178 — Installer.unZip has cognitive complexity 36 (threshold 15). Drivers by points: if/else 32, boolean chains 2, loops 2 (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 · MediaUploadTrait.checkFileMetadata (cognitive 36) · ×1
  • MediaUploadTrait.checkFileMetadata (cognitive 36) system/src/Grav/Common/Media/Traits/MediaUploadTrait.php:118 — MediaUploadTrait.checkFileMetadata has cognitive complexity 36 (threshold 15). Drivers by points: if/else 31, boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Utils.download (cognitive 36) · ×1
  • Utils.download (cognitive 36) system/src/Grav/Common/Utils.php:705 — Utils.download has cognitive complexity 36 (threshold 15). Drivers by points: if/else 30, boolean chains 3, loops 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZipArchiver.extract (cognitive 34) · ×1
  • ZipArchiver.extract (cognitive 34) system/src/Grav/Common/Filesystem/ZipArchiver.php:30 — ZipArchiver.extract has cognitive complexity 34 (threshold 15). Drivers by points: if/else 30, boolean chains 2, loops 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 · UserObject.setUpdatedMedia (cognitive 34) · ×1
  • UserObject.setUpdatedMedia (cognitive 34) system/src/Grav/Common/Flex/Types/Users/UserObject.php:864 — UserObject.setUpdatedMedia has cognitive complexity 34 (threshold 15). Drivers by points: if/else 29, loops 3, boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pages.buildFlexPages (cognitive 34) · ×1
  • Pages.buildFlexPages (cognitive 34) system/src/Grav/Common/Page/Pages.php:1753 — Pages.buildFlexPages has cognitive complexity 34 (threshold 15). Drivers by points: if/else 27, ternaries 3, boolean chains 2, loops 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 · Security.scanContentTwigUsage (cognitive 34) · ×1
  • Security.scanContentTwigUsage (cognitive 34) system/src/Grav/Common/Security.php:1259 — Security.scanContentTwigUsage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15, loops 11, boolean chains 5, error handling 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlexIndex.updateIndexFile (cognitive 34) · ×1
  • FlexIndex.updateIndexFile (cognitive 34) system/src/Grav/Framework/Flex/FlexIndex.php:706 — FlexIndex.updateIndexFile has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24, boolean chains 5, loops 5 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageObject.reorderSiblings (cognitive 33) · ×1
  • PageObject.reorderSiblings (cognitive 33) system/src/Grav/Common/Flex/Types/Pages/PageObject.php:408 — PageObject.reorderSiblings has cognitive complexity 33 (threshold 15). Drivers by points: if/else 22, loops 7, ternaries 3, 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 · Language.getFallbackLanguages (cognitive 33) · ×1
  • Language.getFallbackLanguages (cognitive 33) system/src/Grav/Common/Language/Language.php:443 — Language.getFallbackLanguages has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19, loops 6, boolean chains 4, ternaries 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 · ParsedownGravTrait.blockTableContinue (cognitive 33) · ×1
  • ParsedownGravTrait.blockTableContinue (cognitive 33) system/src/Grav/Common/Markdown/ParsedownGravTrait.php:690 — ParsedownGravTrait.blockTableContinue has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20, boolean chains 9, ternaries 4 (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 · Folder.rcopy (cognitive 32) · ×1
  • Folder.rcopy (cognitive 32) system/src/Grav/Common/Filesystem/Folder.php:489 — Folder.rcopy has cognitive complexity 32 (threshold 15). Drivers by points: if/else 30, boolean chains 1, loops 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 · Excerpts.processLinkExcerpt (cognitive 32) · ×1
  • Excerpts.processLinkExcerpt (cognitive 32) system/src/Grav/Common/Page/Markdown/Excerpts.php:96 — Excerpts.processLinkExcerpt has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20, ternaries 8, boolean chains 2, loops 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 · InstallCommand.processGpm (cognitive 32) · ×1
  • InstallCommand.processGpm (cognitive 32) system/src/Grav/Console/Gpm/InstallCommand.php:541 — InstallCommand.processGpm has cognitive complexity 32 (threshold 15). Drivers by points: if/else 23, loops 7, 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 · GPM.calculateMergedDependenciesOfPackage (cognitive 31) · ×1
  • GPM.calculateMergedDependenciesOfPackage (cognitive 31) system/src/Grav/Common/GPM/GPM.php:1224 — GPM.calculateMergedDependenciesOfPackage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 29, boolean chains 1, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Installer.install (cognitive 31) · ×1
  • Installer.install (cognitive 31) system/src/Grav/Common/GPM/Installer.php:82 — Installer.install has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22, boolean chains 9 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ParsedownGravTrait.blockTableComplete (cognitive 31) · ×1
  • ParsedownGravTrait.blockTableComplete (cognitive 31) system/src/Grav/Common/Markdown/ParsedownGravTrait.php:803 — ParsedownGravTrait.blockTableComplete has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18, boolean chains 5, loops 5, ternaries 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 · Pages.get (cognitive 31) · ×1
  • Pages.get (cognitive 31) system/src/Grav/Common/Page/Pages.php:992 — Pages.get has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21, ternaries 5, loops 4, 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 · VersionCommand.serve (cognitive 31) · ×1
  • VersionCommand.serve (cognitive 31) system/src/Grav/Console/Gpm/VersionCommand.php:55 — VersionCommand.serve has cognitive complexity 31 (threshold 15). Drivers by points: if/else 27, ternaries 2, boolean chains 1, loops 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 · HtmlBlock.getAssetsFast (cognitive 31) · ×1
  • HtmlBlock.getAssetsFast (cognitive 31) system/src/Grav/Framework/ContentBlock/HtmlBlock.php:401 — HtmlBlock.getAssetsFast has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18, loops 13 (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 · BlueprintSchema.filterArray (cognitive 30) · ×1
  • BlueprintSchema.filterArray (cognitive 30) system/src/Grav/Common/Data/BlueprintSchema.php:263 — BlueprintSchema.filterArray has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15, boolean chains 8, ternaries 6, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Page.value (cognitive 30) · ×1
  • Page.value (cognitive 30) system/src/Grav/Common/Page/Page.php:1225 — Page.value has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20, ternaries 6, boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Scheduler.executeJob (cognitive 30) · ×1
  • Scheduler.executeJob (cognitive 30) system/src/Grav/Common/Scheduler/Scheduler.php:873 — Scheduler.executeJob has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 14, if/else 13, boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlexDirectory.loadObjects (cognitive 30) · ×1
  • FlexDirectory.loadObjects (cognitive 30) system/src/Grav/Framework/Flex/FlexDirectory.php:671 — FlexDirectory.loadObjects has cognitive complexity 30 (threshold 15). Drivers by points: if/else 24, loops 4, error handling 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 · BlueprintSchema.processFormRecursive (cognitive 29) · ×1
  • BlueprintSchema.processFormRecursive (cognitive 29) system/src/Grav/Common/Data/BlueprintSchema.php:345 — BlueprintSchema.processFormRecursive has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, boolean chains 5, 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 · Security.resolveTwigContentEvents (cognitive 29) · ×1
  • Security.resolveTwigContentEvents (cognitive 29) system/src/Grav/Common/Security.php:953 — Security.resolveTwigContentEvents has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, boolean chains 7, error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.start (cognitive 29) · ×1
  • Session.start (cognitive 29) system/src/Grav/Framework/Session/Session.php:189 — Session.start has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16, boolean chains 6, ternaries 5, error handling 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Install.detectPendingPackageUpdates (cognitive 29) · ×1
  • Install.detectPendingPackageUpdates (cognitive 29) system/src/Grav/Installer/Install.php:670 — Install.detectPendingPackageUpdates has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, boolean chains 2, loops 2, error handling 1, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Cache.purgeOldCache (cognitive 28) · ×1
  • Cache.purgeOldCache (cognitive 28) system/src/Grav/Common/Cache.php:185 — Cache.purgeOldCache has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, loops 5, boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Installer.sophisticatedInstall (cognitive 28) · ×1
  • Installer.sophisticatedInstall (cognitive 28) system/src/Grav/Common/GPM/Installer.php:508 — Installer.sophisticatedInstall has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14, loops 5, ternaries 4, error handling 3, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pages.evaluate (cognitive 28) · ×1
  • Pages.evaluate (cognitive 28) system/src/Grav/Common/Page/Pages.php:779 — Pages.evaluate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14, ternaries 6, boolean chains 4, loops 2, match/switch 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 · Pages.dispatch (cognitive 28) · ×1
  • Pages.dispatch (cognitive 28) system/src/Grav/Common/Page/Pages.php:1227 — Pages.dispatch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, error handling 3, boolean chains 2, loops 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 · Pages.buildRegularPages (cognitive 28) · ×1
  • Pages.buildRegularPages (cognitive 28) system/src/Grav/Common/Page/Pages.php:1901 — Pages.buildRegularPages has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 13, if/else 12, boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParsedownGravTrait.__call (cognitive 27) · ×1
  • ParsedownGravTrait.__call (cognitive 27) system/src/Grav/Common/Markdown/ParsedownGravTrait.php:979 — ParsedownGravTrait.__call has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14, ternaries 11, loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Security.detectXss (cognitive 27) · ×1
  • Security.detectXss (cognitive 27) system/src/Grav/Common/Security.php:190 — Security.detectXss has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20, boolean chains 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 · SelfupgradeCommand.serve (cognitive 27) · ×1
  • SelfupgradeCommand.serve (cognitive 27) system/src/Grav/Console/Gpm/SelfupgradeCommand.php:108 — SelfupgradeCommand.serve has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, boolean chains 3, loops 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 · FlexIndex.__call (cognitive 27) · ×1
  • FlexIndex.__call (cognitive 27) system/src/Grav/Framework/Flex/FlexIndex.php:445 — FlexIndex.__call has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19, error handling 5, ternaries 2, 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 · FlexObject.render (cognitive 27) · ×1
  • FlexObject.render (cognitive 27) system/src/Grav/Framework/Flex/FlexObject.php:543 — FlexObject.render has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13, boolean chains 5, ternaries 4, error handling 3, 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 · FileReader.read (cognitive 26) · ×1
  • FileReader.read (cognitive 26) system/src/Grav/Common/Helpers/FileReader.php:62 — FileReader.read has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, boolean chains 5, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · FlexCollection.render (cognitive 26) · ×1
  • FlexCollection.render (cognitive 26) system/src/Grav/Framework/Flex/FlexCollection.php:369 — FlexCollection.render has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11, boolean chains 7, ternaries 4, error handling 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.
D2 · Cognitive Complexity · PageStorage.getIndexMeta (cognitive 25) · ×1
  • PageStorage.getIndexMeta (cognitive 25) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:660 — PageStorage.getIndexMeta has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, loops 5, ternaries 3, 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 · MediaObjectTrait.parsedownElement (cognitive 25) · ×1
  • MediaObjectTrait.parsedownElement (cognitive 25) system/src/Grav/Common/Media/Traits/MediaObjectTrait.php:261 — MediaObjectTrait.parsedownElement has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, ternaries 2, loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Job.runWithRetry (cognitive 25) · ×1
  • Job.runWithRetry (cognitive 25) system/src/Grav/Common/Scheduler/Job.php:838 — Job.runWithRetry has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, error handling 2, 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 · Uri.convertUrlOld (cognitive 25) · ×1
  • Uri.convertUrlOld (cognitive 25) system/src/Grav/Common/Uri.php:1051 — Uri.convertUrlOld has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, boolean chains 3, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · YamlUpdater.findPath (cognitive 25) · ×1
  • YamlUpdater.findPath (cognitive 25) system/src/Grav/Installer/YamlUpdater.php:252 — YamlUpdater.findPath has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, ternaries 3, boolean chains 1, 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 · AssetUtilsTrait.gatherLinks (cognitive 24) · ×1
  • AssetUtilsTrait.gatherLinks (cognitive 24) system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php:68 — AssetUtilsTrait.gatherLinks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 3, ternaries 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pages.accessLevels (cognitive 24) · ×1
  • Pages.accessLevels (cognitive 24) system/src/Grav/Common/Page/Pages.php:1601 — Pages.accessLevels has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12, loops 11, boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Uri.createFromEnvironment (cognitive 24) · ×1
  • Uri.createFromEnvironment (cognitive 24) system/src/Grav/Common/Uri.php:1240 — Uri.createFromEnvironment has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12, boolean chains 6, ternaries 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · User.save (cognitive 24) · ×1
  • User.save (cognitive 24) system/src/Grav/Common/User/DataUser/User.php:120 — User.save has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 4, ternaries 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PreflightCommand.serve (cognitive 24) · ×1
  • PreflightCommand.serve (cognitive 24) system/src/Grav/Console/Gpm/PreflightCommand.php:21 — PreflightCommand.serve has cognitive complexity 24 (threshold 15). Drivers by points: loops 11, if/else 7, boolean chains 3, ternaries 3 (nesting depth added 7). 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 · Validation.typeArray (cognitive 23) · ×1
  • Validation.typeArray (cognitive 23) system/src/Grav/Common/Data/Validation.php:788 — Validation.typeArray has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, boolean chains 7, 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 · ZipArchiver.extractStreamed (cognitive 23) · ×1
  • ZipArchiver.extractStreamed (cognitive 23) system/src/Grav/Common/Filesystem/ZipArchiver.php:186 — ZipArchiver.extractStreamed has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Installer.extractStreamed (cognitive 23) · ×1
  • Installer.extractStreamed (cognitive 23) system/src/Grav/Common/GPM/Installer.php:349 — Installer.extractStreamed has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageMediaTrait.derivatives (cognitive 23) · ×1
  • ImageMediaTrait.derivatives (cognitive 23) system/src/Grav/Common/Media/Traits/ImageMediaTrait.php:130 — ImageMediaTrait.derivatives has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, loops 8 (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 · Pages.getList (cognitive 23) · ×1
  • Pages.getList (cognitive 23) system/src/Grav/Common/Page/Pages.php:1430 — Pages.getList has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, boolean chains 4, ternaries 3, 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 · Pages.getTypes (cognitive 23) · ×1
  • Pages.getTypes (cognitive 23) system/src/Grav/Common/Page/Pages.php:1475 — Pages.getTypes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RequestServiceProvider.register (cognitive 23) · ×1
  • RequestServiceProvider.register (cognitive 23) system/src/Grav/Common/Service/RequestServiceProvider.php:36 — RequestServiceProvider.register has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, error handling 4, match/switch 3, loops 2, 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 · PageAuthorsTrait.isAuthorizedByGroup (cognitive 23) · ×1
  • PageAuthorsTrait.isAuthorizedByGroup (cognitive 23) system/src/Grav/Framework/Flex/Pages/Traits/PageAuthorsTrait.php:168 — PageAuthorsTrait.isAuthorizedByGroup has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, boolean chains 3, ternaries 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlexMediaTrait.setUpdatedMedia (cognitive 23) · ×1
  • FlexMediaTrait.setUpdatedMedia (cognitive 23) system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php:367 — FlexMediaTrait.setUpdatedMedia has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 3, 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 · MediaIdentifier.getObject (cognitive 23) · ×1
  • MediaIdentifier.getObject (cognitive 23) system/src/Grav/Framework/Media/MediaIdentifier.php:47 — MediaIdentifier.getObject has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, ternaries 4, boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Validation.validate (cognitive 22) · ×1
  • Validation.validate (cognitive 22) system/src/Grav/Common/Data/Validation.php:53 — Validation.validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, boolean chains 8, ternaries 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Validation.filterArray (cognitive 22) · ×1
  • Validation.filterArray (cognitive 22) system/src/Grav/Common/Data/Validation.php:866 — Validation.filterArray has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8, boolean chains 6, loops 4, ternaries 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Debugger.addMessage (cognitive 22) · ×1
  • Debugger.addMessage (cognitive 22) system/src/Grav/Common/Debugger.php:834 — Debugger.addMessage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22 (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 · Base32.decode (cognitive 22) · ×1
  • Base32.decode (cognitive 22) system/src/Grav/Common/Helpers/Base32.php:87 — Base32.decode has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, 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 · Excerpts.processImageExcerpt (cognitive 22) · ×1
  • Excerpts.processImageExcerpt (cognitive 22) system/src/Grav/Common/Page/Markdown/Excerpts.php:186 — Excerpts.processImageExcerpt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, boolean chains 7 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractMedia.compareMeta (cognitive 22) · ×1
  • AbstractMedia.compareMeta (cognitive 22) system/src/Grav/Common/Page/Medium/AbstractMedia.php:498 — AbstractMedia.compareMeta has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, ternaries 4, loops 3, boolean chains 1, 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 · JobHistory.searchHistory (cognitive 22) · ×1
  • JobHistory.searchHistory (cognitive 22) system/src/Grav/Common/Scheduler/JobHistory.php:331 — JobHistory.searchHistory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 3, ternaries 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 · Session.getFlashObject (cognitive 22) · ×1
  • Session.getFlashObject (cognitive 22) system/src/Grav/Common/Session.php:123 — Session.getFlashObject has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9, ternaries 6, error handling 4, boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Taxonomy.findTaxonomy (cognitive 22) · ×1
  • Taxonomy.findTaxonomy (cognitive 22) system/src/Grav/Common/Taxonomy.php:178 — Taxonomy.findTaxonomy has cognitive complexity 22 (threshold 15). Drivers by points: loops 14, if/else 4, boolean chains 2, ternaries 2 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Uri.init (cognitive 22) · ×1
  • Uri.init (cognitive 22) system/src/Grav/Common/Uri.php:154 — Uri.init has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, ternaries 4, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Assets.splitPipelineAssetsByAttribute (cognitive 21) · ×1
  • Assets.splitPipelineAssetsByAttribute (cognitive 21) system/src/Grav/Common/Assets.php:623 — Assets.splitPipelineAssetsByAttribute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, ternaries 4, 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 · BaseAsset.init (cognitive 21) · ×1
  • BaseAsset.init (cognitive 21) system/src/Grav/Common/Assets/BaseAsset.php:94 — BaseAsset.init has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, ternaries 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Backups.backup (cognitive 21) · ×1
  • Backups.backup (cognitive 21) system/src/Grav/Common/Backup/Backups.php:221 — Backups.backup has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, boolean chains 5, loops 2, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · PageTranslateTrait.translatedLanguages (cognitive 21) · ×1
  • PageTranslateTrait.translatedLanguages (cognitive 21) system/src/Grav/Common/Flex/Types/Pages/Traits/PageTranslateTrait.php:32 — PageTranslateTrait.translatedLanguages has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, ternaries 7, loops 3, 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 · Page.doReorder (cognitive 21) · ×1
  • Page.doReorder (cognitive 21) system/src/Grav/Common/Page/Page.php:3027 — Page.doReorder has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 3, loops 2, 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 · JobHistory.getJobStatistics (cognitive 21) · ×1
  • JobHistory.getJobStatistics (cognitive 21) system/src/Grav/Common/Scheduler/JobHistory.php:223 — JobHistory.getJobStatistics has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 4, ternaries 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 · SelfupgradeCommand.upgrade (cognitive 21) · ×1
  • SelfupgradeCommand.upgrade (cognitive 21) system/src/Grav/Console/Gpm/SelfupgradeCommand.php:518 — SelfupgradeCommand.upgrade has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, ternaries 10 (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 · PageLegacyTrait.copy (cognitive 21) · ×1
  • PageLegacyTrait.copy (cognitive 21) system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:297 — PageLegacyTrait.copy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, ternaries 6, 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 · DOMWordsIterator.next (cognitive 20) · ×1
  • DOMWordsIterator.next (cognitive 20) system/src/DOMWordsIterator.php:89 — DOMWordsIterator.next has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 5, 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 · Blueprint.init (cognitive 20) · ×1
  • Blueprint.init (cognitive 20) system/src/Grav/Common/Data/Blueprint.php:142 — Blueprint.init has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Blueprint.getFiles (cognitive 20) · ×1
  • Blueprint.getFiles (cognitive 20) system/src/Grav/Common/Data/Blueprint.php:372 — Blueprint.getFiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Language.translate (cognitive 20) · ×1
  • Language.translate (cognitive 20) system/src/Grav/Common/Language/Language.php:521 — Language.translate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 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 · Page.summary (cognitive 20) · ×1
  • Page.summary (cognitive 20) system/src/Grav/Common/Page/Page.php:808 — Page.summary has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, ternaries 4, boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Security.recordTwigContentEvent (cognitive 20) · ×1
  • Security.recordTwigContentEvent (cognitive 20) system/src/Grav/Common/Security.php:801 — Security.recordTwigContentEvent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UserCollection.find (cognitive 20) · ×1
  • UserCollection.find (cognitive 20) system/src/Grav/Common/User/DataUser/UserCollection.php:86 — UserCollection.find has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, loops 6, boolean chains 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 · Utils.arrayUnflattenDotNotation (cognitive 20) · ×1
  • Utils.arrayUnflattenDotNotation (cognitive 20) system/src/Grav/Common/Utils.php:1319 — Utils.arrayUnflattenDotNotation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 4, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Assets.add (cognitive 19) · ×1
  • Assets.add (cognitive 19) system/src/Grav/Common/Assets.php:175 — Assets.add has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 2, ternaries 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Assets.addType (cognitive 19) · ×1
  • Assets.addType (cognitive 19) system/src/Grav/Common/Assets.php:231 — Assets.addType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, loops 2, 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 · Assets.render (cognitive 19) · ×1
  • Assets.render (cognitive 19) system/src/Grav/Common/Assets.php:446 — Assets.render has cognitive complexity 19 (threshold 15). Drivers by points: loops 10, if/else 9 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Pipeline.gatherAndMinifyJs (cognitive 19) · ×1
  • Pipeline.gatherAndMinifyJs (cognitive 19) system/src/Grav/Common/Assets/Pipeline.php:369 — Pipeline.gatherAndMinifyJs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, error handling 2, ternaries 2, 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 · Env.load (cognitive 19) · ×1
  • Env.load (cognitive 19) system/src/Grav/Common/Config/Env.php:65 — Env.load has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, boolean chains 7, ternaries 2, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BlueprintSchema.checkRequired (cognitive 19) · ×1
  • BlueprintSchema.checkRequired (cognitive 19) system/src/Grav/Common/Data/BlueprintSchema.php:402 — BlueprintSchema.checkRequired has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 4, 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 · Inflector.pluralize (cognitive 19) · ×1
  • Inflector.pluralize (cognitive 19) system/src/Grav/Common/Inflector.php:63 — Inflector.pluralize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, 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 · Inflector.singularize (cognitive 19) · ×1
  • Inflector.singularize (cognitive 19) system/src/Grav/Common/Inflector.php:108 — Inflector.singularize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, 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 · MediaUploadTrait.doRemove (cognitive 19) · ×1
  • MediaUploadTrait.doRemove (cognitive 19) system/src/Grav/Common/Media/Traits/MediaUploadTrait.php:521 — MediaUploadTrait.doRemove has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigServiceProvider.loadCachedFileList (cognitive 19) · ×1
  • ConfigServiceProvider.loadCachedFileList (cognitive 19) system/src/Grav/Common/Service/ConfigServiceProvider.php:266 — ConfigServiceProvider.loadCachedFileList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 4, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TwigTokenParserScript.parseArguments (cognitive 19) · ×1
  • TwigTokenParserScript.parseArguments (cognitive 19) system/src/Grav/Common/Twig/TokenParser/TwigTokenParserScript.php:62 — TwigTokenParserScript.parseArguments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 5, 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 · Uri.ip (cognitive 19) · ×1
  • Uri.ip (cognitive 19) system/src/Grav/Common/Uri.php:688 — Uri.ip has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 4, 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 · InstallCommand.installDependencies (cognitive 19) · ×1
  • InstallCommand.installDependencies (cognitive 19) system/src/Grav/Console/Gpm/InstallCommand.php:301 — InstallCommand.installDependencies has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, loops 5, 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 · InstallCommand.installDemoContent (cognitive 19) · ×1
  • InstallCommand.installDemoContent (cognitive 19) system/src/Grav/Console/Gpm/InstallCommand.php:394 — InstallCommand.installDemoContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, ternaries 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 · UninstallCommand.serve (cognitive 19) · ×1
  • UninstallCommand.serve (cognitive 19) system/src/Grav/Console/Gpm/UninstallCommand.php:72 — UninstallCommand.serve has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, ternaries 3, loops 2, boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlexPageObject.filterElements (cognitive 19) · ×1
  • FlexPageObject.filterElements (cognitive 19) system/src/Grav/Framework/Flex/Pages/FlexPageObject.php:431 — FlexPageObject.filterElements has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, ternaries 8 (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 · Grav.getRedirectResponse (cognitive 18) · ×1
  • Grav.getRedirectResponse (cognitive 18) system/src/Grav/Common/Grav.php:529 — Grav.getRedirectResponse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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 · GlobalMedia.addMedium (cognitive 18) · ×1
  • GlobalMedia.addMedium (cognitive 18) system/src/Grav/Common/Page/Medium/GlobalMedia.php:85 — GlobalMedia.addMedium has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 2, 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 · InitializeProcessor.initializeConfig (cognitive 18) · ×1
  • InitializeProcessor.initializeConfig (cognitive 18) system/src/Grav/Common/Processors/InitializeProcessor.php:166 — InitializeProcessor.initializeConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, loops 7, 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 · TwigTokenParserStyle.parseArguments (cognitive 18) · ×1
  • TwigTokenParserStyle.parseArguments (cognitive 18) system/src/Grav/Common/Twig/TokenParser/TwigTokenParserStyle.php:55 — TwigTokenParserStyle.parseArguments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 5, 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 · YamlLinterCommand.serve (cognitive 18) · ×1
  • YamlLinterCommand.serve (cognitive 18) system/src/Grav/Console/Cli/YamlLinterCommand.php:55 — YamlLinterCommand.serve has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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 · FlexIndex.orderBy (cognitive 18) · ×1
  • FlexIndex.orderBy (cognitive 18) system/src/Grav/Framework/Flex/FlexIndex.php:382 — FlexIndex.orderBy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, 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.
D2 · Cognitive Complexity · DOMLettersIterator.next (cognitive 17) · ×1
  • DOMLettersIterator.next (cognitive 17) system/src/DOMLettersIterator.php:88 — DOMLettersIterator.next has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 5, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Setup.check (cognitive 17) · ×1
  • Setup.check (cognitive 17) system/src/Grav/Common/Config/Setup.php:390 — Setup.check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 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 · Debugger.addAssets (cognitive 17) · ×1
  • Debugger.addAssets (cognitive 17) system/src/Grav/Common/Debugger.php:488 — Debugger.addAssets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, 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 · Installer.mergeInstall (cognitive 17) · ×1
  • Installer.mergeInstall (cognitive 17) system/src/Grav/Common/GPM/Installer.php:583 — Installer.mergeInstall has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, error handling 3, loops 2, 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 · VectorImageMedium.__construct (cognitive 17) · ×1
  • VectorImageMedium.__construct (cognitive 17) system/src/Grav/Common/Page/Medium/VectorImageMedium.php:27 — VectorImageMedium.__construct has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 8, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SchedulerController.formatHealthStatus (cognitive 17) · ×1
  • SchedulerController.formatHealthStatus (cognitive 17) system/src/Grav/Common/Scheduler/SchedulerController.php:161 — SchedulerController.formatHealthStatus has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9, if/else 7, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Security.splitMethodNames (cognitive 17) · ×1
  • Security.splitMethodNames (cognitive 17) system/src/Grav/Common/Security.php:1448 — Security.splitMethodNames has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, loops 4, ternaries 4, 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 · SessionServiceProvider.register (cognitive 17) · ×1
  • SessionServiceProvider.register (cognitive 17) system/src/Grav/Common/Service/SessionServiceProvider.php:32 — SessionServiceProvider.register has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 5, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · GravExtension.dump (cognitive 17) · ×1
  • GravExtension.dump (cognitive 17) system/src/Grav/Common/Twig/Extension/GravExtension.php:1256 — GravExtension.dump has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 4, 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 · PluginCommandLoader.__construct (cognitive 17) · ×1
  • PluginCommandLoader.__construct (cognitive 17) system/src/Grav/Console/Application/CommandLoader/PluginCommandLoader.php:34 — PluginCommandLoader.__construct has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, loops 6, error handling 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 · InstallCommand.symlink (cognitive 17) · ×1
  • InstallCommand.symlink (cognitive 17) system/src/Grav/Console/Cli/InstallCommand.php:188 — InstallCommand.symlink has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, 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 · SelfupgradeCommand.upgradeGrav (cognitive 17) · ×1
  • SelfupgradeCommand.upgradeGrav (cognitive 17) system/src/Grav/Console/Gpm/SelfupgradeCommand.php:618 — SelfupgradeCommand.upgradeGrav has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 4, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdateCommand.userInputPackages (cognitive 17) · ×1
  • UpdateCommand.userInputPackages (cognitive 17) system/src/Grav/Console/Gpm/UpdateCommand.php:283 — UpdateCommand.userInputPackages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 2, 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 · FlexDirectory.loadIndex (cognitive 17) · ×1
  • FlexDirectory.loadIndex (cognitive 17) system/src/Grav/Framework/Flex/FlexDirectory.php:1062 — FlexDirectory.loadIndex has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, error handling 5, 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 · FlexObject.refresh (cognitive 17) · ×1
  • FlexObject.refresh (cognitive 17) system/src/Grav/Framework/Flex/FlexObject.php:200 — FlexObject.refresh has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 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 · FolderStorage.deleteRows (cognitive 17) · ×1
  • FolderStorage.deleteRows (cognitive 17) system/src/Grav/Framework/Flex/Storage/FolderStorage.php:178 — FolderStorage.deleteRows has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, 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 · FlexMediaTrait.addUpdatedMedia (cognitive 17) · ×1
  • FlexMediaTrait.addUpdatedMedia (cognitive 17) system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php:436 — FlexMediaTrait.addUpdatedMedia has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, 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 · Validation.checkSafety (cognitive 16) · ×1
  • Validation.checkSafety (cognitive 16) system/src/Grav/Common/Data/Validation.php:122 — Validation.checkSafety has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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 · PageObject.filterElements (cognitive 16) · ×1
  • PageObject.filterElements (cognitive 16) system/src/Grav/Common/Flex/Types/Pages/PageObject.php:693 — PageObject.filterElements has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, ternaries 5, 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 · UserObject.authorize (cognitive 16) · ×1
  • UserObject.authorize (cognitive 16) system/src/Grav/Common/Flex/Types/Users/UserObject.php:272 — UserObject.authorize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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 · GPM.findPackages (cognitive 16) · ×1
  • GPM.findPackages (cognitive 16) system/src/Grav/Common/GPM/GPM.php:880 — GPM.findPackages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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 · Grav.shutdown (cognitive 16) · ×1
  • Grav.shutdown (cognitive 16) system/src/Grav/Common/Grav.php:690 — Grav.shutdown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, ternaries 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 · MediaObjectTrait.getThumbnail (cognitive 16) · ×1
  • MediaObjectTrait.getThumbnail (cognitive 16) system/src/Grav/Common/Media/Traits/MediaObjectTrait.php:699 — MediaObjectTrait.getThumbnail has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, ternaries 4, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pages.findSiteBasedRoute (cognitive 16) · ×1
  • Pages.findSiteBasedRoute (cognitive 16) system/src/Grav/Common/Page/Pages.php:1181 — Pages.findSiteBasedRoute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, error handling 3, loops 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Plugins.init (cognitive 16) · ×1
  • Plugins.init (cognitive 16) system/src/Grav/Common/Plugins.php:125 — Plugins.init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, error handling 4, 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 · Scheduler.loadSavedJobs (cognitive 16) · ×1
  • Scheduler.loadSavedJobs (cognitive 16) system/src/Grav/Common/Scheduler/Scheduler.php:113 — Scheduler.loadSavedJobs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, 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 · Security.normalizeMethodsMap (cognitive 16) · ×1
  • Security.normalizeMethodsMap (cognitive 16) system/src/Grav/Common/Security.php:1397 — Security.normalizeMethodsMap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Themes.configure (cognitive 16) · ×1
  • Themes.configure (cognitive 16) system/src/Grav/Common/Themes.php:314 — Themes.configure has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 4, 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 · GravExtension.nicetimeFunc (cognitive 16) · ×1
  • GravExtension.nicetimeFunc (cognitive 16) system/src/Grav/Common/Twig/Extension/GravExtension.php:829 — GravExtension.nicetimeFunc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 1, loops 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · GravExtension.authorize (cognitive 16) · ×1
  • GravExtension.authorize (cognitive 16) system/src/Grav/Common/Twig/Extension/GravExtension.php:1383 — GravExtension.authorize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TwigNodeScript.compile (cognitive 16) · ×1
  • TwigNodeScript.compile (cognitive 16) system/src/Grav/Common/Twig/Node/TwigNodeScript.php:53 — TwigNodeScript.compile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, ternaries 8 (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 · Uri.isExternal (cognitive 16) · ×1
  • Uri.isExternal (cognitive 16) system/src/Grav/Common/Uri.php:770 — Uri.isExternal has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 16. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Group.save (cognitive 16) · ×1
  • Group.save (cognitive 16) system/src/Grav/Common/User/Group.php:97 — Group.save has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 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 · InstallCommand.addSymlinks (cognitive 16) · ×1
  • InstallCommand.addSymlinks (cognitive 16) system/src/Grav/Console/Cli/InstallCommand.php:264 — InstallCommand.addSymlinks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 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 · JsonFormatter.getEncodeOptions (cognitive 16) · ×1
  • JsonFormatter.getEncodeOptions (cognitive 16) system/src/Grav/Framework/File/Formatter/JsonFormatter.php:71 — JsonFormatter.getEncodeOptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 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 · JsonFormatter.getDecodeOptions (cognitive 16) · ×1
  • JsonFormatter.getDecodeOptions (cognitive 16) system/src/Grav/Framework/File/Formatter/JsonFormatter.php:98 — JsonFormatter.getDecodeOptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 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 · Filesystem.normalizePathPart (cognitive 16) · ×1
  • Filesystem.normalizePathPart (cognitive 16) system/src/Grav/Framework/Filesystem/Filesystem.php:301 — Filesystem.normalizePathPart has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlexObject.searchValue (cognitive 16) · ×1
  • FlexObject.searchValue (cognitive 16) system/src/Grav/Framework/Flex/FlexObject.php:392 — FlexObject.searchValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 5 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlexMediaTrait.buildMediaList (cognitive 16) · ×1
  • FlexMediaTrait.buildMediaList (cognitive 16) system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php:336 — FlexMediaTrait.buildMediaList has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8, if/else 7, 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 · Session.regenerateId (cognitive 16) · ×1
  • Session.regenerateId (cognitive 16) system/src/Grav/Framework/Session/Session.php:320 — Session.regenerateId has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, 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 · Install.detectPsrLogConflicts (cognitive 16) · ×1
  • Install.detectPsrLogConflicts (cognitive 16) system/src/Grav/Installer/Install.php:848 — Install.detectPsrLogConflicts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, 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 · Install.detectMonologConflicts (cognitive 16) · ×1
  • Install.detectMonologConflicts (cognitive 16) system/src/Grav/Installer/Install.php:891 — Install.detectMonologConflicts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, 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.
D36 · Supply-chain Provenance & Signing · Unpinned build actions · ×1
  • Unpinned build actions — CI references GitHub Actions by a floating ref (@main / @tag) rather than a pinned commit SHA, weakening build integrity. 13 floating ref(s) across 5 workflow file(s). Each floating ref is itemized at file:line by the SAST (D29) lens.
D36 · Supply-chain Provenance & Signing · Secret passed as a command-line argument · ×1
  • Secret passed as a command-line argument — 2 CI command(s) pass a credential as a bare command-line argument, where it is visible in the runner's process table to any other process on the host (and to anything that logs a command line): build.yaml: http_code=$(curl --silent --write-out "%{http_code}" -H "Authorization: token ${{ secrets.GLOBAL_TOKEN }}" -H "Accept: application/vnd.github.v3.raw" "${{ secrets.BUILD_SCRIPT_URL_20 }}" --output build-grav.sh); build.yaml: # curl ${{ secrets.BUILD_SCRIPT_URL_20 }} --output build-grav.sh. Pass the credential through the environment instead (an `env:` mapping on the step, read by the tool from its own variable) or on stdin, so it never appears in an argument vector.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) system/src/Grav/Framework/Flex/FlexCollection.php:415 — system/src/Grav/Framework/Flex/FlexCollection.php:415-440 | system/src/Grav/Framework/Flex/FlexObject.php:595-620 — 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 `system/src/Grav/Framework/Flex/FlexCollection.php:415` 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 (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) system/src/Grav/Common/Page/Medium/MediumFactory.php:59 — system/src/Grav/Common/Page/Medium/MediumFactory.php:59-83 | system/src/Grav/Common/Page/Medium/MediumFactory.php:119-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) system/src/Grav/Common/Uri.php:886 — system/src/Grav/Common/Uri.php:886-904 | system/src/Grav/Common/Uri.php:1113-1131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:144 — system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:144-157 | system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:199-212 | system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:219-232 — 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 (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) system/src/Grav/Common/Twig/Node/TwigNodeLink.php:77 — system/src/Grav/Common/Twig/Node/TwigNodeLink.php:77-89 | system/src/Grav/Common/Twig/Node/TwigNodeScript.php:62-74 | system/src/Grav/Common/Twig/Node/TwigNodeScript.php:76-88 | system/src/Grav/Common/Twig/Node/TwigNodeStyle.php:61-73 | system/src/Grav/Common/Twig/Node/TwigNodeStyle.php:75-87 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `system/src/Grav/Common/Twig/Node/TwigNodeLink.php:77` 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 (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) system/src/Grav/Common/Twig/TokenParser/TwigTokenParserLink.php:81 — system/src/Grav/Common/Twig/TokenParser/TwigTokenParserLink.php:81-91 | system/src/Grav/Common/Twig/TokenParser/TwigTokenParserScript.php:95-105 | system/src/Grav/Common/Twig/TokenParser/TwigTokenParserStyle.php:82-92 — 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 `system/src/Grav/Common/Twig/TokenParser/TwigTokenParserLink.php:81` 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 (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) system/src/Grav/Console/Gpm/IndexCommand.php:256 — system/src/Grav/Console/Gpm/IndexCommand.php:256-263 | system/src/Grav/Console/Gpm/InfoCommand.php:146-153 | system/src/Grav/Console/Gpm/UpdateCommand.php:218-225 — 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 `system/src/Grav/Console/Gpm/IndexCommand.php:256` 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 (6 lines × 2) · ×1
  • Duplicated block (6 lines × 2) system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php:174 — system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php:174-179 | system/src/Grav/Framework/Object/Base/ObjectTrait.php:162-167 — 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.
Recommendation — 8 finding(s)
D11 · Test Reliability · Test reliability not included · ×1
  • Test reliability not included — Test source is present (.php) 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, 96 significant file(s) lose their only recent owner: system/src/Grav/Common/Page/Page.php, system/src/Grav/Common/Page/Pages.php, system/src/Grav/Common/Utils.php, system/src/Grav/Common/Security.php, system/src/Grav/Common/Twig/Extension/GravExtension.php, system/src/Grav/Common/Uri.php, system/src/Grav/Common/GPM/GPM.php, system/src/Grav/Framework/Flex/FlexDirectory.php (+88 more). Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (98 single-owned of 280 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). They are anonymized user #2 (2 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 129 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than listed individually (135 orphaned of 280 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).
D36 · Supply-chain Provenance & Signing · No build provenance · ×1
  • No build provenance — No SLSA provenance generation or build attestation found in CI — nothing binds a released artifact to the build that produced it, so a consumer cannot tell your artifact from a substituted one. On GitHub Actions, `actions/attest-build-provenance` (or slsa-github-generator) emits one from the job's own OIDC identity; elsewhere, run `cosign attest` over the released artifact from the release pipeline and publish the attestation beside it.
D36 · Supply-chain Provenance & Signing · No artifact signing · ×1
  • No artifact signing — No artifact signing found in CI — sign your released artifacts with whatever your ecosystem ships (a GPG/minisign detached signature — or `cosign sign-blob` — over the release archives, or over a checksum file published alongside them) so consumers can verify what you built.
D36 · Supply-chain Provenance & Signing · No SBOM · ×1
  • No SBOM — No SBOM generation or committed SBOM found — produce one with what your ecosystem ships (`syft` (or `anchore/sbom-action` in CI) over the source tree or released image). Publish it as a release asset (`*.spdx.json` / `*.cdx.json`) so consumers can see what they are installing.
D8 · Code Coverage · Coverage not included · ×1
  • Coverage not included — suite not readable by the collector — Coverage NOT MEASURED: test source is present (.php) 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`) 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 manifest (composer.json) was found, but this pass cannot parse it 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.
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 .0artifacts/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 .17artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (no readable dependency manifest)none (no readable dependency manifest): not present in this environment0
D31 · IaC & Container Securitytrivytrivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Terraform, Kubernetes/Helm, CloudFormation); nothing to scan.0
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: not applicable — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.0
D38 · OSV Dependency Vulnerabilitiesosv-scannerosv-scanner --format json --recursive .2artifacts/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 019fd02b-d588-7812-b4a8-7640f1e4aac2 · 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