Public report of getgrav/grav, published 10 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.2). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 10 November 2026, 14:13 UTC · Survey ID cd_35924665ba204be480ed249ebe8b90a5

getgrav/grav

Measured 10 November 2026, 14:10 UTC, at code version 6a0b8cd

CAI score 55out of 100 At risk Up 1 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 112,265 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 1.0 person-years · Weakest lens: Code Health, 45

Findings by how serious they are

32 critical 766 serious 172 minor

16 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
10 November 2026, 14:10 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

52of 52 dimensions measured by tools.
946of 970 findings point to an exact file and line, so you can open each one in the code. The other 24 concern the repository as a whole, such as missing documentation.
52dimensions across 5 lenses, read from 112,265 lines of product code in 1 project.
Chapters

Executive summary

getgrav/grav is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 55 out of 100, which the At risk rating leaves unchanged.

Code Health, at 45, is the weakest lens and counts most in the score. The best first step for the work it takes is recording design decisions, worth about 5 points. Raising the type checker to a stricter level would lift Code Health itself, worth about 7 points. Raising Code Health to 70 would lift the score to about 63.

Thirteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Eleven secrets can leak from the build pipeline, and two passwords or keys are open to anyone who can read the repository. Pinning each tool to an exact version, limiting each secret to its own step and replacing each exposed password or key would close these risks. Passing outside input through environment variables would fix the two pipeline steps that put outside input straight into a shell command, and setting a waiting period for automatic updates would deal with the automatic dependency update that takes a new release at once. The part of the code nobody has worked on for a long time needs someone to learn and document it before anyone changes it.

The product code is 112,265 lines, about €150,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Code Health 45 · counts for 47%Maturity 56 · counts for 26%Production Readiness 65 · counts for 14%Security and Compliance 71 · counts for 8%Architecture 95 · counts for 4%

If Code Health rose from 45 to 70, the lowest score rated Strong, the score would rise from 55 to about 63.

Code composition: what the lines of code are
Product code 75%Tests 25%
New since the last survey: 71 findings

These 71 critical or serious findings weren't in the previous survey, on 23 October 2026.

  • Cyclomatic Complexity · ImageFile.jpegFrameSize (cyclomatic 21) system/src/Grav/Common/Page/Medium/ImageFile.php
  • Cyclomatic Complexity · Excerpts.processMediaActions (cyclomatic 20) system/src/Grav/Common/Page/Markdown/Excerpts.php
  • Cyclomatic Complexity · BaseAsset.init (cyclomatic 18) system/src/Grav/Common/Assets/BaseAsset.php
  • Cyclomatic Complexity · Cache.purgeOldCache (cyclomatic 18) system/src/Grav/Common/Cache.php
  • Cyclomatic Complexity · UserObject.setUpdatedMedia (cyclomatic 18) system/src/Grav/Common/Flex/Types/Users/UserObject.php
  • Cyclomatic Complexity · Excerpts.processImageExcerpt (cyclomatic 18) system/src/Grav/Common/Page/Markdown/Excerpts.php
  • Cyclomatic Complexity · PageAuthorsTrait.isAuthorizedByGroup (cyclomatic 18) system/src/Grav/Framework/Flex/Pages/Traits/PageAuthorsTrait.php
  • Cyclomatic Complexity · Blueprint.extend (cyclomatic 17) system/src/Grav/Common/Data/Blueprint.php
  • Cyclomatic Complexity · Blueprint.loadImport (cyclomatic 17) system/src/Grav/Common/Data/Blueprint.php
  • Cyclomatic Complexity · LogRotator.rotate (cyclomatic 17) system/src/Grav/Common/Log/LogRotator.php
  • Cyclomatic Complexity · User.save (cyclomatic 17) system/src/Grav/Common/User/DataUser/User.php
  • Cyclomatic Complexity · PageIdsCommand.serve (cyclomatic 17) system/src/Grav/Console/Cli/PageIdsCommand.php
  • Cyclomatic Complexity · PageStorage.assertValidPageKeys (cyclomatic 16) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php
  • Cognitive Complexity · ImageFile.jpegFrameSize (cognitive 30) system/src/Grav/Common/Page/Medium/ImageFile.php
  • Cognitive Complexity · Blueprint.extend (cognitive 29) system/src/Grav/Common/Data/Blueprint.php
  • Cognitive Complexity · PageIdsCommand.serve (cognitive 23) system/src/Grav/Console/Cli/PageIdsCommand.php
  • Cognitive Complexity · PageIdentity.assignAll (cognitive 22) system/src/Grav/Common/Page/PageIdentity.php
  • Cognitive Complexity · Setup.isStreamFolder (cognitive 21) system/src/Grav/Common/Config/Setup.php
  • Cognitive Complexity · PageObject.isAuthorizedByChildren (cognitive 21) system/src/Grav/Common/Flex/Types/Pages/PageObject.php
  • Cognitive Complexity · LogRotator.rotate (cognitive 21) system/src/Grav/Common/Log/LogRotator.php
  • Cognitive Complexity · PageIdentity.pageFolders (cognitive 20) system/src/Grav/Common/Page/PageIdentity.php
  • Cognitive Complexity · ObjectExpressionVisitor.getObjectFieldValue (cognitive 20) system/src/Grav/Framework/Object/Collection/ObjectExpressionVisitor.php
  • Cognitive Complexity · PageObject.isAuthorizedOverride (cognitive 19) system/src/Grav/Common/Flex/Types/Pages/PageObject.php
  • Cognitive Complexity · GravExtension.exifFunc (cognitive 18) system/src/Grav/Common/Twig/Extension/GravExtension.php
  • Cognitive Complexity · Uri.post (cognitive 18) system/src/Grav/Common/Uri.php
  • Cognitive Complexity · PageStorage.assertValidPageKeys (cognitive 17) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php
  • Cognitive Complexity · UserObject.save (cognitive 17) system/src/Grav/Common/Flex/Types/Users/UserObject.php
  • Cognitive Complexity · AbstractMedia.getFileParts (cognitive 17) system/src/Grav/Common/Page/Medium/AbstractMedia.php
  • Cognitive Complexity · GravExtension.themeVarGuarded (cognitive 17) system/src/Grav/Common/Twig/Extension/GravExtension.php
  • Cognitive Complexity · TwigEnvironment.includeFromContent (cognitive 17) system/src/Grav/Common/Twig/TwigEnvironment.php
  • Cognitive Complexity · Blueprint.loadImport (cognitive 16) system/src/Grav/Common/Data/Blueprint.php
  • Cognitive Complexity · UserObject.isAuthorizedOverride (cognitive 16) system/src/Grav/Common/Flex/Types/Users/UserObject.php
  • Cognitive Complexity · ImageMedium.__call (cognitive 16) system/src/Grav/Common/Page/Medium/ImageMedium.php
  • Cognitive Complexity · PageIdentity.scan (cognitive 16) system/src/Grav/Common/Page/PageIdentity.php
  • Cognitive Complexity · Pages.loadCachedPages (cognitive 16) system/src/Grav/Common/Page/Pages.php
  • God Classes · ClassTooLong: UserObject system/src/Grav/Common/Flex/Types/Users/UserObject.php
  • God Classes · TooManyMethods: Cache system/src/Grav/Common/Cache.php
  • God Classes · ClassTooLong: Cache system/src/Grav/Common/Cache.php
  • God Classes · TooManyMethods: Session system/src/Grav/Framework/Session/Session.php
  • God Classes · ClassTooLong: PageObject system/src/Grav/Common/Flex/Types/Pages/PageObject.php
  • God Classes · FileTooLong: Data/Validation.php system/src/Grav/Common/Data/Validation.php
  • Code Duplication · Duplicated block (38 lines × 2) system/src/Grav/Common/Flex/Types/Users/UserObject.php
  • Code Duplication · Duplicated block (12–17 lines × 2) system/src/Grav/Common/Page/Page.php
  • Code Duplication · Duplicated block (11 lines × 3) system/src/Grav/Common/Media/Traits/ImageDecodingTrait.php
  • Code Duplication · Duplicated block (10 lines × 2) system/src/Grav/Common/Page/Page.php
  • Code Duplication · Duplicated block (9–10 lines × 2) system/src/Grav/Common/Page/PageIdentity.php
  • Code Duplication · Duplicated block (10 lines × 2) system/src/Grav/Common/Security.php
  • Code Duplication · Duplicated block (10 lines × 2) system/src/Grav/Framework/Flex/Storage/FolderStorage.php
  • Code Duplication · Duplicated block (8 lines × 2) system/src/Grav/Common/Flex/Types/Pages/PageObject.php
  • Cohesion (LCOM4) · Low cohesion: Blueprint (LCOM4 6) system/src/Grav/Common/Data/Blueprint.php
  • Cohesion (LCOM4) · Low cohesion: BlueprintSchema (LCOM4 5) system/src/Grav/Common/Data/BlueprintSchema.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Common/Utils.php system/src/Grav/Common/Utils.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Common/Page/Markdown/Excerpts.php system/src/Grav/Common/Page/Markdown/Excerpts.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Common/Flex/Types/Users/UserObject.php system/src/Grav/Common/Flex/Types/Users/UserObject.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Framework/Session/Session.php system/src/Grav/Framework/Session/Session.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Common/Cache.php system/src/Grav/Common/Cache.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Common/Page/Media.php system/src/Grav/Common/Page/Media.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Common/Data/Blueprint.php system/src/Grav/Common/Data/Blueprint.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Common/Assets/BaseAsset.php system/src/Grav/Common/Assets/BaseAsset.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Common/Data/BlueprintSchema.php system/src/Grav/Common/Data/BlueprintSchema.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Framework/Flex/FlexDirectory.php system/src/Grav/Framework/Flex/FlexDirectory.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Common/Config/Setup.php system/src/Grav/Common/Config/Setup.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Framework/Flex/Pages/Traits/PageAuthorsTrait.php system/src/Grav/Framework/Flex/Pages/Traits/PageAuthorsTrait.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php
  • Churn × Complexity Hotspots · Hotspot: system/src/Grav/Console/Cli/CacheCleanupCommand.php system/src/Grav/Console/Cli/CacheCleanupCommand.php
  • Exception handling · Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php
  • Exception handling · Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php
  • Exception handling · Swallowed exception (caught, then discarded) system/src/Grav/Common/Log/LogRotator.php
  • Exception handling · Swallowed exception (caught, then discarded) system/src/Grav/Common/Log/LogRotator.php
  • Exception handling · Swallowed exception (caught, then discarded) system/src/Grav/Common/Helpers/JsonBody.php

We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 22 findings

These 22 critical or serious findings were in the previous survey, on 23 October 2026, and are gone from this one.

  • Cyclomatic Complexity · RequestServiceProvider.register (cyclomatic 16) system/src/Grav/Common/Service/RequestServiceProvider.php
  • Cyclomatic Complexity · Utils.download (cyclomatic 16) system/src/Grav/Common/Utils.php
  • Code Duplication · Duplicated block (24 lines × 2) system/src/Grav/Common/Flex/Types/Users/UserObject.php
  • Code Duplication · Duplicated block (17 lines × 2) system/src/Grav/Common/Twig/Node/TwigNodeScript.php
  • Code Duplication · Duplicated block (12 lines × 2) system/src/Grav/Framework/Flex/Storage/FolderStorage.php
  • Code Duplication · Duplicated block (10–11 lines × 2) system/src/Grav/Common/Flex/Types/Pages/PageObject.php
  • Code Duplication · Duplicated block (7–8 lines × 2) system/src/Grav/Common/Filesystem/Folder.php
  • Code Duplication · Duplicated block (8 lines × 2) system/src/Grav/Common/Flex/Types/Users/UserObject.php
  • Code Duplication · Duplicated block (10 lines × 2) system/src/Grav/Common/Media/Traits/ImageDecodingTrait.php
  • Cohesion (LCOM4) · Low cohesion: Blueprint (LCOM4 8) system/src/Grav/Common/Data/Blueprint.php
  • Cohesion (LCOM4) · Low cohesion: Plugins (LCOM4 5) system/src/Grav/Common/Plugins.php
  • Churn × Complexity Hotspots · Repeated repair: system/src/Grav/Common/Processors/InitializeProcessor.php system/src/Grav/Common/Processors/InitializeProcessor.php
  • Churn × Complexity Hotspots · Repeated repair: system/src/Grav/Common/Assets/BaseAsset.php system/src/Grav/Common/Assets/BaseAsset.php
  • Explicit Debt · FixmeComment system/src/Grav/Common/Flex/Types/Pages/Traits/PageRoutableTrait.php
  • Knowledge Freshness · Orphaned knowledge system/src/Grav/Framework/Form/Traits/FormTrait.php
  • Knowledge Freshness · Orphaned knowledge system/src/Grav/Framework/Flex/Storage/FolderStorage.php
  • Documentation (README) · README may be stale
  • Exception handling · Swallowed exception (caught, then discarded) system/src/Grav/Common/Data/Blueprint.php
  • Exception handling · Swallowed exception (caught, then discarded) system/src/Grav/Common/GPM/Licenses.php
  • Exception handling · Swallowed exception (empty catch) system/src/Grav/Common/GPM/GPM.php
  • Exception handling · Swallowed exception (empty catch) system/src/Grav/Common/GPM/GPM.php
  • Exception handling · Swallowed exception (empty catch) system/src/Grav/Common/HTTP/Response.php
Rebuild cost: about €150,000 · Estimate
Cost to rebuild€49,000 to €250,000, for 823 to 2,612 hours of work, about 1.0 person-years for 1 to 2 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.8 at a score of 55. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 112,265 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 5 points · Low effort · ADR Quality
2
Raise PHPStan to level 8 (`level: 8` in `phpstan.neon.dist`, or `max`) or Psalm to `errorLevel="3"` or stricter, so `?Type` is a type the checker holds you to; generate a baseline for what that surfaces only to pay it down, not to keep it.
Then resolve the baselined nullness errors rather than adding to them: each is a call on a value the checker showed could be null — narrow it (`if ($x === null) { … }`, `?->`, an early return), make the property non-nullable and initialise it in the constructor, or change the return type so the null cannot arrive.
Raises the score by about 7 points · Medium effort · Nullable reference types
3
Interpolated log message defeats structured logging
Raises the score by about 5 points · Medium effort · Structured logging

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €150,000 to build again, about 1.0 person-years of work. Its weakest lens is Code Health, at 45 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 1 No ADRs found finding(s) in ADR Quality. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for low effort, because it clears the 1 ADR Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 7% on every change. The history of the code shows how much it changes: about 54,068 lines over the last 90 days, which is about 219,276 lines a year. At that pace, the extra work comes to an estimated 16 to 95.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

123 modules, with 177 dependencies between them. 3 loops run through 21 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 83 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 Doctrine.Common.Cache2 Grav.Console3 Grav.Framework.Contracts.Object4 Grav.Framework.Object.Interfaces5 RocketTheme.Toolbox.Event6 Grav.Common.Language7 Grav.Framework.Contracts.Relationships8 Grav.Framework.Media.Interfaces9 Grav.Framework.Object10 Grav.Framework.Route11 Grav.Common.Page.Medium12 Grav.Common.Processors.Events13 Grav.Common.Media.Interfaces14 Grav.Common.Page.Interfaces15 Grav.Common.User.Interfaces16 Grav.Common.Data17 Grav.Common.Twig18 Grav.Console.Cli19 Grav.Common.Config20 Grav.Common.User21 Grav.Framework.Form.Interfaces22 Grav.Framework.Flex.Interfaces23 Grav.Framework.Form24 Grav.Framework.Flex25 Grav.Common.Flex26 Grav.Common.Page27 Grav.Framework.Flex.Pages28 Grav.Framework.Flex.Traits29 Grav.Framework.Media30 Grav.Common31 Grav.Common.Flex.Types.Pages32 Grav.Common.Flex.Types.UserGroups33 Grav.Common.Assets34 Grav.Common.Flex.Traits35 Grav.Common.Flex.Types.Users36 Grav.Common.GPM.Common37 Grav.Common.Media.Traits38 Grav.Common.Processors39 Grav.Common.Service40 Grav.Events
1 Doctrine.Common.Cache
2 Grav.Console
3 Grav.Framework.Contracts.Object
4 Grav.Framework.Object.Interfaces
5 RocketTheme.Toolbox.Event
6 Grav.Common.Language1
7 Grav.Framework.Contracts.Relationships4
8 Grav.Framework.Media.Interfaces1
9 Grav.Framework.Object5
10 Grav.Framework.Route1
11 Grav.Common.Page.Medium111612
12 Grav.Common.Processors.Events11
13 Grav.Common.Media.Interfaces311
14 Grav.Common.Page.Interfaces1
15 Grav.Common.User.Interfaces111
16 Grav.Common.Data2
17 Grav.Common.Twig11
18 Grav.Console.Cli151
19 Grav.Common.Config3
20 Grav.Common.User1
21 Grav.Framework.Form.Interfaces11
22 Grav.Framework.Flex.Interfaces3115
23 Grav.Framework.Form11
24 Grav.Framework.Flex12233201
25 Grav.Common.Flex13
26 Grav.Common.Page151113
27 Grav.Framework.Flex.Pages113
28 Grav.Framework.Flex.Traits11112
29 Grav.Framework.Media122
30 Grav.Common21541
31 Grav.Common.Flex.Types.Pages1621113
32 Grav.Common.Flex.Types.UserGroups213
33 Grav.Common.Assets21
34 Grav.Common.Flex.Traits112
35 Grav.Common.Flex.Types.Users15111131
36 Grav.Common.GPM.Common12
37 Grav.Common.Media.Traits1212
38 Grav.Common.Processors114
39 Grav.Common.Service11
40 Grav.Events212
Uses a module listed above itPart of a loopThe module itself
1 Doctrine.Common.Cache2 Grav.Console3 Grav.Framework.Contracts.Object4 Grav.Framework.Object.Interfaces5 RocketTheme.Toolbox.Event6 Grav.Common.Language7 Grav.Framework.Contracts.Relationships8 Grav.Framework.Media.Interfaces9 Grav.Framework.Object10 Grav.Framework.Route11 Grav.Common.Page.Medium12 Grav.Common.Processors.Events13 Grav.Common.Media.Interfaces14 Grav.Common.Page.Interfaces15 Grav.Common.User.Interfaces16 Grav.Common.Data17 Grav.Common.Twig18 Grav.Console.Cli19 Grav.Common.Config20 Grav.Common.User21 Grav.Framework.Form.Interfaces22 Grav.Framework.Flex.Interfaces23 Grav.Framework.Form24 Grav.Framework.Flex25 Grav.Common.Flex26 Grav.Common.Page27 Grav.Framework.Flex.Pages28 Grav.Framework.Flex.Traits29 Grav.Framework.Media30 Grav.Common31 Grav.Common.Flex.Types.Pages32 Grav.Common.Flex.Types.UserGroups33 Grav.Common.Assets34 Grav.Common.Flex.Traits35 Grav.Common.Flex.Types.Users36 Grav.Common.GPM.Common37 Grav.Common.Media.Traits38 Grav.Common.Processors39 Grav.Common.Service40 Grav.EventsDoctrine.Common.Cache1Grav.Console2Grav.Framework.Contracts.Object3Grav.Framework.Object.Interfaces4RocketTheme.Toolbox.Event5Grav.Common.Language6Grav.Framework.Contracts.Relationships7Grav.Framework.Media.Interfaces8Grav.Framework.Object9Grav.Framework.Route10Grav.Common.Page.Medium11Grav.Common.Processors.Events12Grav.Common.Media.Interfaces13Grav.Common.Page.Interfaces14Grav.Common.User.Interfaces15Grav.Common.Data16Grav.Common.Twig17Grav.Console.Cli18Grav.Common.Config19Grav.Common.User20Grav.Framework.Form.Interfaces21Grav.Framework.Flex.Interfaces22Grav.Framework.Form23Grav.Framework.Flex24Grav.Common.Flex25Grav.Common.Page26Grav.Framework.Flex.Pages27Grav.Framework.Flex.Traits28Grav.Framework.Media29Grav.Common30Grav.Common.Flex.Types.Pages31Grav.Common.Flex.Types.UserGroups32Grav.Common.Assets33Grav.Common.Flex.Traits34Grav.Common.Flex.Types.Users35Grav.Common.GPM.Common36Grav.Common.Media.Traits37Grav.Common.Processors38Grav.Common.Service39Grav.Events40141511116121131111112111513111311511122332011315111311311112122215411621113213211121511113112121211411212+83 more modules (most-connected shown)

At a glance — Code Health · 45% · Weak · gated by D2, X5 ·

At a glance — Architecture · 95% · Exemplary ·

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

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

At a glance — Security · 71% · 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
A05:2025 — Injection28High / Critical
A03:2025 — Software Supply Chain Failures8High / Critical
A02:2025 — Security Misconfiguration4High / Critical
A07:2025 — Authentication Failures3High / Critical

Roadmap

Top priorities: Raise PHPStan to level 8 (`level: 8` in `phpstan.neon.dist`, or `max`) or Psalm to `errorLevel="3"` or stricter, so `?Type` is a type the checker holds you to; generate a baseline for what that surfaces only to pay it down, not to keep it. Then resolve the baselined nullness errors rather than adding to them: each is a call on a value the checker showed could be null — narrow it (`if ($x === null) { … }`, `?->`, an early return), make the property non-nullable and initialise it in the constructor, or change the return type so the null cannot arrive; Resolve the 1 No ADRs found finding(s) in ADR Quality; Interpolated log message defeats structured logging.

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

Do thisHelpsEffortDimension
Resolve the 1 No ADRs found finding(s) in ADR Quality.+5.4 ptsLowADR Quality
Raise PHPStan to level 8 (`level: 8` in `phpstan.neon.dist`, or `max`) or Psalm to `errorLevel="3"` or stricter, so `?Type` is a type the checker holds you to; generate a baseline for what that surfaces only to pay it down, not to keep it. Then resolve the baselined nullness errors rather than adding to them: each is a call on a value the checker showed could be null — narrow it (`if ($x === null) { … }`, `?->`, an early return), make the property non-nullable and initialise it in the constructor, or change the return type so the null cannot arrive.+6.5 ptsMediumNullable reference types
Interpolated log message defeats structured logging+4.8 ptsMediumStructured logging
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+4.3 ptsMediumArchitecture documentation
Swallowed exception (caught, then discarded)+3.6 ptsMediumException handling
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with FlexIndex.php.+1.7 ptsLowKnowledge Freshness
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor.+1.7 ptsLowBus Factor
Resolve the 1 Off-boarding risk finding(s) in Bus Factor.+1.7 ptsLowBus Factor

File quality

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

FileScoreBandWorst signal
REDACTED3.5SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
system/src/Grav/Common/Page/Page.php5.5MixedCyclomatic Complexity: Page.header (cyclomatic 49)
system/src/Grav/Common/Uri.php5.5MixedCyclomatic Complexity: Uri.convertUrl (cyclomatic 35)
system/src/Grav/Common/Scheduler/Scheduler.php5.5MixedCyclomatic Complexity: Scheduler.processJobsWithWorkers (cyclomatic 34)
system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php5.5MixedCyclomatic Complexity: PageStorage.getObjectMeta (cyclomatic 33)
system/src/Grav/Common/Data/Blueprint.php5.5MixedCyclomatic Complexity: Blueprint.extend (cyclomatic 17)
system/src/Grav/Common/Grav.php5.6MixedCyclomatic Complexity: Grav.fallbackUrl (cyclomatic 24)
system/src/Grav/Framework/Flex/FlexDirectoryForm.php5.6MixedCode Duplication: Duplicated block (19 lines × 2)
system/src/Grav/Console/Gpm/InfoCommand.php5.7MixedCyclomatic Complexity: InfoCommand.serve (cyclomatic 24)
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
system/src/Grav/Common/Markdown/ParsedownExtra.php5.9MixedCyclomatic Complexity: ParsedownExtra.findEndTag (cyclomatic 18)
system/src/Grav/Common/Debugger.php6.0MixedExplicit Debt: TodoComment
system/src/Grav/Common/Page/Pages.php6.0MixedExplicit Debt: TodoComment
system/src/Grav/Common/Flex/Types/Pages/PageIndex.php6.0MixedExplicit Debt: TodoComment
system/src/Grav/Common/Twig/Twig.php6.0MixedExplicit Debt: TodoComment

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 32

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 766

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 172

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 16

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 52 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.

What we checked — 52 dimensions across the health lenses
D1D2D3D4D6D12D13D14D15D16D17D19D20D27D28D29D30D31D34D35D36D37D43D44AX10AX3AX4M1M2M3M4P1P2P3P4P6P7S1X12X14X16X18X19X21X23X24X25X28X3X30X4X5

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, 946 of 970 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 or a scanner, 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
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1c5cb-d065-7481-badd-d5a745b1fd05.

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.

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT 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 — with Xdebug (`XDEBUG_MODE=coverage`) or PCOV installed, `vendor/bin/phpunit --coverage-clover coverage.xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (Clover XML — with Xdebug (`XDEBUG_MODE=coverage`) or PCOV installed, `vendor/bin/phpunit --coverage-clover coverage.xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.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.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. This repository's source is written only in languages whose packages are published through a manifest, and no manifest in the tree makes a publication act: either there is no package manifest of any ecosystem (no package.json, pyproject.toml, setup.py, gemspec, Cargo.toml, pom.xml, build.gradle, composer.json, pubspec.yaml or mix.exs), or every one present declares in its package manager's own terms that it is not published (an npm package marked "private": true, a Cargo package with publish = false, a pubspec with publish_to: none, a Composer "project", a Poetry project with package-mode = false, or the "Private :: Do Not Upload" classifier). With no publication act there is no intentionally-exposed surface for API consistency to be judged over.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `(repository root)` (109934 LoC, 542 module-visible types across 124 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `system/src/Grav/Common/Assets.php`, `system/src/Grav/Common/Backup/Backups.php`, `system/src/Grav/Common/Cache.php`, `system/src/Grav/Common/Debugger.php`, `system/src/Grav/Common/File/CompiledFile.php`, … (+26 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository's container is Pimple and a PSR-11 container (Psr\Container) and an unrecognised PHP container, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — ca-certificates git unzip curl procps libfreetype6-dev libjpeg62-turbo-dev libpng-dev libwebp-dev libzip-dev libicu-dev && docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp && docker-php-ext-install -j\"$(nproc)\" gd zip intl exif && pecl install apcu && docker-php-ext-enable apcu && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 1; runtime evidence skipped.
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'PDO' is imported (system/src/Grav/Common/Page/PageIndexStore.php:135), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'PDO' is imported (system/src/Grav/Common/Page/PageIndexStore.php:135), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'PDO' is imported (system/src/Grav/Common/Page/PageIndexStore.php:135), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'PDO' is imported (system/src/Grav/Common/Page/PageIndexStore.php:135), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's PHP is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's PHP is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala or Kotlin was found, and this repository's PHP is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 5 further occurrence(s) are not listed individually; the score already reflects all 45.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • 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.

Dimensions

D1 · Cyclomatic Complexity6.5 / 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: Documented → Verified → Prevented · effective 6.5 / 10 · rule-coverage 100% · ceiling Prevented

120 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Debugger.deprecatedErrorHandler at 54. 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.

Debugger.deprecatedErrorHandler (cyclomatic 54)system/src/Grav/Common/Debugger.php:1131
Pages.getCollection (cyclomatic 50)system/src/Grav/Common/Page/Pages.php:692
Page.header (cyclomatic 49)system/src/Grav/Common/Page/Page.php:569
Pages.recurse (cyclomatic 49)system/src/Grav/Common/Page/Pages.php:2688
Pages.buildSort (cyclomatic 44)system/src/Grav/Common/Page/Pages.php:2971

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

What to do

  1. Bring the 19 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with Debugger.deprecatedErrorHandler (cyclomatic 54), Pages.getCollection (cyclomatic 50), Page.header (cyclomatic 49). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 19 together lifts Cyclomatic Complexity from 6.5 to about 7.2/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.

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

D2 · Cognitive Complexity3.1 / 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: Documented → Verified → Prevented · effective 3.1 / 10 · rule-coverage 100% · ceiling Prevented

251 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:1224
Debugger.deprecatedErrorHandler (cognitive 113)system/src/Grav/Common/Debugger.php:1131
Page.header (cognitive 102)system/src/Grav/Common/Page/Page.php:569
PageIndex.getLevelListingRecurse (cognitive 96)system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:518
Media.init (cognitive 91)system/src/Grav/Common/Page/Media.php:129

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

What to do

  1. Bring the 18 bodies over 60 down to 60 or less in Cognitive Complexity — start with Scheduler.processJobsWithWorkers (cognitive 118), Debugger.deprecatedErrorHandler (cognitive 113), Page.header (cognitive 102). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 18 together lifts Cognitive Complexity from 3.1 to about 4.7/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes8.1 / 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: Documented → Verified → Prevented · effective 8.1 / 10 · rule-coverage 100% · ceiling Prevented

80 god class(es) detected.

TooManyMethods: Page · ×34system/src/Grav/Common/Page/Page.php:58
ClassTooLong: Pages · ×20system/src/Grav/Common/Page/Pages.php:59
FileTooLong: Page/Pages.php · ×13system/src/Grav/Common/Page/Pages.php
MethodTooLong: PageIndex.getLevelListingRecurse · ×13system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:518

What to do

  1. Resolve the 34 TooManyMethods finding(s) in God Classes — start with Page.php, GravExtension.php, Pages.php. — One of this dimension's main actionable groups (34 warning-level).
  2. Resolve the 20 ClassTooLong finding(s) in God Classes — start with Pages.php, Page.php, Utils.php. — One of this dimension's main actionable groups (20 warning-level).
  3. Resolve the 13 FileTooLong finding(s) in God Classes — start with Pages.php, Page.php, Utils.php. — One of this dimension's main actionable groups (13 warning-level).

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

D4 · Code Duplication9.5 / 10Stronggated by 128 serious findings✓ 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: Documented → Verified → Prevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Verified

125 duplicated block group(s) detected. A further 3 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (8 lines × 2) · ×10system/src/Grav/Common/Flex/Types/Pages/PageObject.php:341
Duplicated block (12 lines × 2) · ×8system/src/Grav/Common/GPM/GPM.php:119
Duplicated block (9 lines × 2) · ×8system/src/Grav/Common/Flex/Types/Users/UserCollection.php:82
Duplicated block (5 lines × 2) · ×8system/src/Grav/Common/Filesystem/ZipArchiver.php:127
Duplicated block (15 lines × 2) · ×7system/src/Grav/Common/Filesystem/Folder.php:40

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

What to do

  1. Resolve the 10 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with FlexDirectoryForm.php (3), ObjectCollectionTrait.php (2), PageObject.php. — One of this dimension's main actionable groups (10 warning-level).
  2. Resolve the 8 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with GPM.php, TaskServiceProvider.php, Twig3CompatibilityTransformer.php. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 8 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with HtmlBlock.php (2), UserCollection.php, Grav.php. — One of this dimension's main actionable groups (8 warning-level).

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

D6 · Cohesion (LCOM4)8.3 / 10Strong✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 8.3 / 10 · rule-coverage 100% · ceiling Verified

20 of 139 classes have LCOM4 above 3.

Low cohesion: FlexPageObject (LCOM4 15) · ×20system/src/Grav/Framework/Flex/Pages/FlexPageObject.php:38

What to do

  1. Resolve the 20 Low cohesion finding(s) in Cohesion (LCOM4) — start with FlexPageObject.php, UserObject.php, Grav.php. — One of this dimension's main actionable groups (20 warning-level).

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

D12 · Dependency Hygiene9.6 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Verified

9 outdated, 0 abandoned direct Composer dependencies. PLATFORM requirements (php, ext-*, lib-*) are deliberately not graded here: they name the runtime rather than a Packagist package, so there is no release for them to be behind — whether that runtime is still supported is a separate question with a separate remedy. Development requirements are excluded, because a consumer never installs them. A newer release is reported only where this repository's OWN constraint already admits it, so the remedy is `composer update` and never a manifest edit. Known CVEs in this dependency graph are D30's question.

Outdated: composer/ca-bundle · ×9

✓ On the Gold path — maintain.

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

D13 · REDACTED 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: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 62 locked Composer package(s) use a banned license. Licences were read from this repository's REDACTED, which records the `license` each package declares, over every package in its production `packages` list, direct and transitive, at the locked version; the 48 package(s) under `packages-dev` are not installed for a consumer and are excluded.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.4 / 10Stronggated by 32 serious findings✓ 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: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: system/src/Grav/Common/Page/Page.php (24×49=1176); system/src/Grav/Common/Page/Pages.php (13×49=637); system/src/Grav/Common/Grav.php (18×24=432)

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

What to do

  1. Resolve the 32 Hotspot finding(s) in Churn × Complexity Hotspots — start with Page.php, Pages.php, Grav.php. — One of this dimension's main actionable groups (32 warning-level).

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

D16 · Bus Factor6.1 / 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: Documented → Verified → Prevented · effective 6.1 / 10 · rule-coverage 100% · ceiling Documented

114 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is system/src/Grav/Common/Page/Pages.php. Counted over 293 of the 539 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1
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.

D17 · Explicit Debt9.9 / 10Stronggated by 75 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Prevented

75 deducted task-comment markers across 112265 LoC (0.1/KLoC) → score 9.9. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×55system/src/Grav/Framework/Session/Session.php:438
FixmeComment · ×18tests/unit/Grav/Common/UriTest.php:294
HackComment · ×2system/src/Grav/Common/Flex/Types/Users/UserObject.php:841

What to do

  1. Resolve the 55 TodoComment finding(s) in Explicit Debt — start with MediaUploadTrait.php (11), PageLegacyTrait.php (6), PageRoutableTrait.php (5). — One of this dimension's main actionable groups (55 warning-level).
  2. Resolve the 18 FixmeComment finding(s) in Explicit Debt — start with UriTest.php (4), PageTranslateTrait.php (3), PageIndex.php (3). — One of this dimension's main actionable groups (18 warning-level).
  3. Resolve the 2 HackComment finding(s) in Explicit Debt — start with UserObject.php, PageTranslateTrait.php. — One of this dimension's main actionable groups (2 warning-level).

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

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 documentation facets pass in full. 3 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

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

D27 · Navigability9.8 / 10Exemplary✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

21 % of calls cross a namespace and 0 % go through an interface, but 78 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)8.0 / 10Adequategated by 2 critical findings✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Documented

2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

D29 · Static Analysis (SAST)0.8 / 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: Documented → Verified → Prevented · effective 0.8 / 10 · rule-coverage 100% · ceiling Documented

28 finding(s): 0 critical, 27 high, 1 medium, 0 low. 13 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 49 file(s) — `system/languages/cs.yaml`, `system/languages/da.yaml`, `system/languages/eo.yaml`, `system/languages/fr.yaml`, `system/languages/he.yaml`, … (+44 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 4 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 7 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED, REDACTED. — One of this dimension's main actionable groups (7 issue-level).
  2. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 issue-level).
  3. No action in Static Analysis (SAST) — all 13 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (13 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities8.8 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 8.8 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED

What to do

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

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

D31 · IaC & Container Security9.4 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED

What to do

  1. Resolve the 1 High IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 3 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-level).

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

D34 · Knowledge Freshness6.3 / 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: Documented → Verified → Prevented · effective 6.3 / 10 · rule-coverage 100% · ceiling Documented

108 of 293 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/Framework/Flex/FlexIndex.php. Counted over 293 of the 539 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledgesystem/src/Grav/Framework/Flex/FlexIndex.php:1
Orphaned file · ×107system/src/Grav/Framework/ContentBlock/HtmlBlock.php:1
Further orphaned files (smaller)

What to do

  1. Resolve the 107 Orphaned file finding(s) in Knowledge Freshness — start with PageTranslateTrait.php (2), Uri.php (2), HtmlBlock.php. — One of this dimension's main actionable groups (107 recommendation-level).
  2. Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with FlexIndex.php. — One of this dimension's main actionable groups (1 issue-level).
  3. 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 Coupling9.9 / 10Stronggated by 2 serious findings✓ 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. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: PageCollection.php↔PageIndex.php 60%; InfoCommand.php↔UpdateCommand.php 50%

Change coupling: PageCollection.php ↔ PageIndex.php · ×2system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:1

What to do

  1. Resolve the 2 Change coupling finding(s) in Change Coupling — start with PageCollection.php, InfoCommand.php. — One of this dimension's main actionable groups (2 warning-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.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: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-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: Documented → Verified → Prevented · 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.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 42 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.4 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

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 numbered `NNNN-title` documents in any markup this check reads, 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/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
  • 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 accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

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.

P2 · Observability7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

What to do

  • Consider OpenTelemetry tracing/metrics (opentelemetry-php) and a health-check endpoint (Laravel's /up health route or a /health route) for operability.
P3 · Security & performance tooling6.0 / 10Adequate✓ 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.

  • `REDACTED` schedules updates, but no `package-ecosystem` entry covers `composer`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list. — REDACTED:4

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.
  • Dependabot is configured but does not watch `composer` — add that `package-ecosystem` entry to .github/dependabot.yml so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback8.0 / 10Strong✓ 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.

  • The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene10.0 / 10Exemplary✓ 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.

P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `new CurlHttpClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — system/src/Grav/Common/HTTP/Client.php:47
  • `new NativeHttpClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — system/src/Grav/Common/HTTP/Client.php:48
  • `HttpClient::create(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — system/src/Grav/Common/HTTP/Client.php:49
  • `->request(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — system/src/Grav/Common/HTTP/Response.php:80

What to do

  • Give every client an explicit bound: `new Client(['timeout' => 10, 'connect_timeout' => 3])` for Guzzle (whose default is to wait forever), `CURLOPT_TIMEOUT`/`CURLOPT_CONNECTTIMEOUT` before `curl_exec`, `timeout`/`max_duration` on Symfony HttpClient (or `framework.http_client.default_options`), and a stream-context `timeout` or `connection_timeout` for `file_get_contents`/`SoapClient`. In Drupal, use the `http_client` service, which carries core's site-wide timeout, rather than `new Client()`. Add retries with back-off (Guzzle `Middleware::retry`, Symfony `RetryableHttpClient`, Laravel `->retry()`) around dependencies that fail.
S1 · Web-Security Posture8.0 / 10Strong✓ Tool-verified

Other · Security — Only what this repository's own non-C# files could be read for was assessed — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `nginx.conf` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — webserver-configs/nginx.conf:1

What to do

  • Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state4.6 / 10Weak✓ Tool-verified

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

  • `decode` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `yaml.decode_php` ini setting (changed at line 160, put back at line 163) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — system/src/Grav/Framework/File/Formatter/YamlFormatter.php:154
  • `writeCacheFile` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the process umask (changed at line 46, put back at line 48) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — system/src/Grav/Common/Twig/WriteCacheFileTrait.php:33
  • `mainRegion` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — libxml's internal-error mode (changed at line 402, put back at line 405) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — system/src/Grav/Common/Page/Markdown/MarkdownOutput.php:395
  • `processTag` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — libxml's internal-error mode (changed at line 287, put back at line 291) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — system/src/Grav/Common/Markdown/ParsedownExtra.php:280
  • `getExcerptFromHtml` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — libxml's internal-error mode (changed at line 90, put back at line 92) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — system/src/Grav/Common/Helpers/Excerpts.php:87
  • `backup` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `max_execution_time` ini setting (changed at line 254, put back at line 308) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path. — system/src/Grav/Common/Backup/Backups.php:229

What to do

  • Each finding names the statement that changes the process-global value and the statement that puts it back. Confirm from the two that nothing between them is protected — then prefer removing the mutation over widening the restore: a working directory or an environment variable passed to the operation that needs it (the `cwd` and `env` options of `child_process`, or of `Deno.Command`) is scoped to that operation, which is what the save-and-restore was trying to approximate. Where the global genuinely must move, a `try`/`finally` is the least that makes the restore unconditional. In PHP the same holds for `chdir`, `putenv`, `setlocale`, `date_default_timezone_set`, `ini_set` and the error-handler stack: pass the value to the operation (`Process` with `cwd`/`env`, an explicit `DateTimeZone`) or restore in a `finally`.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped3.5 / 10Weak✓ Tool-verified

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

  • `route` carries text this program read out of a document — an attribute or a text node, which the DOM hands back already decoded, so an entity its author wrote is a live character again — and it is written straight into the `href` attribute of markup built here with nothing escaping it on the way. The value is chosen by whoever authored that document, not by this program, so it can close the attribute or element it sits in and open another — a crafted document becomes markup in what this code renders. Escape `route` at this site, or validate it against the shape the position accepts before interpolating it. — system/assets/debugger/clockwork.js:31

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X3 · Exception handling5.1 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×16) — system/src/Grav/Installer/Install.php:936, system/src/Grav/Installer/Install.php:1190, system/src/Grav/Common/Debugger.php:418, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. — system/src/Grav/Framework/Form/FormFlash.php:148
  • `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×9) — system/src/Grav/Framework/File/AbstractFile.php:308, system/src/Grav/Common/Security.php:222, system/src/Grav/Common/Security.php:854, …
  • `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×9) — system/src/Grav/Common/Security.php:162, system/src/Grav/Common/Security.php:630, system/src/Grav/Common/Security.php:1281, …
  • `catch (\Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×5) — system/src/Grav/Common/Utils.php:1036, system/src/Grav/Common/Scheduler/JobQueue.php:489, system/src/Grav/Common/Scheduler/Scheduler.php:557, …

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X4 · Structured logging4.0 / 10Weak✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `debug` at line 404 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — system/src/Grav/Common/Scheduler/Scheduler.php:404
  • `debug` at line 422 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade. — system/src/Grav/Common/Scheduler/Scheduler.php:422
  • `warning` at line 476 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->warning('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::warning('order moved', ['order_id' => $orderId])` with Laravel's facade. — system/src/Grav/Common/Scheduler/Scheduler.php:476
  • `info` at line 478 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->info('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::info('order moved', ['order_id' => $orderId])` with Laravel's facade. — system/src/Grav/Common/Scheduler/Scheduler.php:478
  • `info` at line 1295 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->info('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::info('order moved', ['order_id' => $orderId])` with Laravel's facade. — system/src/Grav/Common/Scheduler/Scheduler.php:1295
  • `error` at line 1301 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->error('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::error('order moved', ['order_id' => $orderId])` with Laravel's facade. — system/src/Grav/Common/Scheduler/Scheduler.php:1301
  • `info` at line 1403 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->info('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::info('order moved', ['order_id' => $orderId])` with Laravel's facade. — system/src/Grav/Common/Scheduler/Scheduler.php:1403
  • `error` at line 1408 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->error('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::error('order moved', ['order_id' => $orderId])` with Laravel's facade. — system/src/Grav/Common/Scheduler/Scheduler.php:1408

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether PHP's static analysis checks null and is not undermined by a nullness baseline — PHPStan from level 8 (`checkNullables`) or Psalm at `errorLevel` 3 or stricter is what makes `?User` a type whose method call is an error, and the null entries of a baseline, `@psalm-suppress PossiblyNull…` and `@phpstan-ignore *.nonObject` are what silence it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • This repository commits no PHPStan or Psalm configuration (`phpstan.neon[.dist]`, `phpstan.dist.neon`, `psalm.xml[.dist]`, or one a composer.json script names with `--configuration`), so nothing checks null: a `?Customer` reaches `->name()` silently and throws `Error: Call to a member function name() on null` the first time it is null. If the build passes a level on a command line instead, put it in a committed configuration — this check reads configuration, and configuration is all it can read.

What to do

  • Raise PHPStan to level 8 (`level: 8` in `phpstan.neon.dist`, or `max`) or Psalm to `errorLevel="3"` or stricter, so `?Type` is a type the checker holds you to; generate a baseline for what that surfaces only to pay it down, not to keep it. Then resolve the baselined nullness errors rather than adding to them: each is a call on a value the checker showed could be null — narrow it (`if ($x === null) { … }`, `?->`, an early return), make the property non-nullable and initialise it in the constructor, or change the return type so the null cannot arrive.

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 Health45%Weak — gated by D2, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture95%ExemplaryStrongest area.
Maturity56%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness65%Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security71%Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Unscored — 2 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 8 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Not assessed: this repository stores data through 'PDO' (system/src/Grav/Common/Page/PageIndexStore.php:135) but declares no persisted model this check reads (Laravel migration columns, Eloquent $fillable/$hidden lists, Doctrine #[ORM\Column] properties). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
  • C4 Data Retention — Not assessed: this repository stores data through 'PDO' (system/src/Grav/Common/Page/PageIndexStore.php:135) but declares no persisted model this check reads (Laravel migration columns, Eloquent $fillable/$hidden lists, Doctrine #[ORM\Column] properties). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
  • C5 Data-Subject Rights — Not assessed: this repository stores data through 'PDO' (system/src/Grav/Common/Page/PageIndexStore.php:135) but declares no persisted model this check reads (Laravel migration columns, Eloquent $fillable/$hidden lists, Doctrine #[ORM\Column] properties). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 61 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — Frontend below the scale floor (23 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC2 Forms & labels — Frontend below the scale floor (23 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC3 Page structure — Frontend below the scale floor (23 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC4 Keyboard semantics — Frontend below the scale floor (23 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC5 ARIA correctness — Frontend below the scale floor (23 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC6 Visual & motion safety — Frontend below the scale floor (23 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC7 A11y enforcement — Frontend below the scale floor (23 DOM element(s) < 25) — too little surface to assess accessibility.
  • AX1 Captive dependencies — 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
  • AX2 Stateful singletons — Not applicable: PHP builds its object graph per request and shares none of it between requests. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — docker build failed (exit 1) — ca-certificates git unzip curl procps libfreetype6-dev libjpeg62-turbo-dev libpng-dev libwebp-dev libzip-dev libicu-dev && docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp && docker-php-ext-install -j\"$(nproc)\" gd zip intl exif && pecl install apcu && docker-php-ext-enable apcu && rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 1; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: this repository stores data through 'PDO' (system/src/Grav/Common/Page/PageIndexStore.php:135) but declares no persisted model this check reads (Laravel migration columns, Eloquent $fillable/$hidden lists, Doctrine #[ORM\Column] properties). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository registers no route (no Laravel Route::…, no Symfony #[Route], no Filament panel, no WordPress REST route or AJAX action). Access control is therefore N/A here — a Composer library is authorized by the application that mounts it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • D10 Test Quality — ~36806 lines of test source are present (.php) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — no .php test runner
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency is measured on C# and TypeScript only; JavaScript, PHP not measured.
  • D22 Internal API Consistency — No intentionally-exposed public API to evaluate for consistency.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .php source were not judged.
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — 31 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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 — Not applicable — this Composer build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
  • 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 no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so 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 — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 5 value object(s); 4 domain event(s); its domain events are published by services or handlers — no domain entity raises one
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, 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'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (Clover XML — with Xdebug (`XDEBUG_MODE=coverage`) or PCOV installed, `vendor/bin/phpunit --coverage-clover coverage.xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for PHPBench subjects (`bench*` methods, or `@Subject`/`#[Subject]` ones) in a file importing PhpBench or carrying its annotations, `bench*` methods in a `*Bench.php` file where PHPBench is installed, or phpbench/phpbench in a composer.json or a phpbench.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • PF3 Async & latency hygiene — Not applicable: PHP has no async/await function colour, so there is no asynchronous code for a blocking call to stall.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — no C# was loaded; this repository's PHP was read and makes no request a caller can cancel (amphp's HttpClient or connect) — synchronous PHP offers its callers no cancellation to take
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. PHP gives a request one thread of its own; the event-loop libraries (ReactPHP, Amp) run callbacks one at a time, and ext-parallel copies every value across its channels, so no array or collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
  • X27 Collection changed while being enumerated — 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
  • X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 32 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
D31 · IaC & Container Security · High IaC · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×1
  • Orphaned knowledge system/src/Grav/Framework/Flex/FlexIndex.php:1 — 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.
Serious — 766 finding(s)
D17 · Explicit Debt · TodoComment · ×55
  • TodoComment system/src/Grav/Framework/Session/Session.php:438 — // TODO: session_create_id() segfaults in PHP 7.3 (PHP bug #73461), remove phpstan rule when removing this one.
  • TodoComment system/src/Grav/Framework/Flex/FlexCollection.php:332 — // TODO: remove hardcoded logic — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/FlexDirectory.php:793 — // TODO: log about the issue. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/FlexDirectory.php:1153 — // TODO: log about the issue. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/FlexDirectory.php:1255 — // TODO: media support. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/FlexFormFlash.php:123 — // TODO: update instead of create new. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/FlexIndex.php:500 — // TODO: log error. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/FlexIndex.php:929 — // TODO: Implement findFirst() method. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/FlexIndex.php:934 — // TODO: Implement reduce() method. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/Traits/FlexAuthorizeTrait.php:88 — // TODO: Not needed anymore with flex users, remove in 2.0. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/Storage/AbstractFilesystemStorage.php:165 — // TODO: start using the new file classes. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:62 — // TODO: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:75 — // TODO: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:271 — // TODO: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:295 — // TODO: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:726 — // TODO: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/Pages/Traits/PageRoutableTrait.php:245 — // TODO: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/Pages/Traits/PageRoutableTrait.php:258 — // TODO: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/Pages/Traits/PageRoutableTrait.php:356 — // TODO: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/Pages/Traits/PageRoutableTrait.php:433 — // TODO: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:485 — // TODO: better language support — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Flex/Pages/Traits/PageRoutableTrait.php:185 — // TODO: not the best approach, but works... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Controller/Traits/ControllerResponseTrait.php:115 — // TODO: add multipart download support. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Controller/Traits/ControllerResponseTrait.php:189 — // TODO: improve error page — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment system/src/Grav/Framework/Controller/Traits/ControllerResponseTrait.php:289 — // TODO: add support for image/* etc — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • + 30 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×39
  • Swallowed exception (caught, then discarded) system/src/Grav/Installer/Install.php:936 — `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Installer/Install.php:1190 — `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Framework/File/AbstractFile.php:308 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Debugger.php:418 — `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:162 — `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:222 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:630 — `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:854 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:889 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:918 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:1060 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:1281 — `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:1397 — `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:1606 — `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:1632 — `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:1724 — `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:1777 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Security.php:2018 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Session.php:360 — `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Utils.php:1036 — `catch (\Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Utils.php:1645 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Scheduler/JobQueue.php:489 — `catch (\Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Scheduler/Scheduler.php:557 — `catch (\Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Scheduler/Scheduler.php:593 — `catch (\Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) system/src/Grav/Common/Scheduler/Scheduler.php:933 — `catch (\Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • + 14 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×34
  • TooManyMethods: Page system/src/Grav/Common/Page/Page.php:58 — TooManyMethods — 138 methods. The bar is 30 methods; this is 108 over it, 4.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GravExtension system/src/Grav/Common/Twig/Extension/GravExtension.php:81 — TooManyMethods — 108 methods. The bar is 30 methods; this is 78 over it, 3.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Pages system/src/Grav/Common/Page/Pages.php:59 — TooManyMethods — 93 methods. The bar is 30 methods; this is 63 over it, 3.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Utils system/src/Grav/Common/Utils.php:53 — TooManyMethods — 86 methods. The bar is 30 methods; this is 56 over it, 2.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Validation system/src/Grav/Common/Data/Validation.php:37 — TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Job system/src/Grav/Common/Scheduler/Job.php:33 — TooManyMethods — 67 methods. The bar is 30 methods; this is 37 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FlexObject system/src/Grav/Framework/Flex/FlexObject.php:54 — TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GPM system/src/Grav/Common/GPM/GPM.php:34 — TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Uri system/src/Grav/Common/Uri.php:36 — TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FormTrait system/src/Grav/Framework/Form/Traits/FormTrait.php:50 — TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PageLegacyTrait system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:46 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Scheduler system/src/Grav/Common/Scheduler/Scheduler.php:34 — TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PageIndex system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:51 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UserObject system/src/Grav/Common/Flex/Types/Users/UserObject.php:73 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FlexIndex system/src/Grav/Framework/Flex/FlexIndex.php:44 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FlexDirectory system/src/Grav/Framework/Flex/FlexDirectory.php:52 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Security system/src/Grav/Common/Security.php:75 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AbstractIndexCollection system/src/Grav/Framework/Collection/AbstractIndexCollection.php:29 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Collection system/src/Grav/Common/Page/Collection.php:32 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. Most of these members implement Interfaces.PageCollectionInterface (30 of 42 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: Install system/src/Grav/Installer/Install.php:50 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Debugger system/src/Grav/Common/Debugger.php:69 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PageCollection system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:53 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Blueprint system/src/Grav/Common/Data/Blueprint.php:36 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PageContentTrait system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php:35 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FlexCollection system/src/Grav/Framework/Flex/FlexCollection.php:45 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 9 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×32
  • Hotspot: system/src/Grav/Common/Page/Page.php system/src/Grav/Common/Page/Page.php:569 — system/src/Grav/Common/Page/Page.php changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in Page.header at line 569. 5 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Page/Page.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Page/Pages.php system/src/Grav/Common/Page/Pages.php:2688 — system/src/Grav/Common/Page/Pages.php changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in Pages.recurse at line 2688. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Page/Pages.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Grav.php system/src/Grav/Common/Grav.php:998 — system/src/Grav/Common/Grav.php changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in Grav.fallbackUrl at line 998. 3 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Grav.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Security.php system/src/Grav/Common/Security.php:278 — system/src/Grav/Common/Security.php changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in Security.detectXss at line 278. 4 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Security.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Media/Traits/ImageMediaTrait.php system/src/Grav/Common/Media/Traits/ImageMediaTrait.php:263 — system/src/Grav/Common/Media/Traits/ImageMediaTrait.php changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in ImageMediaTrait.derivatives at line 263. 6 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Media/Traits/ImageMediaTrait.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Utils.php system/src/Grav/Common/Utils.php:81 — system/src/Grav/Common/Utils.php changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in Utils.url at line 81. 2 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Utils.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Twig/Twig.php system/src/Grav/Common/Twig/Twig.php:130 — system/src/Grav/Common/Twig/Twig.php changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in Twig.init at line 130. 1 of those changes was a fix/bug commit, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Twig/Twig.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Scheduler/Scheduler.php system/src/Grav/Common/Scheduler/Scheduler.php:383 — system/src/Grav/Common/Scheduler/Scheduler.php changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in Scheduler.runJobs at line 383. 3 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Scheduler/Scheduler.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:631 — system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in PageStorage.getObjectMeta at line 631. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Page/Markdown/Excerpts.php system/src/Grav/Common/Page/Markdown/Excerpts.php:98 — system/src/Grav/Common/Page/Markdown/Excerpts.php changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in Excerpts.processLinkExcerpt at line 98. 4 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Page/Markdown/Excerpts.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php:715 — system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in PageContentTrait.processContent at line 715. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Flex/Types/Users/UserObject.php system/src/Grav/Common/Flex/Types/Users/UserObject.php:1047 — system/src/Grav/Common/Flex/Types/Users/UserObject.php changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in UserObject.setUpdatedMedia at line 1047. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Flex/Types/Users/UserObject.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Service/PagesServiceProvider.php system/src/Grav/Common/Service/PagesServiceProvider.php:34 — system/src/Grav/Common/Service/PagesServiceProvider.php changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in PagesServiceProvider.register at line 34. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Service/PagesServiceProvider.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/GPM/GPM.php system/src/Grav/Common/GPM/GPM.php:1169 — system/src/Grav/Common/GPM/GPM.php changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in GPM.getDependencies at line 1169. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/GPM/GPM.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Framework/Session/Session.php system/src/Grav/Framework/Session/Session.php:238 — system/src/Grav/Framework/Session/Session.php changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in Session.start at line 238. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Framework/Session/Session.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Debugger.php system/src/Grav/Common/Debugger.php:356 — system/src/Grav/Common/Debugger.php changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Debugger.debuggerRequest at line 356. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Debugger.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Uri.php system/src/Grav/Common/Uri.php:1324 — system/src/Grav/Common/Uri.php changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in Uri.createFromEnvironment at line 1324. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Uri.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/File/CompiledFile.php system/src/Grav/Common/File/CompiledFile.php:34 — system/src/Grav/Common/File/CompiledFile.php changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in CompiledFile.content at line 34. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/File/CompiledFile.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Cache.php system/src/Grav/Common/Cache.php:689 — system/src/Grav/Common/Cache.php changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in Cache.clearCache at line 689. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Cache.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Service/SessionServiceProvider.php system/src/Grav/Common/Service/SessionServiceProvider.php:35 — system/src/Grav/Common/Service/SessionServiceProvider.php changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in SessionServiceProvider.register at line 35. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Service/SessionServiceProvider.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Page/Media.php system/src/Grav/Common/Page/Media.php:129 — system/src/Grav/Common/Page/Media.php changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in Media.init at line 129. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Page/Media.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/GPM/Installer.php system/src/Grav/Common/GPM/Installer.php:187 — system/src/Grav/Common/GPM/Installer.php changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in Installer.unZip at line 187. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/GPM/Installer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Data/Blueprint.php system/src/Grav/Common/Data/Blueprint.php:326 — system/src/Grav/Common/Data/Blueprint.php changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in Blueprint.extend at line 326. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Data/Blueprint.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Assets/BaseAsset.php system/src/Grav/Common/Assets/BaseAsset.php:94 — system/src/Grav/Common/Assets/BaseAsset.php changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in BaseAsset.init at line 94. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Assets/BaseAsset.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: system/src/Grav/Common/Data/BlueprintSchema.php system/src/Grav/Common/Data/BlueprintSchema.php:306 — system/src/Grav/Common/Data/BlueprintSchema.php changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in BlueprintSchema.filterArray at line 306. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 13:29:03 -07:00' --until='2026-11-09 13:29:03 -07:00' --full-history --no-merges -- system/src/Grav/Common/Data/BlueprintSchema.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 7 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×20
  • ClassTooLong: Pages system/src/Grav/Common/Page/Pages.php:59 — ClassTooLong — 1503 significant lines (blank, comment-only and punctuation-only lines excluded), 93 methods. The bar is 400 significant lines; this is 1103 over it, 3.76× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Page system/src/Grav/Common/Page/Page.php:58 — ClassTooLong — 1286 significant lines (blank, comment-only and punctuation-only lines excluded), 138 methods. The bar is 400 significant lines; this is 886 over it, 3.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Utils system/src/Grav/Common/Utils.php:53 — ClassTooLong — 1053 significant lines (blank, comment-only and punctuation-only lines excluded), 86 methods. The bar is 400 significant lines; this is 653 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GravExtension system/src/Grav/Common/Twig/Extension/GravExtension.php:81 — ClassTooLong — 794 significant lines (blank, comment-only and punctuation-only lines excluded), 108 methods. The bar is 400 significant lines; this is 394 over it, 1.99× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Uri system/src/Grav/Common/Uri.php:36 — ClassTooLong — 654 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 400 significant lines; this is 254 over it, 1.64× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Scheduler system/src/Grav/Common/Scheduler/Scheduler.php:34 — ClassTooLong — 640 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods. The bar is 400 significant lines; this is 240 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Debugger system/src/Grav/Common/Debugger.php:69 — ClassTooLong — 633 significant lines (blank, comment-only and punctuation-only lines excluded), 40 methods. The bar is 400 significant lines; this is 233 over it, 1.58× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Install system/src/Grav/Installer/Install.php:50 — ClassTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 225 over it, 1.56× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GPM system/src/Grav/Common/GPM/GPM.php:34 — ClassTooLong — 579 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 400 significant lines; this is 179 over it, 1.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FlexDirectory system/src/Grav/Framework/Flex/FlexDirectory.php:52 — ClassTooLong — 505 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 105 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FlexObject system/src/Grav/Framework/Flex/FlexObject.php:54 — ClassTooLong — 487 significant lines (blank, comment-only and punctuation-only lines excluded), 66 methods. The bar is 400 significant lines; this is 87 over it, 1.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Validation system/src/Grav/Common/Data/Validation.php:37 — ClassTooLong — 483 significant lines (blank, comment-only and punctuation-only lines excluded), 69 methods. The bar is 400 significant lines; this is 83 over it, 1.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Installer system/src/Grav/Common/GPM/Installer.php:27 — ClassTooLong — 475 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 75 over it, 1.19× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Job system/src/Grav/Common/Scheduler/Job.php:33 — ClassTooLong — 469 significant lines (blank, comment-only and punctuation-only lines excluded), 67 methods. The bar is 400 significant lines; this is 69 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SelfupgradeCommand system/src/Grav/Console/Gpm/SelfupgradeCommand.php:36 — ClassTooLong — 464 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 64 over it, 1.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PageIndex system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:51 — ClassTooLong — 454 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 54 over it, 1.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: UserObject system/src/Grav/Common/Flex/Types/Users/UserObject.php:73 — ClassTooLong — 447 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods. The bar is 400 significant lines; this is 47 over it, 1.12× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Cache system/src/Grav/Common/Cache.php:46 — ClassTooLong — 432 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 32 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PageObject system/src/Grav/Common/Flex/Types/Pages/PageObject.php:60 — ClassTooLong — 410 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 10 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: InstallCommand system/src/Grav/Console/Gpm/InstallCommand.php:36 — ClassTooLong — 404 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 4 over it, 1.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D6 · Cohesion (LCOM4) · Low cohesion · ×20
  • Low cohesion: FlexPageObject (LCOM4 15) system/src/Grav/Framework/Flex/Pages/FlexPageObject.php:38 — FlexPageObject's methods fall into 15 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 15 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: UserObject (LCOM4 12) system/src/Grav/Common/Flex/Types/Users/UserObject.php:73 — UserObject's methods fall into 12 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 12 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Grav (LCOM4 8) system/src/Grav/Common/Grav.php:83 — Grav's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ParsedownExtra (LCOM4 8) system/src/Grav/Common/Markdown/ParsedownExtra.php:22 — ParsedownExtra's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: FlexObject (LCOM4 8) system/src/Grav/Framework/Flex/FlexObject.php:54 — FlexObject's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Blueprint (LCOM4 6) system/src/Grav/Common/Data/Blueprint.php:36 — Blueprint's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Parsedown (LCOM4 6) system/src/Grav/Common/Markdown/Parsedown.php:19 — Parsedown's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: AbstractFilesystemStorage (LCOM4 6) system/src/Grav/Framework/Flex/Storage/AbstractFilesystemStorage.php:31 — AbstractFilesystemStorage's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: BlueprintSchema (LCOM4 5) system/src/Grav/Common/Data/BlueprintSchema.php:25 — BlueprintSchema's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PageStorage (LCOM4 5) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:34 — PageStorage's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Page (LCOM4 5) system/src/Grav/Common/Page/Page.php:58 — Page's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: LazyObject (LCOM4 5) system/src/Grav/Framework/Object/LazyObject.php:27 — LazyObject's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Languages (LCOM4 4) system/src/Grav/Common/Config/Languages.php:30 — Languages's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Scheduler (LCOM4 4) system/src/Grav/Common/Scheduler/Scheduler.php:34 — Scheduler's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Uri (LCOM4 4) system/src/Grav/Common/Uri.php:36 — Uri's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ConsoleCommand (LCOM4 4) system/src/Grav/Console/ConsoleCommand.php:20 — ConsoleCommand's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: GpmCommand (LCOM4 4) system/src/Grav/Console/GpmCommand.php:22 — GpmCommand's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: GravCommand (LCOM4 4) system/src/Grav/Console/GravCommand.php:20 — GravCommand's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: FlexDirectoryForm (LCOM4 4) system/src/Grav/Framework/Flex/FlexDirectoryForm.php:36 — FlexDirectoryForm's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: FlexForm (LCOM4 4) system/src/Grav/Framework/Flex/FlexForm.php:37 — FlexForm's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D17 · Explicit Debt · FixmeComment · ×18
  • FixmeComment tests/unit/Grav/Common/UriTest.php:294 — // FIXME <- — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/unit/Grav/Common/UriTest.php:719 — // FIXME <- — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/unit/Grav/Common/UtilsTest.php:545 — // FIXME <- — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/unit/Grav/Common/UriTest.php:718 — //'addNonce' => '%22%3E%3Cscript%3Ealert%3C/localhost/script%3E:/nonce:{{nonce}}', // FIXME <- — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/unit/Grav/Common/UriTest.php:787 — //'addNonce' => 'http://localhost/something/script%3E/p1:foo/p2:%22%3E%3Cscript%3Ealert%3C/nonce:{{nonce}}', // FIXME <-
  • FixmeComment tests/unit/Grav/Common/UtilsTest.php:621 — // self::assertSame('mailto:joe@domain.com', Utils::url('mailto:joe@domain.com', true)); // FIXME <- — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment system/src/Grav/Framework/Media/MediaObject.php:123 — // FIXME: This only works for images — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment system/src/Grav/Framework/Flex/FlexObject.php:778 — // FIXME: For some reason locator caching isn't cleared for the file, investigate! — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment system/src/Grav/Framework/Flex/Pages/Traits/PageTranslateTrait.php:159 — // FIXME: only published is not implemented... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment system/src/Grav/Framework/Flex/Pages/Traits/PageTranslateTrait.php:181 — // FIXME: only published is not implemented... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment system/src/Grav/Common/Processors/InitializeProcessor.php:571 — // FIXME: Initialize session should happen later after plugins have been loaded. This is a workaround to fix session issues in AWS. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment system/src/Grav/Common/Page/Pages.php:2180 — // FIXME: ... better... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:162 — // FIXME: support other keys. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:209 — // FIXME: this method does not rewind the internal pointer! — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:584 — // FIXME — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:586 — // FIXME — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:599 — // FIXME — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment system/src/Grav/Common/Flex/Types/Pages/Traits/PageTranslateTrait.php:77 — // FIXME: use flex, also rawRoute() does not fully work? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D3 · God Classes · FileTooLong · ×13
  • FileTooLong: Page/Pages.php system/src/Grav/Common/Page/Pages.php — FileTooLong — 1547 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Pages (59-3417). The bar is 500 significant lines; this is 1047 over it, 3.09× the bar. 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 — FileTooLong — 1328 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Page (58-3497). The bar is 500 significant lines; this is 828 over it, 2.66× the bar. 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 — FileTooLong — 1091 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Utils (53-2556). The bar is 500 significant lines; this is 591 over it, 2.18× the bar. 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 — FileTooLong — 884 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 384 over it, 1.77× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Extension/GravExtension.php system/src/Grav/Common/Twig/Extension/GravExtension.php — FileTooLong — 860 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: GravExtension (81-2479). The bar is 500 significant lines; this is 360 over it, 1.72× the bar. 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 — FileTooLong — 687 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: Debugger (69-1461). The bar is 500 significant lines; this is 187 over it, 1.37× the bar. 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/Uri.php system/src/Grav/Common/Uri.php — FileTooLong — 675 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Uri (36-1640). The bar is 500 significant lines; this is 175 over it, 1.35× the bar. 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: Scheduler/Scheduler.php system/src/Grav/Common/Scheduler/Scheduler.php — FileTooLong — 659 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: Scheduler (34-1678). The bar is 500 significant lines; this is 159 over it, 1.32× the bar. 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 — FileTooLong — 659 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: Install (50-1252). The bar is 500 significant lines; this is 159 over it, 1.32× the bar. 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 — FileTooLong — 598 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: GPM (34-1610). The bar is 500 significant lines; this is 98 over it, 1.20× the bar. 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 — FileTooLong — 542 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: FlexDirectory (52-1292). The bar is 500 significant lines; this is 42 over it, 1.08× the bar. 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 — FileTooLong — 526 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: FlexObject (54-1277). The bar is 500 significant lines; this is 26 over it, 1.05× the bar. 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: Data/Validation.php system/src/Grav/Common/Data/Validation.php — FileTooLong — 505 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: Validation (37-1467). The bar is 500 significant lines; this is 5 over it, 1.01× the bar. 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.
D3 · God Classes · MethodTooLong · ×13
  • MethodTooLong: PageIndex.getLevelListingRecurse system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:518 — MethodTooLong — getLevelListingRecurse runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DirectInstallCommand.serve system/src/Grav/Console/Gpm/DirectInstallCommand.php:71 — MethodTooLong — serve runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SchedulerCommand.serve system/src/Grav/Console/Cli/SchedulerCommand.php:78 — MethodTooLong — serve runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Debugger.deprecatedErrorHandler system/src/Grav/Common/Debugger.php:1131 — MethodTooLong — deprecatedErrorHandler runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Pages.getCollection system/src/Grav/Common/Page/Pages.php:692 — MethodTooLong — getCollection runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SelfupgradeCommand.handlePreflightReport system/src/Grav/Console/Gpm/SelfupgradeCommand.php:297 — MethodTooLong — handlePreflightReport runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Pages.buildSort system/src/Grav/Common/Page/Pages.php:2971 — MethodTooLong — buildSort runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Utils.isDangerousFunction system/src/Grav/Common/Utils.php:2299 — MethodTooLong — isDangerousFunction runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: UpdateCommand.serve system/src/Grav/Console/Gpm/UpdateCommand.php:104 — MethodTooLong — serve runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Page.header system/src/Grav/Common/Page/Page.php:569 — MethodTooLong — header runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: InfoCommand.serve system/src/Grav/Console/Gpm/InfoCommand.php:63 — MethodTooLong — serve runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SelfupgradeCommand.serve system/src/Grav/Console/Gpm/SelfupgradeCommand.php:108 — MethodTooLong — serve runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Twig.init system/src/Grav/Common/Twig/Twig.php:130 — MethodTooLong — init runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×10
  • Duplicated block (8 lines × 2) system/src/Grav/Common/Flex/Types/Pages/PageObject.php:341 — system/src/Grav/Common/Flex/Types/Pages/PageObject.php:341-348 | system/src/Grav/Common/Flex/Types/Users/UserObject.php:661-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.
  • Duplicated block (8 lines × 2) system/src/Grav/Common/Markdown/Parsedown.php:32 — system/src/Grav/Common/Markdown/Parsedown.php:32-39 | system/src/Grav/Common/Markdown/ParsedownExtra.php:72-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `system/src/Grav/Common/Markdown/ParsedownExtra.php:81` calls `__construct` and `system/src/Grav/Common/Markdown/Parsedown.php:41` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) system/src/Grav/Common/Flex/Types/Users/UserCollection.php:112 — system/src/Grav/Common/Flex/Types/Users/UserCollection.php:112-119 | system/src/Grav/Common/Flex/Types/Users/UserIndex.php:119-126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) system/src/Grav/Common/Page/Page.php:1767 — system/src/Grav/Common/Page/Page.php:1767-1774 | system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:383-390 — before extracting anything, compare `system/src/Grav/Common/Page/Page.php` and `system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) system/src/Grav/Framework/Flex/FlexDirectoryForm.php:183 — system/src/Grav/Framework/Flex/FlexDirectoryForm.php:183-190 | system/src/Grav/Framework/Flex/FlexForm.php:226-233 — before extracting anything, compare `system/src/Grav/Framework/Flex/FlexDirectoryForm.php` and `system/src/Grav/Framework/Flex/FlexForm.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) system/src/Grav/Framework/Flex/FlexDirectoryForm.php:363 — system/src/Grav/Framework/Flex/FlexDirectoryForm.php:363-370 | system/src/Grav/Framework/Flex/FlexForm.php:453-460 — before extracting anything, compare `system/src/Grav/Framework/Flex/FlexDirectoryForm.php` and `system/src/Grav/Framework/Flex/FlexForm.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) system/src/Grav/Framework/Flex/FlexDirectoryForm.php:393 — system/src/Grav/Framework/Flex/FlexDirectoryForm.php:393-400 | system/src/Grav/Framework/Flex/FlexForm.php:483-490 — before extracting anything, compare `system/src/Grav/Framework/Flex/FlexDirectoryForm.php` and `system/src/Grav/Framework/Flex/FlexForm.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php:51 — system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php:51-59 | system/src/Grav/Framework/Object/Base/ObjectTrait.php:45-52 — before extracting anything, compare `system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php` and `system/src/Grav/Framework/Object/Base/ObjectTrait.php` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php:222 — system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php:222-229 | system/src/Grav/Framework/Object/ObjectIndex.php:190-197 — 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 (8 lines × 2) system/src/Grav/Framework/Object/Access/NestedPropertyCollectionTrait.php:27 — system/src/Grav/Framework/Object/Access/NestedPropertyCollectionTrait.php:27-34 | system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php:264-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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×8
  • Duplicated block (12 lines × 2) system/src/Grav/Common/GPM/GPM.php:119 — system/src/Grav/Common/GPM/GPM.php:119-130 | system/src/Grav/Common/GPM/GPM.php:279-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 (12 lines × 2) system/src/Grav/Common/Service/TaskServiceProvider.php:29 — system/src/Grav/Common/Service/TaskServiceProvider.php:29-40 | system/src/Grav/Common/Service/TaskServiceProvider.php:42-53 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:96 — system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:96-107 | system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:177-188 — 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:96` 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/Console/Gpm/InfoCommand.php:144 — system/src/Grav/Console/Gpm/InfoCommand.php:144-155 | system/src/Grav/Console/Gpm/UpdateCommand.php:210-221 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `system/src/Grav/Console/Gpm/InfoCommand.php:144` 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/Framework/Flex/FlexCollection.php:371 — system/src/Grav/Framework/Flex/FlexCollection.php:371-382 | system/src/Grav/Framework/Flex/FlexObject.php:545-556 — before extracting anything, compare `system/src/Grav/Framework/Flex/FlexCollection.php` and `system/src/Grav/Framework/Flex/FlexObject.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) system/src/Grav/Framework/Flex/FlexDirectory.php:1002 — system/src/Grav/Framework/Flex/FlexDirectory.php:1002-1013 | system/src/Grav/Framework/Flex/FlexDirectory.php:1046-1057 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) system/src/Grav/Framework/Media/MediaObject.php:185 — system/src/Grav/Framework/Media/MediaObject.php:185-196 | system/src/Grav/Framework/Media/UploadedMediaObject.php:127-138 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) system/src/Grav/Installer/Versions.php:253 — system/src/Grav/Installer/Versions.php:253-264 | system/src/Grav/Installer/YamlUpdater.php:404-415 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×8
  • Duplicated block (9 lines × 2) system/src/Grav/Common/Flex/Types/Users/UserCollection.php:82 — system/src/Grav/Common/Flex/Types/Users/UserCollection.php:82-90 | system/src/Grav/Common/Flex/Types/Users/UserIndex.php:138-146 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (9 lines × 2) system/src/Grav/Common/Grav.php:354 — system/src/Grav/Common/Grav.php:354-362 | system/src/Grav/Common/Grav.php:582-590 — 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:354` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `system/src/Grav/Common/Grav.php:595` calls `registerShutdown` and `system/src/Grav/Common/Grav.php:365` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) system/src/Grav/Framework/ContentBlock/HtmlBlock.php:161 — system/src/Grav/Framework/ContentBlock/HtmlBlock.php:161-169 | system/src/Grav/Framework/ContentBlock/HtmlBlock.php:205-213 — 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/ContentBlock/HtmlBlock.php:239 — system/src/Grav/Framework/ContentBlock/HtmlBlock.php:239-247 | system/src/Grav/Framework/ContentBlock/HtmlBlock.php:281-289 — 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:506 — system/src/Grav/Framework/Flex/Storage/FolderStorage.php:506-514 | system/src/Grav/Framework/Flex/Storage/FolderStorage.php:526-534 — 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:506` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) system/src/DOMLettersIterator.php:42 — system/src/DOMLettersIterator.php:42-50 | system/src/DOMWordsIterator.php:41-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) system/src/Grav/Common/Page/Page.php:471 — system/src/Grav/Common/Page/Page.php:471-479 | system/src/Grav/Framework/Flex/Pages/Traits/PageTranslateTrait.php:212-220 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) system/src/Grav/Console/Gpm/InstallCommand.php:792 — system/src/Grav/Console/Gpm/InstallCommand.php:792-800 | system/src/Grav/Console/Gpm/SelfupgradeCommand.php:591-599 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×8
  • Duplicated block (5 lines × 2) system/src/Grav/Common/Filesystem/ZipArchiver.php:127 — system/src/Grav/Common/Filesystem/ZipArchiver.php:127-131 | system/src/Grav/Common/GPM/Installer.php:354-358 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (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, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `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.
  • Duplicated block (5 lines × 2) system/src/Grav/Common/Processors/ThemesProcessor.php:34 — system/src/Grav/Common/Processors/ThemesProcessor.php:34-38 | system/src/Grav/Common/Processors/TwigProcessor.php:34-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) system/src/Grav/Framework/Flex/FlexCollection.php:602 — system/src/Grav/Framework/Flex/FlexCollection.php:602-606 | system/src/Grav/Framework/Flex/FlexObject.php:1036-1040 — before extracting anything, compare `system/src/Grav/Framework/Flex/FlexCollection.php` and `system/src/Grav/Framework/Flex/FlexObject.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) system/src/Grav/Framework/Flex/FlexCollection.php:692 — system/src/Grav/Framework/Flex/FlexCollection.php:692-696 | system/src/Grav/Framework/Flex/FlexIndex.php:920-924 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php:455 — system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php:455-459 | system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:710-714 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) system/src/Grav/Common/Page/Page.php:1796 — system/src/Grav/Common/Page/Page.php:1796-1800 | system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:412-416 — before extracting anything, compare `system/src/Grav/Common/Page/Page.php` and `system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) system/src/Grav/Common/Flex/Types/Pages/Traits/PageRoutableTrait.php:86 — system/src/Grav/Common/Flex/Types/Pages/Traits/PageRoutableTrait.php:86-90 | system/src/Grav/Framework/Flex/Pages/Traits/PageRoutableTrait.php:507-511 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×7
  • Duplicated block (15 lines × 2) system/src/Grav/Common/Filesystem/Folder.php:40 — system/src/Grav/Common/Filesystem/Folder.php:40-54 | system/src/Grav/Common/Filesystem/Folder.php:79-93 — 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:40` 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/Filesystem/ZipArchiver.php:289 — system/src/Grav/Common/Filesystem/ZipArchiver.php:289-303 | system/src/Grav/Common/Filesystem/ZipArchiver.php:384-398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `system/src/Grav/Common/Filesystem/ZipArchiver.php:305` calls `getArchiveFiles` and `system/src/Grav/Common/Filesystem/ZipArchiver.php:400` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:350 — system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:350-364 | system/src/Grav/Common/Page/Pages.php:3055-3069 — 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:350` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) system/src/Grav/Common/Flex/Types/Users/UserObject.php:1181 — system/src/Grav/Common/Flex/Types/Users/UserObject.php:1181-1195 | system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php:509-523 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (15 lines × 2) 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 — before extracting anything, compare `system/src/Grav/Common/Twig/Node/TwigNodeLink.php` and `system/src/Grav/Common/Twig/Node/TwigNodeStyle.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `system/src/Grav/Common/Twig/Node/TwigNodeStyle.php:96` calls `hasNode` and `system/src/Grav/Common/Twig/Node/TwigNodeLink.php:96` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) system/src/Grav/Installer/Versions.php:275 — system/src/Grav/Installer/Versions.php:275-289 | system/src/Grav/Installer/YamlUpdater.php:426-440 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (15 lines × 2) system/src/Grav/Common/Page/Page.php:3275 — system/src/Grav/Common/Page/Page.php:3275-3289 | system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:1077-1091 — before extracting anything, compare `system/src/Grav/Common/Page/Page.php` and `system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×7
  • Duplicated block (7 lines × 2) system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:713 — system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:713-719 | system/src/Grav/Common/Page/Collection.php:725-731 — 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:713` 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/Page/Page.php:2302 — system/src/Grav/Common/Page/Page.php:2302-2308 | system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:671-677 — before extracting anything, compare `system/src/Grav/Common/Page/Page.php` and `system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `system/src/Grav/Common/Page/Page.php:2302` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) system/src/Grav/Common/Scheduler/Cron.php:538 — system/src/Grav/Common/Scheduler/Cron.php:538-544 | system/src/Grav/Common/Scheduler/Cron.php:546-552 — 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 (7 lines × 2) system/src/Grav/Common/Config/Env.php:71 — system/src/Grav/Common/Config/Env.php:71-77 | system/src/Grav/Common/Config/Setup.php:186-192 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) system/src/Grav/Common/Flex/Types/Users/Storage/UserFileStorage.php:41 — system/src/Grav/Common/Flex/Types/Users/Storage/UserFileStorage.php:41-47 | system/src/Grav/Common/Flex/Types/Users/Storage/UserFolderStorage.php:31-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) system/src/Grav/Common/GPM/AbstractCollection.php:33 — system/src/Grav/Common/GPM/AbstractCollection.php:33-39 | system/src/Grav/Common/GPM/Common/AbstractPackageCollection.php:42-48 — 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 (7 lines × 2) system/src/Grav/Common/Flex/Types/Users/UserObject.php:1018 — system/src/Grav/Common/Flex/Types/Users/UserObject.php:1018-1025 | system/src/Grav/Common/User/DataUser/User.php:446-452 — 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.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×6
  • Duplicated block (16 lines × 2) system/src/Grav/Common/Data/Data.php:205 — system/src/Grav/Common/Data/Data.php:205-220 | system/src/Grav/Common/Flex/Types/Users/UserObject.php:512-527 — 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 (16 lines × 2) system/src/Grav/Common/Form/FormFlash.php:54 — system/src/Grav/Common/Form/FormFlash.php:54-69 | system/src/Grav/Common/Form/FormFlash.php:86-101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) system/src/Grav/Common/GPM/Remote/GravCore.php:83 — system/src/Grav/Common/GPM/Remote/GravCore.php:83-98 | system/src/Grav/Common/GPM/Remote/Package.php:49-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (16 lines × 2) system/src/Grav/Common/Service/ConfigServiceProvider.php:99 — system/src/Grav/Common/Service/ConfigServiceProvider.php:99-114 | system/src/Grav/Common/Service/ConfigServiceProvider.php:141-156 — 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:99` 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 (16 lines × 2) system/src/Grav/Framework/Flex/FlexObject.php:786 — system/src/Grav/Framework/Flex/FlexObject.php:786-801 | system/src/Grav/Framework/Flex/FlexObject.php:818-833 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) system/src/Grav/Console/Cli/ComposerCommand.php:26 — system/src/Grav/Console/Cli/ComposerCommand.php:26-41 | system/src/Grav/Console/Cli/LogViewerCommand.php:29-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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.
X19 · Unrestored process-global state · Process-global state is restored only on the happy path · ×6
  • Process-global state is restored only on the happy path system/src/Grav/Framework/File/Formatter/YamlFormatter.php:154 — `decode` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `yaml.decode_php` ini setting (changed at line 160, put back at line 163) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path system/src/Grav/Common/Twig/WriteCacheFileTrait.php:33 — `writeCacheFile` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the process umask (changed at line 46, put back at line 48) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path system/src/Grav/Common/Page/Markdown/MarkdownOutput.php:395 — `mainRegion` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — libxml's internal-error mode (changed at line 402, put back at line 405) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path system/src/Grav/Common/Markdown/ParsedownExtra.php:280 — `processTag` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — libxml's internal-error mode (changed at line 287, put back at line 291) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path system/src/Grav/Common/Helpers/Excerpts.php:87 — `getExcerptFromHtml` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — libxml's internal-error mode (changed at line 90, put back at line 92) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
  • Process-global state is restored only on the happy path system/src/Grav/Common/Backup/Backups.php:229 — `backup` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `max_execution_time` ini setting (changed at line 254, put back at line 308) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, not a `finally`, so it is skipped by any exception thrown in between: PHP then keeps the overwritten value for the rest of the request — and in a CLI command, a queue worker or a long-running server (Octane, Swoole, RoadRunner, FrankenPHP) for the rest of the process's life — and every later relative path, child-process launch, date, number format, XML parse or error report in ANY class reads it. That failure is silent and remote from its cause: the function that breaks is not the function that moved the value. The durable fix is not to widen the restore but to stop mutating the global: pass the value to the operation that needs it — `cwd` and `env` to Symfony `Process` (`new Process($command, $cwd, $env)`) or `proc_open($command, $spec, $pipes, $cwd, $env)`, absolute paths instead of `chdir`, an explicit `DateTimeZone` or locale to `DateTimeImmutable`/`IntlDateFormatter`/`NumberFormatter`, an explicit encoding to the `mb_*` call, `LIBXML_NOERROR`/`libxml_get_errors` handling in one place. Where the global genuinely must move, wrap it `try`/`finally` so the restore runs on every path.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×5
  • Duplicated block (10 lines × 2) system/src/Grav/Common/Flex/Types/Pages/Traits/PageLegacyTrait.php:146 — system/src/Grav/Common/Flex/Types/Pages/Traits/PageLegacyTrait.php:146-155 | system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:1010-1019 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `system/src/Grav/Common/Flex/Types/Pages/Traits/PageLegacyTrait.php:141` calls `isAdminPlugin`, `getInheritedParams` and `system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:1008` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) system/src/Grav/Common/Page/Page.php:806 — system/src/Grav/Common/Page/Page.php:806-815 | system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:154-163 — before extracting anything, compare `system/src/Grav/Common/Page/Page.php` and `system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `system/src/Grav/Common/Page/Page.php:806` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) system/src/Grav/Common/Security.php:886 — system/src/Grav/Common/Security.php:886-895 | system/src/Grav/Common/Security.php:915-924 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) system/src/Grav/Framework/Flex/Storage/FolderStorage.php:438 — system/src/Grav/Framework/Flex/Storage/FolderStorage.php:438-447 | system/src/Grav/Framework/Flex/Storage/SimpleStorage.php:365-374 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `system/src/Grav/Framework/Flex/Storage/FolderStorage.php:438` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `system/src/Grav/Framework/Flex/Storage/FolderStorage.php:436` calls `assertValidKey` and `system/src/Grav/Framework/Flex/Storage/SimpleStorage.php:364` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) system/src/Grav/Installer/Install.php:1097 — system/src/Grav/Installer/Install.php:1097-1106 | system/src/Grav/Installer/Install.php:1124-1133 — 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:1097` 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) · ×5
  • Duplicated block (6 lines × 2) system/src/Grav/Common/Data/Blueprint.php:230 — system/src/Grav/Common/Data/Blueprint.php:230-235 | system/src/Grav/Common/Page/Page.php:1544-1549 — 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:230` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) system/src/Grav/Common/Uri.php:1087 — system/src/Grav/Common/Uri.php:1087-1092 | system/src/Grav/Common/Uri.php:1626-1631 — 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:1087` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) 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 — before extracting anything, compare `system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php` and `system/src/Grav/Framework/Object/Base/ObjectTrait.php` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) system/src/Grav/Framework/Relationships/ToManyRelationship.php:135 — system/src/Grav/Framework/Relationships/ToManyRelationship.php:135-140 | system/src/Grav/Framework/Relationships/ToOneRelationship.php:110-115 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) system/src/Grav/Framework/Relationships/ToManyRelationship.php:252 — system/src/Grav/Framework/Relationships/ToManyRelationship.php:252-257 | system/src/Grav/Framework/Relationships/ToOneRelationship.php:200-205 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×4
  • Duplicated block (11 lines × 2) system/src/Grav/Common/Data/Data.php:108 — system/src/Grav/Common/Data/Data.php:108-118 | system/src/Grav/Common/Flex/Types/Users/UserObject.php:445-455 — 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:108` 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/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, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (11 lines × 2) system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:475 — system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:475-485 | system/src/Grav/Framework/Flex/Pages/Traits/PageTranslateTrait.php:250-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 (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, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×4
  • Outbound HTTP without resilience system/src/Grav/Common/HTTP/Client.php:47 — `new CurlHttpClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience system/src/Grav/Common/HTTP/Client.php:48 — `new NativeHttpClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience system/src/Grav/Common/HTTP/Client.php:49 — `HttpClient::create(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience system/src/Grav/Common/HTTP/Response.php:80 — `->request(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D31 · IaC & Container Security · Medium IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×3
  • Duplicated block (17 lines × 2) system/src/Grav/Common/Page/Pages.php:2036 — system/src/Grav/Common/Page/Pages.php:2036-2052 | system/src/Grav/Common/Service/AccountsServiceProvider.php:105-121 — 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:2036` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `system/src/Grav/Common/Service/AccountsServiceProvider.php:122` calls `getFlexDirectory` and `system/src/Grav/Common/Page/Pages.php:2053` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) system/src/Grav/Common/Plugin.php:395 — system/src/Grav/Common/Plugin.php:395-411 | system/src/Grav/Common/Theme.php:52-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) system/src/Grav/Installer/Versions.php:299 — system/src/Grav/Installer/Versions.php:299-315 | system/src/Grav/Installer/YamlUpdater.php:450-466 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×3
  • Duplicated block (13 lines × 2) system/src/Grav/Common/Filesystem/Folder.php:487 — system/src/Grav/Common/Filesystem/Folder.php:487-499 | system/src/Grav/Framework/Cache/Adapter/FileCache.php:260-272 — 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 (13 lines × 2) system/src/Grav/Common/Page/Medium/AbstractMedia.php:359 — system/src/Grav/Common/Page/Medium/AbstractMedia.php:359-371 | system/src/Grav/Common/Page/Medium/AbstractMedia.php:467-479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×3
  • Duplicated block (10 lines × 3) system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:102 — system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:102-111 | system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:127-136 | system/src/Grav/Common/Twig/Compatibility/Twig3CompatibilityTransformer.php:183-192 — 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/Twig/Compatibility/Twig3CompatibilityTransformer.php:102` 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/Console/Gpm/IndexCommand.php:256 — system/src/Grav/Console/Gpm/IndexCommand.php:256-265 | system/src/Grav/Console/Gpm/InfoCommand.php:146-155 | system/src/Grav/Console/Gpm/UpdateCommand.php:212-221 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • 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 — before extracting anything, compare `system/src/Grav/Framework/Flex/FlexCollection.php` and `system/src/Grav/Framework/Flex/FlexObject.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D17 · Explicit Debt · HackComment · ×2
  • HackComment system/src/Grav/Common/Flex/Types/Users/UserObject.php:841 — // HACK: With folder storage we need to ignore the avatar destination. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment system/src/Grav/Common/Flex/Types/Pages/Traits/PageTranslateTrait.php:97 — // Hack to get the same result as with old pages. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: PageCollection.php ↔ PageIndex.php system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:1 — `system/src/Grav/Common/Flex/Types/Pages/PageCollection.php` and `system/src/Grav/Common/Flex/Types/Pages/PageIndex.php` change together 60% of the time (18 of the 30 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 18 shared commits counted here, the most recent 3 are `3c83efd8` Add Collection::notOfType() to exclude page templates (#3910); `179dec4c` More phpstan fixes; `a57c18f6` Fixed some phpstan errors — run `git show` on any of them.
  • Change coupling: InfoCommand.php ↔ UpdateCommand.php system/src/Grav/Console/Gpm/InfoCommand.php:1 — `system/src/Grav/Console/Gpm/InfoCommand.php` and `system/src/Grav/Console/Gpm/UpdateCommand.php` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `31dc6831` Add 2.0 migration wizard, preflight, and compatibility flag extensions; `6324cca5` Recognize '2.0' in compatibility inference and CLI badges; `e460ed66` Add compatibility: blueprint support and preflight handling for 1.7→1… — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×2
  • Duplicated block (38 lines × 2) system/src/Grav/Common/Flex/Types/Users/UserObject.php:1069 — system/src/Grav/Common/Flex/Types/Users/UserObject.php:1069-1106 | system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php:385-422 — 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:1069` 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 (38 lines × 2) system/src/Grav/Framework/Object/Access/ArrayAccessTrait.php:27 — system/src/Grav/Framework/Object/Access/ArrayAccessTrait.php:27-64 | system/src/Grav/Framework/Object/Access/OverloadedPropertyTrait.php:27-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `system/src/Grav/Framework/Object/Access/ArrayAccessTrait.php:27` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×2
  • Duplicated block (24–25 lines × 2) system/src/DOMLettersIterator.php:103 — system/src/DOMLettersIterator.php:103-127 | system/src/DOMWordsIterator.php:103-126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `system/src/DOMLettersIterator.php:103` 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 (24–25 lines × 2) system/src/Grav/Common/Filesystem/ZipArchiver.php:188 — system/src/Grav/Common/Filesystem/ZipArchiver.php:188-212 | system/src/Grav/Common/GPM/Installer.php:380-403 — 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/ZipArchiver.php:188` 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) · ×2
  • Duplicated block (25 lines × 2) system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:372 — system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:372-396 | system/src/Grav/Common/Page/Pages.php:3081-3105 — 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:372` 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 (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 (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) system/src/Grav/Common/Flex/Types/Users/UserObject.php:1123 — system/src/Grav/Common/Flex/Types/Users/UserObject.php:1123-1146 | system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php:426-449 — 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:1123` 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 (24 lines × 2) system/src/Grav/Common/GPM/Installer.php:662 — system/src/Grav/Common/GPM/Installer.php:662-685 | system/src/Grav/Installer/Install.php:450-473 — 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×2
  • Duplicated block (23 lines × 2) system/src/Grav/Common/Uri.php:946 — system/src/Grav/Common/Uri.php:946-968 | system/src/Grav/Common/Uri.php:1173-1195 — 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:946` 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 (23 lines × 2) system/src/Grav/Framework/Flex/FlexObject.php:875 — system/src/Grav/Framework/Flex/FlexObject.php:875-897 | system/src/Grav/Framework/Form/Traits/FormTrait.php:230-252 — 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.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) system/src/Grav/Console/Gpm/InstallCommand.php:710 — system/src/Grav/Console/Gpm/InstallCommand.php:710-729 | system/src/Grav/Console/Gpm/UninstallCommand.php:277-296 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) system/src/Grav/Common/User/DataUser/User.php:419 — system/src/Grav/Common/User/DataUser/User.php:419-438 | system/src/Grav/Framework/Flex/Storage/AbstractFilesystemStorage.php:224-243 — 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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×2
  • Duplicated block (19 lines × 2) system/src/Grav/Common/Twig/TokenParser/TwigTokenParserScript.php:64 — system/src/Grav/Common/Twig/TokenParser/TwigTokenParserScript.php:64-82 | system/src/Grav/Common/Twig/TokenParser/TwigTokenParserStyle.php:57-75 — before extracting anything, compare `system/src/Grav/Common/Twig/TokenParser/TwigTokenParserScript.php` and `system/src/Grav/Common/Twig/TokenParser/TwigTokenParserStyle.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) system/src/Grav/Framework/Flex/FlexDirectoryForm.php:307 — system/src/Grav/Framework/Flex/FlexDirectoryForm.php:307-325 | system/src/Grav/Framework/Flex/FlexForm.php:373-391 — before extracting anything, compare `system/src/Grav/Framework/Flex/FlexDirectoryForm.php` and `system/src/Grav/Framework/Flex/FlexForm.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `system/src/Grav/Framework/Flex/FlexDirectoryForm.php:307` 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 (18 lines × 2) · ×2
  • Duplicated block (18 lines × 2) system/src/Grav/Framework/Flex/FlexDirectoryForm.php:156 — system/src/Grav/Framework/Flex/FlexDirectoryForm.php:156-173 | system/src/Grav/Framework/Flex/FlexForm.php:199-216 — before extracting anything, compare `system/src/Grav/Framework/Flex/FlexDirectoryForm.php` and `system/src/Grav/Framework/Flex/FlexForm.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • 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 — before extracting anything, compare `system/src/Grav/Framework/Flex/FlexDirectoryForm.php` and `system/src/Grav/Framework/Flex/FlexForm.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) system/src/Grav/Common/Media/Traits/MediaObjectTrait.php:284 — system/src/Grav/Common/Media/Traits/MediaObjectTrait.php:284-296 | system/src/Grav/Common/Media/Traits/MediaObjectTrait.php:304-317 — 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:284` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) system/src/Grav/Common/Service/ConfigServiceProvider.php:355 — system/src/Grav/Common/Service/ConfigServiceProvider.php:355-367 | system/src/Grav/Common/Service/ConfigServiceProvider.php:401-414 — 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:355` 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) · ×2
  • Duplicated block (11 lines × 3) system/src/Grav/Common/Flex/Traits/FlexCommonTrait.php:39 — system/src/Grav/Common/Flex/Traits/FlexCommonTrait.php:39-49 | system/src/Grav/Framework/Flex/FlexCollection.php:649-659 | system/src/Grav/Framework/Flex/FlexObject.php:1226-1236 — before extracting anything, compare `system/src/Grav/Framework/Flex/FlexCollection.php` and `system/src/Grav/Framework/Flex/FlexObject.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `system/src/Grav/Framework/Flex/FlexObject.php:1221` calls `user_error` and `system/src/Grav/Framework/Flex/FlexCollection.php:645` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 3) system/src/Grav/Common/Media/Traits/ImageDecodingTrait.php:28 — system/src/Grav/Common/Media/Traits/ImageDecodingTrait.php:28-38 | system/src/Grav/Common/Media/Traits/ImageFetchPriorityTrait.php:28-38 | system/src/Grav/Common/Media/Traits/ImageLoadingTrait.php:28-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×2
  • Duplicated block (9–10 lines × 2) system/src/Grav/Common/Page/PageIdentity.php:288 — system/src/Grav/Common/Page/PageIdentity.php:288-296 | system/src/Grav/Common/Page/PageIdentity.php:415-424 — 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/PageIdentity.php:288` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 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.
D1 · Cyclomatic Complexity · Debugger.deprecatedErrorHandler (cyclomatic 54) · ×1
  • Debugger.deprecatedErrorHandler (cyclomatic 54) system/src/Grav/Common/Debugger.php:1131 — Debugger.deprecatedErrorHandler has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent 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.getCollection (cyclomatic 50) · ×1
  • Pages.getCollection (cyclomatic 50) system/src/Grav/Common/Page/Pages.php:692 — 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 · Page.header (cyclomatic 49) · ×1
  • Page.header (cyclomatic 49) system/src/Grav/Common/Page/Page.php:569 — Page.header 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 · Pages.recurse (cyclomatic 49) · ×1
  • Pages.recurse (cyclomatic 49) system/src/Grav/Common/Page/Pages.php:2688 — Pages.recurse 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 · Pages.buildSort (cyclomatic 44) · ×1
  • Pages.buildSort (cyclomatic 44) system/src/Grav/Common/Page/Pages.php:2971 — Pages.buildSort has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 41) · ×1
  • Media.init (cyclomatic 41) system/src/Grav/Common/Page/Media.php:129 — Media.init 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 · Cache.clearCache (cyclomatic 35) · ×1
  • Cache.clearCache (cyclomatic 35) system/src/Grav/Common/Cache.php:689 — Cache.clearCache 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 · Pages.evaluate (cyclomatic 35) · ×1
  • Pages.evaluate (cyclomatic 35) system/src/Grav/Common/Page/Pages.php:893 — 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:891 — 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 · SchedulerCommand.serve (cyclomatic 35) · ×1
  • SchedulerCommand.serve (cyclomatic 35) system/src/Grav/Console/Cli/SchedulerCommand.php:78 — SchedulerCommand.serve 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:1224 — 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 · Twig.init (cyclomatic 34) · ×1
  • Twig.init (cyclomatic 34) system/src/Grav/Common/Twig/Twig.php:130 — Twig.init 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 · Utils.url (cyclomatic 34) · ×1
  • Utils.url (cyclomatic 34) system/src/Grav/Common/Utils.php:81 — Utils.url 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 · PageStorage.getObjectMeta (cyclomatic 33) · ×1
  • PageStorage.getObjectMeta (cyclomatic 33) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:631 — PageStorage.getObjectMeta 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:302 — 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 · Pages.resetPages (cyclomatic 32) · ×1
  • Pages.resetPages (cyclomatic 32) system/src/Grav/Common/Page/Pages.php:2406 — Pages.resetPages 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 · ConfigServiceProvider.saveCachedFileList (cyclomatic 32) · ×1
  • ConfigServiceProvider.saveCachedFileList (cyclomatic 32) system/src/Grav/Common/Service/ConfigServiceProvider.php:335 — ConfigServiceProvider.saveCachedFileList 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 · SelfupgradeCommand.handlePreflightReport (cyclomatic 32) · ×1
  • SelfupgradeCommand.handlePreflightReport (cyclomatic 32) system/src/Grav/Console/Gpm/SelfupgradeCommand.php:297 — SelfupgradeCommand.handlePreflightReport 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 · PageContentTrait.processContent (cyclomatic 30) · ×1
  • PageContentTrait.processContent (cyclomatic 30) system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php:715 — PageContentTrait.processContent 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 · Pages.buildFlexPages (cyclomatic 29) · ×1
  • Pages.buildFlexPages (cyclomatic 29) system/src/Grav/Common/Page/Pages.php:2081 — Pages.buildFlexPages 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 · PagesServiceProvider.register (cyclomatic 29) · ×1
  • PagesServiceProvider.register (cyclomatic 29) system/src/Grav/Common/Service/PagesServiceProvider.php:34 — PagesServiceProvider.register 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 · GPM.getDependencies (cyclomatic 28) · ×1
  • GPM.getDependencies (cyclomatic 28) system/src/Grav/Common/GPM/GPM.php:1169 — GPM.getDependencies 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 · Page.content (cyclomatic 28) · ×1
  • Page.content (cyclomatic 28) system/src/Grav/Common/Page/Page.php:956 — Page.content 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 · BlueprintSchema.filterArray (cyclomatic 27) · ×1
  • BlueprintSchema.filterArray (cyclomatic 27) system/src/Grav/Common/Data/BlueprintSchema.php:306 — BlueprintSchema.filterArray 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 · UpdateCommand.serve (cyclomatic 27) · ×1
  • UpdateCommand.serve (cyclomatic 27) system/src/Grav/Console/Gpm/UpdateCommand.php:104 — UpdateCommand.serve 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 · Session.start (cyclomatic 27) · ×1
  • Session.start (cyclomatic 27) system/src/Grav/Framework/Session/Session.php:238 — Session.start 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:346 — 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:224 — 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:234 — 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 · Security.detectXss (cyclomatic 26) · ×1
  • Security.detectXss (cyclomatic 26) system/src/Grav/Common/Security.php:278 — Security.detectXss 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 · UninstallCommand.uninstallPackage (cyclomatic 26) · ×1
  • UninstallCommand.uninstallPackage (cyclomatic 26) system/src/Grav/Console/Gpm/UninstallCommand.php:157 — UninstallCommand.uninstallPackage 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 · Setup.__construct (cyclomatic 25) · ×1
  • Setup.__construct (cyclomatic 25) system/src/Grav/Common/Config/Setup.php:198 — Setup.__construct 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 · CompiledFile.content (cyclomatic 25) · ×1
  • CompiledFile.content (cyclomatic 25) system/src/Grav/Common/File/CompiledFile.php:34 — CompiledFile.content has cyclomatic complexity 25 (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 · Installer.install (cyclomatic 25) · ×1
  • Installer.install (cyclomatic 25) system/src/Grav/Common/GPM/Installer.php:83 — Installer.install has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MediaUploadTrait.checkFileMetadata (cyclomatic 25) · ×1
  • MediaUploadTrait.checkFileMetadata (cyclomatic 25) system/src/Grav/Common/Media/Traits/MediaUploadTrait.php:118 — MediaUploadTrait.checkFileMetadata 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 · PageStorage.saveRow (cyclomatic 24) · ×1
  • PageStorage.saveRow (cyclomatic 24) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:375 — PageStorage.saveRow 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.unZip (cyclomatic 24) · ×1
  • Installer.unZip (cyclomatic 24) system/src/Grav/Common/GPM/Installer.php:187 — Installer.unZip 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 · Grav.fallbackUrl (cyclomatic 24) · ×1
  • Grav.fallbackUrl (cyclomatic 24) system/src/Grav/Common/Grav.php:998 — Grav.fallbackUrl 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:1483 — 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 · 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.getDestinationIssue (cyclomatic 23) · ×1
  • Installer.getDestinationIssue (cyclomatic 23) system/src/Grav/Common/GPM/Installer.php:796 — Installer.getDestinationIssue has cyclomatic complexity 23 (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 · 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:260 — 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 · Page.moduleOutputCacheId (cyclomatic 23) · ×1
  • Page.moduleOutputCacheId (cyclomatic 23) system/src/Grav/Common/Page/Page.php:1353 — Page.moduleOutputCacheId has cyclomatic complexity 23 (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 · Validation.arrayFilterRecurse (cyclomatic 22) · ×1
  • Validation.arrayFilterRecurse (cyclomatic 22) system/src/Grav/Common/Data/Validation.php:1164 — 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 · ImageMediaTrait.derivatives (cyclomatic 22) · ×1
  • ImageMediaTrait.derivatives (cyclomatic 22) system/src/Grav/Common/Media/Traits/ImageMediaTrait.php:263 — ImageMediaTrait.derivatives 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 · MarkdownOutput.mainRegion (cyclomatic 22) · ×1
  • MarkdownOutput.mainRegion (cyclomatic 22) system/src/Grav/Common/Page/Markdown/MarkdownOutput.php:395 — MarkdownOutput.mainRegion 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.dispatch (cyclomatic 22) · ×1
  • Pages.dispatch (cyclomatic 22) system/src/Grav/Common/Page/Pages.php:1433 — Pages.dispatch 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:2885 — 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.runJobs (cyclomatic 22) · ×1
  • Scheduler.runJobs (cyclomatic 22) system/src/Grav/Common/Scheduler/Scheduler.php:383 — Scheduler.runJobs 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:1649 — 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 · Install.detectPendingPackageUpdates (cyclomatic 22) · ×1
  • Install.detectPendingPackageUpdates (cyclomatic 22) system/src/Grav/Installer/Install.php:755 — Install.detectPendingPackageUpdates 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 · Validation.validate (cyclomatic 21) · ×1
  • Validation.validate (cyclomatic 21) system/src/Grav/Common/Data/Validation.php:65 — Validation.validate 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 · Language.setActiveFromUri (cyclomatic 21) · ×1
  • Language.setActiveFromUri (cyclomatic 21) system/src/Grav/Common/Language/Language.php:246 — Language.setActiveFromUri 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 · ImageMediaTrait.saveImage (cyclomatic 21) · ×1
  • ImageMediaTrait.saveImage (cyclomatic 21) system/src/Grav/Common/Media/Traits/ImageMediaTrait.php:666 — ImageMediaTrait.saveImage has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ImageFile.jpegFrameSize (cyclomatic 21) · ×1
  • ImageFile.jpegFrameSize (cyclomatic 21) system/src/Grav/Common/Page/Medium/ImageFile.php:339 — ImageFile.jpegFrameSize 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 · Pages.allItems (cyclomatic 21) · ×1
  • Pages.allItems (cyclomatic 21) system/src/Grav/Common/Page/Pages.php:1618 — Pages.allItems 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:1867 — 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:1955 — 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 · SessionServiceProvider.register (cyclomatic 21) · ×1
  • SessionServiceProvider.register (cyclomatic 21) system/src/Grav/Common/Service/SessionServiceProvider.php:35 — SessionServiceProvider.register has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Validation.typeArray (cyclomatic 20) · ×1
  • Validation.typeArray (cyclomatic 20) system/src/Grav/Common/Data/Validation.php:1037 — 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 · Excerpts.processLinkExcerpt (cyclomatic 20) · ×1
  • Excerpts.processLinkExcerpt (cyclomatic 20) system/src/Grav/Common/Page/Markdown/Excerpts.php:98 — Excerpts.processLinkExcerpt 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 · Excerpts.processMediaActions (cyclomatic 20) · ×1
  • Excerpts.processMediaActions (cyclomatic 20) system/src/Grav/Common/Page/Markdown/Excerpts.php:287 — Excerpts.processMediaActions 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 · Uri.isExternal (cyclomatic 20) · ×1
  • Uri.isExternal (cyclomatic 20) system/src/Grav/Common/Uri.php:808 — Uri.isExternal has cyclomatic complexity 20 (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 · 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 · PageObject.reorderSiblings (cyclomatic 19) · ×1
  • PageObject.reorderSiblings (cyclomatic 19) system/src/Grav/Common/Flex/Types/Pages/PageObject.php:613 — 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). To reduce it, separate the cases: extract each independent 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.blockTableContinue (cyclomatic 19) · ×1
  • ParsedownGravTrait.blockTableContinue (cyclomatic 19) system/src/Grav/Common/Markdown/ParsedownGravTrait.php:742 — 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:855 — 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:2248 — 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 · Uri.init (cyclomatic 19) · ×1
  • Uri.init (cyclomatic 19) system/src/Grav/Common/Uri.php:157 — Uri.init 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 · Uri.createFromEnvironment (cyclomatic 19) · ×1
  • Uri.createFromEnvironment (cyclomatic 19) system/src/Grav/Common/Uri.php:1324 — Uri.createFromEnvironment 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 · Utils.getPathFromToken (cyclomatic 19) · ×1
  • Utils.getPathFromToken (cyclomatic 19) system/src/Grav/Common/Utils.php:1968 — 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 · SelfupgradeCommand.serve (cyclomatic 19) · ×1
  • SelfupgradeCommand.serve (cyclomatic 19) system/src/Grav/Console/Gpm/SelfupgradeCommand.php:108 — SelfupgradeCommand.serve 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 · FlexCollection.render (cyclomatic 19) · ×1
  • FlexCollection.render (cyclomatic 19) system/src/Grav/Framework/Flex/FlexCollection.php:369 — FlexCollection.render 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:592 — 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 · BaseAsset.init (cyclomatic 18) · ×1
  • BaseAsset.init (cyclomatic 18) system/src/Grav/Common/Assets/BaseAsset.php:94 — BaseAsset.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 · Cache.purgeOldCache (cyclomatic 18) · ×1
  • Cache.purgeOldCache (cyclomatic 18) system/src/Grav/Common/Cache.php:199 — Cache.purgeOldCache 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 · Debugger.init (cyclomatic 18) · ×1
  • Debugger.init (cyclomatic 18) system/src/Grav/Common/Debugger.php:139 — 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 · ZipArchiver.compress (cyclomatic 18) · ×1
  • ZipArchiver.compress (cyclomatic 18) system/src/Grav/Common/Filesystem/ZipArchiver.php:269 — ZipArchiver.compress 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 · UserObject.setUpdatedMedia (cyclomatic 18) · ×1
  • UserObject.setUpdatedMedia (cyclomatic 18) system/src/Grav/Common/Flex/Types/Users/UserObject.php:1047 — UserObject.setUpdatedMedia 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 · ParsedownExtra.findEndTag (cyclomatic 18) · ×1
  • ParsedownExtra.findEndTag (cyclomatic 18) system/src/Grav/Common/Markdown/ParsedownExtra.php:483 — ParsedownExtra.findEndTag 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 · Excerpts.processImageExcerpt (cyclomatic 18) · ×1
  • Excerpts.processImageExcerpt (cyclomatic 18) system/src/Grav/Common/Page/Markdown/Excerpts.php:192 — Excerpts.processImageExcerpt 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 · GravExtension.arrayGroupByFilter (cyclomatic 18) · ×1
  • GravExtension.arrayGroupByFilter (cyclomatic 18) system/src/Grav/Common/Twig/Extension/GravExtension.php:1577 — GravExtension.arrayGroupByFilter 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.ip (cyclomatic 18) · ×1
  • Uri.ip (cyclomatic 18) system/src/Grav/Common/Uri.php:710 — Uri.ip 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:1113 — 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 · PreflightCommand.serve (cyclomatic 18) · ×1
  • PreflightCommand.serve (cyclomatic 18) system/src/Grav/Console/Gpm/PreflightCommand.php:21 — PreflightCommand.serve 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 · FlexObject.render (cyclomatic 18) · ×1
  • FlexObject.render (cyclomatic 18) system/src/Grav/Framework/Flex/FlexObject.php:543 — FlexObject.render 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 · PageAuthorsTrait.isAuthorizedByGroup (cyclomatic 18) · ×1
  • PageAuthorsTrait.isAuthorizedByGroup (cyclomatic 18) system/src/Grav/Framework/Flex/Pages/Traits/PageAuthorsTrait.php:170 — PageAuthorsTrait.isAuthorizedByGroup 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 · Env.load (cyclomatic 17) · ×1
  • Env.load (cyclomatic 17) system/src/Grav/Common/Config/Env.php:90 — Env.load has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Blueprint.extend (cyclomatic 17) · ×1
  • Blueprint.extend (cyclomatic 17) system/src/Grav/Common/Data/Blueprint.php:326 — Blueprint.extend 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 · Blueprint.loadImport (cyclomatic 17) · ×1
  • Blueprint.loadImport (cyclomatic 17) system/src/Grav/Common/Data/Blueprint.php:437 — Blueprint.loadImport has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · 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 · LogRotator.rotate (cyclomatic 17) · ×1
  • LogRotator.rotate (cyclomatic 17) system/src/Grav/Common/Log/LogRotator.php:112 — LogRotator.rotate 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 · Page.httpHeaders (cyclomatic 17) · ×1
  • Page.httpHeaders (cyclomatic 17) system/src/Grav/Common/Page/Page.php:785 — Page.httpHeaders has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Page.summary (cyclomatic 17) · ×1
  • Page.summary (cyclomatic 17) system/src/Grav/Common/Page/Page.php:872 — Page.summary has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Pages.resolvePagesHash (cyclomatic 17) · ×1
  • Pages.resolvePagesHash (cyclomatic 17) system/src/Grav/Common/Page/Pages.php:3168 — Pages.resolvePagesHash 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 · Security.planSandboxDefaultsMigration (cyclomatic 17) · ×1
  • Security.planSandboxDefaultsMigration (cyclomatic 17) system/src/Grav/Common/Security.php:967 — Security.planSandboxDefaultsMigration 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 · User.save (cyclomatic 17) · ×1
  • User.save (cyclomatic 17) system/src/Grav/Common/User/DataUser/User.php:141 — User.save 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 · PageIdsCommand.serve (cyclomatic 17) · ×1
  • PageIdsCommand.serve (cyclomatic 17) system/src/Grav/Console/Cli/PageIdsCommand.php:36 — PageIdsCommand.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:623 — 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 · Validation.filterArray (cyclomatic 16) · ×1
  • Validation.filterArray (cyclomatic 16) system/src/Grav/Common/Data/Validation.php:1120 — 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 · Debugger.debuggerRequest (cyclomatic 16) · ×1
  • Debugger.debuggerRequest (cyclomatic 16) system/src/Grav/Common/Debugger.php:356 — Debugger.debuggerRequest 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 · PageObject.filterBy (cyclomatic 16) · ×1
  • PageObject.filterBy (cyclomatic 16) system/src/Grav/Common/Flex/Types/Pages/PageObject.php:808 — 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 · PageStorage.assertValidPageKeys (cyclomatic 16) · ×1
  • PageStorage.assertValidPageKeys (cyclomatic 16) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:521 — PageStorage.assertValidPageKeys 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 · 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 · GPM.calculateMergedDependenciesOfPackage (cyclomatic 16) · ×1
  • GPM.calculateMergedDependenciesOfPackage (cyclomatic 16) system/src/Grav/Common/GPM/GPM.php:1435 — GPM.calculateMergedDependenciesOfPackage 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 · Grav.getRedirectResponse (cyclomatic 16) · ×1
  • Grav.getRedirectResponse (cyclomatic 16) system/src/Grav/Common/Grav.php:652 — Grav.getRedirectResponse 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:452 — 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 · Scheduler.executeJob (cyclomatic 16) · ×1
  • Scheduler.executeJob (cyclomatic 16) system/src/Grav/Common/Scheduler/Scheduler.php:1356 — 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 · InstallCommand.processGpm (cyclomatic 16) · ×1
  • InstallCommand.processGpm (cyclomatic 16) system/src/Grav/Console/Gpm/InstallCommand.php:548 — InstallCommand.processGpm 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:698 — 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:1224 — Scheduler.processJobsWithWorkers has cognitive complexity 118 (threshold 15). Drivers by points: if/else 18 (64 pts), ternaries 6 (41 pts), loops 4 (7 pts), boolean chains 6 (nesting depth added 84). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Debugger.deprecatedErrorHandler (cognitive 113) · ×1
  • Debugger.deprecatedErrorHandler (cognitive 113) system/src/Grav/Common/Debugger.php:1131 — Debugger.deprecatedErrorHandler has cognitive complexity 113 (threshold 15). Drivers by points: if/else 30 (75 pts), loops 8 (23 pts), ternaries 2 (8 pts), boolean chains 7 (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch 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 102) · ×1
  • Page.header (cognitive 102) system/src/Grav/Common/Page/Page.php:569 — Page.header has cognitive complexity 102 (threshold 15). Drivers by points: if/else 42 (89 pts), boolean chains 4, error handling 1 (3 pts), loops 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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 15 (55 pts), if/else 17 (29 pts), boolean chains 8, loops 2 (4 pts) (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 · Media.init (cognitive 91) · ×1
  • Media.init (cognitive 91) system/src/Grav/Common/Page/Media.php:129 — Media.init has cognitive complexity 91 (threshold 15). Drivers by points: if/else 25 (64 pts), loops 5 (11 pts), boolean chains 10, error handling 2 (5 pts), ternaries 1 (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SchedulerCommand.serve (cognitive 91) · ×1
  • SchedulerCommand.serve (cognitive 91) system/src/Grav/Console/Cli/SchedulerCommand.php:78 — SchedulerCommand.serve has cognitive complexity 91 (threshold 15). Drivers by points: if/else 31 (64 pts), ternaries 6 (17 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PageStorage.getObjectMeta (cognitive 89) · ×1
  • PageStorage.getObjectMeta (cognitive 89) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:631 — PageStorage.getObjectMeta has cognitive complexity 89 (threshold 15). Drivers by points: if/else 21 (62 pts), ternaries 4 (10 pts), boolean chains 9, error handling 1 (5 pts), loops 1 (3 pts) (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Pages.buildSort (cognitive 84) · ×1
  • Pages.buildSort (cognitive 84) system/src/Grav/Common/Page/Pages.php:2971 — Pages.buildSort has cognitive complexity 84 (threshold 15). Drivers by points: if/else 23 (54 pts), ternaries 5 (16 pts), loops 4 (7 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Pages.getCollection (cognitive 82) · ×1
  • Pages.getCollection (cognitive 82) system/src/Grav/Common/Page/Pages.php:692 — Pages.getCollection has cognitive complexity 82 (threshold 15). Drivers by points: if/else 28 (52 pts), loops 7 (13 pts), ternaries 3 (8 pts), boolean chains 7, match/switch 1 (2 pts) (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 · Page.content (cognitive 80) · ×1
  • Page.content (cognitive 80) system/src/Grav/Common/Page/Page.php:956 — Page.content has cognitive complexity 80 (threshold 15). Drivers by points: if/else 25 (74 pts), boolean chains 6 (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GPM.getDependencies (cognitive 78) · ×1
  • GPM.getDependencies (cognitive 78) system/src/Grav/Common/GPM/GPM.php:1169 — GPM.getDependencies has cognitive complexity 78 (threshold 15). Drivers by points: if/else 21 (66 pts), loops 2 (7 pts), boolean chains 5 (nesting depth added 50). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Pages.recurse (cognitive 77) · ×1
  • Pages.recurse (cognitive 77) system/src/Grav/Common/Page/Pages.php:2688 — Pages.recurse has cognitive complexity 77 (threshold 15). Drivers by points: if/else 29 (58 pts), boolean chains 14, loops 3 (4 pts), ternaries 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Uri.convertUrl (cognitive 76) · ×1
  • Uri.convertUrl (cognitive 76) system/src/Grav/Common/Uri.php:891 — Uri.convertUrl has cognitive complexity 76 (threshold 15). Drivers by points: if/else 29 (62 pts), boolean chains 10, ternaries 2 (4 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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 24 (56 pts), ternaries 2 (5 pts), loops 1 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Utils.url (cognitive 68) · ×1
  • Utils.url (cognitive 68) system/src/Grav/Common/Utils.php:81 — Utils.url has cognitive complexity 68 (threshold 15). Drivers by points: if/else 22 (55 pts), boolean chains 11, ternaries 2 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ConfigServiceProvider.saveCachedFileList (cognitive 67) · ×1
  • ConfigServiceProvider.saveCachedFileList (cognitive 67) system/src/Grav/Common/Service/ConfigServiceProvider.php:335 — ConfigServiceProvider.saveCachedFileList has cognitive complexity 67 (threshold 15). Drivers by points: if/else 13 (38 pts), loops 10 (23 pts), boolean chains 5, error handling 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 18 (39 pts), error handling 3 (9 pts), ternaries 2 (8 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Twig.init (cognitive 63) · ×1
  • Twig.init (cognitive 63) system/src/Grav/Common/Twig/Twig.php:130 — Twig.init has cognitive complexity 63 (threshold 15). Drivers by points: if/else 17 (38 pts), ternaries 5 (15 pts), boolean chains 8, loops 1 (2 pts) (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 · Cache.clearCache (cognitive 58) · ×1
  • Cache.clearCache (cognitive 58) system/src/Grav/Common/Cache.php:689 — Cache.clearCache has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (36 pts), error handling 3 (9 pts), boolean chains 4, loops 2 (4 pts), ternaries 2 (4 pts), match/switch 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 · Grav.fallbackUrl (cognitive 58) · ×1
  • Grav.fallbackUrl (cognitive 58) system/src/Grav/Common/Grav.php:998 — Grav.fallbackUrl has cognitive complexity 58 (threshold 15). Drivers by points: if/else 15 (42 pts), boolean chains 5, loops 1 (4 pts), ternaries 1 (4 pts), error handling 1 (3 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Page.metadata (cognitive 58) · ×1
  • Page.metadata (cognitive 58) system/src/Grav/Common/Page/Page.php:2248 — Page.metadata has cognitive complexity 58 (threshold 15). Drivers by points: if/else 10 (25 pts), ternaries 4 (23 pts), loops 2 (6 pts), boolean chains 4 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PagesServiceProvider.register (cognitive 56) · ×1
  • PagesServiceProvider.register (cognitive 56) system/src/Grav/Common/Service/PagesServiceProvider.php:34 — PagesServiceProvider.register has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (36 pts), ternaries 4 (11 pts), boolean chains 9 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Security.extractTwigTokens (cognitive 55) · ×1
  • Security.extractTwigTokens (cognitive 55) system/src/Grav/Common/Security.php:1867 — Security.extractTwigTokens has cognitive complexity 55 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 7 (22 pts), ternaries 1 (3 pts), 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:302 — PageCollection.buildSort has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (32 pts), ternaries 4 (15 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Pages.buildFlexPages (cognitive 54) · ×1
  • Pages.buildFlexPages (cognitive 54) system/src/Grav/Common/Page/Pages.php:2081 — Pages.buildFlexPages has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (34 pts), ternaries 5 (13 pts), boolean chains 5, loops 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UninstallCommand.uninstallPackage (cognitive 54) · ×1
  • UninstallCommand.uninstallPackage (cognitive 54) system/src/Grav/Console/Gpm/UninstallCommand.php:157 — UninstallCommand.uninstallPackage has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (38 pts), ternaries 3 (7 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PageContentTrait.processContent (cognitive 53) · ×1
  • PageContentTrait.processContent (cognitive 53) system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php:715 — PageContentTrait.processContent has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (42 pts), boolean chains 10, ternaries 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Pages.resetPages (cognitive 52) · ×1
  • Pages.resetPages (cognitive 52) system/src/Grav/Common/Page/Pages.php:2406 — Pages.resetPages has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (28 pts), ternaries 6 (12 pts), boolean chains 9, loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdateCommand.serve (cognitive 51) · ×1
  • UpdateCommand.serve (cognitive 51) system/src/Grav/Console/Gpm/UpdateCommand.php:104 — UpdateCommand.serve has cognitive complexity 51 (threshold 15). Drivers by points: if/else 23 (44 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pages.allItems (cognitive 50) · ×1
  • Pages.allItems (cognitive 50) system/src/Grav/Common/Page/Pages.php:1618 — Pages.allItems has cognitive complexity 50 (threshold 15). Drivers by points: loops 8 (23 pts), if/else 7 (14 pts), ternaries 3 (10 pts), 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 · Folder.all (cognitive 49) · ×1
  • Folder.all (cognitive 49) system/src/Grav/Common/Filesystem/Folder.php:234 — Folder.all has cognitive complexity 49 (threshold 15). Drivers by points: if/else 19 (34 pts), ternaries 5 (9 pts), 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 16 (40 pts), loops 3 (9 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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 14 (28 pts), loops 5 (13 pts), ternaries 3 (5 pts), 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 · PageStorage.saveRow (cognitive 48) · ×1
  • PageStorage.saveRow (cognitive 48) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:375 — PageStorage.saveRow has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (32 pts), ternaries 4 (11 pts), boolean chains 4, error handling 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ImageMediaTrait.derivatives (cognitive 48) · ×1
  • ImageMediaTrait.derivatives (cognitive 48) system/src/Grav/Common/Media/Traits/ImageMediaTrait.php:263 — ImageMediaTrait.derivatives has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 5 (9 pts), boolean chains 3, ternaries 1 (3 pts) (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 · Installer.unZip (cognitive 47) · ×1
  • Installer.unZip (cognitive 47) system/src/Grav/Common/GPM/Installer.php:187 — Installer.unZip has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (37 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SelfupgradeCommand.handlePreflightReport (cognitive 47) · ×1
  • SelfupgradeCommand.handlePreflightReport (cognitive 47) system/src/Grav/Console/Gpm/SelfupgradeCommand.php:297 — SelfupgradeCommand.handlePreflightReport has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 9 (17 pts), boolean chains 6, ternaries 3 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlueprintSchema.validateArray (cognitive 46) · ×1
  • BlueprintSchema.validateArray (cognitive 46) system/src/Grav/Common/Data/BlueprintSchema.php:224 — BlueprintSchema.validateArray has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (31 pts), boolean chains 9, ternaries 2 (5 pts), loops 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PageCollection.ofOneOfTheseAccessLevels (cognitive 45) · ×1
  • PageCollection.ofOneOfTheseAccessLevels (cognitive 45) system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:708 — PageCollection.ofOneOfTheseAccessLevels has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (33 pts), loops 3 (11 pts), boolean chains 1 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · UserObject.setUpdatedMedia (cognitive 45) · ×1
  • UserObject.setUpdatedMedia (cognitive 45) system/src/Grav/Common/Flex/Types/Users/UserObject.php:1047 — UserObject.setUpdatedMedia has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (39 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Collection.ofOneOfTheseAccessLevels (cognitive 45) · ×1
  • Collection.ofOneOfTheseAccessLevels (cognitive 45) system/src/Grav/Common/Page/Collection.php:716 — Collection.ofOneOfTheseAccessLevels has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (33 pts), loops 3 (11 pts), boolean chains 1 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PageLegacyTrait.metadata (cognitive 45) · ×1
  • PageLegacyTrait.metadata (cognitive 45) system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:623 — PageLegacyTrait.metadata has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 4 (20 pts), if/else 7 (16 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Language.setActiveFromUri (cognitive 44) · ×1
  • Language.setActiveFromUri (cognitive 44) system/src/Grav/Common/Language/Language.php:246 — Language.setActiveFromUri has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 9, loops 1 (4 pts), ternaries 1 (4 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Cache.getCacheAdapter (cognitive 43) · ×1
  • Cache.getCacheAdapter (cognitive 43) system/src/Grav/Common/Cache.php:346 — Cache.getCacheAdapter has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (34 pts), boolean chains 5, error handling 1 (3 pts), 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:1968 — Utils.getPathFromToken has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (35 pts), ternaries 2 (7 pts), 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 14 (34 pts), error handling 1 (4 pts), loops 2 (3 pts), 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 10 (32 pts), boolean chains 6, loops 2 (5 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlueprintSchema.filterArray (cognitive 42) · ×1
  • BlueprintSchema.filterArray (cognitive 42) system/src/Grav/Common/Data/BlueprintSchema.php:306 — BlueprintSchema.filterArray has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 11, ternaries 3 (6 pts), loops 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Scheduler.runJobs (cognitive 42) · ×1
  • Scheduler.runJobs (cognitive 42) system/src/Grav/Common/Scheduler/Scheduler.php:383 — Scheduler.runJobs has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 5 (10 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseAsset.init (cognitive 40) · ×1
  • BaseAsset.init (cognitive 40) system/src/Grav/Common/Assets/BaseAsset.php:94 — BaseAsset.init has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 2 (5 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Pages.buildRoutes (cognitive 40) · ×1
  • Pages.buildRoutes (cognitive 40) system/src/Grav/Common/Page/Pages.php:2885 — Pages.buildRoutes has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 7 (20 pts), loops 5 (16 pts), 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 18 (28 pts), boolean chains 4, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Setup.__construct (cognitive 38) · ×1
  • Setup.__construct (cognitive 38) system/src/Grav/Common/Config/Setup.php:198 — Setup.__construct has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (26 pts), ternaries 6 (7 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 7 (15 pts), boolean chains 12, error handling 4 (9 pts), ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParsedownExtra.findEndTag (cognitive 38) · ×1
  • ParsedownExtra.findEndTag (cognitive 38) system/src/Grav/Common/Markdown/ParsedownExtra.php:483 — ParsedownExtra.findEndTag has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (35 pts), boolean chains 2, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Excerpts.processLinkExcerpt (cognitive 38) · ×1
  • Excerpts.processLinkExcerpt (cognitive 38) system/src/Grav/Common/Page/Markdown/Excerpts.php:98 — Excerpts.processLinkExcerpt has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 3 (9 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Pages.dispatch (cognitive 38) · ×1
  • Pages.dispatch (cognitive 38) system/src/Grav/Common/Page/Pages.php:1433 — Pages.dispatch has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 7, error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Debugger.init (cognitive 37) · ×1
  • Debugger.init (cognitive 37) system/src/Grav/Common/Debugger.php:139 — Debugger.init has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (34 pts), match/switch 1 (2 pts), 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 · MediaUploadTrait.checkFileMetadata (cognitive 37) · ×1
  • MediaUploadTrait.checkFileMetadata (cognitive 37) system/src/Grav/Common/Media/Traits/MediaUploadTrait.php:118 — MediaUploadTrait.checkFileMetadata has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 5, 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 · Security.detectXss (cognitive 37) · ×1
  • Security.detectXss (cognitive 37) system/src/Grav/Common/Security.php:278 — Security.detectXss has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 9, ternaries 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.start (cognitive 37) · ×1
  • Session.start (cognitive 37) system/src/Grav/Framework/Session/Session.php:238 — Session.start has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 4 (10 pts), boolean chains 6, error handling 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Validation.arrayFilterRecurse (cognitive 36) · ×1
  • Validation.arrayFilterRecurse (cognitive 36) system/src/Grav/Common/Data/Validation.php:1164 — Validation.arrayFilterRecurse has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 2 (7 pts), 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 · Install.detectPendingPackageUpdates (cognitive 36) · ×1
  • Install.detectPendingPackageUpdates (cognitive 36) system/src/Grav/Installer/Install.php:755 — Install.detectPendingPackageUpdates has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (25 pts), ternaries 3 (5 pts), loops 3, boolean chains 2, error handling 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 · InstallCommand.processGpm (cognitive 35) · ×1
  • InstallCommand.processGpm (cognitive 35) system/src/Grav/Console/Gpm/InstallCommand.php:548 — InstallCommand.processGpm has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 2 (7 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 10 (30 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Installer.install (cognitive 34) · ×1
  • Installer.install (cognitive 34) system/src/Grav/Common/GPM/Installer.php:83 — Installer.install has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 9 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Security.scanContentTwigUsage (cognitive 34) · ×1
  • Security.scanContentTwigUsage (cognitive 34) system/src/Grav/Common/Security.php:1955 — Security.scanContentTwigUsage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 7 (11 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 10 (24 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlexMediaTrait.setUpdatedMedia (cognitive 34) · ×1
  • FlexMediaTrait.setUpdatedMedia (cognitive 34) system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php:367 — FlexMediaTrait.setUpdatedMedia has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Cache.purgeOldCache (cognitive 33) · ×1
  • Cache.purgeOldCache (cognitive 33) system/src/Grav/Common/Cache.php:199 — Cache.purgeOldCache has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 5, loops 3 (5 pts), error handling 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageObject.reorderSiblings (cognitive 33) · ×1
  • PageObject.reorderSiblings (cognitive 33) system/src/Grav/Common/Flex/Types/Pages/PageObject.php:613 — PageObject.reorderSiblings has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 4 (7 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Language.getFallbackLanguages (cognitive 33) · ×1
  • Language.getFallbackLanguages (cognitive 33) system/src/Grav/Common/Language/Language.php:452 — Language.getFallbackLanguages has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (6 pts), boolean chains 4, ternaries 1 (4 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ParsedownGravTrait.blockTableContinue (cognitive 33) · ×1
  • ParsedownGravTrait.blockTableContinue (cognitive 33) system/src/Grav/Common/Markdown/ParsedownGravTrait.php:742 — ParsedownGravTrait.blockTableContinue has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 9, ternaries 1 (4 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Folder.rcopy (cognitive 32) · ×1
  • Folder.rcopy (cognitive 32) system/src/Grav/Common/Filesystem/Folder.php:510 — Folder.rcopy has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (30 pts), 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 · GPM.calculateMergedDependenciesOfPackage (cognitive 32) · ×1
  • GPM.calculateMergedDependenciesOfPackage (cognitive 32) system/src/Grav/Common/GPM/GPM.php:1435 — GPM.calculateMergedDependenciesOfPackage has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 2, 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 · Utils.download (cognitive 32) · ×1
  • Utils.download (cognitive 32) system/src/Grav/Common/Utils.php:921 — Utils.download has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SelfupgradeCommand.serve (cognitive 32) · ×1
  • SelfupgradeCommand.serve (cognitive 32) system/src/Grav/Console/Gpm/SelfupgradeCommand.php:108 — SelfupgradeCommand.serve has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParsedownGravTrait.blockTableComplete (cognitive 31) · ×1
  • ParsedownGravTrait.blockTableComplete (cognitive 31) system/src/Grav/Common/Markdown/ParsedownGravTrait.php:855 — ParsedownGravTrait.blockTableComplete has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, loops 2 (5 pts), ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Excerpts.processMediaActions (cognitive 31) · ×1
  • Excerpts.processMediaActions (cognitive 31) system/src/Grav/Common/Page/Markdown/Excerpts.php:287 — Excerpts.processMediaActions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, loops 3 (5 pts), ternaries 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pages.get (cognitive 31) · ×1
  • Pages.get (cognitive 31) system/src/Grav/Common/Page/Pages.php:1108 — Pages.get has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 1 (5 pts), loops 1 (4 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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 11 (27 pts), ternaries 1 (2 pts), 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 5 (18 pts), loops 5 (13 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageFile.jpegFrameSize (cognitive 30) · ×1
  • ImageFile.jpegFrameSize (cognitive 30) system/src/Grav/Common/Page/Medium/ImageFile.php:339 — ImageFile.jpegFrameSize has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 8, loops 3 (5 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Page.value (cognitive 30) · ×1
  • Page.value (cognitive 30) system/src/Grav/Common/Page/Page.php:1483 — Page.value has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (20 pts), ternaries 3 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Scheduler.executeJob (cognitive 30) · ×1
  • Scheduler.executeJob (cognitive 30) system/src/Grav/Common/Scheduler/Scheduler.php:1356 — Scheduler.executeJob has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 9 (13 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlexDirectory.loadObjects (cognitive 30) · ×1
  • FlexDirectory.loadObjects (cognitive 30) system/src/Grav/Framework/Flex/FlexDirectory.php:698 — FlexDirectory.loadObjects has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 3 (4 pts), error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Blueprint.extend (cognitive 29) · ×1
  • Blueprint.extend (cognitive 29) system/src/Grav/Common/Data/Blueprint.php:326 — Blueprint.extend has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (7 pts), boolean chains 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlueprintSchema.processFormRecursive (cognitive 29) · ×1
  • BlueprintSchema.processFormRecursive (cognitive 29) system/src/Grav/Common/Data/BlueprintSchema.php:410 — BlueprintSchema.processFormRecursive has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), 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 · MarkdownOutput.mainRegion (cognitive 29) · ×1
  • MarkdownOutput.mainRegion (cognitive 29) system/src/Grav/Common/Page/Markdown/MarkdownOutput.php:395 — MarkdownOutput.mainRegion has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 6 (8 pts), ternaries 3 (6 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Security.resolveTwigContentEvents (cognitive 29) · ×1
  • Security.resolveTwigContentEvents (cognitive 29) system/src/Grav/Common/Security.php:1649 — Security.resolveTwigContentEvents has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), 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 · User.save (cognitive 29) · ×1
  • User.save (cognitive 29) system/src/Grav/Common/User/DataUser/User.php:141 — User.save has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Installer.sophisticatedInstall (cognitive 28) · ×1
  • Installer.sophisticatedInstall (cognitive 28) system/src/Grav/Common/GPM/Installer.php:589 — Installer.sophisticatedInstall has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (5 pts), ternaries 1 (4 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Installer.getDestinationIssue (cognitive 28) · ×1
  • Installer.getDestinationIssue (cognitive 28) system/src/Grav/Common/GPM/Installer.php:796 — Installer.getDestinationIssue has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 10, loops 3 (4 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Grav.getRedirectResponse (cognitive 28) · ×1
  • Grav.getRedirectResponse (cognitive 28) system/src/Grav/Common/Grav.php:652 — Grav.getRedirectResponse has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParsedownExtra.renderMarkdownElements (cognitive 28) · ×1
  • ParsedownExtra.renderMarkdownElements (cognitive 28) system/src/Grav/Common/Markdown/ParsedownExtra.php:339 — ParsedownExtra.renderMarkdownElements has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (4 pts), boolean chains 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 · Excerpts.processImageExcerpt (cognitive 28) · ×1
  • Excerpts.processImageExcerpt (cognitive 28) system/src/Grav/Common/Page/Markdown/Excerpts.php:192 — Excerpts.processImageExcerpt has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 8, 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 · Pages.evaluate (cognitive 28) · ×1
  • Pages.evaluate (cognitive 28) system/src/Grav/Common/Page/Pages.php:893 — Pages.evaluate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 3 (6 pts), boolean chains 4, loops 1 (2 pts), 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 · Security.planSandboxDefaultsMigration (cognitive 28) · ×1
  • Security.planSandboxDefaultsMigration (cognitive 28) system/src/Grav/Common/Security.php:967 — Security.planSandboxDefaultsMigration has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Validation.validate (cognitive 27) · ×1
  • Validation.validate (cognitive 27) system/src/Grav/Common/Data/Validation.php:65 — Validation.validate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8, ternaries 3 (5 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParsedownGravTrait.__call (cognitive 27) · ×1
  • ParsedownGravTrait.__call (cognitive 27) system/src/Grav/Common/Markdown/ParsedownGravTrait.php:1031 — ParsedownGravTrait.__call has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 3 (11 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PreflightCommand.serve (cognitive 27) · ×1
  • PreflightCommand.serve (cognitive 27) system/src/Grav/Console/Gpm/PreflightCommand.php:21 — PreflightCommand.serve has cognitive complexity 27 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 8 (10 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
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 11 (19 pts), error handling 2 (5 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 15 (19 pts), 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 · Uri.init (cognitive 26) · ×1
  • Uri.init (cognitive 26) system/src/Grav/Common/Uri.php:157 — Uri.init has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 4, ternaries 3 (4 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PageStorage.getIndexMeta (cognitive 25) · ×1
  • PageStorage.getIndexMeta (cognitive 25) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:772 — PageStorage.getIndexMeta has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaObjectTrait.parsedownElement (cognitive 25) · ×1
  • MediaObjectTrait.parsedownElement (cognitive 25) system/src/Grav/Common/Media/Traits/MediaObjectTrait.php:260 — MediaObjectTrait.parsedownElement has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 1 (2 pts), 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:1125 — Job.runWithRetry has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (21 pts), error handling 1 (2 pts), 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:1113 — Uri.convertUrlOld has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FlexObject.render (cognitive 25) · ×1
  • FlexObject.render (cognitive 25) system/src/Grav/Framework/Flex/FlexObject.php:543 — FlexObject.render has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 3 (4 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageAuthorsTrait.isAuthorizedByGroup (cognitive 25) · ×1
  • PageAuthorsTrait.isAuthorizedByGroup (cognitive 25) system/src/Grav/Framework/Flex/Pages/Traits/PageAuthorsTrait.php:170 — PageAuthorsTrait.isAuthorizedByGroup has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 8 (20 pts), ternaries 1 (3 pts), 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 · Grav.shutdown (cognitive 24) · ×1
  • Grav.shutdown (cognitive 24) system/src/Grav/Common/Grav.php:830 — Grav.shutdown has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ImageMediaTrait.saveImage (cognitive 24) · ×1
  • ImageMediaTrait.saveImage (cognitive 24) system/src/Grav/Common/Media/Traits/ImageMediaTrait.php:666 — ImageMediaTrait.saveImage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7, ternaries 2 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Pages.accessLevels (cognitive 24) · ×1
  • Pages.accessLevels (cognitive 24) system/src/Grav/Common/Page/Pages.php:1929 — Pages.accessLevels has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (11 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Plugins.init (cognitive 24) · ×1
  • Plugins.init (cognitive 24) system/src/Grav/Common/Plugins.php:229 — Plugins.init has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 1 (4 pts), 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 · GravExtension.arrayGroupByFilter (cognitive 24) · ×1
  • GravExtension.arrayGroupByFilter (cognitive 24) system/src/Grav/Common/Twig/Extension/GravExtension.php:1577 — GravExtension.arrayGroupByFilter has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), 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 · FlexCollection.render (cognitive 24) · ×1
  • FlexCollection.render (cognitive 24) system/src/Grav/Framework/Flex/FlexCollection.php:369 — FlexCollection.render has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, ternaries 3 (4 pts), error handling 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Validation.typeArray (cognitive 23) · ×1
  • Validation.typeArray (cognitive 23) system/src/Grav/Common/Data/Validation.php:1037 — Validation.typeArray has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 8 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Installer.extractStreamed (cognitive 23) · ×1
  • Installer.extractStreamed (cognitive 23) system/src/Grav/Common/GPM/Installer.php:378 — Installer.extractStreamed has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Page.moduleOutputCacheId (cognitive 23) · ×1
  • Page.moduleOutputCacheId (cognitive 23) system/src/Grav/Common/Page/Page.php:1353 — Page.moduleOutputCacheId has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (9 pts), ternaries 2, loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Pages.getList (cognitive 23) · ×1
  • Pages.getList (cognitive 23) system/src/Grav/Common/Page/Pages.php:1758 — Pages.getList has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pages.getTypes (cognitive 23) · ×1
  • Pages.getTypes (cognitive 23) system/src/Grav/Common/Page/Pages.php:1803 — Pages.getTypes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageIdsCommand.serve (cognitive 23) · ×1
  • PageIdsCommand.serve (cognitive 23) system/src/Grav/Console/Cli/PageIdsCommand.php:36 — PageIdsCommand.serve has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (10 pts), loops 4 (6 pts), if/else 4 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstallCommand.installDependencies (cognitive 23) · ×1
  • InstallCommand.installDependencies (cognitive 23) system/src/Grav/Console/Gpm/InstallCommand.php:301 — InstallCommand.installDependencies has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (6 pts), loops 2 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 7 (16 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AssetUtilsTrait.gatherLinks (cognitive 22) · ×1
  • AssetUtilsTrait.gatherLinks (cognitive 22) system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php:71 — AssetUtilsTrait.gatherLinks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Validation.filterArray (cognitive 22) · ×1
  • Validation.filterArray (cognitive 22) system/src/Grav/Common/Data/Validation.php:1120 — Validation.filterArray has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, loops 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Debugger.addMessage (cognitive 22) · ×1
  • Debugger.addMessage (cognitive 22) system/src/Grav/Common/Debugger.php:1017 — Debugger.addMessage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (22 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZipArchiver.compress (cognitive 22) · ×1
  • ZipArchiver.compress (cognitive 22) system/src/Grav/Common/Filesystem/ZipArchiver.php:269 — ZipArchiver.compress has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 8 (18 pts), 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 · 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 6 (13 pts), ternaries 2 (4 pts), loops 1 (3 pts), 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 · PageIdentity.assignAll (cognitive 22) · ×1
  • PageIdentity.assignAll (cognitive 22) system/src/Grav/Common/Page/PageIdentity.php:455 — PageIdentity.assignAll has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pages.resolvePagesHash (cognitive 22) · ×1
  • Pages.resolvePagesHash (cognitive 22) system/src/Grav/Common/Page/Pages.php:3168 — Pages.resolvePagesHash has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (4 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InitializeProcessor.initializeConfig (cognitive 22) · ×1
  • InitializeProcessor.initializeConfig (cognitive 22) system/src/Grav/Common/Processors/InitializeProcessor.php:191 — InitializeProcessor.initializeConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JobHistory.searchHistory (cognitive 22) · ×1
  • JobHistory.searchHistory (cognitive 22) system/src/Grav/Common/Scheduler/JobHistory.php:334 — JobHistory.searchHistory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), 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 · SessionServiceProvider.register (cognitive 22) · ×1
  • SessionServiceProvider.register (cognitive 22) system/src/Grav/Common/Service/SessionServiceProvider.php:35 — SessionServiceProvider.register has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 8, 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 · Session.getFlashObject (cognitive 22) · ×1
  • Session.getFlashObject (cognitive 22) system/src/Grav/Common/Session.php:345 — Session.getFlashObject has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (6 pts), error handling 1 (4 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 6 (14 pts), if/else 4, boolean chains 2, ternaries 1 (2 pts) (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.ip (cognitive 22) · ×1
  • Uri.ip (cognitive 22) system/src/Grav/Common/Uri.php:710 — Uri.ip has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, ternaries 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Assets.splitPipelineAssetsByAttribute (cognitive 21) · ×1
  • Assets.splitPipelineAssetsByAttribute (cognitive 21) system/src/Grav/Common/Assets.php:742 — Assets.splitPipelineAssetsByAttribute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (4 pts), 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 · Setup.isStreamFolder (cognitive 21) · ×1
  • Setup.isStreamFolder (cognitive 21) system/src/Grav/Common/Config/Setup.php:325 — Setup.isStreamFolder has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageObject.isAuthorizedByChildren (cognitive 21) · ×1
  • PageObject.isAuthorizedByChildren (cognitive 21) system/src/Grav/Common/Flex/Types/Pages/PageObject.php:486 — PageObject.isAuthorizedByChildren has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 2 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 7 (10 pts), ternaries 4 (7 pts), 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 · LogRotator.rotate (cognitive 21) · ×1
  • LogRotator.rotate (cognitive 21) system/src/Grav/Common/Log/LogRotator.php:112 — LogRotator.rotate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, error handling 1, 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 · Page.summary (cognitive 21) · ×1
  • Page.summary (cognitive 21) system/src/Grav/Common/Page/Page.php:872 — Page.summary has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Page.doReorder (cognitive 21) · ×1
  • Page.doReorder (cognitive 21) system/src/Grav/Common/Page/Page.php:3367 — Page.doReorder has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · JobHistory.getJobStatistics (cognitive 21) · ×1
  • JobHistory.getJobStatistics (cognitive 21) system/src/Grav/Common/Scheduler/JobHistory.php:226 — JobHistory.getJobStatistics has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), 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:519 — SelfupgradeCommand.upgrade has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (10 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageLegacyTrait.copy (cognitive 21) · ×1
  • PageLegacyTrait.copy (cognitive 21) system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:308 — PageLegacyTrait.copy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 4 (6 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 6 (10 pts), boolean chains 5, ternaries 1 (3 pts), 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 · Pipeline.renderCss (cognitive 20) · ×1
  • Pipeline.renderCss (cognitive 20) system/src/Grav/Common/Assets/Pipeline.php:132 — Pipeline.renderCss has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompiledLanguages.loadLanguage (cognitive 20) · ×1
  • CompiledLanguages.loadLanguage (cognitive 20) system/src/Grav/Common/Config/CompiledLanguages.php:154 — CompiledLanguages.loadLanguage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Blueprint.init (cognitive 20) · ×1
  • Blueprint.init (cognitive 20) system/src/Grav/Common/Data/Blueprint.php:266 — Blueprint.init has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Blueprint.getFiles (cognitive 20) · ×1
  • Blueprint.getFiles (cognitive 20) system/src/Grav/Common/Data/Blueprint.php:823 — Blueprint.getFiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GPM.filterDependenciesForGeneration (cognitive 20) · ×1
  • GPM.filterDependenciesForGeneration (cognitive 20) system/src/Grav/Common/GPM/GPM.php:1391 — GPM.filterDependenciesForGeneration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Language.translate (cognitive 20) · ×1
  • Language.translate (cognitive 20) system/src/Grav/Common/Language/Language.php:530 — Language.translate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorImageMedium.__construct (cognitive 20) · ×1
  • VectorImageMedium.__construct (cognitive 20) system/src/Grav/Common/Page/Medium/VectorImageMedium.php:27 — VectorImageMedium.__construct has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, ternaries 2 (3 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · PageIdentity.pageFolders (cognitive 20) · ×1
  • PageIdentity.pageFolders (cognitive 20) system/src/Grav/Common/Page/PageIdentity.php:503 — PageIdentity.pageFolders has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Scheduler.loadSavedJobs (cognitive 20) · ×1
  • Scheduler.loadSavedJobs (cognitive 20) system/src/Grav/Common/Scheduler/Scheduler.php:132 — Scheduler.loadSavedJobs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Security.recordTwigContentEvent (cognitive 20) · ×1
  • Security.recordTwigContentEvent (cognitive 20) system/src/Grav/Common/Security.php:1497 — Security.recordTwigContentEvent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), 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 · Security.getNonceKey (cognitive 20) · ×1
  • Security.getNonceKey (cognitive 20) system/src/Grav/Common/Security.php:2197 — Security.getNonceKey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, ternaries 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UserCollection.find (cognitive 20) · ×1
  • UserCollection.find (cognitive 20) system/src/Grav/Common/User/DataUser/UserCollection.php:89 — UserCollection.find has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (6 pts), 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:1550 — Utils.arrayUnflattenDotNotation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdateCommand.reportSkippedSymlinks (cognitive 20) · ×1
  • UpdateCommand.reportSkippedSymlinks (cognitive 20) system/src/Grav/Console/Gpm/UpdateCommand.php:289 — UpdateCommand.reportSkippedSymlinks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 5, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ObjectExpressionVisitor.getObjectFieldValue (cognitive 20) · ×1
  • ObjectExpressionVisitor.getObjectFieldValue (cognitive 20) system/src/Grav/Framework/Object/Collection/ObjectExpressionVisitor.php:46 — ObjectExpressionVisitor.getObjectFieldValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Assets.add (cognitive 19) · ×1
  • Assets.add (cognitive 19) system/src/Grav/Common/Assets.php:282 — Assets.add has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Assets.addTypeNow (cognitive 19) · ×1
  • Assets.addTypeNow (cognitive 19) system/src/Grav/Common/Assets.php:359 — Assets.addTypeNow has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pipeline.renderJs (cognitive 19) · ×1
  • Pipeline.renderJs (cognitive 19) system/src/Grav/Common/Assets/Pipeline.php:213 — Pipeline.renderJs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Setup.check (cognitive 19) · ×1
  • Setup.check (cognitive 19) system/src/Grav/Common/Config/Setup.php:471 — Setup.check has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts), boolean chains 1, 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 · BlueprintSchema.checkRequired (cognitive 19) · ×1
  • BlueprintSchema.checkRequired (cognitive 19) system/src/Grav/Common/Data/BlueprintSchema.php:467 — BlueprintSchema.checkRequired has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), 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 · PageObject.isAuthorizedOverride (cognitive 19) · ×1
  • PageObject.isAuthorizedOverride (cognitive 19) system/src/Grav/Common/Flex/Types/Pages/PageObject.php:428 — PageObject.isAuthorizedOverride has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 7 (13 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Inflector.singularize) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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 7 (13 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Inflector.pluralize) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · MediaUploadTrait.doRemove (cognitive 19) · ×1
  • MediaUploadTrait.doRemove (cognitive 19) system/src/Grav/Common/Media/Traits/MediaUploadTrait.php:558 — MediaUploadTrait.doRemove has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), 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 · Page.httpHeaders (cognitive 19) · ×1
  • Page.httpHeaders (cognitive 19) system/src/Grav/Common/Page/Page.php:785 — Page.httpHeaders has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Job.run (cognitive 19) · ×1
  • Job.run (cognitive 19) system/src/Grav/Common/Scheduler/Job.php:542 — Job.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigServiceProvider.loadCachedFileList (cognitive 19) · ×1
  • ConfigServiceProvider.loadCachedFileList (cognitive 19) system/src/Grav/Common/Service/ConfigServiceProvider.php:270 — ConfigServiceProvider.loadCachedFileList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Themes.initTheme (cognitive 19) · ×1
  • Themes.initTheme (cognitive 19) system/src/Grav/Common/Themes.php:72 — Themes.initTheme has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 8 (12 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Uri.isExternal (cognitive 19) · ×1
  • Uri.isExternal (cognitive 19) system/src/Grav/Common/Uri.php:808 — Uri.isExternal has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 17, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · InstallCommand.installDemoContent (cognitive 19) · ×1
  • InstallCommand.installDemoContent (cognitive 19) system/src/Grav/Console/Gpm/InstallCommand.php:401 — InstallCommand.installDemoContent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 1 (3 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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 8 (12 pts), ternaries 1 (3 pts), 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:450 — FlexPageObject.filterElements has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 3 (8 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · UserObject.authorize (cognitive 18) · ×1
  • UserObject.authorize (cognitive 18) system/src/Grav/Common/Flex/Types/Users/UserObject.php:272 — UserObject.authorize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaObjectTrait.getThumbnail (cognitive 18) · ×1
  • MediaObjectTrait.getThumbnail (cognitive 18) system/src/Grav/Common/Media/Traits/MediaObjectTrait.php:741 — MediaObjectTrait.getThumbnail has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 1 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownOutput.links (cognitive 18) · ×1
  • MarkdownOutput.links (cognitive 18) system/src/Grav/Common/Page/Markdown/MarkdownOutput.php:236 — MarkdownOutput.links has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GlobalMedia.addMedium (cognitive 18) · ×1
  • GlobalMedia.addMedium (cognitive 18) system/src/Grav/Common/Page/Medium/GlobalMedia.php:197 — GlobalMedia.addMedium has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (2 pts), 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 · JobQueue.reconstructJob (cognitive 18) · ×1
  • JobQueue.reconstructJob (cognitive 18) system/src/Grav/Common/Scheduler/JobQueue.php:471 — JobQueue.reconstructJob has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GravExtension.exifFunc (cognitive 18) · ×1
  • GravExtension.exifFunc (cognitive 18) system/src/Grav/Common/Twig/Extension/GravExtension.php:1872 — GravExtension.exifFunc has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
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 7 (11 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Uri.createFromEnvironment (cognitive 18) · ×1
  • Uri.createFromEnvironment (cognitive 18) system/src/Grav/Common/Uri.php:1324 — Uri.createFromEnvironment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, ternaries 4 (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 · Uri.post (cognitive 18) · ×1
  • Uri.post (cognitive 18) system/src/Grav/Common/Uri.php:1472 — Uri.post has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 1 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 11 (17 pts), 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 8 (11 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 6 (10 pts), 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 · Pipeline.gatherAndMinifyCss (cognitive 17) · ×1
  • Pipeline.gatherAndMinifyCss (cognitive 17) system/src/Grav/Common/Assets/Pipeline.php:528 — Pipeline.gatherAndMinifyCss has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Pipeline.gatherAndMinifyJs) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Pipeline.gatherAndMinifyJs (cognitive 17) · ×1
  • Pipeline.gatherAndMinifyJs (cognitive 17) system/src/Grav/Common/Assets/Pipeline.php:599 — Pipeline.gatherAndMinifyJs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Pipeline.gatherAndMinifyCss) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · Backups.backup (cognitive 17) · ×1
  • Backups.backup (cognitive 17) system/src/Grav/Common/Backup/Backups.php:229 — Backups.backup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 6, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Env.load (cognitive 17) · ×1
  • Env.load (cognitive 17) system/src/Grav/Common/Config/Env.php:90 — Env.load has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Debugger.addAssets (cognitive 17) · ×1
  • Debugger.addAssets (cognitive 17) system/src/Grav/Common/Debugger.php:658 — Debugger.addAssets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageStorage.assertValidPageKeys (cognitive 17) · ×1
  • PageStorage.assertValidPageKeys (cognitive 17) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:521 — PageStorage.assertValidPageKeys has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), loops 2, ternaries 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UserObject.save (cognitive 17) · ×1
  • UserObject.save (cognitive 17) system/src/Grav/Common/Flex/Types/Users/UserObject.php:622 — UserObject.save has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Installer.mergeInstall (cognitive 17) · ×1
  • Installer.mergeInstall (cognitive 17) system/src/Grav/Common/GPM/Installer.php:705 — Installer.mergeInstall has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 1 (3 pts), 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 · AbstractMedia.getFileParts (cognitive 17) · ×1
  • AbstractMedia.getFileParts (cognitive 17) system/src/Grav/Common/Page/Medium/AbstractMedia.php:614 — AbstractMedia.getFileParts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pages.listFolder (cognitive 17) · ×1
  • Pages.listFolder (cognitive 17) system/src/Grav/Common/Page/Pages.php:2653 — Pages.listFolder has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 3 (9 pts), if/else 6 (7 pts), 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:2147 — Security.splitMethodNames has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GravExtension.dump (cognitive 17) · ×1
  • GravExtension.dump (cognitive 17) system/src/Grav/Common/Twig/Extension/GravExtension.php:1444 — GravExtension.dump has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GravExtension.themeVarGuarded (cognitive 17) · ×1
  • GravExtension.themeVarGuarded (cognitive 17) system/src/Grav/Common/Twig/Extension/GravExtension.php:2055 — GravExtension.themeVarGuarded has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TwigEnvironment.includeFromContent (cognitive 17) · ×1
  • TwigEnvironment.includeFromContent (cognitive 17) system/src/Grav/Common/Twig/TwigEnvironment.php:183 — TwigEnvironment.includeFromContent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1, 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 · 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 3 (9 pts), loops 2 (6 pts), 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 8 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SelfupgradeCommand.upgradeGrav (cognitive 17) · ×1
  • SelfupgradeCommand.upgradeGrav (cognitive 17) system/src/Grav/Console/Gpm/SelfupgradeCommand.php:619 — SelfupgradeCommand.upgradeGrav has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdateCommand.userInputPackages (cognitive 17) · ×1
  • UpdateCommand.userInputPackages (cognitive 17) system/src/Grav/Console/Gpm/UpdateCommand.php:317 — UpdateCommand.userInputPackages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlexDirectory.loadIndex (cognitive 17) · ×1
  • FlexDirectory.loadIndex (cognitive 17) system/src/Grav/Framework/Flex/FlexDirectory.php:1112 — FlexDirectory.loadIndex has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (5 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 7 (12 pts), loops 1 (3 pts), 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 5 (14 pts), 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:455 — FlexMediaTrait.addUpdatedMedia has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.regenerateId (cognitive 17) · ×1
  • Session.regenerateId (cognitive 17) system/src/Grav/Framework/Session/Session.php:428 — Session.regenerateId has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Blueprint.loadImport (cognitive 16) · ×1
  • Blueprint.loadImport (cognitive 16) system/src/Grav/Common/Data/Blueprint.php:437 — Blueprint.loadImport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, ternaries 5 (6 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Validation.checkSafety (cognitive 16) · ×1
  • Validation.checkSafety (cognitive 16) system/src/Grav/Common/Data/Validation.php:142 — Validation.checkSafety has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Debugger.debuggerRequest (cognitive 16) · ×1
  • Debugger.debuggerRequest (cognitive 16) system/src/Grav/Common/Debugger.php:356 — Debugger.debuggerRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, ternaries 3 (5 pts), boolean chains 3, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PageObject.filterElements (cognitive 16) · ×1
  • PageObject.filterElements (cognitive 16) system/src/Grav/Common/Flex/Types/Pages/PageObject.php:898 — PageObject.filterElements has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UserObject.isAuthorizedOverride (cognitive 16) · ×1
  • UserObject.isAuthorizedOverride (cognitive 16) system/src/Grav/Common/Flex/Types/Users/UserObject.php:860 — UserObject.isAuthorizedOverride has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7 (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 · GPM.findPackages (cognitive 16) · ×1
  • GPM.findPackages (cognitive 16) system/src/Grav/Common/GPM/GPM.php:900 — GPM.findPackages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Collection.filterByPageFlag (cognitive 16) · ×1
  • Collection.filterByPageFlag (cognitive 16) system/src/Grav/Common/Page/Collection.php:420 — Collection.filterByPageFlag has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, 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 · ImageMedium.__call (cognitive 16) · ×1
  • ImageMedium.__call (cognitive 16) system/src/Grav/Common/Page/Medium/ImageMedium.php:492 — ImageMedium.__call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Page.url (cognitive 16) · ×1
  • Page.url (cognitive 16) system/src/Grav/Common/Page/Page.php:2424 — Page.url has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, ternaries 3 (4 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PageIdentity.scan (cognitive 16) · ×1
  • PageIdentity.scan (cognitive 16) system/src/Grav/Common/Page/PageIdentity.php:405 — PageIdentity.scan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pages.referrerRoute (cognitive 16) · ×1
  • Pages.referrerRoute (cognitive 16) system/src/Grav/Common/Page/Pages.php:252 — Pages.referrerRoute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), boolean chains 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 · Pages.findSiteBasedRoute (cognitive 16) · ×1
  • Pages.findSiteBasedRoute (cognitive 16) system/src/Grav/Common/Page/Pages.php:1372 — Pages.findSiteBasedRoute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Pages.loadCachedPages (cognitive 16) · ×1
  • Pages.loadCachedPages (cognitive 16) system/src/Grav/Common/Page/Pages.php:2310 — Pages.loadCachedPages has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 5, boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Security.normalizeMethodsMap (cognitive 16) · ×1
  • Security.normalizeMethodsMap (cognitive 16) system/src/Grav/Common/Security.php:2096 — Security.normalizeMethodsMap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), 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 · RequestServiceProvider.register (cognitive 16) · ×1
  • RequestServiceProvider.register (cognitive 16) system/src/Grav/Common/Service/RequestServiceProvider.php:37 — RequestServiceProvider.register has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 1 (3 pts), loops 1 (2 pts), ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Themes.configure (cognitive 16) · ×1
  • Themes.configure (cognitive 16) system/src/Grav/Common/Themes.php:338 — Themes.configure has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GravExtension.nicetimeFunc (cognitive 16) · ×1
  • GravExtension.nicetimeFunc (cognitive 16) system/src/Grav/Common/Twig/Extension/GravExtension.php:994 — GravExtension.nicetimeFunc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), 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:1666 — GravExtension.authorize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), 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 4 (8 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 4 (10 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 4 (10 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 5 (12 pts), loops 1 (4 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (JsonFormatter.getDecodeOptions) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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 5 (12 pts), loops 1 (4 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (JsonFormatter.getEncodeOptions) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
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 8 (12 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlexDirectory.dynamicFlexField (cognitive 16) · ×1
  • FlexDirectory.dynamicFlexField (cognitive 16) system/src/Grav/Framework/Flex/FlexDirectory.php:1000 — FlexDirectory.dynamicFlexField has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, ternaries 1 (2 pts) (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 · 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 8 (11 pts), 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 · PageRoutableTrait.url (cognitive 16) · ×1
  • PageRoutableTrait.url (cognitive 16) system/src/Grav/Framework/Flex/Pages/Traits/PageRoutableTrait.php:126 — PageRoutableTrait.url has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, ternaries 3 (4 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
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 4 (8 pts), if/else 4 (7 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Install.detectPsrLogConflicts (cognitive 16) · ×1
  • Install.detectPsrLogConflicts (cognitive 16) system/src/Grav/Installer/Install.php:945 — Install.detectPsrLogConflicts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), 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:988 — Install.detectMonologConflicts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (39 shared lines) · ×1
  • Near-duplicate member pair (39 shared lines) system/src/Grav/Common/Twig/Node/TwigNodeLink.php:54 — system/src/Grav/Common/Twig/Node/TwigNodeLink.php:54-112 | system/src/Grav/Common/Twig/Node/TwigNodeStyle.php:54-131 — These two members are variants of one another: 39 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) system/src/Grav/Common/Inflector.php:65 — system/src/Grav/Common/Inflector.php:65-97 | system/src/Grav/Common/Inflector.php:110-142 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (4 members, 50+ identical tokens) system/src/Grav/Common/Twig/TokenParser/TwigTokenParserLink.php:65 — system/src/Grav/Common/Twig/TokenParser/TwigTokenParserLink.php:65-97 | system/src/Grav/Common/Twig/TokenParser/TwigTokenParserRender.php:45-62 | system/src/Grav/Common/Twig/TokenParser/TwigTokenParserScript.php:64-111 | system/src/Grav/Common/Twig/TokenParser/TwigTokenParserStyle.php:57-98 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×1
  • Duplicated block (40 lines × 2) system/src/Grav/Common/Scheduler/JobQueue.php:142 — system/src/Grav/Common/Scheduler/JobQueue.php:142-181 | system/src/Grav/Common/Scheduler/JobQueue.php:209-248 — 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:142` 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 (39–40 lines × 2) · ×1
  • Duplicated block (39–40 lines × 2) system/src/Grav/Framework/Flex/FlexCollection.php:402 — system/src/Grav/Framework/Flex/FlexCollection.php:402-440 | system/src/Grav/Framework/Flex/FlexObject.php:581-620 — before extracting anything, compare `system/src/Grav/Framework/Flex/FlexCollection.php` and `system/src/Grav/Framework/Flex/FlexObject.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `system/src/Grav/Framework/Flex/FlexCollection.php:402` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `system/src/Grav/Framework/Flex/FlexObject.php:621` calls `getKey` and `system/src/Grav/Framework/Flex/FlexCollection.php:441` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) system/src/Grav/Common/GPM/GPM.php:301 — system/src/Grav/Common/GPM/GPM.php:301-337 | system/src/Grav/Common/GPM/GPM.php:446-482 — 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 (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) system/src/Grav/Common/Page/Page.php:2431 — system/src/Grav/Common/Page/Page.php:2431-2466 | system/src/Grav/Framework/Flex/Pages/Traits/PageRoutableTrait.php:134-169 — 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 (28–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) system/src/Grav/Framework/Controller/Traits/ControllerResponseTrait.php:215 — system/src/Grav/Framework/Controller/Traits/ControllerResponseTrait.php:215-243 | system/src/Grav/Framework/RequestHandler/Middlewares/Exceptions.php:43-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 (27–28 lines × 3) · ×1
  • Duplicated block (27–28 lines × 3) system/src/Grav/Common/Assets/Pipeline.php:537 — system/src/Grav/Common/Assets/Pipeline.php:537-563 | system/src/Grav/Common/Assets/Pipeline.php:608-634 | system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php:75-102 — there are 3 copies across 2 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 3 sites; resolving a subset leaves the remainder to drift apart. 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 (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) system/src/Grav/Common/Inflector.php:68 — system/src/Grav/Common/Inflector.php:68-95 | system/src/Grav/Common/Inflector.php:113-140 — 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 runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (48 lines × 2) · ×1
  • Duplicated block (48 lines × 2) system/src/Grav/Common/Twig/Node/TwigNodeScript.php:55 — system/src/Grav/Common/Twig/Node/TwigNodeScript.php:55-102 | system/src/Grav/Common/Twig/Node/TwigNodeStyle.php:54-101 — before extracting anything, compare `system/src/Grav/Common/Twig/Node/TwigNodeScript.php` and `system/src/Grav/Common/Twig/Node/TwigNodeStyle.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `system/src/Grav/Common/Twig/Node/TwigNodeScript.php:55` 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 (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) system/src/Grav/Common/GPM/Local/Package.php:92 — system/src/Grav/Common/GPM/Local/Package.php:92-113 | system/src/Grav/Installer/Install.php:1203-1224 — 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 (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) system/src/Grav/Framework/Flex/FlexCollection.php:707 — system/src/Grav/Framework/Flex/FlexCollection.php:707-728 | system/src/Grav/Framework/Flex/FlexObject.php:1167-1187 — before extracting anything, compare `system/src/Grav/Framework/Flex/FlexCollection.php` and `system/src/Grav/Framework/Flex/FlexObject.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) system/src/Grav/Common/Flex/Types/Pages/Traits/PageRoutableTrait.php:101 — system/src/Grav/Common/Flex/Types/Pages/Traits/PageRoutableTrait.php:101-121 | system/src/Grav/Common/Page/Page.php:3111-3131 | system/src/Grav/Framework/Flex/Pages/Traits/PageRoutableTrait.php:522-542 — 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. 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 (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) system/src/Grav/Framework/Flex/FlexCollection.php:615 — system/src/Grav/Framework/Flex/FlexCollection.php:615-635 | system/src/Grav/Framework/Flex/FlexObject.php:1049-1069 — before extracting anything, compare `system/src/Grav/Framework/Flex/FlexCollection.php` and `system/src/Grav/Framework/Flex/FlexObject.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) system/src/Grav/Common/Security.php:190 — system/src/Grav/Common/Security.php:190-209 | system/src/Grav/Common/Security.php:1752-1768 — 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:190` 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 (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) system/src/Grav/Common/Scheduler/Scheduler.php:1289 — system/src/Grav/Common/Scheduler/Scheduler.php:1289-1306 | system/src/Grav/Common/Scheduler/Scheduler.php:1397-1412 — 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:1289` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–17 lines × 2) · ×1
  • Duplicated block (12–17 lines × 2) system/src/Grav/Common/Page/Page.php:839 — system/src/Grav/Common/Page/Page.php:839-855 | system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:180-191 — before extracting anything, compare `system/src/Grav/Common/Page/Page.php` and `system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php:179` calls `instance` and `system/src/Grav/Common/Page/Page.php:836` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) system/src/Grav/Common/Twig/TokenParser/TwigTokenParserLink.php:81 — system/src/Grav/Common/Twig/TokenParser/TwigTokenParserLink.php:81-95 | system/src/Grav/Common/Twig/TokenParser/TwigTokenParserScript.php:95-109 | system/src/Grav/Common/Twig/TokenParser/TwigTokenParserStyle.php:82-96 — before extracting anything, compare `system/src/Grav/Common/Twig/TokenParser/TwigTokenParserScript.php` and `system/src/Grav/Common/Twig/TokenParser/TwigTokenParserStyle.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `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 (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) system/src/Grav/Common/Twig/Node/TwigNodeScript.php:104 — system/src/Grav/Common/Twig/Node/TwigNodeScript.php:104-117 | system/src/Grav/Common/Twig/Node/TwigNodeScript.php:126-140 — 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/Node/TwigNodeScript.php:104` 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 (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 (14 lines × 2) · ×1
  • Duplicated block (14 lines × 2) system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:492 — system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php:492-505 | system/src/Grav/Framework/Flex/Storage/FolderStorage.php:456-469 — 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:492` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) system/src/Grav/Common/Service/ConfigServiceProvider.php:355 — system/src/Grav/Common/Service/ConfigServiceProvider.php:355-367 | system/src/Grav/Common/Service/ConfigServiceProvider.php:385-397 | system/src/Grav/Common/Service/ConfigServiceProvider.php:401-413 — 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:355` 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 (12 lines × 5) · ×1
  • Duplicated block (12 lines × 5) system/src/Grav/Common/Twig/Node/TwigNodeLink.php:73 — system/src/Grav/Common/Twig/Node/TwigNodeLink.php:73-84 | system/src/Grav/Common/Twig/Node/TwigNodeScript.php:58-69 | system/src/Grav/Common/Twig/Node/TwigNodeScript.php:72-83 | system/src/Grav/Common/Twig/Node/TwigNodeStyle.php:57-68 | system/src/Grav/Common/Twig/Node/TwigNodeStyle.php:71-82 — before extracting anything, compare `system/src/Grav/Common/Twig/Node/TwigNodeLink.php` and `system/src/Grav/Common/Twig/Node/TwigNodeStyle.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) system/src/Grav/Common/Twig/TokenParser/TwigTokenParserLink.php:84 — system/src/Grav/Common/Twig/TokenParser/TwigTokenParserLink.php:84-95 | system/src/Grav/Common/Twig/TokenParser/TwigTokenParserRender.php:49-60 | system/src/Grav/Common/Twig/TokenParser/TwigTokenParserScript.php:98-109 | system/src/Grav/Common/Twig/TokenParser/TwigTokenParserStyle.php:85-96 — before extracting anything, compare `system/src/Grav/Common/Twig/TokenParser/TwigTokenParserScript.php` and `system/src/Grav/Common/Twig/TokenParser/TwigTokenParserStyle.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–11 lines × 6) · ×1
  • Duplicated block (10–11 lines × 6) system/src/Grav/Common/Twig/Node/TwigNodeLink.php:60 — system/src/Grav/Common/Twig/Node/TwigNodeLink.php:60-70 | system/src/Grav/Common/Twig/Node/TwigNodeLink.php:72-81 | system/src/Grav/Common/Twig/Node/TwigNodeScript.php:57-66 | system/src/Grav/Common/Twig/Node/TwigNodeScript.php:71-80 | system/src/Grav/Common/Twig/Node/TwigNodeStyle.php:56-65 | system/src/Grav/Common/Twig/Node/TwigNodeStyle.php:70-79 — before extracting anything, compare `system/src/Grav/Common/Twig/Node/TwigNodeLink.php` and `system/src/Grav/Common/Twig/Node/TwigNodeStyle.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `system/src/Grav/Common/Twig/Node/TwigNodeLink.php:60` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `system/src/Grav/Common/Twig/Node/TwigNodeLink.php:81` calls `write` and `system/src/Grav/Common/Twig/Node/TwigNodeLink.php:70` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) system/src/Grav/Common/Service/ConfigServiceProvider.php:107 — system/src/Grav/Common/Service/ConfigServiceProvider.php:107-114 | system/src/Grav/Common/Service/ConfigServiceProvider.php:149-156 | system/src/Grav/Common/Service/ConfigServiceProvider.php:201-208 — 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:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `system/src/Grav/Common/Service/ConfigServiceProvider.php:199` calls `get` and `system/src/Grav/Common/Service/ConfigServiceProvider.php:104` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) system/src/Grav/Common/Assets/InlineCss.php:27 — system/src/Grav/Common/Assets/InlineCss.php:27-42 | system/src/Grav/Common/Assets/InlineJs.php:27-42 | system/src/Grav/Common/Assets/InlineJsModule.php:27-43 — before extracting anything, compare `system/src/Grav/Common/Assets/InlineJs.php` and `system/src/Grav/Common/Assets/InlineJsModule.php` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `system/src/Grav/Common/Assets/InlineCss.php:27` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×1
  • Duplicated block (7 lines × 5) system/src/Grav/Common/Media/Traits/MediaPlayerTrait.php:27 — system/src/Grav/Common/Media/Traits/MediaPlayerTrait.php:27-33 | system/src/Grav/Common/Media/Traits/MediaPlayerTrait.php:44-50 | system/src/Grav/Common/Media/Traits/MediaPlayerTrait.php:61-67 | system/src/Grav/Common/Media/Traits/MediaPlayerTrait.php:78-84 | system/src/Grav/Common/Media/Traits/VideoMediaTrait.php:42-48 — there are 5 copies across 2 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
X24 · Document value interpolated into markup unescaped · Document value reaches a markup attribute unescaped · ×1
  • Document value reaches a markup attribute unescaped system/assets/debugger/clockwork.js:31 — `route` carries text this program read out of a document — an attribute or a text node, which the DOM hands back already decoded, so an entity its author wrote is a live character again — and it is written straight into the `href` attribute of markup built here with nothing escaping it on the way. The value is chosen by whoever authored that document, not by this program, so it can close the attribute or element it sits in and open another — a crafted document becomes markup in what this code renders. Escape `route` at this site, or validate it against the shape the position accepts before interpolating it.
X3 · Exception handling · Swallowed exception (empty catch) · ×1
  • Swallowed exception (empty catch) system/src/Grav/Framework/Form/FormFlash.php:148 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Minor — 163 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×107
  • Orphaned file system/src/Grav/Framework/ContentBlock/HtmlBlock.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Flex/FlexDirectoryForm.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Flex/Storage/SimpleStorage.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Common/Page/Interfaces/PageLegacyInterface.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Collection/AbstractIndexCollection.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/File/AbstractFile.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Flex/Flex.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Pagination/AbstractPagination.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Psr7/AbstractUri.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Route/Route.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Cache/CacheTrait.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Console/ConsoleTrait.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Psr7/ServerRequest.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Filesystem/Filesystem.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Console/Cli/PageSystemValidatorCommand.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Flex/Pages/Traits/PageTranslateTrait.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Cache/Adapter/FileCache.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Common/Config/ConfigFileFinder.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Common/Page/Interfaces/PageContentInterface.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Object/ObjectIndex.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Installer/Versions.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Flex/Interfaces/FlexObjectInterface.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Psr7/Response.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file system/src/Grav/Framework/Collection/AbstractFileCollection.php:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 82 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate system/src/Grav/Common/GPM/Remote/GravCore.php:91 — `!$cleanVersion || version_compare($diff, $cleanVersion[0], '>=')` appears character-identically in 2 files — system/src/Grav/Common/GPM/Remote/GravCore.php, system/src/Grav/Common/GPM/Remote/Package.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Markdown/Parsedown.php:32 — `!$excerpts || $excerpts instanceof PageInterface || null !== $defaults` appears character-identically in 2 files — system/src/Grav/Common/Markdown/Parsedown.php, system/src/Grav/Common/Markdown/ParsedownExtra.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Page/Medium/ImageMedium.php:62 — `!$path || !file_exists($path) || !filesize($path)` appears character-identically in 2 files — system/src/Grav/Common/Page/Medium/ImageMedium.php, system/src/Grav/Common/Page/Medium/VectorImageMedium.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Console/Gpm/DirectInstallCommand.php:86 — `!Installer::isGravInstance($this->destination) || !Installer::isValidDestination($this->destination, [Installer::EXISTS, Installer::IS_LINK]…` appears character-identically in 2 files — system/src/Grav/Console/Gpm/DirectInstallCommand.php, system/src/Grav/Console/Gpm/InstallCommand.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Flex/Types/Users/UserObject.php:1073 — `!empty($settings['disabled']) || !empty($settings['validate']['ignore'])` appears character-identically in 2 files — system/src/Grav/Common/Flex/Types/Users/UserObject.php, system/src/Grav/Framework/Flex/Traits/FlexMediaTrait.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Installer/Versions.php:308 — `!is_array($current) || !isset($current[$field])` appears character-identically in 2 files — system/src/Grav/Installer/Versions.php, system/src/Grav/Installer/YamlUpdater.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Installer/updates/2.1.0_2026-09-10_0.php:27 — `!is_file($file) || !is_readable($file) || !is_writable($file)` appears character-identically in 5 files — system/src/Grav/Installer/updates/2.1.0_2026-09-10_0.php, system/src/Grav/Installer/updates/2.1.10_2026-09-22_0.php, system/src/Grav/Installer/updates/2.1.8_2026-09-18_0.php, system/src/Grav/Installer/updates/2.2.19_2026-10-31_0.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Data/Validation.php:811 — `!is_string($value) || strlen($value) > Utils::DATE_MAX_LENGTH` appears character-identically in 2 files — system/src/Grav/Common/Data/Validation.php, system/src/Grav/Framework/Flex/Pages/FlexPageObject.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Flex/Types/Pages/PageIndex.php:762 — `!method_exists($storage, 'isIndexed') || !$storage` appears character-identically in 2 files — system/src/Grav/Common/Flex/Types/Pages/PageIndex.php, system/src/Grav/Framework/Flex/FlexIndex.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Flex/Traits/FlexCollectionTrait.php:38 — `!str_starts_with($name, 'onFlexCollection') && str_starts_with($name, 'on')` appears character-identically in 2 files — system/src/Grav/Common/Flex/Traits/FlexCollectionTrait.php, system/src/Grav/Framework/Flex/FlexCollection.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Flex/Traits/FlexObjectTrait.php:49 — `!str_starts_with($name, 'onFlexObject') && str_starts_with($name, 'on')` appears character-identically in 2 files — system/src/Grav/Common/Flex/Traits/FlexObjectTrait.php, system/src/Grav/Framework/Flex/FlexObject.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Filesystem/ZipArchiver.php:235 — `$buffer !== '' && fwrite($out, $buffer) === false` appears character-identically in 2 files — system/src/Grav/Common/Filesystem/ZipArchiver.php, system/src/Grav/Common/GPM/Installer.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Page/Page.php:1005 — `$content_twig_requested && !$content_twig_allowed && !$this` appears character-identically in 2 files — system/src/Grav/Common/Page/Page.php, system/src/Grav/Framework/Flex/Pages/Traits/PageContentTrait.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Page/Page.php:2461 — `$extension !== '' && !$raw_route && $this` appears character-identically in 2 files — system/src/Grav/Common/Page/Page.php, system/src/Grav/Framework/Flex/Pages/Traits/PageRoutableTrait.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Framework/Relationships/ToManyRelationship.php:136 — `$identifier && is_callable([$identifier, 'getObject'])` appears character-identically in 2 files — system/src/Grav/Framework/Relationships/ToManyRelationship.php, system/src/Grav/Framework/Relationships/ToOneRelationship.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Flex/Types/Pages/Traits/PageLegacyTrait.php:151 — `$inheritedParams && is_array($inheritedParams)` appears character-identically in 3 files — system/src/Grav/Common/Flex/Types/Pages/Traits/PageLegacyTrait.php, system/src/Grav/Common/Page/Page.php, system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Page/Page.php:2305 — `$separator && $separator < strlen($key) - 1` appears character-identically in 2 files — system/src/Grav/Common/Page/Page.php, system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Log/LogRotator.php:261 — `$settings === null || !$settings['enabled']` appears character-identically in 2 files — system/src/Grav/Common/Log/LogRotator.php, system/src/Grav/Common/Log/RotatingStreamHandler.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Flex/Types/Pages/PageCollection.php:461 — `(!$start || $date >= $start) && (!$end || $date <= $end)` appears character-identically in 2 files — system/src/Grav/Common/Flex/Types/Pages/PageCollection.php, system/src/Grav/Common/Page/Collection.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Assets/Pipeline.php:549 — `($this->base_url !== '/') && Utils::startsWith($relative_path, $this->base_url)` appears character-identically in 2 files — system/src/Grav/Common/Assets/Pipeline.php, system/src/Grav/Common/Assets/Traits/AssetUtilsTrait.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Framework/Flex/FlexObject.php:888 — `(is_array($current) || $current instanceof ArrayAccess) && isset($current[$offset])` appears character-identically in 2 files — system/src/Grav/Framework/Flex/FlexObject.php, system/src/Grav/Framework/Form/Traits/FormTrait.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Page/Page.php:850 — `MarkdownOutput::enabled() && !$grav['uri']` appears character-identically in 2 files — system/src/Grav/Common/Page/Page.php, system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Flex/Types/UserGroups/UserGroupObject.php:160 — `authorize('admin.super', $scope) === true || $user` appears character-identically in 2 files — system/src/Grav/Common/Flex/Types/UserGroups/UserGroupObject.php, system/src/Grav/Common/Flex/Types/Users/UserObject.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Common/Page/Page.php:2217 — `get('system.strict_mode.twig2_compat', false) || $config` appears character-identically in 2 files — system/src/Grav/Common/Page/Page.php, system/src/Grav/Framework/Flex/Pages/Traits/PageLegacyTrait.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate system/src/Grav/Framework/Psr7/Uri.php:60 — `getPort() === null || GuzzleUri::isDefaultPort($this)` appears character-identically in 2 files — system/src/Grav/Framework/Psr7/Uri.php, system/src/Grav/Framework/Uri/Uri.php. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X4 · Structured logging · Interpolated log message defeats structured logging · ×8
  • Interpolated log message defeats structured logging system/src/Grav/Common/Scheduler/Scheduler.php:404 — `debug` at line 404 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging system/src/Grav/Common/Scheduler/Scheduler.php:422 — `debug` at line 422 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->debug('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::debug('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging system/src/Grav/Common/Scheduler/Scheduler.php:476 — `warning` at line 476 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->warning('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::warning('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging system/src/Grav/Common/Scheduler/Scheduler.php:478 — `info` at line 478 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->info('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::info('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging system/src/Grav/Common/Scheduler/Scheduler.php:1295 — `info` at line 1295 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->info('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::info('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging system/src/Grav/Common/Scheduler/Scheduler.php:1301 — `error` at line 1301 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->error('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::error('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging system/src/Grav/Common/Scheduler/Scheduler.php:1403 — `info` at line 1403 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->info('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::info('order moved', ['order_id' => $orderId])` with Laravel's facade.
  • Interpolated log message defeats structured logging system/src/Grav/Common/Scheduler/Scheduler.php:1408 — `error` at line 1408 is handed a double-quoted string with variables interpolated into it as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values in the PSR-3 context array instead: `$logger->error('Order {order_id} moved to {status}', ['order_id' => $orderId, 'status' => $status])`, which Monolog and every PSR-3 handler keep as fields beside the message (Monolog's PsrLogMessageProcessor fills the placeholders), or `Log::error('order moved', ['order_id' => $orderId])` with Laravel's facade.
X7 · Silent fallback defaults · Silent fallback default in catch · ×7
  • Silent fallback default in catch system/src/Grav/Common/Page/PageIndexStore.php:286 — `readAll` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
  • Silent fallback default in catch system/src/Grav/Common/Page/PageIndexStore.php:326 — `readAllRoutes` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
  • Silent fallback default in catch system/src/Grav/Common/Page/PageIndexStore.php:400 — `readTaxonomyValue` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
  • Silent fallback default in catch system/src/Grav/Common/Page/PageIndexStore.php:422 — `readTaxonomy` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
  • Silent fallback default in catch system/src/Grav/Common/Security.php:1606 — `recentTwigContentEvents` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
  • Silent fallback default in catch system/src/Grav/Common/Security.php:1724 — `resolveTwigContentEvents` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
  • Silent fallback default in catch system/src/Grav/Common/Utils.php:1036 — `getPageFormat` swallows every exception into `return 'html'` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 110 significant file(s) lose their only recent owner: system/src/Grav/Common/Page/Pages.php, system/src/Grav/Common/Page/Page.php, system/src/Grav/Common/Security.php, system/src/Grav/Common/Twig/Extension/GravExtension.php, system/src/Grav/Common/Scheduler/Scheduler.php, system/src/Grav/Common/GPM/GPM.php, system/src/Grav/Common/Data/Validation.php, system/src/Grav/Common/Data/Blueprint.php (+102 more). Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 3 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 (114 single-owned of 293 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 293 of the 539 production source files in this repository met that bar). They are anonymized user #2 (2 file(s)), anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: system/src/Grav/Common/Helpers/LogViewer.php, system/src/Grav/Console/Cli/LogViewerCommand.php, system/src/Grav/Common/Page/Interfaces/PageCollectionInterface.php, system/src/Grav/Common/Media/Traits/MediaPlayerTrait.php.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 107 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: system/src/Grav/Framework/ContentBlock/HtmlBlock.php, system/src/Grav/Framework/Flex/FlexDirectoryForm.php, system/src/Grav/Framework/Flex/Storage/SimpleStorage.php, system/src/Grav/Common/Page/Interfaces/PageLegacyInterface.php, system/src/Grav/Framework/Collection/AbstractIndexCollection.php, system/src/Grav/Framework/File/AbstractFile.php, system/src/Grav/Framework/Flex/Flex.php, system/src/Grav/Framework/Pagination/AbstractPagination.php (and 99 more) (108 orphaned of 293 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 293 of the 539 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, 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.
M2 · Architecture documentation · No architecture diagram/doc · ×1
  • No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
P3 · Security & performance tooling · Dependabot does not watch composer · ×1
  • Dependabot does not watch composer REDACTED:4 — `REDACTED` schedules updates, but no `package-ecosystem` entry covers `composer`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected webserver-configs/nginx.conf:1 — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `nginx.conf` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
X5 · Nullable reference types · PHP static analysis does not check null everywhere · ×1
  • PHP static analysis does not check null everywhere — This repository commits no PHPStan or Psalm configuration (`phpstan.neon[.dist]`, `phpstan.dist.neon`, `psalm.xml[.dist]`, or one a composer.json script names with `--configuration`), so nothing checks null: a `?Customer` reaches `->name()` silently and throws `Error: Call to a member function name() on null` the first time it is null. If the build passes a level on a command line instead, put it in a committed configuration — this check reads configuration, and configuration is all it can read.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×1
  • Silent fallback default on parse failure system/src/Grav/Common/Cache/SymfonyCacheProvider.php:60 — `doFetchMultiple` returns `[]` when `InvalidArgumentException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
Minor — 9 finding(s)
D12 · Dependency Hygiene · Outdated · ×9
  • Outdated: composer/ca-bundle — `composer/ca-bundle` is locked at 1.5.14 but 1.6.1 is the current stable release on Packagist, and it already satisfies the `^1.5` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update composer/ca-bundle` and commit the updated REDACTED.
  • Outdated: composer/semver — `composer/semver` is locked at 3.4.4 but 3.6.0 is the current stable release on Packagist, and it already satisfies the `^3.4` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update composer/semver` and commit the updated REDACTED.
  • Outdated: dragonmantank/cron-expression — `dragonmantank/cron-expression` is locked at v3.6.0 but v3.6.1 is the current stable release on Packagist, and it already satisfies the `^3.3` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update dragonmantank/cron-expression` and commit the updated REDACTED.
  • Outdated: filp/whoops — `filp/whoops` is locked at 2.18.5 but 2.19.3 is the current stable release on Packagist, and it already satisfies the `~2.16` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update filp/whoops` and commit the updated REDACTED.
  • Outdated: league/html-to-markdown — `league/html-to-markdown` is locked at 5.1.2 but 5.2.3 is the current stable release on Packagist, and it already satisfies the `^5.1` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update league/html-to-markdown` and commit the updated REDACTED.
  • Outdated: monolog/monolog — `monolog/monolog` is locked at 3.12.0 but 3.12.1 is the current stable release on Packagist, and it already satisfies the `^3.0` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update monolog/monolog` and commit the updated REDACTED.
  • Outdated: rhukster/dom-sanitizer — `rhukster/dom-sanitizer` is locked at 1.0.19 but 1.0.20 is the current stable release on Packagist, and it already satisfies the `^1.0.14` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update rhukster/dom-sanitizer` and commit the updated REDACTED.
  • Outdated: symfony/polyfill-iconv — `symfony/polyfill-iconv` is locked at v1.37.0 but v1.43.0 is the current stable release on Packagist, and it already satisfies the `^1.31` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update symfony/polyfill-iconv` and commit the updated REDACTED.
  • Outdated: symfony/polyfill-mbstring — `symfony/polyfill-mbstring` is locked at v1.38.2 but v1.43.3 is the current stable release on Packagist, and it already satisfies the `^1.31` constraint declared in composer.json — so the lockfile is behind this repository's own declared range. Run `composer update symfony/polyfill-mbstring` and commit the updated REDACTED.

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)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-e3ef42d0d707405d9242399eb6bd1400/history.json --exit-code 0 --source .2artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-e3ef42d0d707405d9242399eb6bd1400/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude system/assets/jquery .28artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .1artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .4artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 31 file(s) — `system/src/Grav/Common/Assets.php`, `system/src/Grav/Common/Backup/Backups.php`, `system/src/Grav/Common/Cache.php`, `system/src/Grav/Common/Debugger.php`, `system/src/Grav/Common/File/CompiledFile.php`, … (+26 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1c5cb-d065-7481-badd-d5a745b1fd05 · 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