Public report of squizlabs/PHP_CodeSniffer, published 13 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.4). 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, 13 November 2026, 21:32 UTC · Survey ID cd_d3771521e52147af898a4ccf4500574e

squizlabs/PHP_CodeSniffer

Measured 13 November 2026, 21:32 UTC, at code version c6c65ca

Bus factor is not measured: No living knowledge left to concentrate.

Supply-chain provenance & signing is not measured: Supply-chain provenance is not scored (this pipeline releases no artifact), but its build steps or GitHub Actions workflows have integrity defects, or nothing watches its dependency set for published advisories.

CAI score 51out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Up 2 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 medium codebase: 55,587 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 0.6 person-years · Weakest lens: Production Readiness, 43

Findings by how serious they are

24 critical 755 serious 275 minor

26 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
13 November 2026, 21:32 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.

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 ▸

32of 32 dimensions measured by tools.
1046of 1054 findings point to an exact file and line, so you can open each one in the code. The other 8 concern the repository as a whole, such as missing documentation.
32dimensions across 5 lenses, read from 55,587 lines of product code in 1 project.
Chapters

Executive summary

squizlabs/PHP_CodeSniffer falls short of our standard for production because we found no logging, tracing or health checks in the code. It scores 51 out of 100 and is rated Adequate, and all 24 of its critical findings are security problems.

Production Readiness, at 43, 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 4 points. Adding a diagnostic log would lift Production Readiness itself, worth about 6 points. Raising Production Readiness to 70 would lift the score to about 57.

Nineteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Four secrets can leak from the build pipeline. Pinning each tool to an exact version and limiting each secret to its own step would close both risks. Giving the pull-request workflow read-only access would fix the pipeline that outsiders can trigger with write access.

The product code is 55,587 lines, about €82,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.
Production Readiness 43 · counts for 47%Maturity 50 · counts for 26%Code Health 52 · counts for 14%Security and Compliance 71 · counts for 8%Architecture 92 · counts for 4%

If Production Readiness rose from 43 to 70, the lowest score rated Strong, the score would rise from 51 to about 57.

Code composition: what the lines of code are
Product code 64%Tests 36%
New since the last survey: 28 findings

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

  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php
  • Code Duplication · Edited copy of a member (102 corresponding lines) src/Reports/Cbf.php
  • Code Duplication · Edited copy of a member (70 corresponding lines) src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php
  • Code Duplication · Edited copy of a member (42 corresponding lines) src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php
  • Code Duplication · Edited copy of a member (31 corresponding lines) src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php
  • Code Duplication · Edited copy of a member (36 corresponding lines) src/Files/File.php
  • Code Duplication · Edited copy of a member (38 corresponding lines) src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php
  • Code Duplication · Edited copy of a member (30 corresponding lines) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php
  • Code Duplication · Edited copies of one member (3 members, 33+ corresponding lines) src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php
  • Code Duplication · Edited copy of a member (30 corresponding lines) src/Standards/Generic/Sniffs/Debug/JSHintSniff.php
  • Code Duplication · Edited copy of a member (32 corresponding lines) src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php
  • Code Duplication · Edited copy of a member (39 corresponding lines) src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php
  • Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php
  • Code Duplication · Edited copy of a member (26 corresponding lines) src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php
  • Code Duplication · Edited copy of a member (22 corresponding lines) src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php
  • Code Duplication · Edited copy of a member (20 corresponding lines) src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php
  • Code Duplication · Edited copy of a member (19 corresponding lines) src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php
  • Code Duplication · Edited copy of a member (15 corresponding lines) src/Generators/HTML.php
  • Code Duplication · Edited copy of a member (20 corresponding lines) src/Files/File.php
  • Code Duplication · Edited copy of a member (13 corresponding lines) src/Reports/Gitblame.php
  • Code Duplication · Edited copy of a member (9 corresponding lines) src/Files/File.php
  • Code Duplication · Edited copy of a member (7 corresponding lines) src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php
  • Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php
  • Code Duplication · Duplicated block (18–19 lines × 3) src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php
  • Code Duplication · Duplicated block (15 lines × 3) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php
  • Code Duplication · Duplicated block (12 lines × 3) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php
  • Code Duplication · Duplicated block (6 lines × 6) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.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: 56 findings

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

  • Cyclomatic Complexity · ValidatePEARPackageXML.checkFileTag (cyclomatic 19) scripts/ValidatePEAR/ValidatePEARPackageXML.php
  • Cyclomatic Complexity · ValidatePEARPackageXML.checkPHPRelease (cyclomatic 17) scripts/ValidatePEAR/ValidatePEARPackageXML.php
  • Cognitive Complexity · ValidatePEARPackageXML.checkFileTag (cognitive 45) scripts/ValidatePEAR/ValidatePEARPackageXML.php
  • Cognitive Complexity · ValidatePEARPackageXML.checkPHPRelease (cognitive 30) scripts/ValidatePEAR/ValidatePEARPackageXML.php
  • Code Duplication · Near-duplicate member pair (33 shared lines) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php
  • Code Duplication · Near-duplicate member pair (30 shared lines) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php
  • Code Duplication · Edited copy of a member (43 corresponding lines) src/Config.php
  • Code Duplication · Edited copy of a member (21 corresponding lines) src/Generators/HTML.php
  • Code Duplication · Duplicated block (26 lines × 2) src/Tokenizers/PHP.php
  • Code Duplication · Duplicated block (21 lines × 2) src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php
  • Code Duplication · Duplicated block (20 lines × 3) src/Standards/Generic/Sniffs/PHP/LowerCaseTypeSniff.php
  • Code Duplication · Duplicated block (20 lines × 2) src/Tokenizers/PHP.php
  • Code Duplication · Duplicated block (18–19 lines × 3) src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php
  • Code Duplication · Duplicated block (19 lines × 2) src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php
  • Code Duplication · Duplicated block (19 lines × 2) src/Tokenizers/PHP.php
  • Code Duplication · Duplicated block (17 lines × 2) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php
  • Code Duplication · Duplicated block (16 lines × 2) src/Tokenizers/PHP.php
  • Code Duplication · Duplicated block (15 lines × 3) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php
  • Code Duplication · Duplicated block (14–15 lines × 2) src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php
  • Code Duplication · Duplicated block (14 lines × 2) src/Config.php
  • Code Duplication · Duplicated block (13 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php
  • Code Duplication · Duplicated block (13 lines × 2) src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php
  • Code Duplication · Duplicated block (13 lines × 2) src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php
  • Code Duplication · Duplicated block (12 lines × 4) src/Config.php
  • Code Duplication · Duplicated block (12 lines × 3) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php
  • Code Duplication · Duplicated block (12 lines × 2) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php
  • Code Duplication · Duplicated block (11 lines × 3) src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php
  • Code Duplication · Duplicated block (11 lines × 2) src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php
  • Code Duplication · Duplicated block (11 lines × 2) src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php
  • Code Duplication · Duplicated block (10 lines × 5) src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php
  • Code Duplication · Duplicated block (10 lines × 4) src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php
  • Code Duplication · Duplicated block (10 lines × 3) src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php
  • Code Duplication · Duplicated block (10 lines × 2) src/Generators/HTML.php
  • Code Duplication · Duplicated block (10 lines × 2) src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php
  • Code Duplication · Duplicated block (9 lines × 2) src/Tokenizers/PHP.php
  • Code Duplication · Duplicated block (7–8 lines × 4) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php
  • Code Duplication · Duplicated block (8 lines × 2) src/Standards/Generic/Sniffs/Formatting/SpaceBeforeCastSniff.php
  • Code Duplication · Duplicated block (8 lines × 2) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php
  • Code Duplication · Duplicated block (8 lines × 2) src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php
  • Code Duplication · Duplicated block (8 lines × 2) src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php
  • Code Duplication · Duplicated block (7 lines × 5) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php
  • Code Duplication · Duplicated block (7 lines × 2) src/Generators/HTML.php
  • Code Duplication · Duplicated block (7 lines × 2) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php
  • Code Duplication · Duplicated block (6–7 lines × 2) src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php
  • Code Duplication · Duplicated block (6 lines × 6) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php
  • Code Duplication · Duplicated block (6 lines × 2) src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php
  • Code Duplication · Duplicated block (6 lines × 2) src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php
  • Code Duplication · Duplicated block (6 lines × 2) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php
  • Code Duplication · Duplicated block (6 lines × 2) src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php
  • Code Duplication · Duplicated block (5 lines × 8) src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php
  • Code Duplication · Duplicated block (5 lines × 7) src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php
  • Code Duplication · Duplicated block (5 lines × 2) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php
  • Code Duplication · Duplicated block (5 lines × 2) src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php
  • Code Duplication · Duplicated block (9 lines × 2) src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php
  • Code Duplication · Duplicated block (5 lines × 2) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php
  • Code Duplication · Duplicated block (5 lines × 2) src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php
Rebuild cost: about €82,000 · Estimate
Cost to rebuild€27,000 to €140,000, for 453 to 1,438 hours of work, about 0.6 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.7 at a score of 51. 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.
SizeMedium: 55,587 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 — start with composer.json.
Raises the score by about 4 points · Low effort · ADR Quality
2
Resolve the 6 redundant comment finding(s) in Comment Value — start with FunctionClosingBraceSpaceUnitTest.js (2), ScopeIndentUnitTest.1.js, InlineCommentUnitTest.js.
Raises the score by about 4 points · Low effort · Comment Value
3
Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag.
Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
Raises the score by about 6 points · Medium effort · Observability

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 €82,000 to build again, about 0.6 person-years of work. Its weakest lens is Production Readiness, at 43 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness 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 4 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 4.4 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 9% to 20% on every change. The history of the code shows how much it changes: about 339 lines over the last 90 days, which is about 1,375 lines a year. At that pace, the extra work comes to an estimated 0.3 to 1.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.

77 modules, with 149 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 37 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 Files2 PHP_CodeSniffer3 Sniffs4 Standards.Generic.Sniffs.Arrays5 Standards.Generic.Sniffs.Classes6 Standards.Generic.Sniffs.CodeAnalysis7 Standards.Generic.Sniffs.Commenting8 Standards.Generic.Sniffs.ControlStructures9 Standards.Generic.Sniffs.Debug10 Standards.Generic.Sniffs.Files11 Standards.Generic.Sniffs.Formatting12 Standards.Generic.Sniffs.Functions13 Standards.Generic.Sniffs.Metrics14 Standards.Generic.Sniffs.NamingConventions15 Standards.Generic.Sniffs.PHP16 Standards.Generic.Sniffs.Strings17 Standards.Generic.Sniffs.VersionControl18 Standards.Generic.Sniffs.WhiteSpace19 Standards.MySource.Sniffs.CSS20 Standards.MySource.Sniffs.Channels21 Standards.MySource.Sniffs.Debug22 Standards.MySource.Sniffs.Objects23 Standards.MySource.Sniffs.PHP24 Standards.MySource.Sniffs.Strings25 Standards.PEAR.Sniffs.Classes26 Standards.PEAR.Sniffs.Commenting27 Standards.PEAR.Sniffs.ControlStructures28 Standards.PEAR.Sniffs.Functions29 Standards.PEAR.Sniffs.NamingConventions30 Standards.Squiz.Sniffs.WhiteSpace31 Standards.PEAR.Sniffs.WhiteSpace32 Standards.PSR2.Sniffs.Classes33 Standards.PSR2.Sniffs.Methods34 Standards.Squiz.Sniffs.Commenting35 Standards.Squiz.Sniffs.Functions36 Standards.Squiz.Sniffs.NamingConventions37 Standards.Squiz.Sniffs.PHP38 Standards.MySource.Sniffs.Commenting39 Standards.PSR12.Sniffs.Classes40 Standards.Squiz.Sniffs.Classes
1 Files8
2 PHP_CodeSniffer3
3 Sniffs5
4 Standards.Generic.Sniffs.Arrays23
5 Standards.Generic.Sniffs.Classes22
6 Standards.Generic.Sniffs.CodeAnalysis1010
7 Standards.Generic.Sniffs.Commenting33
8 Standards.Generic.Sniffs.ControlStructures22
9 Standards.Generic.Sniffs.Debug44
10 Standards.Generic.Sniffs.Files1212
11 Standards.Generic.Sniffs.Formatting66
12 Standards.Generic.Sniffs.Functions44
13 Standards.Generic.Sniffs.Metrics22
14 Standards.Generic.Sniffs.NamingConventions66
15 Standards.Generic.Sniffs.PHP1615
16 Standards.Generic.Sniffs.Strings11
17 Standards.Generic.Sniffs.VersionControl22
18 Standards.Generic.Sniffs.WhiteSpace77
19 Standards.MySource.Sniffs.CSS11
20 Standards.MySource.Sniffs.Channels44
21 Standards.MySource.Sniffs.Debug22
22 Standards.MySource.Sniffs.Objects33
23 Standards.MySource.Sniffs.PHP44
24 Standards.MySource.Sniffs.Strings11
25 Standards.PEAR.Sniffs.Classes11
26 Standards.PEAR.Sniffs.Commenting43
27 Standards.PEAR.Sniffs.ControlStructures12
28 Standards.PEAR.Sniffs.Functions33
29 Standards.PEAR.Sniffs.NamingConventions33
30 Standards.Squiz.Sniffs.WhiteSpace1515
31 Standards.PEAR.Sniffs.WhiteSpace221
32 Standards.PSR2.Sniffs.Classes211
33 Standards.PSR2.Sniffs.Methods321
34 Standards.Squiz.Sniffs.Commenting12111
35 Standards.Squiz.Sniffs.Functions451
36 Standards.Squiz.Sniffs.NamingConventions211
37 Standards.Squiz.Sniffs.PHP13131
38 Standards.MySource.Sniffs.Commenting11
39 Standards.PSR12.Sniffs.Classes431
40 Standards.Squiz.Sniffs.Classes651
Uses a module listed above itPart of a loopThe module itself
1 Files2 PHP_CodeSniffer3 Sniffs4 Standards.Generic.Sniffs.Arrays5 Standards.Generic.Sniffs.Classes6 Standards.Generic.Sniffs.CodeAnalysis7 Standards.Generic.Sniffs.Commenting8 Standards.Generic.Sniffs.ControlStructures9 Standards.Generic.Sniffs.Debug10 Standards.Generic.Sniffs.Files11 Standards.Generic.Sniffs.Formatting12 Standards.Generic.Sniffs.Functions13 Standards.Generic.Sniffs.Metrics14 Standards.Generic.Sniffs.NamingConventions15 Standards.Generic.Sniffs.PHP16 Standards.Generic.Sniffs.Strings17 Standards.Generic.Sniffs.VersionControl18 Standards.Generic.Sniffs.WhiteSpace19 Standards.MySource.Sniffs.CSS20 Standards.MySource.Sniffs.Channels21 Standards.MySource.Sniffs.Debug22 Standards.MySource.Sniffs.Objects23 Standards.MySource.Sniffs.PHP24 Standards.MySource.Sniffs.Strings25 Standards.PEAR.Sniffs.Classes26 Standards.PEAR.Sniffs.Commenting27 Standards.PEAR.Sniffs.ControlStructures28 Standards.PEAR.Sniffs.Functions29 Standards.PEAR.Sniffs.NamingConventions30 Standards.Squiz.Sniffs.WhiteSpace31 Standards.PEAR.Sniffs.WhiteSpace32 Standards.PSR2.Sniffs.Classes33 Standards.PSR2.Sniffs.Methods34 Standards.Squiz.Sniffs.Commenting35 Standards.Squiz.Sniffs.Functions36 Standards.Squiz.Sniffs.NamingConventions37 Standards.Squiz.Sniffs.PHP38 Standards.MySource.Sniffs.Commenting39 Standards.PSR12.Sniffs.Classes40 Standards.Squiz.Sniffs.ClassesFiles1PHP_CodeSniffer2Sniffs3Standards.Generic.Sniffs.Arrays4Standards.Generic.Sniffs.Classes5Standards.Generic.Sniffs.CodeAnalysis6Standards.Generic.Sniffs.Commenting7Standards.Generic.Sniffs.ControlStructures8Standards.Generic.Sniffs.Debug9Standards.Generic.Sniffs.Files10Standards.Generic.Sniffs.Formatting11Standards.Generic.Sniffs.Functions12Standards.Generic.Sniffs.Metrics13Standards.Generic.Sniffs.NamingConventions14Standards.Generic.Sniffs.PHP15Standards.Generic.Sniffs.Strings16Standards.Generic.Sniffs.VersionControl17Standards.Generic.Sniffs.WhiteSpace18Standards.MySource.Sniffs.CSS19Standards.MySource.Sniffs.Channels20Standards.MySource.Sniffs.Debug21Standards.MySource.Sniffs.Objects22Standards.MySource.Sniffs.PHP23Standards.MySource.Sniffs.Strings24Standards.PEAR.Sniffs.Classes25Standards.PEAR.Sniffs.Commenting26Standards.PEAR.Sniffs.ControlStructures27Standards.PEAR.Sniffs.Functions28Standards.PEAR.Sniffs.NamingConventions29Standards.Squiz.Sniffs.WhiteSpace30Standards.PEAR.Sniffs.WhiteSpace31Standards.PSR2.Sniffs.Classes32Standards.PSR2.Sniffs.Methods33Standards.Squiz.Sniffs.Commenting34Standards.Squiz.Sniffs.Functions35Standards.Squiz.Sniffs.NamingConventions36Standards.Squiz.Sniffs.PHP37Standards.MySource.Sniffs.Commenting38Standards.PSR12.Sniffs.Classes39Standards.Squiz.Sniffs.Classes4083523221010332244121266442266161511227711442233441111431233331515221211321121114512111313111431651+37 more modules (most-connected shown)

At a glance — Code Health · 52% · Adequate · gated by D1, D2, X5 ·

At a glance — Architecture · 92% · Checked 4 of 10 ·

At a glance — Maturity · 50% · Weak · gated by D34, M2 ·

At a glance — Readiness · 43% · Weak · gated by P2 ·

At a glance — Security · 71% · Strong ·

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 — Injection26High / Critical

Roadmap

Top priorities: Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce; Resolve the 220 Orphaned file finding(s) in Knowledge Freshness — start with ClassDeclarationSniff.php (4), FunctionCommentSniff.php (3), ControlStructureSpacingSniff.php (3); Resolve the 1 No ADRs found finding(s) in ADR Quality — start with composer.json.

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 — start with composer.json.+4.3 ptsLowADR Quality
Resolve the 6 redundant comment finding(s) in Comment Value — start with FunctionClosingBraceSpaceUnitTest.js (2), ScopeIndentUnitTest.1.js, InlineCommentUnitTest.js.+4.1 ptsLowComment Value
Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.+6.0 ptsMediumObservability
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.+3.8 ptsMediumRelease Hygiene
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.+3.8 ptsMediumArchitecture documentation
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.+3.1 ptsMediumNullable reference types
Resolve the 220 Orphaned file finding(s) in Knowledge Freshness — start with ClassDeclarationSniff.php (4), FunctionCommentSniff.php (3), ControlStructureSpacingSniff.php (3).+5.3 ptsHighKnowledge Freshness
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3).+1.0 ptsLowStatic Analysis (SAST)

File quality

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

FileScoreBandWorst signal
REDACTED0.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php5.5MixedCyclomatic Complexity: FileCommentSniff.process (cyclomatic 20)
tests/Core/ErrorSuppressionTest.php6.4MixedExplicit Debt: TodoComment
src/Tokenizers/PHP.php7.0MixedCyclomatic Complexity: PHP.tokenize (cyclomatic 494)
src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php7.0MixedCyclomatic Complexity: ScopeIndentSniff.process (cyclomatic 323)
src/Tokenizers/Tokenizer.php7.0MixedCyclomatic Complexity: Tokenizer.recurseScopeMap (cyclomatic 133)
src/Tokenizers/JS.php7.0MixedCyclomatic Complexity: JS.tokenize (cyclomatic 122)
src/Config.php7.0MixedCyclomatic Complexity: Config.processLongArgument (cyclomatic 114)
src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php7.0MixedCyclomatic Complexity: ArrayDeclarationSniff.processMultiLineArray (cyclomatic 112)
src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php7.0MixedCyclomatic Complexity: UseDeclarationSniff.processUseGroup (cyclomatic 82)
src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php7.0MixedCyclomatic Complexity: FunctionCommentSniff.processParams (cyclomatic 72)
src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php7.0MixedCyclomatic Complexity: DocCommentSniff.process (cyclomatic 65)
src/Files/File.php7.0MixedCyclomatic Complexity: File.getMethodParameters (cyclomatic 62)
src/Ruleset.php7.0MixedCyclomatic Complexity: Ruleset.processRuleset (cyclomatic 60)
src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php7.0MixedCyclomatic Complexity: FunctionCallSignatureSniff.processMultiLineCall (cyclomatic 60)
src/Runner.php7.0MixedCyclomatic Complexity: Runner.run (cyclomatic 39)
src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php7.0MixedCyclomatic Complexity: FunctionCommentSniff.processParams (cyclomatic 37)

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 — 24

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 — 755

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 — 275

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

Could not be resolved — 26

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 32 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.7, 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 — 32 dimensions across the health lenses
D1D2D3D4D6D13D15D17D19D20D24D27D28D29D34D35AX10M1M2M3M4P1P2P3P6X16X18X19X21X28X3X5

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, 1046 of 1054 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 · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1d6d3-26a2-7eeb-a485-61abdefc8015.

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.

  • D5 Coupling — 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's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • 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.
  • 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.
  • D12 Dependency Hygiene — 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 repository's dependency manifest (composer.json) was found, but this pass cannot parse it for hygiene, so no package was assessed. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. This row is about dependency HYGIENE — outdated, deprecated or unmaintained direct dependencies; known CVEs in the same dependency graph are a separate question, reported under D30 wherever the manifest is OSV-readable.
  • D14 License Compliance — 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. Not scored — this repository declares a composer.json but commits no composer.lock this pass can read, so the set of packages it installs is not on disk: its composer.json states version CONSTRAINTS, and Composer's guidance is that a library leaves the lock uncommitted. Producing the graph needs Composer's solver, which this pass does not run, and grading whichever release happens to be newest today would be a verdict about a dependency graph nobody resolved. NOT a finding that this repository's licences are compliant: this dimension asserts nothing about its licensing in either direction.
  • D16 Bus Factor — 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. All 223 significant source file(s) were last meaningfully changed so long ago that no living knowledge remains — nothing since has been substantial enough to re-establish ownership (a broad, mechanical sweep that touches many files shallowly does not count, and neither does no activity at all). There is no concentration to measure, so the bus factor is not scored. This is not a clean bill: nobody currently holds working knowledge of this code (see D34 Knowledge Freshness). Counted over 131 of the 308 production source files in this repository: 85 are under the ~2,400-byte size floor this dimension measures over, and the remaining 92 have no attributable history left to measure.
  • 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 naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D22 Internal API 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. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
  • D24 Comment Value — 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 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)` (55587 LoC, 304 module-visible types across 77 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.
  • D44 Platform End-of-Life — 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
  • AX3 Project dependency cycles — 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 which project references which. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj/.fsproj/.vbproj, Gradle, Maven, Cargo, npm/pnpm/yarn, Go module (and dep/glide/godep), Python pyproject.toml/setup.cfg/setup.py, SwiftPM, sbt, Mill, RubyGems, Composer, Mix/rebar3, pub, Unity assembly-definition, Deno/JSR, Tuist, CMake, Bazel, Xcode and XcodeGen builds and uni-app uni_modules plugins, or — when none declares a module — from the imports between a JavaScript/TypeScript, Python, Ruby, loose Rust, build-less C# or manifest-less Go tree's top-level directories, or as one module when all of a tree's source is one directory, and this repository offers none of them — so there was no graph to read, and re-running the same commit reads the same nothing. No module manifest of any ecosystem this engine recognises was found either, and the source's own imports could not stand in: they are read for JavaScript/TypeScript, Python and Ruby only, and only when those languages are the product — in any other language a tree is read only when its whole source is one directory, which this one's is not. The collector owed is an import reader for this repository's languages. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and not a finding that the repository is free of what this check looks for.
  • AX4 Dependency direction — 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 direction each project reference points. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj/.fsproj/.vbproj, Gradle, Maven, Cargo, npm/pnpm/yarn, Go module (and dep/glide/godep), Python pyproject.toml/setup.cfg/setup.py, SwiftPM, sbt, Mill, RubyGems, Composer, Mix/rebar3, pub, Unity assembly-definition, Deno/JSR, Tuist, CMake, Bazel, Xcode and XcodeGen builds and uni-app uni_modules plugins, or — when none declares a module — from the imports between a JavaScript/TypeScript, Python, Ruby, loose Rust, build-less C# or manifest-less Go tree's top-level directories, or as one module when all of a tree's source is one directory, and this repository offers none of them — so there was no graph to read, and re-running the same commit reads the same nothing. No module manifest of any ecosystem this engine recognises was found either, and the source's own imports could not stand in: they are read for JavaScript/TypeScript, Python and Ruby only, and only when those languages are the product — in any other language a tree is read only when its whole source is one directory, which this one's is not. The collector owed is an import reader for this repository's languages. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and 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.
  • AX8 Test isolation — 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 which projects are test projects, and what they reference. That is a language-neutral question, but the project-reference graph is collected from MSBuild .csproj/.fsproj/.vbproj, Gradle, Maven, Cargo, npm/pnpm/yarn, Go module (and dep/glide/godep), Python pyproject.toml/setup.cfg/setup.py, SwiftPM, sbt, Mill, RubyGems, Composer, Mix/rebar3, pub, Unity assembly-definition, Deno/JSR, Tuist, CMake, Bazel, Xcode and XcodeGen builds and uni-app uni_modules plugins, or — when none declares a module — from the imports between a JavaScript/TypeScript, Python, Ruby, loose Rust, build-less C# or manifest-less Go tree's top-level directories, or as one module when all of a tree's source is one directory, and this repository offers none of them — so there was no graph to read, and re-running the same commit reads the same nothing. No module manifest of any ecosystem this engine recognises was found either, and the source's own imports could not stand in: they are read for JavaScript/TypeScript, Python and Ruby only, and only when those languages are the product — in any other language a tree is read only when its whole source is one directory, which this one's is not. The collector owed is an import reader for this repository's languages. That is a COLLECTOR gap in this analyzer — no change to the scan image closes it — and not a finding that the repository is free of what this check looks for.
  • 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 no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala 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.
  • 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 no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala 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.
  • 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.
  • P7 Outbound HTTP resilience — 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 recognises outbound HTTP clients, their timeouts and resilience policies, and service entry points in .NET, Go, JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang. No service entry point was found in the PHP source it does read, and the rest of this repository's production source is , which it does not read yet — the service may well be there — a gap in this analyzer's language reach, not a finding about the code.
  • S1 Web-Security Posture — 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. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — 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 JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X12 Unreachable branch — 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 JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X13 Undrained process stream — 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 JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — 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 JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X24 Document value interpolated into markup unescaped — 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 JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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.
  • X29 Per-element action decided by a fixed element — 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 JavaScript/TypeScript (Vue and Svelte components included), Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — not measured this run — 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 JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP make no call through a named logger, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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

Limitations & what we did not check

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.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • 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.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • 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").
  • 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.
  • 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.
  • 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 Complexity2.0 / 10Critical✓ 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 2.0 / 10 · rule-coverage 100% · ceiling Prevented

148 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was PHP.tokenize at 494. 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 PHP.resolveSimpleToken at 27 — they are counted neither in the figure above nor in this dimension's score.

UseDeclarationSniff.process (cyclomatic 52) · ×2src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:41
PHP.tokenize (cyclomatic 494)src/Tokenizers/PHP.php:512
ScopeIndentSniff.process (cyclomatic 323)src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:127
PHP.processAdditional (cyclomatic 181)src/Tokenizers/PHP.php:2409
Tokenizer.recurseScopeMap (cyclomatic 133)src/Tokenizers/Tokenizer.php:933

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

What to do

  1. Bring the 148 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with PHP.tokenize (cyclomatic 494), ScopeIndentSniff.process (cyclomatic 323), PHP.processAdditional (cyclomatic 181). — 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 148 together lifts Cyclomatic Complexity from 2.0 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.

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

D2 · Cognitive Complexity0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Prevented

223 method(s) exceeded the cognitive complexity threshold of 15; the worst was PHP.tokenize at 1203.

PHP.tokenize (cognitive 1203)src/Tokenizers/PHP.php:512
Config.processLongArgument (cognitive 1063)src/Config.php:715
PHP.processAdditional (cognitive 974)src/Tokenizers/PHP.php:2409
ScopeIndentSniff.process (cognitive 953)src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:127
Tokenizer.recurseScopeMap (cognitive 518)src/Tokenizers/Tokenizer.php:933

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

What to do

  1. Bring the 223 bodies over 15 down to 15 or less in Cognitive Complexity — start with PHP.tokenize (cognitive 1203), Config.processLongArgument (cognitive 1063), PHP.processAdditional (cognitive 974). — 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 223 together lifts Cognitive Complexity from 0.0 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.

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

D3 · God Classes5.8 / 10Adequate✓ 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 5.8 / 10 · rule-coverage 100% · ceiling Prevented

78 god class(es) detected.

MethodTooLong: ScopeIndentSniff.process · ×58src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:127
ClassTooLong: File · ×11src/Files/File.php:19
FileTooLong: Tokenizers/PHP.php · ×8src/Tokenizers/PHP.php
TooManyMethods: Filesrc/Files/File.php:19

What to do

  1. Resolve the 58 MethodTooLong finding(s) in God Classes — start with File.php (5), Tokenizer.php (4), UseDeclarationSniff.php (3). — One of this dimension's main actionable groups (58 warning-level).
  2. Resolve the 11 ClassTooLong finding(s) in God Classes — start with File.php, Tokenizer.php, Config.php. — One of this dimension's main actionable groups (11 warning-level).
  3. Resolve the 8 FileTooLong finding(s) in God Classes — start with PHP.php, File.php, Tokenizer.php. — One of this dimension's main actionable groups (8 warning-level).

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

D4 · Code Duplication5.6 / 10Adequate✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

224 duplicated block group(s) detected. 10.9 % of the production lines (6,073 of 55,587) are in a reported copy. A further 30 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (11 lines × 2) · ×11src/Config.php:770
Duplicated block (9 lines × 2) · ×11src/Reports/Checkstyle.php:45
Duplicated block (13 lines × 2) · ×10src/Reports/Code.php:121
Duplicated block (17 lines × 2) · ×9src/Files/File.php:1660
Duplicated block (12 lines × 2) · ×9src/Reports/Code.php:60

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

What to do

  1. Resolve the 11 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with ConcatenationSpacingSniff.php (2), PHP.php (2), Config.php. — One of this dimension's main actionable groups (11 warning-level).
  2. Resolve the 11 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with Checkstyle.php, Ruleset.php, FunctionCommentSniff.php. — One of this dimension's main actionable groups (11 warning-level).
  3. Resolve the 10 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with Code.php, Gitblame.php, OpeningBraceSameLineSniff.php. — One of this dimension's main actionable groups (10 warning-level).

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

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 1 serious finding✓ 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 9.9 / 10 · rule-coverage 100% · ceiling Verified

1 of 136 classes have LCOM4 above 3.

Low cohesion: FileCommentSniff (LCOM4 8)src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:16

What to do

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

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D15 · Churn × Complexity Hotspots10.0 / 10Exemplary✓ Tool-verified

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

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

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

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

D17 · Explicit Debt9.9 / 10Stronggated by 37 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

37 deducted task-comment markers across 55587 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 · ×37tests/Core/ErrorSuppressionTest.php:275

What to do

  1. Resolve the 37 TodoComment finding(s) in Explicit Debt — start with ErrorSuppressionTest.php (37). — One of this dimension's main actionable groups (37 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. 2 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 foundcomposer.json:37

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with composer.json. — 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.

D24 · Comment Value0.0 / 10Critical✓ Tool-verified

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

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

14 of 69 judged comments only repeat the code they sit on (20.3 %). 11 comment(s) in another language or script were not judged.

redundant comment · ×6src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js:65

What to do

  1. Resolve the 6 redundant comment finding(s) in Comment Value — start with FunctionClosingBraceSpaceUnitTest.js (2), ScopeIndentUnitTest.1.js, InlineCommentUnitTest.js. — One of this dimension's main actionable groups (6 recommendation-level).

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

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

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

Scattered collaborators

What to do

  1. Resolve the 1 Scattered collaborators finding(s) in Navigability. — One of this dimension's main actionable groups (1 recommendation-level).

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

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)4.3 / 10Weak✓ 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 4.3 / 10 · rule-coverage 100% · ceiling Documented

26 finding(s): 0 critical, 23 high, 3 medium, 0 low. 19 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 19 file(s) — `src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.js` (line 3, line 6, line 7, …), `src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.1.js` (lines 2–3), `src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.2.js` (line 2), `src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.1.js` (lines 2–3), `src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.2.js` (line 2), … (+14 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 1 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

What to do

  1. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. No action in Static Analysis (SAST) — all 19 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 (19 issue-level, 0 of them charged here).

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

D34 · Knowledge Freshness0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

223 of 223 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/Tokenizers/PHP.php. Counted over 223 of the 308 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×220src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1
Most significant orphaned file · ×3src/Tokenizers/PHP.php:1
Dormant codebase

What to do

  1. Resolve the 220 Orphaned file finding(s) in Knowledge Freshness — start with ClassDeclarationSniff.php (4), FunctionCommentSniff.php (3), ControlStructureSpacingSniff.php (3). — One of this dimension's main actionable groups (220 recommendation-level).
  2. Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with PHP.php, File.php, Tokenizer.php. — One of this dimension's main actionable groups (3 recommendation-level).
  3. Resolve the 1 Dormant codebase finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition9.7 / 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.

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

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

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

  • This repository declares its own end of life: `README.md` line 2 reads “> This repository has been abandoned. Its successor is [PHPCSStandards/PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer/)”. That is a first-party statement of intent, not an inference — the Maturity and Knowledge lenses otherwise approximate the same fact from decayed commit history (D16 reports a dormant codebase, D34 orphaned files), and this row says the maintainer already told you. It does NOT change any score: an honest end-of-life notice is the README doing its job, and every dimension below still measures the code as it stands. Read the whole report as an assessment of software the author has stopped working on. — README.md:2
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 repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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 · Observability0.0 / 10Critical✓ 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.

  • No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.

What to do

  • Write a diagnostic trail the user can hand back with a bug report: a log file under the platform's per-user data directory, switchable with a `--verbose`/`--debug` flag. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
P3 · Security & performance tooling4.0 / 10Weak✓ Tool-verified

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

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

What to do

  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

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

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

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
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 state3.0 / 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.

  • `run` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the error handler (changed at line 408, reset at line 550) — 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. — src/Runner.php:353
  • `createPositionMap` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the error-reporting level (changed at line 219, put back at line 221) — 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. — src/Tokenizers/Tokenizer.php:170
  • `replaceTabsInToken` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the error-reporting level (changed at line 622, put back at line 624) — 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. — src/Tokenizers/Tokenizer.php:585
  • `getBlameContent` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the process working directory (changed at line 72, put back at line 84) — 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. — src/Reports/Gitblame.php:68
  • `getBlameContent` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the process working directory (changed at line 86, put back at line 103) — 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. — src/Reports/Hgblame.php:69
  • `printFooter` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the error-reporting level (changed at line 169, put back at line 174) — 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. — src/Generators/HTML.php:165

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 `cwd` and `env` passed to Symfony `Process` or `proc_open`, an absolute path, or an explicit `DateTimeZone`/locale/encoding argument is scoped to that operation, which is what the save-and-restore was trying to approximate. Where the global genuinely must move (an error handler around a call that warns), a `try`/`finally` is the least that makes the restore unconditional.
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.

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 handling10.0 / 10Exemplary○ Nothing flagged

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.

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.

  • 0/1 of this repository's PHPStan/Psalm configuration(s) run at a level that checks null — PHPStan level 8 or above (`max` included), or Psalm `errorLevel` 3 or below (Psalm's default, with none stated, is 1). A PHPStan level written neither in the file nor in an include inside the repository is 0, PHPStan's own default. Below those levels the checker removes `null` from a union before any rule looks, so `$order->customer()->name()` on a `?Customer` passes, and the first null reaching it is an `Error: Call to a member function name() on null` in production.

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 Health52%Adequate — gated by D1, D2, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture92%Checked 4 of 10Strongest area.
Maturity50%Weak — gated by D34, M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness43%Weak — gated by P2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security71%StrongSolid.
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.

  • D36 Supply-chain Provenance & Signing — 4 observation(s) recorded · The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files). Build integrity and workflow-token hygiene are reported below: they describe what the CI runs and the token it runs with, neither of which is affected by whether the pipeline ships an artifact.
  • X10 Duplicated predicate — 38 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 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.

  • P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 80 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's PHP imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — 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).
  • AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository commits no project file of a kind this check models. This is a gap in the analyzer, not a finding about this repository
  • AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository commits no project file of a kind this check models. This is a gap in the analyzer, not a finding about this repository
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) that was not loaded for this repository, because the repository commits no project file of a kind this check models. This is a gap in the analyzer, not a finding about this repository
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB1 Runtime evidence locked — no reproducible boot — This repository has nothing the runtime tiers could boot or serve — no markup, no UI framework or web-server dependency, no UI component source, no native UI project and no API definition — nothing here is a surface to boot — so runtime a11y/egress/header evidence has no subject here. Not applicable: this is neither a gap in the scan nor a finding about your code.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Laravel migration, an Eloquent $fillable/$hidden list or a Doctrine #[ORM\Column] property — and no database client (PDO, mysqli, Laravel's DB facade, $wpdb) in the source either, so this repository keeps no data at rest for these controls to protect.
  • 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.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone_number, …) or stored credential in a Laravel migration, an Eloquent model's $fillable/$hidden list or a Doctrine #[ORM\Column] property — and no database client (PDO, mysqli, Laravel's DB facade, $wpdb) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a hosted backend configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Laravel migration, an Eloquent $fillable/$hidden list or a Doctrine #[ORM\Column] property — and no database client (PDO, mysqli, Laravel's DB facade, $wpdb) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Laravel migration, an Eloquent $fillable/$hidden list or a Doctrine #[ORM\Column] property — and no database client (PDO, mysqli, Laravel's DB facade, $wpdb) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~31256 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
  • D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • D14 License Compliance — Composer package licences not graded — this repository commits no composer.lock and this pass does not run Composer's solver
  • D16 Bus Factor — dormant codebase — no living knowledge left to concentrate
  • 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 does not read PHP yet; not measured.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ 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"]`.
  • 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.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (composer.json — not scanned yet).
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (composer.json — not scanned yet).
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • D5 Coupling — D5 reads a .NET project-reference graph only — this repository's production source is .php, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
  • 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'.
  • P7 Outbound HTTP resilience — 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
  • 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • 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.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X12 Unreachable branch — 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
  • X13 Undrained process stream — 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
  • X14 Bypassable address classification — 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 analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — no C# was loaded; this repository's 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
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — 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
  • X25 Inert configuration knob — 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. 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 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
  • X30 Support guard that admits what it rejects — 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.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — 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 — 24 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
Serious — 755 finding(s)
D3 · God Classes · MethodTooLong · ×58
  • MethodTooLong: ScopeIndentSniff.process src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:127 — MethodTooLong — process runs 869 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 769 over it, 8.69× 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: JS.tokenize src/Tokenizers/JS.php:279 — MethodTooLong — tokenize runs 373 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 273 over it, 3.73× 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: Config.processLongArgument src/Config.php:715 — MethodTooLong — processLongArgument runs 364 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 264 over it, 3.64× 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: ArrayDeclarationSniff.processMultiLineArray src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:318 — MethodTooLong — processMultiLineArray runs 359 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 259 over it, 3.59× 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: Tokenizer.recurseScopeMap src/Tokenizers/Tokenizer.php:933 — MethodTooLong — recurseScopeMap runs 325 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 225 over it, 3.25× 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: CSS.tokenize src/Tokenizers/CSS.php:52 — MethodTooLong — tokenize runs 288 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 188 over it, 2.88× 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: ClassDeclarationSniff.processOpen src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:62 — MethodTooLong — processOpen runs 269 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 169 over it, 2.69× 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: UseDeclarationSniff.processUseGroup src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:283 — MethodTooLong — processUseGroup runs 256 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 156 over it, 2.56× 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: AbstractPatternSniff.processPattern src/Sniffs/AbstractPatternSniff.php:255 — MethodTooLong — processPattern runs 253 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 153 over it, 2.53× 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: Tokenizer.createPositionMap src/Tokenizers/Tokenizer.php:170 — MethodTooLong — createPositionMap runs 249 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 149 over it, 2.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: FunctionCommentSniff.processParams src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:281 — MethodTooLong — processParams runs 234 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 134 over it, 2.34× 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: BlockCommentSniff.process src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:51 — MethodTooLong — process runs 227 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 127 over it, 2.27× 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: MultipleStatementAlignmentSniff.checkAlignment src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php:100 — MethodTooLong — checkAlignment runs 200 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 100 over it, 2.00× 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: FunctionDeclarationArgumentSpacingSniff.processBracket src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:104 — MethodTooLong — processBracket runs 200 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 100 over it, 2.00× 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: FunctionCommentSniff.processParams src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:265 — MethodTooLong — processParams runs 188 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 88 over it, 1.88× 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: DocCommentSniff.process src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:50 — MethodTooLong — process runs 185 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 85 over it, 1.85× 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: ControlStructureSpacingSniff.process src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php:64 — MethodTooLong — process runs 185 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 85 over it, 1.85× 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: File.getMethodParameters src/Files/File.php:1333 — MethodTooLong — getMethodParameters runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× 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: InlineCommentSniff.process src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php:54 — MethodTooLong — process runs 182 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 82 over it, 1.82× 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: Ruleset.processRuleset src/Ruleset.php:317 — MethodTooLong — processRuleset runs 181 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 81 over it, 1.81× 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: InlineControlStructureSniff.process src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php:67 — MethodTooLong — process runs 178 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 78 over it, 1.78× 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: Code.generateFileReport src/Reports/Code.php:33 — MethodTooLong — generateFileReport runs 177 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× 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: FunctionCallSignatureSniff.processMultiLineCall src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:337 — MethodTooLong — processMultiLineCall runs 177 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× 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: FunctionSpacingSniff.process src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php:69 — MethodTooLong — process runs 166 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 66 over it, 1.66× 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: ControlSignatureSniff.process src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php:71 — MethodTooLong — process runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× 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.
  • + 33 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×37
  • TodoComment tests/Core/ErrorSuppressionTest.php:275 — //TODO: write some code. — 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 tests/Core/ErrorSuppressionTest.php:701 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:798 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:933 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:943 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:945 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:954 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:956 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:965 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:975 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:985 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:995 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:1005 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:1015 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:1025 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:1027 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:1029 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:1039 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:1041 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:1044 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:1084 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:1085 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:1199 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:1208 — //TODO: write some code — 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 tests/Core/ErrorSuppressionTest.php:1229 — //TODO: write some code — 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.
  • + 12 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×11
  • ClassTooLong: File src/Files/File.php:19 — ClassTooLong — 1357 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 957 over it, 3.39× 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: Tokenizer src/Tokenizers/Tokenizer.php:15 — ClassTooLong — 982 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 582 over it, 2.46× 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: Config src/Config.php:75 — ClassTooLong — 964 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 564 over it, 2.41× 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: ScopeIndentSniff src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:17 — ClassTooLong — 934 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 534 over it, 2.34× 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: Ruleset src/Ruleset.php:18 — ClassTooLong — 722 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 322 over it, 1.81× 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: JS src/Tokenizers/JS.php:16 — ClassTooLong — 684 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 284 over it, 1.71× 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: ArrayDeclarationSniff src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:16 — ClassTooLong — 530 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 130 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.
  • ClassTooLong: Runner src/Runner.php:24 — ClassTooLong — 490 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 90 over it, 1.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.
  • ClassTooLong: FunctionCommentSniff src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:17 — ClassTooLong — 451 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 51 over it, 1.13× 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: UseDeclarationSniff src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:16 — ClassTooLong — 434 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 34 over it, 1.09× 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: AbstractPatternSniff src/Sniffs/AbstractPatternSniff.php:17 — ClassTooLong — 430 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 30 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×11
  • Duplicated block (11 lines × 2) src/Config.php:770 — src/Config.php:770-780 | src/Config.php:828-838 — 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 `src/Config.php:770` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php:108 — src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php:108-118 | src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php:165-175 — 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 `src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php:108` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php:304 — src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php:304-314 | src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php:344-354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:193 — src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:193-203 | src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:216-226 — 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 `src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:193` 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) src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php:73 — src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php:73-83 | src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php:54-64 — 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) src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php:86 — src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php:86-96 | src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php:73-83 — 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) src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php:204 — src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php:204-214 | src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php:351-361 — 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 `src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php:204` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:61 — src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:61-71 | src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:181-191 — 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 `src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:61` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/Tokenizers/CSS.php:342 — src/Tokenizers/CSS.php:342-352 | src/Tokenizers/CSS.php:465-475 — 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 `src/Tokenizers/CSS.php:342` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/Tokenizers/PHP.php:1045 — src/Tokenizers/PHP.php:1045-1055 | src/Tokenizers/PHP.php:1263-1273 — 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 `src/Tokenizers/PHP.php:1045` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) src/Tokenizers/PHP.php:2198 — src/Tokenizers/PHP.php:2198-2208 | src/Tokenizers/PHP.php:3234-3244 — 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 `src/Tokenizers/PHP.php:2198` 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 (9 lines × 2) · ×11
  • Duplicated block (9 lines × 2) src/Reports/Checkstyle.php:45 — src/Reports/Checkstyle.php:45-53 | src/Reports/Xml.php:50-58 — 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 `src/Reports/Checkstyle.php:45` 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, `src/Reports/Xml.php:47` calls `writeAttribute` and `src/Reports/Checkstyle.php:44` 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 (9 lines × 2) src/Ruleset.php:1016 — src/Ruleset.php:1016-1024 | src/Ruleset.php:1388-1396 — 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 `src/Ruleset.php:1016` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:123 — src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:123-131 | src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php:85-93 — 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 `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:123` 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 (9 lines × 2) src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php:73 — src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php:73-81 | src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php:240-248 — 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 `src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php:73` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php:99 — src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php:99-107 | src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php:120-128 — 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) src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php:146 — src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php:146-154 | src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php:86-94 — 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 `src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php:146` 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) src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:92 — src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:92-101 | src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:88-96 — before extracting anything, compare `src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php` and `src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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 `src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) src/Tokenizers/PHP.php:1048 — src/Tokenizers/PHP.php:1048-1056 | src/Tokenizers/PHP.php:1729-1738 — 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 `src/Tokenizers/PHP.php:1048` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) src/Tokenizers/Tokenizer.php:336 — src/Tokenizers/Tokenizer.php:336-344 | src/Tokenizers/Tokenizer.php:374-382 — 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) src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php:287 — src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php:287-295 | src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php:349-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php:287` 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) src/Reports/Code.php:349 — src/Reports/Code.php:349-357 | src/Reports/Full.php:218-226 — before extracting anything, compare `src/Reports/Code.php` and `src/Reports/Full.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 78 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 lines × 2) · ×10
  • Duplicated block (13 lines × 2) src/Reports/Code.php:121 — src/Reports/Code.php:121-133 | src/Reports/Full.php:63-75 — before extracting anything, compare `src/Reports/Code.php` and `src/Reports/Full.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 78 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 (13 lines × 2) src/Reports/Gitblame.php:74 — src/Reports/Gitblame.php:74-86 | src/Reports/Hgblame.php:93-105 — before extracting anything, compare `src/Reports/Gitblame.php` and `src/Reports/Hgblame.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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.
  • Duplicated block (13 lines × 2) src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php:100 — src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php:100-112 | src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:174-186 — 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 `src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php:100` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:205 — src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:205-217 | src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:293-305 — 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 `src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:205` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:307 — src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:307-319 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:738-750 — 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 `src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:307` 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.
  • Duplicated block (13 lines × 2) src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php:62 — src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php:62-74 | src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php:68-80 — 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 `src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:364 — src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:364-376 | src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:417-429 — 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 `src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:364` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php:70 — src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php:70-82 | src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php:90-102 — 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) src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:87 — src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:87-99 | src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:314-326 — 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 `src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:87` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 2) src/Tokenizers/JS.php:488 — src/Tokenizers/JS.php:488-500 | src/Tokenizers/JS.php:579-591 — 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 `src/Tokenizers/JS.php:488` 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 (17 lines × 2) · ×9
  • Duplicated block (17 lines × 2) src/Files/File.php:1660 — src/Files/File.php:1660-1676 | src/Files/File.php:1870-1886 — 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 `src/Files/File.php:1660` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) src/Files/File.php:2772 — src/Files/File.php:2772-2788 | src/Files/File.php:2824-2840 — 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 `src/Files/File.php:2824` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (17 lines × 2) src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php:54 — src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php:54-70 | src/Standards/Generic/Sniffs/Commenting/TodoSniff.php:53-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:385 — src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:385-401 | src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:430-446 — 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 `src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:385` 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 (17 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:421 — src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:421-437 | src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:593-609 — before extracting anything, compare `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php` and `src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 118 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 `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:421` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php:87 — src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php:87-103 | src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php:155-171 — before extracting anything, compare `src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php` and `src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 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 `src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php:87` 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 (17 lines × 2) src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:112 — src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:112-128 | src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:351-367 — 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 `src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:126 — src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:126-142 | src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:269-285 — 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 `src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:126` 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 (17 lines × 2) src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:118 — src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:118-134 | src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:152-168 — 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 `src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×9
  • Duplicated block (12 lines × 2) src/Reports/Code.php:60 — src/Reports/Code.php:60-71 | src/Reports/Diff.php:51-62 — 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) src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php:81 — src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php:81-92 | src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php:172-183 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php:108 — src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php:108-119 | src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php:168-179 — 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 (12 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:523 — src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:523-534 | src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:627-638 — before extracting anything, compare `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php` and `src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 118 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 (12 lines × 2) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:127 — src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:127-138 | src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:145-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 `src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:127` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:256 — src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:256-267 | src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php:161-172 — 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 (12 lines × 2) src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php:50 — src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php:50-61 | src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php:60-71 — 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 (12 lines × 2) src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:203 — src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:203-214 | src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:365-376 — 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 `src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:203` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) src/Util/Standards.php:103 — src/Util/Standards.php:103-114 | src/Util/Standards.php:195-206 — 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 `src/Util/Standards.php:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D3 · God Classes · FileTooLong · ×8
  • FileTooLong: Tokenizers/PHP.php src/Tokenizers/PHP.php — FileTooLong — 2182 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1682 over it, 4.36× 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: Files/File.php src/Files/File.php — FileTooLong — 1365 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: File (19-2850). The bar is 500 significant lines; this is 865 over it, 2.73× 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: Tokenizers/Tokenizer.php src/Tokenizers/Tokenizer.php — FileTooLong — 986 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: Tokenizer (15-1734). The bar is 500 significant lines; this is 486 over it, 1.97× 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: src/Config.php src/Config.php — FileTooLong — 969 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: Config (75-1718). The bar is 500 significant lines; this is 469 over it, 1.94× 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: WhiteSpace/ScopeIndentSniff.php src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php — FileTooLong — 940 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ScopeIndentSniff (17-1588). The bar is 500 significant lines; this is 440 over it, 1.88× 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: src/Ruleset.php src/Ruleset.php — FileTooLong — 727 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: Ruleset (18-1458). The bar is 500 significant lines; this is 227 over it, 1.45× 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: Tokenizers/JS.php src/Tokenizers/JS.php — FileTooLong — 689 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: JS (16-1256). The bar is 500 significant lines; this is 189 over it, 1.38× 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: Arrays/ArrayDeclarationSniff.php src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php — FileTooLong — 535 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ArrayDeclarationSniff (16-908). The bar is 500 significant lines; this is 35 over it, 1.07× 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×8
  • Duplicated block (15 lines × 2) src/Files/File.php:2231 — src/Files/File.php:2231-2245 | src/Files/File.php:2312-2326 — 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 (15 lines × 2) src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php:193 — src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php:193-207 | src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php:191-205 — before extracting anything, compare `src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php` and `src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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 `src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php:193` 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, `src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php:189` calls `ltrim` and `src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php:191` 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) src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php:175 — src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php:175-189 | src/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php:149-163 — 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 (15 lines × 2) src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php:32 — src/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php:32-46 | src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php:41-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:288 — src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:288-302 | src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:889-903 — 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 `src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:288` 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) src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:335 — src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:335-349 | src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:680-694 — 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 `src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:335` 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) src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php:70 — src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php:70-84 | src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php:138-152 — before extracting anything, compare `src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php` and `src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 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 `src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php:70` 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) src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php:155 — src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php:155-169 | src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php:305-319 — 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 `src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php:155` 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 (10 lines × 2) · ×8
  • Duplicated block (10 lines × 2) src/Files/File.php:1655 — src/Files/File.php:1655-1664 | src/Files/File.php:1989-1998 — 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 `src/Files/File.php:1655` 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) src/Ruleset.php:1072 — src/Ruleset.php:1072-1081 | src/Ruleset.php:1098-1107 — 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) src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php:63 — src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php:63-72 | src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:53-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1213 — src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1213-1222 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1280-1289 — 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) src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php:112 — src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php:112-121 | src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php:255-264 — 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 `src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php:112` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:128 — src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:128-137 | src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:124-133 — 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 `src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:313 — src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:313-322 | src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:357-366 — 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 `src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:313` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:56 — src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:56-65 | src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:74-83 — 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 (6 lines × 2) · ×8
  • Duplicated block (6 lines × 2) src/Generators/HTML.php:238 — src/Generators/HTML.php:238-243 | src/Generators/Markdown.php:129-134 — 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.
  • Duplicated block (6 lines × 2) src/Reports/Checkstyle.php:50 — src/Reports/Checkstyle.php:50-55 | src/Reports/Junit.php:62-67 — 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 (6 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:130 — src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:130-137 | src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php:58-63 — before extracting anything, compare `src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php` and `src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 92 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 `src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:142 — src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:142-147 | src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php:73-79 — 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 `src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.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.
  • Duplicated block (6 lines × 2) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:358 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:358-363 | src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:82-87 — 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 `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:358` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php:44 — src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php:44-49 | src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php:60-65 — 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 (6 lines × 2) src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php:66 — src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php:66-72 | src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php:77-82 — 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 `src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) src/Tokenizers/PHP.php:3127 — src/Tokenizers/PHP.php:3127-3133 | src/Tokenizers/PHP.php:3162-3167 — 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 `src/Tokenizers/PHP.php:3127` 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 lines × 2) · ×7
  • Duplicated block (16 lines × 2) src/Generators/Text.php:204 — src/Generators/Text.php:204-219 | src/Generators/Text.php:226-241 — 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 `src/Generators/Text.php:204` 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) src/Reports/Cbf.php:180 — src/Reports/Cbf.php:180-195 | src/Reports/Summary.php:119-134 — 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 `src/Reports/Cbf.php:180` 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) src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php:57 — src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php:57-72 | src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php:121-136 — 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) src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php:126 — src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php:126-141 | src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php:69-84 — before extracting anything, compare `src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php` and `src/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php` as WHOLE FILES: 84% 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. 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 `src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php:126` 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 (16 lines × 2) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:655 — src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:655-670 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1195-1210 — 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) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:110 — src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:110-125 | src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:130-145 — 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) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:655 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:655-670 | src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php:76-91 — 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 `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:655` 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 (7 lines × 2) · ×7
  • Duplicated block (7 lines × 2) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:309 — src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:309-315 | src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php:206-212 — 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 `src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:309` 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) src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php:204 — src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php:204-210 | src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php:234-240 — 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 `src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php:204` 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) src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php:77 — src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php:77-83 | src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php:78-84 — 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 `src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php:210 — src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php:210-216 | src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php:345-351 — 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 `src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php:210` 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, `src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php:352` calls `addContentBefore`, `str_repeat` and `src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php:217` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) src/Tokenizers/PHP.php:2433 — src/Tokenizers/PHP.php:2433-2439 | src/Tokenizers/PHP.php:2520-2527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/Tokenizers/Tokenizer.php:1542 — src/Tokenizers/Tokenizer.php:1542-1548 | src/Tokenizers/Tokenizer.php:1633-1639 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:144 — src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:144-150 | src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:179-185 — 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.
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 src/Runner.php:353 — `run` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the error handler (changed at line 408, reset at line 550) — 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 src/Tokenizers/Tokenizer.php:170 — `createPositionMap` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the error-reporting level (changed at line 219, put back at line 221) — 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 src/Tokenizers/Tokenizer.php:585 — `replaceTabsInToken` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the error-reporting level (changed at line 622, put back at line 624) — 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 src/Reports/Gitblame.php:68 — `getBlameContent` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the process working directory (changed at line 72, put back at line 84) — 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 src/Reports/Hgblame.php:69 — `getBlameContent` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the process working directory (changed at line 86, put back at line 103) — 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 src/Generators/HTML.php:165 — `printFooter` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the error-reporting level (changed at line 169, put back at line 174) — 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 × 3) · ×5
  • Duplicated block (10 lines × 3) src/Reports/Gitblame.php:74 — src/Reports/Gitblame.php:74-83 | src/Reports/Hgblame.php:93-102 | src/Reports/Svnblame.php:57-66 — before extracting anything, compare `src/Reports/Gitblame.php` and `src/Reports/Hgblame.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Reports/Gitblame.php:84` calls `chdir` and `src/Reports/Svnblame.php:68` 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 (10 lines × 3) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:305 — src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:305-314 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:736-745 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1388-1397 — 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 `src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:305` 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, `src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:303` calls `isset` and `src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:735` 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 (10 lines × 3) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1190 — src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1190-1199 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1437-1446 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1453-1462 — 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 `src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1190` 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) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:603 — src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:603-612 | src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:163-172 | src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php:125-134 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:603` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php:57 — src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php:57-66 | src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:61-70 | src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:69-78 — 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.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×5
  • Duplicated block (9 lines × 3) src/Fixer.php:442 — src/Fixer.php:442-450 | src/Fixer.php:499-507 | src/Fixer.php:614-622 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:65 — src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:65-73 | src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php:46-54 | src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:68-76 — 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.
  • Duplicated block (9 lines × 3) src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:128 — src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:128-136 | src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:124-132 | src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:363-371 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:207 — src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:207-215 | src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:264-272 | src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:321-329 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:207` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php:86 — src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php:86-94 | src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php:73-81 | src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php:128-136 — 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×5
  • Duplicated block (8 lines × 3) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:311 — src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:311-318 | src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:239-246 | src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:343-350 — before extracting anything, compare `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php` and `src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 118 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 `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:311` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php:71 — src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php:71-78 | src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:81-88 | src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php:238-245 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:79` calls `findNext`, `in_array` and `src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.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.
  • Duplicated block (8 lines × 3) src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php:55 — src/Standards/PSR12/Sniffs/Files/OpenTagSniff.php:55-63 | src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php:119-126 | src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php:89-96 — before extracting anything, compare `src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php` and `src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 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 `src/Standards/PSR12/Sniffs/Files/OpenTagSniff.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.
  • Duplicated block (8 lines × 3) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:321 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:321-328 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:427-434 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:505-512 — 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 `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:321` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php:75 — src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php:75-82 | src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php:75-82 | src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:287-294 — 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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×4
  • Duplicated block (18 lines × 2) src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php:155 — src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php:155-172 | src/Standards/Generic/Sniffs/PHP/UpperCaseConstantSniff.php:35-52 — 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 `src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php:155` 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 (18 lines × 2) src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php:102 — src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php:102-119 | src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php:163-180 — 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 `src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.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. 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) src/Standards/Generic/Sniffs/WhiteSpace/IncrementDecrementSpacingSniff.php:88 — src/Standards/Generic/Sniffs/WhiteSpace/IncrementDecrementSpacingSniff.php:88-105 | src/Standards/Generic/Sniffs/WhiteSpace/IncrementDecrementSpacingSniff.php:141-158 — 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 `src/Standards/Generic/Sniffs/WhiteSpace/IncrementDecrementSpacingSniff.php:88` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) src/Tokenizers/Tokenizer.php:1590 — src/Tokenizers/Tokenizer.php:1590-1607 | src/Tokenizers/Tokenizer.php:1692-1709 — 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 `src/Tokenizers/Tokenizer.php:1590` 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 (15 lines × 3) · ×4
  • Duplicated block (15 lines × 3) src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php:104 — src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php:104-118 | src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php:75-89 | src/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php:41-55 — before extracting anything, compare `src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php` and `src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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 (15 lines × 3) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1123 — src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1123-1137 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1158-1172 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1322-1336 — 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 `src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1123` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 3) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:337 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:337-351 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:448-462 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:526-540 — 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 `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:337` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 3) src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:144 — src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:144-158 | src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:165-179 | src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:236-250 — 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 `src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:142` calls `foreach` and `src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:162` 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×4
  • Duplicated block (8 lines × 2) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:383 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:383-390 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:583-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.
  • Duplicated block (8 lines × 2) src/Tokenizers/PHP.php:692 — src/Tokenizers/PHP.php:692-699 | src/Tokenizers/PHP.php:2166-2173 — 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 `src/Tokenizers/PHP.php:692` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/Tokenizers/PHP.php:2869 — src/Tokenizers/PHP.php:2869-2878 | src/Tokenizers/PHP.php:2924-2931 — 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 `src/Tokenizers/PHP.php:2869` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php:107 — src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php:107-114 | src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php:194-201 — 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 `src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.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. 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 (7 lines × 3) · ×4
  • Duplicated block (7 lines × 3) src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:96 — src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:96-102 | src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php:90-96 | src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php:94-100 — before extracting anything, compare `src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php` and `src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 `src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:96` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:106` calls `recordMetric` and `src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php:100` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 3) src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php:48 — src/Standards/PSR12/Sniffs/Classes/ClosingBraceSniff.php:48-54 | src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php:43-49 | src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php:55-63 — 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.
  • Duplicated block (7 lines × 3) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:474 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:474-480 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:552-558 | src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php:85-91 — 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.
  • Duplicated block (7 lines × 3) src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:256 — src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:256-262 | src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:316-322 | src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:360-366 — 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 `src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:256` 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 (5 lines × 2) · ×4
  • Duplicated block (5 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:202 — src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:202-206 | src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:72-76 — before extracting anything, compare `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php` and `src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 118 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 `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:202` 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, `src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:69` calls `getDeclarationName`, `in_array` and `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:200` 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 (5 lines × 2) src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:232 — src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:232-236 | src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:242-246 — 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 `src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:232` 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 (5 lines × 2) src/Tokenizers/PHP.php:2672 — src/Tokenizers/PHP.php:2672-2676 | src/Tokenizers/PHP.php:2681-2686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) src/Tokenizers/CSS.php:34 — src/Tokenizers/CSS.php:34-38 | src/Tokenizers/JS.php:263-267 — 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×3
  • Duplicated block (21 lines × 2) src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php:141 — src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php:141-161 | src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php:166-186 — 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 (21 lines × 2) src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:82 — src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:82-102 | src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:373-393 — 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 (21 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:386 — src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:386-406 | src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:457-477 — 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 `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:386` 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 (19–20 lines × 2) · ×3
  • Duplicated block (19–20 lines × 2) src/Reports/Gitblame.php:35 — src/Reports/Gitblame.php:35-53 | src/Reports/Hgblame.php:35-54 — before extracting anything, compare `src/Reports/Gitblame.php` and `src/Reports/Hgblame.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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–20 lines × 2) src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:147 — src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:147-166 | src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php:126-144 — 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 `src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:147` 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 (19–20 lines × 2) src/Tokenizers/PHP.php:1355 — src/Tokenizers/PHP.php:1355-1374 | src/Tokenizers/PHP.php:1390-1408 — 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 `src/Tokenizers/PHP.php:1355` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×3
  • Duplicated block (14 lines × 2) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:273 — src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:273-286 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:481-494 — 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 `src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:273` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:76 — src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:76-89 | src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:93-106 — 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 `src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:76` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:684 — src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:684-697 | src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:743-756 — 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 `src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:684` 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 (13–14 lines × 2) · ×3
  • Duplicated block (13–14 lines × 2) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:363 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:363-376 | src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php:251-263 — 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 `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:363` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:170 — src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:170-183 | src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:172-184 — before extracting anything, compare `src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php` and `src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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 `src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:170` 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) src/Tokenizers/Tokenizer.php:796 — src/Tokenizers/Tokenizer.php:796-808 | src/Tokenizers/Tokenizer.php:812-825 — 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 `src/Tokenizers/Tokenizer.php:796` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×3
  • Duplicated block (12–13 lines × 2) src/Config.php:849 — src/Config.php:849-861 | src/Config.php:866-877 — 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 `src/Config.php:849` 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–13 lines × 2) src/Generators/HTML.php:34 — src/Generators/HTML.php:34-46 | src/Generators/Markdown.php:29-40 — 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 before the matched lines, `src/Generators/HTML.php:32` calls `printToc` and `src/Generators/Markdown.php:27` 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 (12–13 lines × 2) src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php:83 — src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php:83-94 | src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php:225-237 — 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 `src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php:83` 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–12 lines × 2) · ×3
  • Duplicated block (10–12 lines × 2) src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php:51 — src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php:51-62 | src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php:50-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10–12 lines × 2) src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php:89 — src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php:89-98 | src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php:96-107 — 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 `src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php:89` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–12 lines × 2) src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php:186 — src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php:186-195 | src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php:281-292 — 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 `src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php:186` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×3
  • Duplicated block (6 lines × 3) src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:92 — src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:92-97 | src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php:103-112 | src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:325-330 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:92` 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 × 3) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:152 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:152-159 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:622-628 | src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php:216-221 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 3) src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php:92 — src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php:92-97 | src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php:106-111 | src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php:120-125 — 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 `src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php:92` 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 (5 lines × 3) · ×3
  • Duplicated block (5 lines × 3) src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:124 — src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:124-128 | src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:165-169 | src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php:69-73 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:124` 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 (5 lines × 3) src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:165 — src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:165-169 | src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:288-292 | src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php:69-73 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:165` 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 (5 lines × 3) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:263 — src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:263-267 | src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php:168-172 | src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:179-183 — 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.
D1 · Cyclomatic Complexity · UseDeclarationSniff.process (cyclomatic 52) · ×2
  • UseDeclarationSniff.process (cyclomatic 52) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:41 — UseDeclarationSniff.process has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • UseDeclarationSniff.process (cyclomatic 52) src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php:41 — UseDeclarationSniff.process has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php:42 — src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php:42-52 | src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php:42-52 | src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php:47-57 | src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php:42-52 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:57 — src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:57-148 | src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php:67-130 | src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php:57-146 | src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:74-311 — 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 · Edited copy of a member (30 corresponding lines) · ×2
  • Edited copy of a member (30 corresponding lines) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:364 — src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:364-402 | src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:417-446 — These two members are one piece of code written twice and then edited apart: 30 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.
  • Edited copy of a member (30 corresponding lines) src/Standards/Generic/Sniffs/Debug/JSHintSniff.php:53 — src/Standards/Generic/Sniffs/Debug/JSHintSniff.php:53-90 | src/Standards/Squiz/Sniffs/Debug/JSLintSniff.php:52-81 — These two members are one piece of code written twice and then edited apart: 30 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 · Edited copy of a member (20 corresponding lines) · ×2
  • Edited copy of a member (20 corresponding lines) src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php:54 — src/Standards/Generic/Sniffs/Commenting/FixmeSniff.php:54-73 | src/Standards/Generic/Sniffs/Commenting/TodoSniff.php:53-72 — These two members are one piece of code written twice and then edited apart: 20 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.
  • Edited copy of a member (20 corresponding lines) src/Files/File.php:2676 — src/Files/File.php:2676-2695 | src/Files/File.php:2717-2737 — These two members are one piece of code written twice and then edited apart: 20 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 · Duplicated block (36 lines × 2) · ×2
  • Duplicated block (36 lines × 2) src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php:60 — src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php:60-95 | src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php:60-95 — 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 (36 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:328 — src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:328-363 | src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:369-404 — before extracting anything, compare `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php` and `src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 118 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 `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:328` 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 (34 lines × 2) · ×2
  • Duplicated block (34 lines × 2) src/Generators/Text.php:129 — src/Generators/Text.php:129-162 | src/Generators/Text.php:164-197 — 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 (34 lines × 2) src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:80 — src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:80-113 | src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php:121-154 — 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 (32–33 lines × 2) · ×2
  • Duplicated block (32–33 lines × 2) src/Reports/Code.php:162 — src/Reports/Code.php:162-194 | src/Reports/Full.php:81-112 — before extracting anything, compare `src/Reports/Code.php` and `src/Reports/Full.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 78 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 `src/Reports/Code.php:162` 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 (32–33 lines × 2) src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:32 — src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:32-63 | src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:32-64 — before extracting anything, compare `src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php` and `src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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 `src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:32` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) src/Standards/Generic/Sniffs/WhiteSpace/ArbitraryParenthesesSpacingSniff.php:136 — src/Standards/Generic/Sniffs/WhiteSpace/ArbitraryParenthesesSpacingSniff.php:136-159 | src/Standards/Generic/Sniffs/WhiteSpace/ArbitraryParenthesesSpacingSniff.php:190-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Generic/Sniffs/WhiteSpace/ArbitraryParenthesesSpacingSniff.php:136` 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) src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:205 — src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:205-228 | src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:262-285 — 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 (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:143 — src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:143-158 | src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php:172-187 | src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php:77-92 — before extracting anything, compare `src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php` and `src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 92 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 `src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:143` 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 (16 lines × 3) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:392 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:392-407 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:465-480 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:543-558 — 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 `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:392` 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 (13 lines × 3) · ×2
  • Duplicated block (13 lines × 3) src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php:58 — src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php:58-70 | src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:76-88 | src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php:46-58 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 3) src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:191 — src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:191-203 | src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:289-301 | src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:890-902 — 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 `src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:395 — src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:395-405 | src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:420-431 — 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 `src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:395` 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–12 lines × 2) src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php:150 — src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php:150-160 | src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php:225-236 — 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 `src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php:150` 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 (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:458 — src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:458-468 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:555-565 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:672-682 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 3) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:364 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:364-375 | src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php:85-95 | src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php:252-262 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:364` 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 (10 lines × 10) · ×2
  • Duplicated block (10 lines × 10) src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php:79 — src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php:79-88 | src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php:205-215 | src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php:129-139 | src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php:164-174 | src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:270-280 | src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php:154-164 | src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:122-131 | src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:172-181 | src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php:129-139 | src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:154-163 — there are 10 copies across 9 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 10 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php:79` 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, `src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php:126` calls `findFirstOnLine` and `src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:267` 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 × 10) src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php:80 — src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php:80-89 | src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php:206-216 | src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php:130-140 | src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php:165-175 | src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:480-490 | src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php:155-165 | src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:123-132 | src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:173-182 | src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php:130-140 | src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:155-164 — there are 10 copies across 9 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 10 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php:80` 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 (9–10 lines × 2) · ×2
  • Duplicated block (9–10 lines × 2) src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:75 — src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:75-84 | src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php:90-98 — 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 `src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) src/Tokenizers/JS.php:1074 — src/Tokenizers/JS.php:1074-1082 | src/Tokenizers/PHP.php:2436-2445 — 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 `src/Tokenizers/JS.php:1074` 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, `src/Tokenizers/JS.php:1083` calls `str_repeat`, `count` and `src/Tokenizers/PHP.php:2446` 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 (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php:57 — src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php:57-65 | src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:75-83 | src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php:45-53 | src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php:62-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php:57` 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 × 4) src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:61 — src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:61-69 | src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:93-101 | src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:148-156 | src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:181-189 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:146` calls `ltrim` and `src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:91` 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.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×2
  • Duplicated block (8 lines × 5) src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:204 — src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:204-211 | src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:292-299 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:362-370 | src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php:250-257 | src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php:331-338 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:213` calls `str_repeat`, `addContent` and `src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php:340` 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 (8 lines × 5) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:392 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:392-399 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:465-472 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:543-550 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:655-662 | src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php:76-83 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:392` 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, `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:651` calls `processUseStatement`, `getTokens` and `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:390` 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×2
  • Duplicated block (6 lines × 4) src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:99 — src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:99-104 | src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php:93-98 | src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php:97-102 | src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:111-116 — before extracting anything, compare `src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php` and `src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:106` calls `recordMetric` and `src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php:100` 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 (6 lines × 4) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:149 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:149-154 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:619-624 | src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:161-166 | src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php:123-128 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:149` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · PHP.tokenize (cyclomatic 494) · ×1
  • PHP.tokenize (cyclomatic 494) src/Tokenizers/PHP.php:512 — PHP.tokenize has cyclomatic complexity 494 (threshold 15). To reduce it, separate the cases: extract each independent 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 · ScopeIndentSniff.process (cyclomatic 323) · ×1
  • ScopeIndentSniff.process (cyclomatic 323) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:127 — ScopeIndentSniff.process has cyclomatic complexity 323 (threshold 15). To reduce it, separate the cases: extract each independent 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 · PHP.processAdditional (cyclomatic 181) · ×1
  • PHP.processAdditional (cyclomatic 181) src/Tokenizers/PHP.php:2409 — PHP.processAdditional has cyclomatic complexity 181 (threshold 15). To reduce it, separate the cases: extract each independent 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 · Tokenizer.recurseScopeMap (cyclomatic 133) · ×1
  • Tokenizer.recurseScopeMap (cyclomatic 133) src/Tokenizers/Tokenizer.php:933 — Tokenizer.recurseScopeMap has cyclomatic complexity 133 (threshold 15). To reduce it, separate the cases: extract each independent 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 · JS.tokenize (cyclomatic 122) · ×1
  • JS.tokenize (cyclomatic 122) src/Tokenizers/JS.php:279 — JS.tokenize has cyclomatic complexity 122 (threshold 15). To reduce it, separate the cases: extract each independent 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 · Config.processLongArgument (cyclomatic 114) · ×1
  • Config.processLongArgument (cyclomatic 114) src/Config.php:715 — Config.processLongArgument has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent 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 · ArrayDeclarationSniff.processMultiLineArray (cyclomatic 112) · ×1
  • ArrayDeclarationSniff.processMultiLineArray (cyclomatic 112) src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:318 — ArrayDeclarationSniff.processMultiLineArray has cyclomatic complexity 112 (threshold 15). To reduce it, separate the cases: extract each independent 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 · InlineControlStructureSniff.process (cyclomatic 95) · ×1
  • InlineControlStructureSniff.process (cyclomatic 95) src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php:67 — InlineControlStructureSniff.process has cyclomatic complexity 95 (threshold 15). To reduce it, separate the cases: extract each independent 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 · Tokenizer.createPositionMap (cyclomatic 90) · ×1
  • Tokenizer.createPositionMap (cyclomatic 90) src/Tokenizers/Tokenizer.php:170 — Tokenizer.createPositionMap has cyclomatic complexity 90 (threshold 15). To reduce it, separate the cases: extract each independent 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 · AbstractPatternSniff.processPattern (cyclomatic 88) · ×1
  • AbstractPatternSniff.processPattern (cyclomatic 88) src/Sniffs/AbstractPatternSniff.php:255 — AbstractPatternSniff.processPattern has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent 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 · CSS.tokenize (cyclomatic 88) · ×1
  • CSS.tokenize (cyclomatic 88) src/Tokenizers/CSS.php:52 — CSS.tokenize has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent 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 · ClassDeclarationSniff.processOpen (cyclomatic 84) · ×1
  • ClassDeclarationSniff.processOpen (cyclomatic 84) src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:62 — ClassDeclarationSniff.processOpen has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent 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 · UseDeclarationSniff.processUseGroup (cyclomatic 82) · ×1
  • UseDeclarationSniff.processUseGroup (cyclomatic 82) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:283 — UseDeclarationSniff.processUseGroup has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent 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 · FunctionCommentSniff.processParams (cyclomatic 72) · ×1
  • FunctionCommentSniff.processParams (cyclomatic 72) src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:281 — FunctionCommentSniff.processParams has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent 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 · MultipleStatementAlignmentSniff.checkAlignment (cyclomatic 68) · ×1
  • MultipleStatementAlignmentSniff.checkAlignment (cyclomatic 68) src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php:100 — MultipleStatementAlignmentSniff.checkAlignment has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ControlStructureSpacingSniff.process (cyclomatic 67) · ×1
  • ControlStructureSpacingSniff.process (cyclomatic 67) src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php:64 — ControlStructureSpacingSniff.process has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent 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 · BlockCommentSniff.process (cyclomatic 66) · ×1
  • BlockCommentSniff.process (cyclomatic 66) src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:51 — BlockCommentSniff.process has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent 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 · DocCommentSniff.process (cyclomatic 65) · ×1
  • DocCommentSniff.process (cyclomatic 65) src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:50 — DocCommentSniff.process has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ControlSignatureSniff.process (cyclomatic 65) · ×1
  • ControlSignatureSniff.process (cyclomatic 65) src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php:71 — ControlSignatureSniff.process has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · File.getMethodParameters (cyclomatic 62) · ×1
  • File.getMethodParameters (cyclomatic 62) src/Files/File.php:1333 — File.getMethodParameters has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent 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 · ForLoopDeclarationSniff.process (cyclomatic 62) · ×1
  • ForLoopDeclarationSniff.process (cyclomatic 62) src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:72 — ForLoopDeclarationSniff.process has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent 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 · GitMergeConflictSniff.process (cyclomatic 61) · ×1
  • GitMergeConflictSniff.process (cyclomatic 61) src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php:54 — GitMergeConflictSniff.process has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent 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 · SideEffectsSniff.searchForConflict (cyclomatic 61) · ×1
  • SideEffectsSniff.searchForConflict (cyclomatic 61) src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php:79 — SideEffectsSniff.searchForConflict has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent 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 · Ruleset.processRuleset (cyclomatic 60) · ×1
  • Ruleset.processRuleset (cyclomatic 60) src/Ruleset.php:317 — Ruleset.processRuleset has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent 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 · Ruleset.processRule (cyclomatic 60) · ×1
  • Ruleset.processRule (cyclomatic 60) src/Ruleset.php:867 — Ruleset.processRule has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent 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 · FunctionCallSignatureSniff.processMultiLineCall (cyclomatic 60) · ×1
  • FunctionCallSignatureSniff.processMultiLineCall (cyclomatic 60) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:337 — FunctionCallSignatureSniff.processMultiLineCall has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent 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 · NonExecutableCodeSniff.process (cyclomatic 59) · ×1
  • NonExecutableCodeSniff.process (cyclomatic 59) src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php:64 — NonExecutableCodeSniff.process has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent 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 · FunctionDeclarationArgumentSpacingSniff.processBracket (cyclomatic 58) · ×1
  • FunctionDeclarationArgumentSpacingSniff.processBracket (cyclomatic 58) src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:104 — FunctionDeclarationArgumentSpacingSniff.processBracket has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent 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 · SwitchDeclarationSniff.process (cyclomatic 57) · ×1
  • SwitchDeclarationSniff.process (cyclomatic 57) src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php:58 — SwitchDeclarationSniff.process has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent 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 · FunctionSpacingSniff.process (cyclomatic 57) · ×1
  • FunctionSpacingSniff.process (cyclomatic 57) src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php:69 — FunctionSpacingSniff.process has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent 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 · File.addMessage (cyclomatic 56) · ×1
  • File.addMessage (cyclomatic 56) src/Files/File.php:842 — File.addMessage has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent 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 · InlineCommentSniff.process (cyclomatic 53) · ×1
  • InlineCommentSniff.process (cyclomatic 53) src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php:54 — InlineCommentSniff.process has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent 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 · File.process (cyclomatic 52) · ×1
  • File.process (cyclomatic 52) src/Files/File.php:317 — File.process has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent 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 · UnusedFunctionParameterSniff.process (cyclomatic 52) · ×1
  • UnusedFunctionParameterSniff.process (cyclomatic 52) src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php:59 — UnusedFunctionParameterSniff.process has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent 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 · Code.generateFileReport (cyclomatic 51) · ×1
  • Code.generateFileReport (cyclomatic 51) src/Reports/Code.php:33 — Code.generateFileReport has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MultiLineConditionSniff.process (cyclomatic 48) · ×1
  • MultiLineConditionSniff.process (cyclomatic 48) src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php:61 — MultiLineConditionSniff.process has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent 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 · OperatorBracketSniff.process (cyclomatic 48) · ×1
  • OperatorBracketSniff.process (cyclomatic 48) src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php:51 — OperatorBracketSniff.process has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent 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 · EmbeddedPhpSniff.validateMultilineEmbeddedPhp (cyclomatic 47) · ×1
  • EmbeddedPhpSniff.validateMultilineEmbeddedPhp (cyclomatic 47) src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:66 — EmbeddedPhpSniff.validateMultilineEmbeddedPhp has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Cache.load (cyclomatic 47) · ×1
  • Cache.load (cyclomatic 47) src/Util/Cache.php:42 — Cache.load has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OperatorSpacingSniff.process (cyclomatic 45) · ×1
  • OperatorSpacingSniff.process (cyclomatic 45) src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php:131 — OperatorSpacingSniff.process has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JS.processAdditional (cyclomatic 45) · ×1
  • JS.processAdditional (cyclomatic 45) src/Tokenizers/JS.php:1052 — JS.processAdditional has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeclareStatementSniff.process (cyclomatic 44) · ×1
  • DeclareStatementSniff.process (cyclomatic 44) src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php:41 — DeclareStatementSniff.process 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 · File.findStartOfStatement (cyclomatic 42) · ×1
  • File.findStartOfStatement (cyclomatic 42) src/Files/File.php:2346 — File.findStartOfStatement has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SuperfluousWhitespaceSniff.process (cyclomatic 41) · ×1
  • SuperfluousWhitespaceSniff.process (cyclomatic 41) src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php:72 — SuperfluousWhitespaceSniff.process 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 · Runner.run (cyclomatic 39) · ×1
  • Runner.run (cyclomatic 39) src/Runner.php:353 — Runner.run has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ForEachLoopDeclarationSniff.process (cyclomatic 39) · ×1
  • ForEachLoopDeclarationSniff.process (cyclomatic 39) src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:54 — ForEachLoopDeclarationSniff.process has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Tokenizer.createLevelMap (cyclomatic 39) · ×1
  • Tokenizer.createLevelMap (cyclomatic 39) src/Tokenizers/Tokenizer.php:1500 — Tokenizer.createLevelMap has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArbitraryParenthesesSpacingSniff.process (cyclomatic 38) · ×1
  • ArbitraryParenthesesSpacingSniff.process (cyclomatic 38) src/Standards/Generic/Sniffs/WhiteSpace/ArbitraryParenthesesSpacingSniff.php:83 — ArbitraryParenthesesSpacingSniff.process has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionCommentSniff.processReturn (cyclomatic 38) · ×1
  • FunctionCommentSniff.processReturn (cyclomatic 38) src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:45 — FunctionCommentSniff.processReturn has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CommentedOutCodeSniff.process (cyclomatic 38) · ×1
  • CommentedOutCodeSniff.process (cyclomatic 38) src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php:60 — CommentedOutCodeSniff.process has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MemberVarSpacingSniff.processMemberVar (cyclomatic 38) · ×1
  • MemberVarSpacingSniff.processMemberVar (cyclomatic 38) src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php:44 — MemberVarSpacingSniff.processMemberVar has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Ruleset.expandRulesetReference (cyclomatic 37) · ×1
  • Ruleset.expandRulesetReference (cyclomatic 37) src/Ruleset.php:685 — Ruleset.expandRulesetReference has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionCommentSniff.processParams (cyclomatic 37) · ×1
  • FunctionCommentSniff.processParams (cyclomatic 37) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:265 — FunctionCommentSniff.processParams has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SwitchDeclarationSniff.process (cyclomatic 37) · ×1
  • SwitchDeclarationSniff.process (cyclomatic 37) src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php:48 — SwitchDeclarationSniff.process has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Tokenizer.createTokenMap (cyclomatic 37) · ×1
  • Tokenizer.createTokenMap (cyclomatic 37) src/Tokenizers/Tokenizer.php:665 — Tokenizer.createTokenMap has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VersionControl.generate (cyclomatic 36) · ×1
  • VersionControl.generate (cyclomatic 36) src/Reports/VersionControl.php:150 — VersionControl.generate has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DisallowSpaceIndentSniff.process (cyclomatic 36) · ×1
  • DisallowSpaceIndentSniff.process (cyclomatic 36) src/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php:61 — DisallowSpaceIndentSniff.process has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionDeclarationSniff.process (cyclomatic 36) · ×1
  • FunctionDeclarationSniff.process (cyclomatic 36) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:63 — FunctionDeclarationSniff.process has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ComparisonOperatorUsageSniff.process (cyclomatic 36) · ×1
  • ComparisonOperatorUsageSniff.process (cyclomatic 36) src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php:89 — ComparisonOperatorUsageSniff.process has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateWidgetTypeCallbackSniff.process (cyclomatic 35) · ×1
  • CreateWidgetTypeCallbackSniff.process (cyclomatic 35) src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php:48 — CreateWidgetTypeCallbackSniff.process 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 · BooleanOperatorPlacementSniff.process (cyclomatic 35) · ×1
  • BooleanOperatorPlacementSniff.process (cyclomatic 35) src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php:55 — BooleanOperatorPlacementSniff.process 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 · DisallowMultipleAssignmentsSniff.process (cyclomatic 35) · ×1
  • DisallowMultipleAssignmentsSniff.process (cyclomatic 35) src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php:41 — DisallowMultipleAssignmentsSniff.process 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 · ConcatenationSpacingSniff.process (cyclomatic 34) · ×1
  • ConcatenationSpacingSniff.process (cyclomatic 34) src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php:55 — ConcatenationSpacingSniff.process 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 · FunctionDeclarationSniff.processArgumentList (cyclomatic 33) · ×1
  • FunctionDeclarationSniff.processArgumentList (cyclomatic 33) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:372 — FunctionDeclarationSniff.processArgumentList 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 · FileCommentSniff.process (cyclomatic 33) · ×1
  • FileCommentSniff.process (cyclomatic 33) src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php:50 — FileCommentSniff.process 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 · ScopeKeywordSpacingSniff.process (cyclomatic 33) · ×1
  • ScopeKeywordSpacingSniff.process (cyclomatic 33) src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php:44 — ScopeKeywordSpacingSniff.process 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 · OpeningFunctionBraceBsdAllmanSniff.process (cyclomatic 32) · ×1
  • OpeningFunctionBraceBsdAllmanSniff.process (cyclomatic 32) src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php:58 — OpeningFunctionBraceBsdAllmanSniff.process 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 · DisallowTabIndentSniff.process (cyclomatic 32) · ×1
  • DisallowTabIndentSniff.process (cyclomatic 32) src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php:61 — DisallowTabIndentSniff.process 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 · File.findEndOfStatement (cyclomatic 31) · ×1
  • File.findEndOfStatement (cyclomatic 31) src/Files/File.php:2499 — File.findEndOfStatement has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · File.getMemberProperties (cyclomatic 30) · ×1
  • File.getMemberProperties (cyclomatic 30) src/Files/File.php:1796 — File.getMemberProperties 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 · PropertyDeclarationSniff.processMemberVar (cyclomatic 30) · ×1
  • PropertyDeclarationSniff.processMemberVar (cyclomatic 30) src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php:28 — PropertyDeclarationSniff.processMemberVar 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 · LongConditionClosingCommentSniff.process (cyclomatic 30) · ×1
  • LongConditionClosingCommentSniff.process (cyclomatic 30) src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php:83 — LongConditionClosingCommentSniff.process 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 · Full.generateFileReport (cyclomatic 29) · ×1
  • Full.generateFileReport (cyclomatic 29) src/Reports/Full.php:33 — Full.generateFileReport 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 · Source.generate (cyclomatic 29) · ×1
  • Source.generate (cyclomatic 29) src/Reports/Source.php:83 — Source.generate 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 · FunctionCommentSniff.process (cyclomatic 29) · ×1
  • FunctionCommentSniff.process (cyclomatic 29) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:60 — FunctionCommentSniff.process 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 · FileHeaderSniff.processHeaderLines (cyclomatic 29) · ×1
  • FileHeaderSniff.processHeaderLines (cyclomatic 29) src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php:289 — FileHeaderSniff.processHeaderLines 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 · SwitchDeclarationSniff.findNestedTerminator (cyclomatic 29) · ×1
  • SwitchDeclarationSniff.findNestedTerminator (cyclomatic 29) src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php:246 — SwitchDeclarationSniff.findNestedTerminator 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 · ClassDeclarationSniff.processClose (cyclomatic 29) · ×1
  • ClassDeclarationSniff.processClose (cyclomatic 29) src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php:99 — ClassDeclarationSniff.processClose 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 · FunctionCommentThrowTagSniff.process (cyclomatic 29) · ×1
  • FunctionCommentThrowTagSniff.process (cyclomatic 29) src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php:41 — FunctionCommentThrowTagSniff.process 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 · EmptyPHPStatementSniff.process (cyclomatic 28) · ×1
  • EmptyPHPStatementSniff.process (cyclomatic 28) src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php:47 — EmptyPHPStatementSniff.process 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 · OpeningFunctionBraceKernighanRitchieSniff.process (cyclomatic 28) · ×1
  • OpeningFunctionBraceKernighanRitchieSniff.process (cyclomatic 28) src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php:58 — OpeningFunctionBraceKernighanRitchieSniff.process 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 · ControlStructureSpacingSniff.process (cyclomatic 28) · ×1
  • ControlStructureSpacingSniff.process (cyclomatic 28) src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:59 — ControlStructureSpacingSniff.process 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 · ArrayDeclarationSniff.processSingleLineArray (cyclomatic 28) · ×1
  • ArrayDeclarationSniff.processSingleLineArray (cyclomatic 28) src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:144 — ArrayDeclarationSniff.processSingleLineArray 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 · EmbeddedPhpSniff.validateInlineEmbeddedPhp (cyclomatic 28) · ×1
  • EmbeddedPhpSniff.validateInlineEmbeddedPhp (cyclomatic 28) src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:299 — EmbeddedPhpSniff.validateInlineEmbeddedPhp 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 · FileHeaderSniff.getHeaderLines (cyclomatic 27) · ×1
  • FileHeaderSniff.getHeaderLines (cyclomatic 27) src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php:131 — FileHeaderSniff.getHeaderLines 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 · File.getMethodProperties (cyclomatic 26) · ×1
  • File.getMethodProperties (cyclomatic 26) src/Files/File.php:1623 — File.getMethodProperties 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 · UselessOverridingMethodSniff.process (cyclomatic 26) · ×1
  • UselessOverridingMethodSniff.process (cyclomatic 26) src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php:53 — UselessOverridingMethodSniff.process 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 · ObjectOperatorIndentSniff.process (cyclomatic 26) · ×1
  • ObjectOperatorIndentSniff.process (cyclomatic 26) src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php:64 — ObjectOperatorIndentSniff.process 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 · ClassDefinitionOpeningBraceSpaceSniff.process (cyclomatic 26) · ×1
  • ClassDefinitionOpeningBraceSpaceSniff.process (cyclomatic 26) src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php:48 — ClassDefinitionOpeningBraceSpaceSniff.process 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 · SelfMemberReferenceSniff.processTokenWithinScope (cyclomatic 26) · ×1
  • SelfMemberReferenceSniff.processTokenWithinScope (cyclomatic 26) src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php:44 — SelfMemberReferenceSniff.processTokenWithinScope 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 · VariableCommentSniff.processMemberVar (cyclomatic 26) · ×1
  • VariableCommentSniff.processMemberVar (cyclomatic 26) src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php:29 — VariableCommentSniff.processMemberVar 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 · File.isReference (cyclomatic 25) · ×1
  • File.isReference (cyclomatic 25) src/Files/File.php:2032 — File.isReference 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 · IncludeSystemSniff.processTokenWithinScope (cyclomatic 25) · ×1
  • IncludeSystemSniff.processTokenWithinScope (cyclomatic 25) src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php:63 — IncludeSystemSniff.processTokenWithinScope 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 · FunctionCallSignatureSniff.processSingleLineCall (cyclomatic 25) · ×1
  • FunctionCallSignatureSniff.processSingleLineCall (cyclomatic 25) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:207 — FunctionCallSignatureSniff.processSingleLineCall 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 · OperatorBracketSniff.addMissingBracketsError (cyclomatic 25) · ×1
  • OperatorBracketSniff.addMissingBracketsError (cyclomatic 25) src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php:274 — OperatorBracketSniff.addMissingBracketsError 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 · Runner.printProgress (cyclomatic 24) · ×1
  • Runner.printProgress (cyclomatic 24) src/Runner.php:828 — Runner.printProgress 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 · IncrementDecrementSpacingSniff.process (cyclomatic 24) · ×1
  • IncrementDecrementSpacingSniff.process (cyclomatic 24) src/Standards/Generic/Sniffs/WhiteSpace/IncrementDecrementSpacingSniff.php:54 — IncrementDecrementSpacingSniff.process 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 · UnusedSystemSniff.process (cyclomatic 24) · ×1
  • UnusedSystemSniff.process (cyclomatic 24) src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php:40 — UnusedSystemSniff.process 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 · MethodDeclarationSniff.processTokenWithinScope (cyclomatic 24) · ×1
  • MethodDeclarationSniff.processTokenWithinScope (cyclomatic 24) src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php:39 — MethodDeclarationSniff.processTokenWithinScope 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 · Fixer.replaceToken (cyclomatic 23) · ×1
  • Fixer.replaceToken (cyclomatic 23) src/Fixer.php:474 — Fixer.replaceToken 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 · IndentationSniff.process (cyclomatic 23) · ×1
  • IndentationSniff.process (cyclomatic 23) src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php:55 — IndentationSniff.process 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 · LowercasePHPFunctionsSniff.process (cyclomatic 23) · ×1
  • LowercasePHPFunctionsSniff.process (cyclomatic 23) src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php:60 — LowercasePHPFunctionsSniff.process 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 · FunctionClosingBraceSpaceSniff.process (cyclomatic 23) · ×1
  • FunctionClosingBraceSpaceSniff.process (cyclomatic 23) src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php:53 — FunctionClosingBraceSpaceSniff.process 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 · LineLengthSniff.checkLineLength (cyclomatic 22) · ×1
  • LineLengthSniff.checkLineLength (cyclomatic 22) src/Standards/Generic/Sniffs/Files/LineLengthSniff.php:97 — LineLengthSniff.checkLineLength 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 · ScopeClosingBraceSniff.process (cyclomatic 22) · ×1
  • ScopeClosingBraceSniff.process (cyclomatic 22) src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php:48 — ScopeClosingBraceSniff.process 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 · Config.processShortArgument (cyclomatic 21) · ×1
  • Config.processShortArgument (cyclomatic 21) src/Config.php:610 — Config.processShortArgument has cyclomatic complexity 21 (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 · Ruleset.__construct (cyclomatic 21) · ×1
  • Ruleset.__construct (cyclomatic 21) src/Ruleset.php:128 — Ruleset.__construct 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 · SpaceAfterCastSniff.process (cyclomatic 21) · ×1
  • SpaceAfterCastSniff.process (cyclomatic 21) src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:55 — SpaceAfterCastSniff.process 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 · DocCommentAlignmentSniff.process (cyclomatic 21) · ×1
  • DocCommentAlignmentSniff.process (cyclomatic 21) src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php:51 — DocCommentAlignmentSniff.process 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 · Summary.generate (cyclomatic 20) · ×1
  • Summary.generate (cyclomatic 20) src/Reports/Summary.php:65 — Summary.generate has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Runner.processFile (cyclomatic 20) · ×1
  • Runner.processFile (cyclomatic 20) src/Runner.php:621 — Runner.processFile 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 · SpreadOperatorSpacingAfterSniff.process (cyclomatic 20) · ×1
  • SpreadOperatorSpacingAfterSniff.process (cyclomatic 20) src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php:55 — SpreadOperatorSpacingAfterSniff.process 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 · FileCommentSniff.process (cyclomatic 20) · ×1
  • FileCommentSniff.process (cyclomatic 20) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:93 — FileCommentSniff.process 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 · InlineIfDeclarationSniff.process (cyclomatic 20) · ×1
  • InlineIfDeclarationSniff.process (cyclomatic 20) src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php:40 — InlineIfDeclarationSniff.process 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 · JS.getRegexToken (cyclomatic 20) · ×1
  • JS.getRegexToken (cyclomatic 20) src/Tokenizers/JS.php:915 — JS.getRegexToken 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 · LanguageConstructSpacingSniff.process (cyclomatic 19) · ×1
  • LanguageConstructSpacingSniff.process (cyclomatic 19) src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php:56 — LanguageConstructSpacingSniff.process 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 · ReturnTypeDeclarationSniff.process (cyclomatic 19) · ×1
  • ReturnTypeDeclarationSniff.process (cyclomatic 19) src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php:44 — ReturnTypeDeclarationSniff.process 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 · ShorthandSizeSniff.process (cyclomatic 19) · ×1
  • ShorthandSizeSniff.process (cyclomatic 19) src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php:62 — ShorthandSizeSniff.process 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 · Config.__construct (cyclomatic 18) · ×1
  • Config.__construct (cyclomatic 18) src/Config.php:340 — Config.__construct 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 · Ruleset.setSniffProperty (cyclomatic 18) · ×1
  • Ruleset.setSniffProperty (cyclomatic 18) src/Ruleset.php:1309 — Ruleset.setSniffProperty 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 · AssignmentInConditionSniff.process (cyclomatic 18) · ×1
  • AssignmentInConditionSniff.process (cyclomatic 18) src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php:78 — AssignmentInConditionSniff.process 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 · DisallowAlternativePHPTagsSniff.process (cyclomatic 18) · ×1
  • DisallowAlternativePHPTagsSniff.process (cyclomatic 18) src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php:72 — DisallowAlternativePHPTagsSniff.process 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 · DisallowShortOpenTagSniff.process (cyclomatic 18) · ×1
  • DisallowShortOpenTagSniff.process (cyclomatic 18) src/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php:51 — DisallowShortOpenTagSniff.process 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 · LowerCaseTypeSniff.process (cyclomatic 18) · ×1
  • LowerCaseTypeSniff.process (cyclomatic 18) src/Standards/Generic/Sniffs/PHP/LowerCaseTypeSniff.php:71 — LowerCaseTypeSniff.process 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 · IncludingFileSniff.process (cyclomatic 18) · ×1
  • IncludingFileSniff.process (cyclomatic 18) src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php:48 — IncludingFileSniff.process 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 · IncrementDecrementUsageSniff.processAssignment (cyclomatic 18) · ×1
  • IncrementDecrementUsageSniff.processAssignment (cyclomatic 18) src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php:119 — IncrementDecrementUsageSniff.processAssignment 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 · Comment.tokenizeString (cyclomatic 18) · ×1
  • Comment.tokenizeString (cyclomatic 18) src/Tokenizers/Comment.php:30 — Comment.tokenizeString 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 · Common.suggestType (cyclomatic 18) · ×1
  • Common.suggestType (cyclomatic 18) src/Util/Common.php:446 — Common.suggestType 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 · Config.restoreDefaults (cyclomatic 17) · ×1
  • Config.restoreDefaults (cyclomatic 17) src/Config.php:479 — Config.restoreDefaults 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 · Text.printCodeComparisonBlock (cyclomatic 17) · ×1
  • Text.printCodeComparisonBlock (cyclomatic 17) src/Generators/Text.php:126 — Text.printCodeComparisonBlock 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 · VersionControl.generateFileReport (cyclomatic 17) · ×1
  • VersionControl.generateFileReport (cyclomatic 17) src/Reports/VersionControl.php:41 — VersionControl.generateFileReport 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 · AbstractVariableSniff.processTokenWithinScope (cyclomatic 17) · ×1
  • AbstractVariableSniff.processTokenWithinScope (cyclomatic 17) src/Sniffs/AbstractVariableSniff.php:78 — AbstractVariableSniff.processTokenWithinScope 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 · FunctionCallArgumentSpacingSniff.checkSpacing (cyclomatic 17) · ×1
  • FunctionCallArgumentSpacingSniff.checkSpacing (cyclomatic 17) src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php:102 — FunctionCallArgumentSpacingSniff.checkSpacing 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 · ClassDeclarationSniff.process (cyclomatic 17) · ×1
  • ClassDeclarationSniff.process (cyclomatic 17) src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php:45 — ClassDeclarationSniff.process 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 · ValidFunctionNameSniff.processTokenOutsideScope (cyclomatic 17) · ×1
  • ValidFunctionNameSniff.processTokenOutsideScope (cyclomatic 17) src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php:181 — ValidFunctionNameSniff.processTokenOutsideScope 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 · AnonClassDeclarationSniff.processSingleLineArgumentList (cyclomatic 17) · ×1
  • AnonClassDeclarationSniff.processSingleLineArgumentList (cyclomatic 17) src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php:143 — AnonClassDeclarationSniff.processSingleLineArgumentList 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 · ClassDefinitionClosingBraceSpaceSniff.process (cyclomatic 17) · ×1
  • ClassDefinitionClosingBraceSpaceSniff.process (cyclomatic 17) src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php:48 — ClassDefinitionClosingBraceSpaceSniff.process 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 · ClosingDeclarationCommentSniff.process (cyclomatic 17) · ×1
  • ClosingDeclarationCommentSniff.process (cyclomatic 17) src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php:45 — ClosingDeclarationCommentSniff.process 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 · OperatorSpacingSniff.isOperator (cyclomatic 17) · ×1
  • OperatorSpacingSniff.isOperator (cyclomatic 17) src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php:326 — OperatorSpacingSniff.isOperator 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 · Config.setConfigData (cyclomatic 16) · ×1
  • Config.setConfigData (cyclomatic 16) src/Config.php:1566 — Config.setConfigData 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 · File.findPrevious (cyclomatic 16) · ×1
  • File.findPrevious (cyclomatic 16) src/Files/File.php:2216 — File.findPrevious 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 · DisallowYodaConditionsSniff.process (cyclomatic 16) · ×1
  • DisallowYodaConditionsSniff.process (cyclomatic 16) src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php:42 — DisallowYodaConditionsSniff.process 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 · FileCommentSniff.processTags (cyclomatic 16) · ×1
  • FileCommentSniff.processTags (cyclomatic 16) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:223 — FileCommentSniff.processTags 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 · ValidFunctionNameSniff.processTokenWithinScope (cyclomatic 16) · ×1
  • ValidFunctionNameSniff.processTokenWithinScope (cyclomatic 16) src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php:73 — ValidFunctionNameSniff.processTokenWithinScope 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 · DisallowComparisonAssignmentSniff.process (cyclomatic 16) · ×1
  • DisallowComparisonAssignmentSniff.process (cyclomatic 16) src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php:41 — DisallowComparisonAssignmentSniff.process 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 · DoubleQuoteUsageSniff.process (cyclomatic 16) · ×1
  • DoubleQuoteUsageSniff.process (cyclomatic 16) src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php:43 — DoubleQuoteUsageSniff.process 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 · PHP.tokenize (cognitive 1203) · ×1
  • PHP.tokenize (cognitive 1203) src/Tokenizers/PHP.php:512 — PHP.tokenize has cognitive complexity 1203 (threshold 15). Drivers by points: if/else 231 (813 pts), boolean chains 252, loops 36 (138 pts) (nesting depth added 684). 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 · Config.processLongArgument (cognitive 1063) · ×1
  • Config.processLongArgument (cognitive 1063) src/Config.php:715 — Config.processLongArgument has cognitive complexity 1063 (threshold 15). Drivers by points: if/else 117 (955 pts), loops 7 (69 pts), error handling 3 (30 pts), boolean chains 8, match/switch 1 (nesting depth added 927). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PHP.processAdditional (cognitive 974) · ×1
  • PHP.processAdditional (cognitive 974) src/Tokenizers/PHP.php:2409 — PHP.processAdditional has cognitive complexity 974 (threshold 15). Drivers by points: if/else 117 (766 pts), loops 26 (160 pts), boolean chains 48 (nesting depth added 783). 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 · ScopeIndentSniff.process (cognitive 953) · ×1
  • ScopeIndentSniff.process (cognitive 953) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:127 — ScopeIndentSniff.process has cognitive complexity 953 (threshold 15). Drivers by points: if/else 250 (835 pts), boolean chains 100, loops 6 (18 pts) (nesting depth added 597). 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 · Tokenizer.recurseScopeMap (cognitive 518) · ×1
  • Tokenizer.recurseScopeMap (cognitive 518) src/Tokenizers/Tokenizer.php:933 — Tokenizer.recurseScopeMap has cognitive complexity 518 (threshold 15). Drivers by points: if/else 107 (451 pts), boolean chains 44, loops 4 (23 pts) (nesting depth added 363). 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 · Tokenizer.createPositionMap (cognitive 507) · ×1
  • Tokenizer.createPositionMap (cognitive 507) src/Tokenizers/Tokenizer.php:170 — Tokenizer.createPositionMap has cognitive complexity 507 (threshold 15). Drivers by points: if/else 75 (399 pts), loops 10 (85 pts), boolean chains 23 (nesting depth added 399). 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 · JS.tokenize (cognitive 372) · ×1
  • JS.tokenize (cognitive 372) src/Tokenizers/JS.php:279 — JS.tokenize has cognitive complexity 372 (threshold 15). Drivers by points: if/else 94 (309 pts), loops 12 (35 pts), boolean chains 28 (nesting depth added 238). 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 · AbstractPatternSniff.processPattern (cognitive 368) · ×1
  • AbstractPatternSniff.processPattern (cognitive 368) src/Sniffs/AbstractPatternSniff.php:255 — AbstractPatternSniff.processPattern has cognitive complexity 368 (threshold 15). Drivers by points: if/else 85 (333 pts), boolean chains 21, loops 4 (14 pts) (nesting depth added 258). 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 · UseDeclarationSniff.processUseGroup (cognitive 335) · ×1
  • UseDeclarationSniff.processUseGroup (cognitive 335) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:283 — UseDeclarationSniff.processUseGroup has cognitive complexity 335 (threshold 15). Drivers by points: if/else 91 (272 pts), loops 12 (59 pts), boolean chains 4 (nesting depth added 228). 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 · ArrayDeclarationSniff.processMultiLineArray (cognitive 332) · ×1
  • ArrayDeclarationSniff.processMultiLineArray (cognitive 332) src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:318 — ArrayDeclarationSniff.processMultiLineArray has cognitive complexity 332 (threshold 15). Drivers by points: if/else 105 (287 pts), loops 8 (25 pts), boolean chains 20 (nesting depth added 199). 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 · ClassDeclarationSniff.processOpen (cognitive 274) · ×1
  • ClassDeclarationSniff.processOpen (cognitive 274) src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:62 — ClassDeclarationSniff.processOpen has cognitive complexity 274 (threshold 15). Drivers by points: if/else 80 (225 pts), loops 9 (34 pts), boolean chains 15 (nesting depth added 170). 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 · CSS.tokenize (cognitive 232) · ×1
  • CSS.tokenize (cognitive 232) src/Tokenizers/CSS.php:52 — CSS.tokenize has cognitive complexity 232 (threshold 15). Drivers by points: if/else 60 (182 pts), loops 9 (28 pts), boolean chains 20, match/switch 1 (2 pts) (nesting depth added 142). 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 · UseDeclarationSniff.process (cognitive 228) · ×1
  • UseDeclarationSniff.process (cognitive 228) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:41 — UseDeclarationSniff.process has cognitive complexity 228 (threshold 15). Drivers by points: if/else 44 (186 pts), loops 8 (36 pts), boolean chains 6 (nesting depth added 170). 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 · FunctionCommentSniff.processParams (cognitive 223) · ×1
  • FunctionCommentSniff.processParams (cognitive 223) src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:281 — FunctionCommentSniff.processParams has cognitive complexity 223 (threshold 15). Drivers by points: if/else 65 (196 pts), loops 8 (16 pts), boolean chains 11 (nesting depth added 139). 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 · JS.processAdditional (cognitive 211) · ×1
  • JS.processAdditional (cognitive 211) src/Tokenizers/JS.php:1052 — JS.processAdditional has cognitive complexity 211 (threshold 15). Drivers by points: if/else 35 (158 pts), loops 10 (49 pts), boolean chains 4 (nesting depth added 162). 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 · Tokenizer.createLevelMap (cognitive 202) · ×1
  • Tokenizer.createLevelMap (cognitive 202) src/Tokenizers/Tokenizer.php:1500 — Tokenizer.createLevelMap has cognitive complexity 202 (threshold 15). Drivers by points: if/else 28 (136 pts), loops 9 (63 pts), boolean chains 3 (nesting depth added 162). 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 · FunctionDeclarationArgumentSpacingSniff.processBracket (cognitive 198) · ×1
  • FunctionDeclarationArgumentSpacingSniff.processBracket (cognitive 198) src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:104 — FunctionDeclarationArgumentSpacingSniff.processBracket has cognitive complexity 198 (threshold 15). Drivers by points: if/else 65 (196 pts), boolean chains 1, loops 1 (nesting depth added 131). 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 · SwitchDeclarationSniff.process (cognitive 193) · ×1
  • SwitchDeclarationSniff.process (cognitive 193) src/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php:58 — SwitchDeclarationSniff.process has cognitive complexity 193 (threshold 15). Drivers by points: if/else 47 (157 pts), loops 6 (26 pts), boolean chains 10 (nesting depth added 130). 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 · FunctionCallSignatureSniff.processMultiLineCall (cognitive 190) · ×1
  • FunctionCallSignatureSniff.processMultiLineCall (cognitive 190) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:337 — FunctionCallSignatureSniff.processMultiLineCall has cognitive complexity 190 (threshold 15). Drivers by points: if/else 57 (169 pts), boolean chains 11, loops 3 (10 pts) (nesting depth added 119). 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 · Ruleset.processRule (cognitive 189) · ×1
  • Ruleset.processRule (cognitive 189) src/Ruleset.php:867 — Ruleset.processRule has cognitive complexity 189 (threshold 15). Drivers by points: if/else 45 (155 pts), loops 7 (22 pts), boolean chains 12 (nesting depth added 125). 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 · MultipleStatementAlignmentSniff.checkAlignment (cognitive 189) · ×1
  • MultipleStatementAlignmentSniff.checkAlignment (cognitive 189) src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php:100 — MultipleStatementAlignmentSniff.checkAlignment has cognitive complexity 189 (threshold 15). Drivers by points: if/else 67 (165 pts), loops 5 (13 pts), boolean chains 11 (nesting depth added 106). 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 · InlineControlStructureSniff.process (cognitive 180) · ×1
  • InlineControlStructureSniff.process (cognitive 180) src/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php:67 — InlineControlStructureSniff.process has cognitive complexity 180 (threshold 15). Drivers by points: if/else 61 (131 pts), boolean chains 39, loops 4 (10 pts) (nesting depth added 76). 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 · ForLoopDeclarationSniff.process (cognitive 177) · ×1
  • ForLoopDeclarationSniff.process (cognitive 177) src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:72 — ForLoopDeclarationSniff.process has cognitive complexity 177 (threshold 15). Drivers by points: if/else 46 (126 pts), loops 7 (34 pts), boolean chains 17 (nesting depth added 107). 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 · ControlSignatureSniff.process (cognitive 173) · ×1
  • ControlSignatureSniff.process (cognitive 173) src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php:71 — ControlSignatureSniff.process has cognitive complexity 173 (threshold 15). Drivers by points: if/else 59 (137 pts), loops 4 (21 pts), boolean chains 15 (nesting depth added 95). 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 · DocCommentSniff.process (cognitive 168) · ×1
  • DocCommentSniff.process (cognitive 168) src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:50 — DocCommentSniff.process has cognitive complexity 168 (threshold 15). Drivers by points: if/else 49 (131 pts), loops 11 (29 pts), boolean chains 8 (nesting depth added 100). 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 · Tokenizer.createTokenMap (cognitive 158) · ×1
  • Tokenizer.createTokenMap (cognitive 158) src/Tokenizers/Tokenizer.php:665 — Tokenizer.createTokenMap has cognitive complexity 158 (threshold 15). Drivers by points: if/else 35 (144 pts), loops 3 (11 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 118). 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 · File.process (cognitive 153) · ×1
  • File.process (cognitive 153) src/Files/File.php:317 — File.process has cognitive complexity 153 (threshold 15). Drivers by points: if/else 36 (126 pts), loops 5 (14 pts), boolean chains 13 (nesting depth added 99). 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 · SwitchDeclarationSniff.findNestedTerminator (cognitive 151) · ×1
  • SwitchDeclarationSniff.findNestedTerminator (cognitive 151) src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php:246 — SwitchDeclarationSniff.findNestedTerminator has cognitive complexity 151 (threshold 15). Drivers by points: if/else 30 (137 pts), loops 2 (11 pts), boolean chains 3 (nesting depth added 116). 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 · UnusedFunctionParameterSniff.process (cognitive 150) · ×1
  • UnusedFunctionParameterSniff.process (cognitive 150) src/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php:59 — UnusedFunctionParameterSniff.process has cognitive complexity 150 (threshold 15). Drivers by points: if/else 40 (119 pts), loops 7 (20 pts), boolean chains 11 (nesting depth added 92). 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 · UseDeclarationSniff.process (cognitive 147) · ×1
  • UseDeclarationSniff.process (cognitive 147) src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php:41 — UseDeclarationSniff.process has cognitive complexity 147 (threshold 15). Drivers by points: if/else 40 (107 pts), loops 7 (27 pts), boolean chains 9, match/switch 1 (4 pts) (nesting depth added 90). 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 · Code.generateFileReport (cognitive 138) · ×1
  • Code.generateFileReport (cognitive 138) src/Reports/Code.php:33 — Code.generateFileReport has cognitive complexity 138 (threshold 15). Drivers by points: if/else 46 (114 pts), loops 10 (19 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 78). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Ruleset.processRuleset (cognitive 135) · ×1
  • Ruleset.processRuleset (cognitive 135) src/Ruleset.php:317 — Ruleset.processRuleset has cognitive complexity 135 (threshold 15). Drivers by points: if/else 49 (115 pts), loops 10 (14 pts), boolean chains 6 (nesting depth added 70). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MultiLineConditionSniff.process (cognitive 133) · ×1
  • MultiLineConditionSniff.process (cognitive 133) src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php:61 — MultiLineConditionSniff.process has cognitive complexity 133 (threshold 15). Drivers by points: if/else 51 (116 pts), loops 3 (10 pts), boolean chains 7 (nesting depth added 72). 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 · BlockCommentSniff.process (cognitive 133) · ×1
  • BlockCommentSniff.process (cognitive 133) src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:51 — BlockCommentSniff.process has cognitive complexity 133 (threshold 15). Drivers by points: if/else 57 (113 pts), boolean chains 13, loops 4 (7 pts) (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeclareStatementSniff.process (cognitive 129) · ×1
  • DeclareStatementSniff.process (cognitive 129) src/Standards/PSR12/Sniffs/Files/DeclareStatementSniff.php:41 — DeclareStatementSniff.process has cognitive complexity 129 (threshold 15). Drivers by points: if/else 49 (119 pts), loops 2 (9 pts), boolean chains 1 (nesting depth added 77). 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 · ControlStructureSpacingSniff.process (cognitive 129) · ×1
  • ControlStructureSpacingSniff.process (cognitive 129) src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php:64 — ControlStructureSpacingSniff.process has cognitive complexity 129 (threshold 15). Drivers by points: if/else 44 (89 pts), boolean chains 25, loops 5 (15 pts) (nesting depth added 55). 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 · SuperfluousWhitespaceSniff.process (cognitive 129) · ×1
  • SuperfluousWhitespaceSniff.process (cognitive 129) src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php:72 — SuperfluousWhitespaceSniff.process has cognitive complexity 129 (threshold 15). Drivers by points: if/else 33 (102 pts), loops 5 (20 pts), boolean chains 7 (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 · FunctionCommentSniff.processReturn (cognitive 126) · ×1
  • FunctionCommentSniff.processReturn (cognitive 126) src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:45 — FunctionCommentSniff.processReturn has cognitive complexity 126 (threshold 15). Drivers by points: if/else 28 (102 pts), loops 4 (15 pts), boolean chains 9 (nesting depth added 85). 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 · SideEffectsSniff.searchForConflict (cognitive 124) · ×1
  • SideEffectsSniff.searchForConflict (cognitive 124) src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php:79 — SideEffectsSniff.searchForConflict has cognitive complexity 124 (threshold 15). Drivers by points: if/else 33 (93 pts), boolean chains 27, loops 2 (4 pts) (nesting depth added 62). 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 · SwitchDeclarationSniff.process (cognitive 120) · ×1
  • SwitchDeclarationSniff.process (cognitive 120) src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php:48 — SwitchDeclarationSniff.process has cognitive complexity 120 (threshold 15). Drivers by points: if/else 32 (103 pts), loops 3 (10 pts), boolean chains 7 (nesting depth added 78). 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 · FunctionCommentSniff.processParams (cognitive 117) · ×1
  • FunctionCommentSniff.processParams (cognitive 117) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:265 — FunctionCommentSniff.processParams has cognitive complexity 117 (threshold 15). Drivers by points: if/else 34 (95 pts), loops 9 (22 pts) (nesting depth added 74). 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 · EmbeddedPhpSniff.validateMultilineEmbeddedPhp (cognitive 117) · ×1
  • EmbeddedPhpSniff.validateMultilineEmbeddedPhp (cognitive 117) src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:66 — EmbeddedPhpSniff.validateMultilineEmbeddedPhp has cognitive complexity 117 (threshold 15). Drivers by points: if/else 41 (90 pts), loops 6 (20 pts), boolean chains 7 (nesting depth added 63). 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 · FunctionSpacingSniff.process (cognitive 115) · ×1
  • FunctionSpacingSniff.process (cognitive 115) src/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php:69 — FunctionSpacingSniff.process has cognitive complexity 115 (threshold 15). Drivers by points: if/else 45 (90 pts), loops 7 (14 pts), boolean chains 11 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GitMergeConflictSniff.process (cognitive 113) · ×1
  • GitMergeConflictSniff.process (cognitive 113) src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php:54 — GitMergeConflictSniff.process has cognitive complexity 113 (threshold 15). Drivers by points: if/else 23 (79 pts), boolean chains 27, match/switch 2 (6 pts), loops 1 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OperatorBracketSniff.process (cognitive 113) · ×1
  • OperatorBracketSniff.process (cognitive 113) src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php:51 — OperatorBracketSniff.process has cognitive complexity 113 (threshold 15). Drivers by points: if/else 34 (89 pts), boolean chains 14, loops 3 (10 pts) (nesting depth added 62). 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 · ComparisonOperatorUsageSniff.process (cognitive 112) · ×1
  • ComparisonOperatorUsageSniff.process (cognitive 112) src/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php:89 — ComparisonOperatorUsageSniff.process has cognitive complexity 112 (threshold 15). Drivers by points: if/else 32 (99 pts), boolean chains 9, loops 2 (4 pts) (nesting depth added 69). 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 · Ruleset.expandRulesetReference (cognitive 111) · ×1
  • Ruleset.expandRulesetReference (cognitive 111) src/Ruleset.php:685 — Ruleset.expandRulesetReference has cognitive complexity 111 (threshold 15). Drivers by points: if/else 42 (102 pts), loops 1 (5 pts), boolean chains 4 (nesting depth added 64). 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 · Runner.run (cognitive 111) · ×1
  • Runner.run (cognitive 111) src/Runner.php:353 — Runner.run has cognitive complexity 111 (threshold 15). Drivers by points: if/else 35 (88 pts), loops 6 (21 pts), boolean chains 2 (nesting depth added 68). 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 · NonExecutableCodeSniff.process (cognitive 110) · ×1
  • NonExecutableCodeSniff.process (cognitive 110) src/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php:64 — NonExecutableCodeSniff.process has cognitive complexity 110 (threshold 15). Drivers by points: if/else 40 (85 pts), boolean chains 16, loops 5 (9 pts) (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 · ArbitraryParenthesesSpacingSniff.process (cognitive 109) · ×1
  • ArbitraryParenthesesSpacingSniff.process (cognitive 109) src/Standards/Generic/Sniffs/WhiteSpace/ArbitraryParenthesesSpacingSniff.php:83 — ArbitraryParenthesesSpacingSniff.process has cognitive complexity 109 (threshold 15). Drivers by points: if/else 34 (88 pts), loops 2 (12 pts), boolean chains 9 (nesting depth added 64). 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 · InlineCommentSniff.process (cognitive 109) · ×1
  • InlineCommentSniff.process (cognitive 109) src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php:54 — InlineCommentSniff.process has cognitive complexity 109 (threshold 15). Drivers by points: if/else 42 (89 pts), loops 7 (14 pts), boolean chains 6 (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 · File.getMethodParameters (cognitive 106) · ×1
  • File.getMethodParameters (cognitive 106) src/Files/File.php:1333 — File.getMethodParameters has cognitive complexity 106 (threshold 15). Drivers by points: if/else 32 (91 pts), loops 3 (8 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionDeclarationSniff.process (cognitive 104) · ×1
  • FunctionDeclarationSniff.process (cognitive 104) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:63 — FunctionDeclarationSniff.process has cognitive complexity 104 (threshold 15). Drivers by points: if/else 44 (99 pts), boolean chains 5 (nesting depth added 55). 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 · OperatorSpacingSniff.process (cognitive 101) · ×1
  • OperatorSpacingSniff.process (cognitive 101) src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php:131 — OperatorSpacingSniff.process has cognitive complexity 101 (threshold 15). Drivers by points: if/else 37 (80 pts), boolean chains 15, loops 1 (6 pts) (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 · MemberVarSpacingSniff.processMemberVar (cognitive 99) · ×1
  • MemberVarSpacingSniff.processMemberVar (cognitive 99) src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php:44 — MemberVarSpacingSniff.processMemberVar has cognitive complexity 99 (threshold 15). Drivers by points: if/else 28 (73 pts), loops 5 (18 pts), boolean chains 8 (nesting depth added 58). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · File.addMessage (cognitive 97) · ×1
  • File.addMessage (cognitive 97) src/Files/File.php:842 — File.addMessage has cognitive complexity 97 (threshold 15). Drivers by points: if/else 39 (70 pts), boolean chains 14, loops 7 (13 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForEachLoopDeclarationSniff.process (cognitive 97) · ×1
  • ForEachLoopDeclarationSniff.process (cognitive 97) src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:54 — ForEachLoopDeclarationSniff.process has cognitive complexity 97 (threshold 15). Drivers by points: if/else 44 (95 pts), boolean chains 2 (nesting depth added 51). 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.load (cognitive 97) · ×1
  • Cache.load (cognitive 97) src/Util/Cache.php:42 — Cache.load has cognitive complexity 97 (threshold 15). Drivers by points: if/else 35 (73 pts), loops 9 (17 pts), boolean chains 7 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileHeaderSniff.processHeaderLines (cognitive 96) · ×1
  • FileHeaderSniff.processHeaderLines (cognitive 96) src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php:289 — FileHeaderSniff.processHeaderLines has cognitive complexity 96 (threshold 15). Drivers by points: if/else 19 (70 pts), loops 6 (20 pts), boolean chains 6 (nesting depth added 65). 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 · OpeningFunctionBraceBsdAllmanSniff.process (cognitive 82) · ×1
  • OpeningFunctionBraceBsdAllmanSniff.process (cognitive 82) src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php:58 — OpeningFunctionBraceBsdAllmanSniff.process has cognitive complexity 82 (threshold 15). Drivers by points: if/else 29 (70 pts), loops 2 (8 pts), boolean chains 4 (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 · DisallowTabIndentSniff.process (cognitive 82) · ×1
  • DisallowTabIndentSniff.process (cognitive 82) src/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php:61 — DisallowTabIndentSniff.process has cognitive complexity 82 (threshold 15). Drivers by points: if/else 28 (71 pts), boolean chains 10, loops 1 (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ClassDefinitionOpeningBraceSpaceSniff.process (cognitive 82) · ×1
  • ClassDefinitionOpeningBraceSpaceSniff.process (cognitive 82) src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php:48 — ClassDefinitionOpeningBraceSpaceSniff.process has cognitive complexity 82 (threshold 15). Drivers by points: if/else 27 (65 pts), loops 4 (17 pts) (nesting depth added 51). 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 · BooleanOperatorPlacementSniff.process (cognitive 81) · ×1
  • BooleanOperatorPlacementSniff.process (cognitive 81) src/Standards/PSR12/Sniffs/ControlStructures/BooleanOperatorPlacementSniff.php:55 — BooleanOperatorPlacementSniff.process has cognitive complexity 81 (threshold 15). Drivers by points: if/else 31 (74 pts), boolean chains 4, loops 2, match/switch 1 (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DisallowSpaceIndentSniff.process (cognitive 80) · ×1
  • DisallowSpaceIndentSniff.process (cognitive 80) src/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php:61 — DisallowSpaceIndentSniff.process has cognitive complexity 80 (threshold 15). Drivers by points: if/else 29 (68 pts), boolean chains 11, loops 1 (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 · ArrayDeclarationSniff.processSingleLineArray (cognitive 80) · ×1
  • ArrayDeclarationSniff.processSingleLineArray (cognitive 80) src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:144 — ArrayDeclarationSniff.processSingleLineArray has cognitive complexity 80 (threshold 15). Drivers by points: if/else 28 (75 pts), loops 3 (4 pts), boolean chains 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 · VersionControl.generate (cognitive 79) · ×1
  • VersionControl.generate (cognitive 79) src/Reports/VersionControl.php:150 — VersionControl.generate has cognitive complexity 79 (threshold 15). Drivers by points: if/else 32 (65 pts), loops 5 (9 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Runner.printProgress (cognitive 79) · ×1
  • Runner.printProgress (cognitive 79) src/Runner.php:828 — Runner.printProgress has cognitive complexity 79 (threshold 15). Drivers by points: if/else 27 (75 pts), boolean chains 4 (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 · PropertyDeclarationSniff.processMemberVar (cognitive 79) · ×1
  • PropertyDeclarationSniff.processMemberVar (cognitive 79) src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php:28 — PropertyDeclarationSniff.processMemberVar has cognitive complexity 79 (threshold 15). Drivers by points: if/else 26 (60 pts), loops 3 (15 pts), boolean chains 3, error handling 1 (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · File.findStartOfStatement (cognitive 78) · ×1
  • File.findStartOfStatement (cognitive 78) src/Files/File.php:2346 — File.findStartOfStatement has cognitive complexity 78 (threshold 15). Drivers by points: if/else 23 (54 pts), boolean chains 18, loops 4 (6 pts) (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 · Full.generateFileReport (cognitive 76) · ×1
  • Full.generateFileReport (cognitive 76) src/Reports/Full.php:33 — Full.generateFileReport has cognitive complexity 76 (threshold 15). Drivers by points: if/else 24 (58 pts), loops 7 (16 pts), boolean chains 2 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionDeclarationSniff.processArgumentList (cognitive 76) · ×1
  • FunctionDeclarationSniff.processArgumentList (cognitive 76) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:372 — FunctionDeclarationSniff.processArgumentList has cognitive complexity 76 (threshold 15). Drivers by points: if/else 27 (66 pts), boolean chains 8, loops 2 (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 · ClassDeclarationSniff.processClose (cognitive 73) · ×1
  • ClassDeclarationSniff.processClose (cognitive 73) src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php:99 — ClassDeclarationSniff.processClose has cognitive complexity 73 (threshold 15). Drivers by points: if/else 25 (62 pts), boolean chains 6, loops 2 (5 pts) (nesting depth added 40). 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 · FunctionCallSignatureSniff.processSingleLineCall (cognitive 72) · ×1
  • FunctionCallSignatureSniff.processSingleLineCall (cognitive 72) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:207 — FunctionCallSignatureSniff.processSingleLineCall has cognitive complexity 72 (threshold 15). Drivers by points: if/else 24 (53 pts), loops 3 (16 pts), boolean chains 3 (nesting depth added 42). 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 · FunctionClosingBraceSpaceSniff.process (cognitive 69) · ×1
  • FunctionClosingBraceSpaceSniff.process (cognitive 69) src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php:53 — FunctionClosingBraceSpaceSniff.process has cognitive complexity 69 (threshold 15). Drivers by points: if/else 21 (53 pts), loops 3 (14 pts), boolean chains 2 (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · File.findEndOfStatement (cognitive 68) · ×1
  • File.findEndOfStatement (cognitive 68) src/Files/File.php:2499 — File.findEndOfStatement has cognitive complexity 68 (threshold 15). Drivers by points: if/else 20 (54 pts), boolean chains 11, loops 2 (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 · CreateWidgetTypeCallbackSniff.process (cognitive 68) · ×1
  • CreateWidgetTypeCallbackSniff.process (cognitive 68) src/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php:48 — CreateWidgetTypeCallbackSniff.process has cognitive complexity 68 (threshold 15). Drivers by points: if/else 24 (53 pts), boolean chains 9, loops 3 (6 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 · CommentedOutCodeSniff.process (cognitive 67) · ×1
  • CommentedOutCodeSniff.process (cognitive 67) src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php:60 — CommentedOutCodeSniff.process has cognitive complexity 67 (threshold 15). Drivers by points: if/else 33 (58 pts), boolean chains 6, loops 2, error handling 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 · Source.generate (cognitive 66) · ×1
  • Source.generate (cognitive 66) src/Reports/Source.php:83 — Source.generate has cognitive complexity 66 (threshold 15). Drivers by points: if/else 35 (62 pts), loops 3, boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCommentThrowTagSniff.process (cognitive 66) · ×1
  • FunctionCommentThrowTagSniff.process (cognitive 66) src/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php:41 — FunctionCommentThrowTagSniff.process has cognitive complexity 66 (threshold 15). Drivers by points: if/else 25 (52 pts), loops 5 (11 pts), boolean chains 3 (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 · ConcatenationSpacingSniff.process (cognitive 64) · ×1
  • ConcatenationSpacingSniff.process (cognitive 64) src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php:55 — ConcatenationSpacingSniff.process has cognitive complexity 64 (threshold 15). Drivers by points: if/else 27 (50 pts), boolean chains 14 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileCommentSniff.process (cognitive 63) · ×1
  • FileCommentSniff.process (cognitive 63) src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php:50 — FileCommentSniff.process has cognitive complexity 63 (threshold 15). Drivers by points: if/else 24 (53 pts), boolean chains 7, loops 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 · ControlStructureSpacingSniff.process (cognitive 62) · ×1
  • ControlStructureSpacingSniff.process (cognitive 62) src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:59 — ControlStructureSpacingSniff.process has cognitive complexity 62 (threshold 15). Drivers by points: if/else 25 (53 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ObjectOperatorIndentSniff.process (cognitive 60) · ×1
  • ObjectOperatorIndentSniff.process (cognitive 60) src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php:64 — ObjectOperatorIndentSniff.process has cognitive complexity 60 (threshold 15). Drivers by points: if/else 20 (49 pts), loops 3 (7 pts), boolean chains 4 (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 · FileHeaderSniff.getHeaderLines (cognitive 60) · ×1
  • FileHeaderSniff.getHeaderLines (cognitive 60) src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php:131 — FileHeaderSniff.getHeaderLines has cognitive complexity 60 (threshold 15). Drivers by points: if/else 13 (44 pts), loops 3 (8 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCallArgumentSpacingSniff.checkSpacing (cognitive 59) · ×1
  • FunctionCallArgumentSpacingSniff.checkSpacing (cognitive 59) src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php:102 — FunctionCallArgumentSpacingSniff.checkSpacing has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (57 pts), boolean chains 1, loops 1 (nesting depth added 40). 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 · SelfMemberReferenceSniff.processTokenWithinScope (cognitive 58) · ×1
  • SelfMemberReferenceSniff.processTokenWithinScope (cognitive 58) src/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php:44 — SelfMemberReferenceSniff.processTokenWithinScope has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (41 pts), loops 4 (12 pts), boolean chains 5 (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 · EmbeddedPhpSniff.validateInlineEmbeddedPhp (cognitive 57) · ×1
  • EmbeddedPhpSniff.validateInlineEmbeddedPhp (cognitive 57) src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:299 — EmbeddedPhpSniff.validateInlineEmbeddedPhp has cognitive complexity 57 (threshold 15). Drivers by points: if/else 22 (43 pts), boolean chains 7, loops 2 (7 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 · LongConditionClosingCommentSniff.process (cognitive 56) · ×1
  • LongConditionClosingCommentSniff.process (cognitive 56) src/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php:83 — LongConditionClosingCommentSniff.process has cognitive complexity 56 (threshold 15). Drivers by points: if/else 21 (44 pts), boolean chains 8, loops 2 (4 pts) (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ScopeKeywordSpacingSniff.process (cognitive 55) · ×1
  • ScopeKeywordSpacingSniff.process (cognitive 55) src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php:44 — ScopeKeywordSpacingSniff.process has cognitive complexity 55 (threshold 15). Drivers by points: if/else 22 (39 pts), boolean chains 12, loops 1 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncludeSystemSniff.processTokenWithinScope (cognitive 54) · ×1
  • IncludeSystemSniff.processTokenWithinScope (cognitive 54) src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php:63 — IncludeSystemSniff.processTokenWithinScope has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (41 pts), loops 6 (13 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 · EmptyPHPStatementSniff.process (cognitive 52) · ×1
  • EmptyPHPStatementSniff.process (cognitive 52) src/Standards/Generic/Sniffs/CodeAnalysis/EmptyPHPStatementSniff.php:47 — EmptyPHPStatementSniff.process has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (35 pts), boolean chains 10, loops 2 (6 pts), match/switch 1 (nesting depth added 26). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · IndentationSniff.process (cognitive 51) · ×1
  • IndentationSniff.process (cognitive 51) src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php:55 — IndentationSniff.process has cognitive complexity 51 (threshold 15). Drivers by points: if/else 17 (43 pts), boolean chains 7, loops 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · LowerCaseTypeSniff.process (cognitive 50) · ×1
  • LowerCaseTypeSniff.process (cognitive 50) src/Standards/Generic/Sniffs/PHP/LowerCaseTypeSniff.php:71 — LowerCaseTypeSniff.process has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (47 pts), error handling 1 (2 pts), loops 1 (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 · UnusedSystemSniff.process (cognitive 50) · ×1
  • UnusedSystemSniff.process (cognitive 50) src/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php:40 — UnusedSystemSniff.process has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (39 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (2 pts) (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 · FunctionCommentSniff.process (cognitive 47) · ×1
  • FunctionCommentSniff.process (cognitive 47) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:60 — FunctionCommentSniff.process has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 11, loops 4 (9 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DisallowMultipleAssignmentsSniff.process (cognitive 47) · ×1
  • DisallowMultipleAssignmentsSniff.process (cognitive 47) src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php:41 — DisallowMultipleAssignmentsSniff.process has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 14, loops 3 (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 · File.isReference (cognitive 46) · ×1
  • File.isReference (cognitive 46) src/Files/File.php:2032 — File.isReference has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 7, loops 2 (7 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpeningFunctionBraceKernighanRitchieSniff.process (cognitive 45) · ×1
  • OpeningFunctionBraceKernighanRitchieSniff.process (cognitive 45) src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php:58 — OpeningFunctionBraceKernighanRitchieSniff.process has cognitive complexity 45 (threshold 15). Drivers by points: if/else 24 (37 pts), boolean chains 8 (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 · ClassDefinitionClosingBraceSpaceSniff.process (cognitive 45) · ×1
  • ClassDefinitionClosingBraceSpaceSniff.process (cognitive 45) src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php:48 — ClassDefinitionClosingBraceSpaceSniff.process has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 3 (11 pts), boolean chains 1 (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 · DocCommentAlignmentSniff.process (cognitive 45) · ×1
  • DocCommentAlignmentSniff.process (cognitive 45) src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php:51 — DocCommentAlignmentSniff.process has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (41 pts), boolean chains 3, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InlineIfDeclarationSniff.process (cognitive 45) · ×1
  • InlineIfDeclarationSniff.process (cognitive 45) src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php:40 — InlineIfDeclarationSniff.process has cognitive complexity 45 (threshold 15). Drivers by points: if/else 24 (45 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 · Fixer.replaceToken (cognitive 44) · ×1
  • Fixer.replaceToken (cognitive 44) src/Fixer.php:474 — Fixer.replaceToken has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UselessOverridingMethodSniff.process (cognitive 44) · ×1
  • UselessOverridingMethodSniff.process (cognitive 44) src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php:53 — UselessOverridingMethodSniff.process has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (34 pts), boolean chains 6, loops 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncludingFileSniff.process (cognitive 44) · ×1
  • IncludingFileSniff.process (cognitive 44) src/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php:48 — IncludingFileSniff.process has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (42 pts), loops 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · File.getMemberProperties (cognitive 43) · ×1
  • File.getMemberProperties (cognitive 43) src/Files/File.php:1796 — File.getMemberProperties has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 9, loops 2 (3 pts), match/switch 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 · File.findPrevious (cognitive 43) · ×1
  • File.findPrevious (cognitive 43) src/Files/File.php:2216 — File.findPrevious has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (37 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DisallowShortOpenTagSniff.process (cognitive 43) · ×1
  • DisallowShortOpenTagSniff.process (cognitive 43) src/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php:51 — DisallowShortOpenTagSniff.process has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (39 pts), boolean chains 2, loops 1 (2 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 · IncrementDecrementSpacingSniff.process (cognitive 43) · ×1
  • IncrementDecrementSpacingSniff.process (cognitive 43) src/Standards/Generic/Sniffs/WhiteSpace/IncrementDecrementSpacingSniff.php:54 — IncrementDecrementSpacingSniff.process has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 8, loops 2 (6 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 · ClassDeclarationSniff.process (cognitive 43) · ×1
  • ClassDeclarationSniff.process (cognitive 43) src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php:45 — ClassDeclarationSniff.process has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 1 (4 pts) (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 · Text.printCodeComparisonBlock (cognitive 42) · ×1
  • Text.printCodeComparisonBlock (cognitive 42) src/Generators/Text.php:126 — Text.printCodeComparisonBlock has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (38 pts), loops 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Reporter.__construct (cognitive 42) · ×1
  • Reporter.__construct (cognitive 42) src/Reporter.php:98 — Reporter.__construct has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 2 (6 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · VariableCommentSniff.processMemberVar (cognitive 42) · ×1
  • VariableCommentSniff.processMemberVar (cognitive 42) src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php:29 — VariableCommentSniff.processMemberVar has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 6, loops 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayDeclarationSniff.process (cognitive 41) · ×1
  • ArrayDeclarationSniff.process (cognitive 41) src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:44 — ArrayDeclarationSniff.process has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (32 pts), loops 2 (9 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 · FunctionCommentSniff.processThrows (cognitive 41) · ×1
  • FunctionCommentSniff.processThrows (cognitive 41) src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:205 — FunctionCommentSniff.processThrows has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 2 (5 pts), boolean chains 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 · MultiLineFunctionDeclarationSniff.processBracket (cognitive 41) · ×1
  • MultiLineFunctionDeclarationSniff.processBracket (cognitive 41) src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php:191 — MultiLineFunctionDeclarationSniff.processBracket has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (35 pts), loops 2 (6 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AbstractPatternSniff.parse (cognitive 40) · ×1
  • AbstractPatternSniff.parse (cognitive 40) src/Sniffs/AbstractPatternSniff.php:768 — AbstractPatternSniff.parse has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnonClassDeclarationSniff.processSingleLineArgumentList (cognitive 40) · ×1
  • AnonClassDeclarationSniff.processSingleLineArgumentList (cognitive 40) src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php:143 — AnonClassDeclarationSniff.processSingleLineArgumentList has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 3 (13 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Runner.processFile (cognitive 39) · ×1
  • Runner.processFile (cognitive 39) src/Runner.php:621 — Runner.processFile has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 2 (4 pts), match/switch 1 (3 pts), boolean chains 2, error handling 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 · AssignmentInConditionSniff.process (cognitive 39) · ×1
  • AssignmentInConditionSniff.process (cognitive 39) src/Standards/Generic/Sniffs/CodeAnalysis/AssignmentInConditionSniff.php:78 — AssignmentInConditionSniff.process has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (35 pts), loops 2 (3 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 · FunctionDeclarationSniff.processMultiLineDeclaration (cognitive 39) · ×1
  • FunctionDeclarationSniff.processMultiLineDeclaration (cognitive 39) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:283 — FunctionDeclarationSniff.processMultiLineDeclaration has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 1 (4 pts), boolean chains 1 (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 · ScopeClosingBraceSniff.process (cognitive 39) · ×1
  • ScopeClosingBraceSniff.process (cognitive 39) src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php:48 — ScopeClosingBraceSniff.process has cognitive complexity 39 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 2, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Ruleset.__construct (cognitive 38) · ×1
  • Ruleset.__construct (cognitive 38) src/Ruleset.php:128 — Ruleset.__construct has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 5 (7 pts), boolean chains 3, 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 · ControlStructureSpacingSniff.process (cognitive 38) · ×1
  • ControlStructureSpacingSniff.process (cognitive 38) src/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:65 — ControlStructureSpacingSniff.process has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · File.getMethodProperties (cognitive 36) · ×1
  • File.getMethodProperties (cognitive 36) src/Files/File.php:1623 — File.getMethodProperties has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 6, loops 2 (3 pts), match/switch 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 · VersionControl.generateFileReport (cognitive 36) · ×1
  • VersionControl.generateFileReport (cognitive 36) src/Reports/VersionControl.php:41 — VersionControl.generateFileReport has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 8 (12 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 · Ruleset.setSniffProperty (cognitive 36) · ×1
  • Ruleset.setSniffProperty (cognitive 36) src/Ruleset.php:1309 — Ruleset.setSniffProperty has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 1 (5 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LineLengthSniff.checkLineLength (cognitive 36) · ×1
  • LineLengthSniff.checkLineLength (cognitive 36) src/Standards/Generic/Sniffs/Files/LineLengthSniff.php:97 — LineLengthSniff.checkLineLength has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (31 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DisallowAlternativePHPTagsSniff.process (cognitive 36) · ×1
  • DisallowAlternativePHPTagsSniff.process (cognitive 36) src/Standards/Generic/Sniffs/PHP/DisallowAlternativePHPTagsSniff.php:72 — DisallowAlternativePHPTagsSniff.process has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 3 (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 · LanguageConstructSpacingSniff.process (cognitive 36) · ×1
  • LanguageConstructSpacingSniff.process (cognitive 36) src/Standards/Generic/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php:56 — LanguageConstructSpacingSniff.process has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 2 (7 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpacitySniff.process (cognitive 36) · ×1
  • OpacitySniff.process (cognitive 36) src/Standards/Squiz/Sniffs/CSS/OpacitySniff.php:48 — OpacitySniff.process has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 4 (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 · JS.getRegexToken (cognitive 36) · ×1
  • JS.getRegexToken (cognitive 36) src/Tokenizers/JS.php:915 — JS.getRegexToken has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (31 pts), loops 5 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReturnTypeDeclarationSniff.process (cognitive 35) · ×1
  • ReturnTypeDeclarationSniff.process (cognitive 35) src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php:44 — ReturnTypeDeclarationSniff.process has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 6, loops 1 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MethodDeclarationSniff.processTokenWithinScope (cognitive 35) · ×1
  • MethodDeclarationSniff.processTokenWithinScope (cognitive 35) src/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php:39 — MethodDeclarationSniff.processTokenWithinScope has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClosingDeclarationCommentSniff.process (cognitive 35) · ×1
  • ClosingDeclarationCommentSniff.process (cognitive 35) src/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php:45 — ClosingDeclarationCommentSniff.process has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (30 pts), loops 1 (4 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 · SpaceAfterCastSniff.process (cognitive 34) · ×1
  • SpaceAfterCastSniff.process (cognitive 34) src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:55 — SpaceAfterCastSniff.process has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OperatorBracketSniff.addMissingBracketsError (cognitive 34) · ×1
  • OperatorBracketSniff.addMissingBracketsError (cognitive 34) src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php:274 — OperatorBracketSniff.addMissingBracketsError has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 10, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncrementDecrementUsageSniff.processAssignment (cognitive 34) · ×1
  • IncrementDecrementUsageSniff.processAssignment (cognitive 34) src/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php:119 — IncrementDecrementUsageSniff.processAssignment has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 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 · SpreadOperatorSpacingAfterSniff.process (cognitive 33) · ×1
  • SpreadOperatorSpacingAfterSniff.process (cognitive 33) src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php:55 — SpreadOperatorSpacingAfterSniff.process has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileHeaderSniff.process (cognitive 33) · ×1
  • FileHeaderSniff.process (cognitive 33) src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.php:41 — FileHeaderSniff.process has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 1, loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ScopeIndentSniff.adjustIndent (cognitive 32) · ×1
  • ScopeIndentSniff.adjustIndent (cognitive 32) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1513 — ScopeIndentSniff.adjustIndent has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ValidVariableNameSniff.processVariable (cognitive 32) · ×1
  • ValidVariableNameSniff.processVariable (cognitive 32) src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:30 — ValidVariableNameSniff.processVariable has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 1 (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 · Comment.tokenizeString (cognitive 32) · ×1
  • Comment.tokenizeString (cognitive 32) src/Tokenizers/Comment.php:30 — Comment.tokenizeString has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileCommentSniff.process (cognitive 31) · ×1
  • FileCommentSniff.process (cognitive 31) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:93 — FileCommentSniff.process has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 3, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DisallowMultipleStatementsSniff.process (cognitive 30) · ×1
  • DisallowMultipleStatementsSniff.process (cognitive 30) src/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php:40 — DisallowMultipleStatementsSniff.process has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (5 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 · LowerCaseConstantSniff.process (cognitive 30) · ×1
  • LowerCaseConstantSniff.process (cognitive 30) src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php:69 — LowerCaseConstantSniff.process has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Fixer.fixFile (cognitive 29) · ×1
  • Fixer.fixFile (cognitive 29) src/Fixer.php:140 — Fixer.fixFile has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (4 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 · ShorthandSizeSniff.process (cognitive 29) · ×1
  • ShorthandSizeSniff.process (cognitive 29) src/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php:62 — ShorthandSizeSniff.process has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (22 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Config.__construct (cognitive 28) · ×1
  • Config.__construct (cognitive 28) src/Config.php:340 — Config.__construct has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (7 pts), boolean chains 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · File.findFirstOnLine (cognitive 28) · ×1
  • File.findFirstOnLine (cognitive 28) src/Files/File.php:2623 — File.findFirstOnLine has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (25 pts), 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 · AbstractVariableSniff.processTokenWithinScope (cognitive 28) · ×1
  • AbstractVariableSniff.processTokenWithinScope (cognitive 28) src/Sniffs/AbstractVariableSniff.php:78 — AbstractVariableSniff.processTokenWithinScope has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnnecessaryStringConcatSniff.process (cognitive 28) · ×1
  • UnnecessaryStringConcatSniff.process (cognitive 28) src/Standards/Generic/Sniffs/Strings/UnnecessaryStringConcatSniff.php:71 — UnnecessaryStringConcatSniff.process has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (24 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 · EvalObjectFactorySniff.process (cognitive 28) · ×1
  • EvalObjectFactorySniff.process (cognitive 28) src/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php:41 — EvalObjectFactorySniff.process has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 5 (8 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 · FileCommentSniff.processTags (cognitive 28) · ×1
  • FileCommentSniff.processTags (cognitive 28) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:223 — FileCommentSniff.processTags has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 3 (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 · ValidFunctionNameSniff.processTokenOutsideScope (cognitive 28) · ×1
  • ValidFunctionNameSniff.processTokenOutsideScope (cognitive 28) src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php:181 — ValidFunctionNameSniff.processTokenOutsideScope has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (22 pts), loops 2 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Common.suggestType (cognitive 28) · ×1
  • Common.suggestType (cognitive 28) src/Util/Common.php:446 — Common.suggestType has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 1 (2 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 · Standards.getInstalledStandardDetails (cognitive 28) · ×1
  • Standards.getInstalledStandardDetails (cognitive 28) src/Util/Standards.php:78 — Standards.getInstalledStandardDetails has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Source.makeFriendlyName (cognitive 27) · ×1
  • Source.makeFriendlyName (cognitive 27) src/Reports/Source.php:282 — Source.makeFriendlyName has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 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 · Summary.generate (cognitive 27) · ×1
  • Summary.generate (cognitive 27) src/Reports/Summary.php:65 — Summary.generate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 5, loops 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ArrayIndentSniff.processMultiLineArray (cognitive 27) · ×1
  • ArrayIndentSniff.processMultiLineArray (cognitive 27) src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php:58 — ArrayIndentSniff.processMultiLineArray has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (26 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UseDeclarationSniff.processUseStatement (cognitive 27) · ×1
  • UseDeclarationSniff.processUseStatement (cognitive 27) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:651 — UseDeclarationSniff.processUseStatement has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 1 (5 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 · Config.__set (cognitive 26) · ×1
  • Config.__set (cognitive 26) src/Config.php:224 — Config.__set has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (5 pts), boolean chains 3, match/switch 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 · Ruleset.populateTokenListeners (cognitive 26) · ×1
  • Ruleset.populateTokenListeners (cognitive 26) src/Ruleset.php:1219 — Ruleset.populateTokenListeners has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 6 (13 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 · DisallowYodaConditionsSniff.process (cognitive 26) · ×1
  • DisallowYodaConditionsSniff.process (cognitive 26) src/Standards/Generic/Sniffs/ControlStructures/DisallowYodaConditionsSniff.php:42 — DisallowYodaConditionsSniff.process has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LowercasePHPFunctionsSniff.process (cognitive 26) · ×1
  • LowercasePHPFunctionsSniff.process (cognitive 26) src/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php:60 — LowercasePHPFunctionsSniff.process has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 8 (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 · Common.isCamelCaps (cognitive 26) · ×1
  • Common.isCamelCaps (cognitive 26) src/Util/Common.php:333 — Common.isCamelCaps has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 2, loops 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 · Config.setCommandLineValues (cognitive 25) · ×1
  • Config.setCommandLineValues (cognitive 25) src/Config.php:430 — Config.setCommandLineValues has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (5 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 · Config.setConfigData (cognitive 25) · ×1
  • Config.setConfigData (cognitive 25) src/Config.php:1566 — Config.setConfigData has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 3, 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 · Filter.shouldIgnorePath (cognitive 25) · ×1
  • Filter.shouldIgnorePath (cognitive 25) src/Filters/Filter.php:201 — Filter.shouldIgnorePath has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3 (5 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 · Cbf.generateFileReport (cognitive 25) · ×1
  • Cbf.generateFileReport (cognitive 25) src/Reports/Cbf.php:39 — Cbf.generateFileReport has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (25 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 · AnonClassDeclarationSniff.process (cognitive 25) · ×1
  • AnonClassDeclarationSniff.process (cognitive 25) src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php:57 — AnonClassDeclarationSniff.process has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 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 · ValidVariableNameSniff.processVariable (cognitive 25) · ×1
  • ValidVariableNameSniff.processVariable (cognitive 25) src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:30 — ValidVariableNameSniff.processVariable has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (24 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 · DoubleQuoteUsageSniff.process (cognitive 25) · ×1
  • DoubleQuoteUsageSniff.process (cognitive 25) src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php:43 — DoubleQuoteUsageSniff.process has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 4 (7 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 · OperatorSpacingSniff.isOperator (cognitive 25) · ×1
  • OperatorSpacingSniff.isOperator (cognitive 25) src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php:326 — OperatorSpacingSniff.isOperator has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 6 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpeningBraceSameLineSniff.process (cognitive 24) · ×1
  • OpeningBraceSameLineSniff.process (cognitive 24) src/Standards/Generic/Sniffs/Classes/OpeningBraceSameLineSniff.php:45 — OpeningBraceSameLineSniff.process has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (23 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 · LineEndingsSniff.process (cognitive 24) · ×1
  • LineEndingsSniff.process (cognitive 24) src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php:61 — LineEndingsSniff.process has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ColonSpacingSniff.process (cognitive 24) · ×1
  • ColonSpacingSniff.process (cognitive 24) src/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php:48 — ColonSpacingSniff.process has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (23 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 · PHP.createAttributesNestingMap (cognitive 24) · ×1
  • PHP.createAttributesNestingMap (cognitive 24) src/Tokenizers/PHP.php:3511 — PHP.createAttributesNestingMap has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Tokenizer.replaceTabsInToken (cognitive 24) · ×1
  • Tokenizer.replaceTabsInToken (cognitive 24) src/Tokenizers/Tokenizer.php:585 — Tokenizer.replaceTabsInToken has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Tokenizer.createParenthesisNestingMap (cognitive 24) · ×1
  • Tokenizer.createParenthesisNestingMap (cognitive 24) src/Tokenizers/Tokenizer.php:850 — Tokenizer.createParenthesisNestingMap has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (21 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Info.generate (cognitive 23) · ×1
  • Info.generate (cognitive 23) src/Reports/Info.php:63 — Info.generate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpperCaseConstantNameSniff.process (cognitive 23) · ×1
  • UpperCaseConstantNameSniff.process (cognitive 23) src/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php:44 — UpperCaseConstantNameSniff.process has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 2 (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 · DisallowSelfActionsSniff.process (cognitive 23) · ×1
  • DisallowSelfActionsSniff.process (cognitive 23) src/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php:41 — DisallowSelfActionsSniff.process has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GetRequestDataSniff.process (cognitive 23) · ×1
  • GetRequestDataSniff.process (cognitive 23) src/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php:40 — GetRequestDataSniff.process has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 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 · FunctionCallSignatureSniff.process (cognitive 23) · ×1
  • FunctionCallSignatureSniff.process (cognitive 23) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:86 — FunctionCallSignatureSniff.process has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2 (7 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 · Reporter.prepareFileReport (cognitive 22) · ×1
  • Reporter.prepareFileReport (cognitive 22) src/Reporter.php:334 — Reporter.prepareFileReport has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 5 (9 pts), boolean chains 1 (nesting depth added 10). 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 · Cbf.generate (cognitive 22) · ×1
  • Cbf.generate (cognitive 22) src/Reports/Cbf.php:136 — Cbf.generate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 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 · IncludeSystemSniff.processTokenOutsideScope (cognitive 22) · ×1
  • IncludeSystemSniff.processTokenOutsideScope (cognitive 22) src/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php:204 — IncludeSystemSniff.processTokenOutsideScope has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 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 · ScopeClosingBraceSniff.process (cognitive 22) · ×1
  • ScopeClosingBraceSniff.process (cognitive 22) src/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php:41 — ScopeClosingBraceSniff.process has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, 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 · Standards.getInstalledStandards (cognitive 22) · ×1
  • Standards.getInstalledStandards (cognitive 22) src/Util/Standards.php:167 — Standards.getInstalledStandards has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 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 · File.findNext (cognitive 21) · ×1
  • File.findNext (cognitive 21) src/Files/File.php:2297 — File.findNext has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SpaceAfterNotSniff.process (cognitive 21) · ×1
  • SpaceAfterNotSniff.process (cognitive 21) src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php:65 — SpaceAfterNotSniff.process has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ValidFunctionNameSniff.processTokenWithinScope (cognitive 21) · ×1
  • ValidFunctionNameSniff.processTokenWithinScope (cognitive 21) src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php:73 — ValidFunctionNameSniff.processTokenWithinScope has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PHP.standardiseToken (cognitive 21) · ×1
  • PHP.standardiseToken (cognitive 21) src/Tokenizers/PHP.php:3228 — PHP.standardiseToken has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCommentSniff.process (cognitive 20) · ×1
  • FunctionCommentSniff.process (cognitive 20) src/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php:31 — FunctionCommentSniff.process has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileCommentSniff.processCopyright (cognitive 20) · ×1
  • FileCommentSniff.processCopyright (cognitive 20) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:489 — FileCommentSniff.processCopyright has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LowercaseStyleDefinitionSniff.process (cognitive 20) · ×1
  • LowercaseStyleDefinitionSniff.process (cognitive 20) src/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php:47 — LowercaseStyleDefinitionSniff.process has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultiLineFunctionDeclarationSniff.isMultiLineDeclaration (cognitive 20) · ×1
  • MultiLineFunctionDeclarationSniff.isMultiLineDeclaration (cognitive 20) src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php:42 — MultiLineFunctionDeclarationSniff.isMultiLineDeclaration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DisallowSizeFunctionsInLoopsSniff.process (cognitive 20) · ×1
  • DisallowSizeFunctionsInLoopsSniff.process (cognitive 20) src/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php:67 — DisallowSizeFunctionsInLoopsSniff.process has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 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 · LogicalOperatorSpacingSniff.process (cognitive 20) · ×1
  • LogicalOperatorSpacingSniff.process (cognitive 20) src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php:51 — LogicalOperatorSpacingSniff.process has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 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 · PHP.parsePhpAttribute (cognitive 20) · ×1
  • PHP.parsePhpAttribute (cognitive 20) src/Tokenizers/PHP.php:3452 — PHP.parsePhpAttribute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Config.restoreDefaults (cognitive 19) · ×1
  • Config.restoreDefaults (cognitive 19) src/Config.php:479 — Config.restoreDefaults has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (19 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Runner.runPHPCS (cognitive 19) · ×1
  • Runner.runPHPCS (cognitive 19) src/Runner.php:54 — Runner.runPHPCS has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 2 (4 pts), boolean chains 3, error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · CallTimePassByReferenceSniff.process (cognitive 19) · ×1
  • CallTimePassByReferenceSniff.process (cognitive 19) src/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php:44 — CallTimePassByReferenceSniff.process has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 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 · SubversionPropertiesSniff.getProperties (cognitive 19) · ×1
  • SubversionPropertiesSniff.getProperties (cognitive 19) src/Standards/Generic/Sniffs/VersionControl/SubversionPropertiesSniff.php:120 — SubversionPropertiesSniff.getProperties has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Diff.generateFileReport (cognitive 18) · ×1
  • Diff.generateFileReport (cognitive 18) src/Reports/Diff.php:32 — Diff.generateFileReport has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OperatorSpacingSniff.process (cognitive 18) · ×1
  • OperatorSpacingSniff.process (cognitive 18) src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php:52 — OperatorSpacingSniff.process has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NamespaceDeclarationSniff.process (cognitive 18) · ×1
  • NamespaceDeclarationSniff.process (cognitive 18) src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php:41 — NamespaceDeclarationSniff.process has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PostStatementCommentSniff.process (cognitive 18) · ×1
  • PostStatementCommentSniff.process (cognitive 18) src/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php:68 — PostStatementCommentSniff.process has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DisallowComparisonAssignmentSniff.process (cognitive 18) · ×1
  • DisallowComparisonAssignmentSniff.process (cognitive 18) src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php:41 — DisallowComparisonAssignmentSniff.process has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 8, 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 · Standards.getInstalledStandardPath (cognitive 18) · ×1
  • Standards.getInstalledStandardPath (cognitive 18) src/Util/Standards.php:279 — Standards.getInstalledStandardPath has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassDeclarationSniff.processOpen (cognitive 17) · ×1
  • ClassDeclarationSniff.processOpen (cognitive 17) src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php:54 — ClassDeclarationSniff.processOpen has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Junit.generateFileReport (cognitive 16) · ×1
  • Junit.generateFileReport (cognitive 16) src/Reports/Junit.php:34 — Junit.generateFileReport has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 3 (7 pts) (nesting depth added 10). 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 · Xml.generateFileReport (cognitive 16) · ×1
  • Xml.generateFileReport (cognitive 16) src/Reports/Xml.php:33 — Xml.generateFileReport has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (6 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 · Ruleset.explain (cognitive 16) · ×1
  • Ruleset.explain (cognitive 16) src/Ruleset.php:238 — Ruleset.explain 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 · Runner.processChildProcs (cognitive 16) · ×1
  • Runner.processChildProcs (cognitive 16) src/Runner.php:748 — Runner.processChildProcs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AbstractPatternSniff.process (cognitive 16) · ×1
  • AbstractPatternSniff.process (cognitive 16) src/Sniffs/AbstractPatternSniff.php:187 — AbstractPatternSniff.process has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (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 · AjaxNullComparisonSniff.process (cognitive 16) · ×1
  • AjaxNullComparisonSniff.process (cognitive 16) src/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php:43 — AjaxNullComparisonSniff.process has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, 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 · ValidClassNameSniff.process (cognitive 16) · ×1
  • ValidClassNameSniff.process (cognitive 16) src/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php:45 — ValidClassNameSniff.process has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 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 · ClosingTagSniff.process (cognitive 16) · ×1
  • ClosingTagSniff.process (cognitive 16) src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php:41 — ClosingTagSniff.process 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 · ClassDefinitionNameSpacingSniff.process (cognitive 16) · ×1
  • ClassDefinitionNameSpacingSniff.process (cognitive 16) src/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php:48 — ClassDefinitionNameSpacingSniff.process has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultiLineFunctionDeclarationSniff.processSingleLineDeclaration (cognitive 16) · ×1
  • MultiLineFunctionDeclarationSniff.processSingleLineDeclaration (cognitive 16) src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php:109 — MultiLineFunctionDeclarationSniff.processSingleLineDeclaration 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.
D2 · Cognitive Complexity · SemicolonSpacingSniff.process (cognitive 16) · ×1
  • SemicolonSpacingSniff.process (cognitive 16) src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php:51 — SemicolonSpacingSniff.process has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Common.prepareForOutput (cognitive 16) · ×1
  • Common.prepareForOutput (cognitive 16) src/Util/Common.php:276 — Common.prepareForOutput has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 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.
D3 · God Classes · TooManyMethods · ×1
  • TooManyMethods: File src/Files/File.php:19 — 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.
D4 · Code Duplication · Near-duplicate member pair (111 shared lines) · ×1
  • Near-duplicate member pair (111 shared lines) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:267 — src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:267-534 | src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:283-638 — These two members are variants of one another: 111 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 · Near-duplicate member pair (68 shared lines) · ×1
  • Near-duplicate member pair (68 shared lines) src/Reports/Code.php:35 — src/Reports/Code.php:35-317 | src/Reports/Full.php:35-186 — These two members are variants of one another: 68 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 · Near-duplicate member pair (43 shared lines) · ×1
  • Near-duplicate member pair (43 shared lines) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:209 — src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:209-319 | src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php:145-216 — These two members are variants of one another: 43 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 · Near-duplicate member pair (40 shared lines) · ×1
  • Near-duplicate member pair (40 shared lines) src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php:50 — src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php:50-129 | src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php:50-171 — These two members are variants of one another: 40 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 · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php:60 — src/Standards/Generic/Sniffs/Arrays/ArrayIndentSniff.php:60-172 | src/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php:60-222 | src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php:47-145 | src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php:63-278 | src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:209-319 | src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:374-530 | src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php:66-199 | src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:61-187 | src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php:57-145 | src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:68-285 — These 10 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 10 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 10 times.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:65 — src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:65-201 | src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:64-465 | src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php:73-320 | src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php:42-150 | src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:106-393 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (102 corresponding lines) · ×1
  • Edited copy of a member (102 corresponding lines) src/Reports/Cbf.php:147 — src/Reports/Cbf.php:147-248 | src/Reports/Summary.php:76-178 — These two members are one piece of code written twice and then edited apart: 102 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 · Edited copy of a member (70 corresponding lines) · ×1
  • Edited copy of a member (70 corresponding lines) src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:32 — src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:32-101 | src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:32-101 — These two members are one piece of code written twice and then edited apart: 70 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 · Edited copy of a member (42 corresponding lines) · ×1
  • Edited copy of a member (42 corresponding lines) src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:656 — src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:656-697 | src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:715-756 — These two members are one piece of code written twice and then edited apart: 42 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 · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php:43 — src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php:43-84 | src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php:44-74 — 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 · Edited copy of a member (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) src/Files/File.php:2755 — src/Files/File.php:2755-2790 | src/Files/File.php:2807-2845 — These two members are one piece of code written twice and then edited apart: 36 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 · Edited copy of a member (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:117 — src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:117-154 | src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php:117-156 — These two members are one piece of code written twice and then edited apart: 38 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 · Edited copies of one member (3 members, 33+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 33+ corresponding lines) src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php:43 — src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php:43-75 | src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php:45-86 | src/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php:55-93 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php:53 — src/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php:53-84 | src/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php:47-93 — These two members are one piece of code written twice and then edited apart: 32 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 · Edited copy of a member (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php:61 — src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php:61-112 | src/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php:57-95 — These two members are one piece of code written twice and then edited apart: 39 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 · Edited copies of one member (3 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 24+ corresponding lines) src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php:149 — src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php:149-172 | src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php:57-80 | src/Standards/Generic/Sniffs/PHP/UpperCaseConstantSniff.php:29-52 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×1
  • Edited copy of a member (26 corresponding lines) src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php:56 — src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php:56-86 | src/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php:63-88 — These two members are one piece of code written twice and then edited apart: 26 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 · Edited copy of a member (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php:102 — src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php:102-123 | src/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php:141-162 — These two members are one piece of code written twice and then edited apart: 22 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 · Edited copy of a member (19 corresponding lines) · ×1
  • Edited copy of a member (19 corresponding lines) src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php:56 — src/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php:56-74 | src/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php:55-81 — These two members are one piece of code written twice and then edited apart: 19 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 · Edited copy of a member (15 corresponding lines) · ×1
  • Edited copy of a member (15 corresponding lines) src/Generators/HTML.php:30 — src/Generators/HTML.php:30-46 | src/Generators/Markdown.php:26-40 — These two members are one piece of code written twice and then edited apart: 15 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 · Edited copy of a member (13 corresponding lines) · ×1
  • Edited copy of a member (13 corresponding lines) src/Reports/Gitblame.php:70 — src/Reports/Gitblame.php:70-86 | src/Reports/Svnblame.php:56-68 — These two members are one piece of code written twice and then edited apart: 13 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 · Edited copy of a member (9 corresponding lines) · ×1
  • Edited copy of a member (9 corresponding lines) src/Files/File.php:670 — src/Files/File.php:670-678 | src/Files/File.php:704-712 — These two members are one piece of code written twice and then edited apart: 9 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 · Edited copy of a member (7 corresponding lines) · ×1
  • Edited copy of a member (7 corresponding lines) src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php:279 — src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php:279-292 | src/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php:50-56 — These two members are one piece of code written twice and then edited apart: 7 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 · Edited copies of one member (3 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php:41 — src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php:41-55 | src/Standards/Generic/Sniffs/NamingConventions/InterfaceNameSuffixSniff.php:41-49 | src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php:41-49 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (67 lines × 2) · ×1
  • Duplicated block (67 lines × 2) src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:69 — src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:69-135 | src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php:67-133 — before extracting anything, compare `src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php` and `src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 100 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 `src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:69` 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 (49–53 lines × 2) · ×1
  • Duplicated block (49–53 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:136 — src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:136-184 | src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php:70-122 — before extracting anything, compare `src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php` and `src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 92 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 `src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:136` 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 (38–40 lines × 2) · ×1
  • Duplicated block (38–40 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:269 — src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:269-308 | src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:298-335 — before extracting anything, compare `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php` and `src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 118 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 `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:269` 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, `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:265` calls `processParams`, `getTokens` and `src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php:296` 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.
D4 · Code Duplication · Duplicated block (28–33 lines × 2) · ×1
  • Duplicated block (28–33 lines × 2) src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:71 — src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:71-98 | src/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php:61-93 — 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 `src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php:71` 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 (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php:107 — src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php:107-133 | src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php:78-103 — before extracting anything, compare `src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php` and `src/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 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 `src/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.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. 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 (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php:55 — src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php:55-81 | src/Standards/Zend/Sniffs/Files/ClosingTagSniff.php:45-71 — 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 (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:427 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:427-469 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:505-547 — 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 `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:427` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) src/Filters/GitModified.php:37 — src/Filters/GitModified.php:37-61 | src/Filters/GitStaged.php:39-63 — 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 (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:282 — src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:282-305 | src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php:178-202 — 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 `src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:282` 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 (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) src/Reports/Code.php:267 — src/Reports/Code.php:267-289 | src/Reports/Full.php:150-172 — before extracting anything, compare `src/Reports/Code.php` and `src/Reports/Full.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 78 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 (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php:191 — src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php:191-213 | src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php:119-140 — 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–22 lines × 3) · ×1
  • Duplicated block (16–22 lines × 3) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:287 — src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:287-302 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:720-741 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:1372-1393 — 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 `src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:287` 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 (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) src/Tokenizers/Tokenizer.php:1147 — src/Tokenizers/Tokenizer.php:1147-1168 | src/Tokenizers/Tokenizer.php:1173-1192 — 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 `src/Tokenizers/Tokenizer.php:1147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php:132 — src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php:132-151 | src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php:199-219 — 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 `src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php:132` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:129 — src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php:129-148 | src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php:111-130 | src/Standards/Generic/Sniffs/WhiteSpace/SpreadOperatorSpacingAfterSniff.php:127-146 — before extracting anything, compare `src/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php` and `src/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 (20 lines × 2) · ×1
  • Duplicated block (20 lines × 2) src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:143 — src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:143-162 | src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:164-183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:142` calls `foreach` and `src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:162` 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.
D4 · Code Duplication · Duplicated block (18–19 lines × 3) · ×1
  • Duplicated block (18–19 lines × 3) src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php:127 — src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php:127-145 | src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:170-187 | src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php:152-169 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php:127` 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 (17–19 lines × 3) · ×1
  • Duplicated block (17–19 lines × 3) src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:168 — src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:168-184 | src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:205-221 | src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php:66-84 — before extracting anything, compare `src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php` and `src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:168` 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 (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) src/Fixer.php:494 — src/Fixer.php:494-512 | src/Fixer.php:609-627 — 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 `src/Fixer.php:494` 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 (17–19 lines × 2) · ×1
  • Duplicated block (17–19 lines × 2) src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php:68 — src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php:68-84 | src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:92-110 — 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 (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:452 — src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:452-470 | src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:549-566 — 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 `src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:452` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php:67 — src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php:67-84 | src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php:114-128 — 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 `src/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php:67` 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 (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php:52 — src/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php:52-68 | src/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php:54-70 | src/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php:48-64 — 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 3) · ×1
  • Duplicated block (16–17 lines × 3) src/Tokenizers/PHP.php:3185 — src/Tokenizers/PHP.php:3185-3201 | src/Tokenizers/Tokenizer.php:1582-1597 | src/Tokenizers/Tokenizer.php:1684-1699 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Tokenizers/PHP.php:3185` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) src/Config.php:1575 — src/Config.php:1575-1591 | src/Config.php:1653-1667 — 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 (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:148 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:148-164 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:618-633 — 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 `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:148` 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–16 lines × 3) · ×1
  • Duplicated block (12–16 lines × 3) src/Tokenizers/PHP.php:885 — src/Tokenizers/PHP.php:885-896 | src/Tokenizers/PHP.php:999-1010 | src/Tokenizers/PHP.php:2115-2130 — 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 `src/Tokenizers/PHP.php:885` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:162 — src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:162-176 | src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php:124-139 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:162` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–16 lines × 2) · ×1
  • Duplicated block (11–16 lines × 2) src/Util/Common.php:279 — src/Util/Common.php:279-289 | src/Util/Common.php:291-306 — 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 `src/Util/Common.php:291` 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 (15 lines × 5) · ×1
  • Duplicated block (15 lines × 5) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:408 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:408-422 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:486-500 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:564-578 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:671-685 | src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php:97-111 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:408` 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) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:289 — src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:289-303 | src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php:206-219 — before extracting anything, compare `src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php` and `src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 92 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 (12–14 lines × 8) · ×1
  • Duplicated block (12–14 lines × 8) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:441 — src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:441-452 | src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php:114-127 | src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php:64-75 | src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:151-163 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:209-221 | src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php:129-141 | src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php:73-85 | src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php:219-230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 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 8 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:441` 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, `src/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php:233` calls `recordMetric` and `src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php:129` 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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:182 — src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:182-193 | src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php:77-88 | src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php:123-134 — 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:88 — src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:88-98 | src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:121-132 | src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:379-389 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:88` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–12 lines × 2) · ×1
  • Duplicated block (8–12 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:101 — src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:101-112 | src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php:78-85 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php:42 — src/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php:42-52 | src/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php:42-52 | src/Standards/Generic/Sniffs/Files/OneObjectStructurePerFileSniff.php:47-57 | src/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php:42-52 — 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 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (8–11 lines × 3) · ×1
  • Duplicated block (8–11 lines × 3) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:605 — src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:605-615 | src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php:89-96 | src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php:157-164 — before extracting anything, compare `src/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php` and `src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 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 `src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:605` 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 (9–10 lines × 6) · ×1
  • Duplicated block (9–10 lines × 6) src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:329 — src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:329-337 | src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:351-359 | src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php:144-153 | src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php:169-178 | src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:574-582 | src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:96-104 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:329` 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, `src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:339` calls `addNewline` and `src/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php:106` 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:186 — src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:186-194 | src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:223-231 | src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php:88-97 — before extracting anything, compare `src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php` and `src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:186` 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 (7–9 lines × 8) · ×1
  • Duplicated block (7–9 lines × 8) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:439 — src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:439-445 | src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php:112-119 | src/Standards/PSR12/Sniffs/Classes/OpeningBraceSpaceSniff.php:62-68 | src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:148-156 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:207-213 | src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php:127-134 | src/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php:71-78 | src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php:191-197 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 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 8 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:439` 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, `src/Standards/PSR12/Sniffs/ControlStructures/ControlStructureSpacingSniff.php:146` calls `addNewlineBefore` and `src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:438` 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.
D4 · Code Duplication · Duplicated block (9 lines × 7) · ×1
  • Duplicated block (9 lines × 7) src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:91 — src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:91-99 | src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:164-172 | src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php:155-163 | src/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php:312-320 | src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php:109-117 | src/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php:142-150 | src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php:249-257 — there are 7 copies across 5 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 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php:91` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–9 lines × 3) · ×1
  • Duplicated block (6–9 lines × 3) src/Files/File.php:2250 — src/Files/File.php:2250-2255 | src/Files/File.php:2468-2473 | src/Files/File.php:2580-2588 — 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 `src/Files/File.php:2250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 3) · ×1
  • Duplicated block (8–9 lines × 3) src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php:94 — src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php:94-101 | src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:85-93 | src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:109-117 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:85` 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 (7–8 lines × 4) · ×1
  • Duplicated block (7–8 lines × 4) src/Files/File.php:2249 — src/Files/File.php:2249-2255 | src/Files/File.php:2390-2397 | src/Files/File.php:2467-2473 | src/Files/File.php:2582-2588 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Files/File.php:2249` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:196 — src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:196-205 | src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:171-178 | src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php:208-215 | src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php:70-78 — before extracting anything, compare `src/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php` and `src/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 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 `src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:196` 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 (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:340 — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:340-346 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:451-457 | src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:529-535 | src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php:76-84 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php:76` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:346` calls `endChangeset`, `replaceToken` and `src/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php:84` 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 (5–7 lines × 3) · ×1
  • Duplicated block (5–7 lines × 3) src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:168 — src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:168-172 | src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:438-443 | src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php:111-117 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5–7 lines × 2) · ×1
  • Duplicated block (5–7 lines × 2) src/Tokenizers/JS.php:1072 — src/Tokenizers/JS.php:1072-1076 | src/Tokenizers/PHP.php:2469-2475 — 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 `src/Tokenizers/PHP.php:2469` 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 (4–7 lines × 3) · ×1
  • Duplicated block (4–7 lines × 3) src/Tokenizers/JS.php:1088 — src/Tokenizers/JS.php:1088-1094 | src/Tokenizers/PHP.php:2450-2456 | src/Tokenizers/PHP.php:2504-2507 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `src/Tokenizers/JS.php:1088` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Tokenizers/JS.php:1095` calls `str_repeat`, `count` and `src/Tokenizers/PHP.php:2457` 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 (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:126 — src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:126-131 | src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:144-149 | src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php:178-183 | src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php:93-98 | src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:84-89 | src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php:107-113 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:126` 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, `src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:135` calls `replaceToken` and `src/Standards/PSR12/Sniffs/Functions/ReturnTypeDeclarationSniff.php:100` 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.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:156 — src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:156-161 | src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php:86-90 — 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 `src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:156` 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: FileCommentSniff (LCOM4 8) src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:16 — FileCommentSniff'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.
M1 · Documentation (README) · Repository declared end-of-life · ×1
  • Repository declared end-of-life README.md:2 — This repository declares its own end of life: `README.md` line 2 reads “> This repository has been abandoned. Its successor is [PHPCSStandards/PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer/)”. That is a first-party statement of intent, not an inference — the Maturity and Knowledge lenses otherwise approximate the same fact from decayed commit history (D16 reports a dormant codebase, D34 orphaned files), and this row says the maintainer already told you. It does NOT change any score: an honest end-of-life notice is the README doing its job, and every dimension below still measures the code as it stands. Read the whole report as an assessment of software the author has stopped working on.
P2 · Observability · No structured logging · ×1
  • No structured logging — No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.
Minor — 275 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×220
  • Orphaned file src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.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 src/Config.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 src/Ruleset.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 src/Tokenizers/JS.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 src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.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 src/Sniffs/AbstractPatternSniff.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 src/Runner.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 src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.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 src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.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 src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.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 src/Util/Tokens.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 src/Fixer.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 src/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.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 src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.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 src/Tokenizers/CSS.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 src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.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 src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.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 src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.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 src/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.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 src/Standards/PSR12/Sniffs/Files/FileHeaderSniff.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 src/Util/Common.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 src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.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 src/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.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 src/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.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 src/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.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.
  • + 195 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×38
  • Duplicated predicate src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:131 — `$commentStart === false || $tokens[$commentStart]['code'] !== T_DOC_COMMENT_OPEN_TAG` appears character-identically in 2 files — src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php, src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.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 src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php:102 — `$i >= 0 && $tokens[$i]['code'] === T_WHITESPACE` appears character-identically in 2 files — src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php, src/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.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 src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php:688 — `$next !== false && $tokens[$next]['code'] === T_COMMA` appears character-identically in 2 files — src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php, src/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.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 src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php:70 — `$next !== false && $tokens[$next]['line'] !== $tokens[$end]['line']` appears character-identically in 2 files — src/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php, src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.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 src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php:138 — `$next === false || $tokens[$next]['code'] !== T_SEMICOLON` appears character-identically in 2 files — src/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php, src/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.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 src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php:50 — `$opener < $stackPtr && $closer > $stackPtr` appears character-identically in 2 files — src/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php, src/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.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 autoload.php:133 — `$path !== false && is_file($path) === true` appears character-identically in 2 files — autoload.php, src/Util/Standards.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 src/Reporter.php:344 — `$report['errors'] === 0 && $report['warnings'] === 0` appears character-identically in 8 files — src/Reporter.php, src/Reports/Checkstyle.php, src/Reports/Code.php, src/Reports/Csv.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 src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:256 — `$string === false || $tokens[$string]['line'] !== $tokens[$tag]['line']` appears character-identically in 4 files — src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php, src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php, src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php, src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.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 src/Reports/Cbf.php:246 — `$toScreen === true && $interactive === false` appears character-identically in 7 files — src/Reports/Cbf.php, src/Reports/Code.php, src/Reports/Full.php, src/Reports/Info.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 src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php:72 — `$tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG && $tokens[$commentEnd]['code'] !== T_COMMENT` appears character-identically in 3 files — src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php, src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php, src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.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 src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php:62 — `$tokens[$commentEnd]['code'] === T_ATTRIBUTE_END && isset($tokens[$commentEnd]['attribute_opener']) === true` appears character-identically in 4 files — src/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php, src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php, src/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php, src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.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 src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:661 — `$tokens[$first]['code'] === T_CONSTANT_ENCAPSED_STRING && $tokens[($first - 1)]['code'] === T_CONSTANT_ENCAPSED_STRING` appears character-identically in 2 files — src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php, src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.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 src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php:185 — `$tokens[$i]['code'] === T_ATTRIBUTE && isset($tokens[$i]['attribute_closer']) === true` appears character-identically in 2 files — src/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php, src/Standards/PSR12/Sniffs/Classes/ClassInstantiationSniff.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 src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php:149 — `$tokens[$i]['code'] === T_COMMENT || isset(Tokens::$phpcsCommentTokens[$tokens[$i]['code']]) === true` appears character-identically in 2 files — src/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php, src/Standards/Squiz/Sniffs/CSS/IndentationSniff.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 src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php:233 — `$tokens[$i]['code'] === T_OPEN_PARENTHESIS && isset($tokens[$i]['parenthesis_closer']) === true` appears character-identically in 2 files — src/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php, src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.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 src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:128 — `$tokens[$i]['code'] === T_WHITESPACE && $tokens[$i]['line'] !== $tokens[($i + 1)]['line']` appears character-identically in 3 files — src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php, src/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php, src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.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 src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php:76 — `$tokens[$i]['column'] !== 1 || isset($checkTokens[$tokens[$i]['code']]) === false` appears character-identically in 2 files — src/Standards/Generic/Sniffs/VersionControl/GitMergeConflictSniff.php, src/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.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 src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php:146 — `$tokens[$nextToken]['code'] === T_ATTRIBUTE && isset($tokens[$nextToken]['attribute_closer']) === true` appears character-identically in 2 files — src/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php, src/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.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 src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php:41 — `$tokens[$objOperator]['code'] === T_OBJECT_OPERATOR || $tokens[$objOperator]['code'] === T_NULLSAFE_OBJECT_OPERATOR` appears character-identically in 2 files — src/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php, src/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.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 src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php:68 — `$tokens[$prev]['code'] !== T_SEMICOLON && $tokens[$prev]['code'] !== T_CLOSE_CURLY_BRACKET && $tokens[$prev]['code'] !== T_OPEN_TAG` appears character-identically in 2 files — src/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php, src/Standards/Zend/Sniffs/Files/ClosingTagSniff.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 src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:258 — `$tokens[$prev]['code'] === T_END_HEREDOC || $tokens[$prev]['code'] === T_END_NOWDOC` appears character-identically in 3 files — src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php, src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.php, src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.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 src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php:68 — `$tokens[$stackPtr]['code'] === T_CLOSE_CURLY_BRACKET && isset($tokens[$stackPtr]['scope_condition']) === true` appears character-identically in 2 files — src/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php, src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.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 src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php:81 — `$tokens[$stackPtr]['code'] === T_INLINE_THEN && $tokens[($stackPtr + 1)]['code'] === T_INLINE_ELSE` appears character-identically in 2 files — src/Standards/PSR12/Sniffs/Operators/OperatorSpacingSniff.php, src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.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 src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php:298 — `($tokens[$prev]['code'] === T_COMMENT) && (strpos($tokens[$prev]['content'], '*/') !== false)` appears character-identically in 2 files — src/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php, src/Standards/PSR12/Sniffs/Classes/AnonClassDeclarationSniff.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.
  • + 13 more in this group — see findings.md.
D24 · Comment Value · redundant comment · ×6
  • redundant comment src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.1.js:65 — "end if" only labels the closing brace of the if. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.js:17 — "end testFunction()" only labels the closing brace of the function testFunction. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.js:24 — 9 comments in this file only repeat the code they sit on (lines 24, 72, 121, 167, 213, 238, 261, 284, 372), for example "end if". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.1.js:7 — "end test()" only labels the closing brace of the function test. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.js:113 — "end for" only labels the closing brace of the for. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.js:126 — "end for" only labels the closing brace of the for. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D34 · Knowledge Freshness · Most significant orphaned file · ×3
  • Most significant orphaned file src/Tokenizers/PHP.php:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file src/Files/File.php:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file src/Tokenizers/Tokenizer.php:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found composer.json:37 — 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/`. ADRs are expected here because `composer.json` makes this repository a deployable product (line 37).
D27 · Navigability · Scattered collaborators · ×1
  • Scattered collaborators — 70 % of calls cross a namespace and only 1 % of collaborators are co-located — group each feature's code into a vertical slice so a call's collaborators sit together.
D34 · Knowledge Freshness · Dormant codebase · ×1
  • Dormant codebase — 223 of 223 significant files have no living knowledge — the codebase as a whole is dormant, not 223 separate risks. Counted over 223 of the 308 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. Re-engage owners or document before change.
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.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X5 · Nullable reference types · PHP static analysis does not check null everywhere · ×1
  • PHP static analysis does not check null everywhere — 0/1 of this repository's PHPStan/Psalm configuration(s) run at a level that checks null — PHPStan level 8 or above (`max` included), or Psalm `errorLevel` 3 or below (Psalm's default, with none stated, is 1). A PHPStan level written neither in the file nor in an include inside the repository is 0, PHPStan's own default. Below those levels the checker removes `null` from a union before any rule looks, so `$order->customer()->name()` on a `?Customer` passes, and the first null reaching it is an `Error: Call to a member function name() on null` in production.

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-87ece5b1ab13457f945a4c4e5ff70bd4/history.json --exit-code 0 --source .0artifacts/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-87ece5b1ab13457f945a4c4e5ff70bd4/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 .26artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (composer.json — not scanned yet).0—
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
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.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.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 Dependenciesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (composer.json — not scanned yet).0—

Run 01a1d6d3-26a2-7eeb-a485-61abdefc8015 · 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