Public report of vimeo/psalm, published 17 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, 17 November 2026, 14:38 UTC · Survey ID cd_cd7410410a034eefb1946e0c1e4db575

vimeo/psalm

Measured 17 November 2026, 14:35 UTC, at code version 8ff70ac

Test reliability is not measured: The suite could not be re-run, but the repository declares tests of its own unreliable.

CAI score 65.6out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Up 9.6 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 very large codebase: 2,659,812 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 24.0 person-years · Weakest lens: Security and Compliance, 61.8

Findings by how serious they are

13 critical 2815 serious 133 minor

20 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
17 November 2026, 14:35 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 ▸

47of 47 dimensions measured by tools.
2948of 2961 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
47dimensions across 5 lenses, read from 2,659,812 lines of product code in 3 projects.
Chapters

Executive summary

vimeo/psalm falls short of our standard for production because it has passwords or keys in the code's history. It scores 65.6 out of 100 and is rated Adequate, and nine of its 13 critical findings are security problems.

Security and Compliance, at 61.8, is the weakest lens and counts most in the score. The best first step is replacing the seven passwords or keys found in the code's history, worth about 3.4 points. Fixing the pipeline tool referenced by a changeable name comes next, worth about 1.5 points. Raising Security and Compliance to 70 would lift the score to about 68.0.

Seven passwords or keys are open to anyone who can read the repository. One automatic update takes new releases before a bad one can be spotted, and one pipeline tool is referenced by a changeable name, so the build pipeline can be tampered with. Replacing each exposed password or key, setting a waiting period for automatic updates and pinning the tool to an exact version would close these risks. The two tests the project itself marks as unreliable need fixing or deleting.

The product code is 2,659,812 lines, about €3,500,000 to rebuild. Two of our security checks couldn't finish, among them the one for known security holes in its packages, so those results are missing, not clean passes.

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.
Security and Compliance 61.8 · counts for 47%Production Readiness 62.6 · counts for 26%Maturity 71.3 · counts for 14%Code Health 75.8 · counts for 8%Architecture 88.8 · counts for 4%

If Security and Compliance rose from 61.8 to 70, the lowest score rated Strong, the score would rise from 65.6 to about 68.0.

Code composition: what the lines of code are
Product code 91%Tests 9%
New since the last survey: 542 findings

These 542 critical or serious findings weren't in the previous survey, on 5 November 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · ReturnAnalyzer.analyzeReturn (cyclomatic 109) src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php
  • Cyclomatic Complexity · AssignmentAnalyzer.analyzeAfterTheKeys (cyclomatic 102) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php
  • Cyclomatic Complexity · ArgumentsAnalyzer.analyzeArguments (cyclomatic 80) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php
  • Cyclomatic Complexity · ClassAnalyzer.analyzeClass (cyclomatic 73) src/Psalm/Internal/Analyzer/ClassAnalyzer.php
  • Cyclomatic Complexity · SimpleAssertionReconciler.reconcileAssertion (cyclomatic 58) src/Psalm/Internal/Type/SimpleAssertionReconciler.php
  • Cyclomatic Complexity · NamedFunctionCallHandler.handleExtract (cyclomatic 40) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php
  • Cyclomatic Complexity · ReflectorVisitor.recordExternalEffects (cyclomatic 36) src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php
  • Cyclomatic Complexity · LoopAnalyzer.setLoopVars (cyclomatic 35) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php
  • Cyclomatic Complexity · AssignmentAnalyzer.getReferencedPropertyType (cyclomatic 35) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php
  • Cyclomatic Complexity · Populator.inheritPropertyTypes (cyclomatic 31) src/Psalm/Internal/Codebase/Populator.php
  • Cyclomatic Complexity · DoAnalyzer.getUnsureBounds (cyclomatic 30) src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php
  • Cyclomatic Complexity · AndAnalyzer.analyze (cyclomatic 30) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/AndAnalyzer.php
  • Cyclomatic Complexity · ClassLikes.getPotentialDynamicMethodCalls (cyclomatic 29) src/Psalm/Internal/Codebase/ClassLikes.php
  • Cyclomatic Complexity · ArrayUniqueReturnTypeProvider.getFunctionReturnType (cyclomatic 29) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayUniqueReturnTypeProvider.php
  • Cyclomatic Complexity · LoopAnalyzer.addAlwaysWrittenVarIds (cyclomatic 27) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php
  • Cyclomatic Complexity · AssignmentAnalyzer.analyzeAssignmentOperation (cyclomatic 27) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php
  • Cyclomatic Complexity · ArgumentAnalyzer.getDispatchNode (cyclomatic 27) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php
  • Cyclomatic Complexity · NullsafeAnalyzer.analyze (cyclomatic 27) src/Psalm/Internal/Analyzer/Statements/Expression/NullsafeAnalyzer.php
  • Cyclomatic Complexity · Context.findReferenceRebinding (cyclomatic 26) src/Psalm/Context.php
  • Cyclomatic Complexity · GuardedClasses.whenResult (cyclomatic 26) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/GuardedClasses.php
  • Cyclomatic Complexity · AtomicTypeComparator.getTraversableHalf (cyclomatic 25) src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php
  • Cyclomatic Complexity · LoopAnalyzer.widenIntRanges (cyclomatic 24) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php
  • Cyclomatic Complexity · StaticCallAnalyzer.analyzeParentPropertyHookCall (cyclomatic 24) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php
  • Cyclomatic Complexity · ClassLikes.rebuildStructuralEdges (cyclomatic 24) src/Psalm/Internal/Codebase/ClassLikes.php
  • Cyclomatic Complexity · IssetGuardedProperties.walk (cyclomatic 23) src/Psalm/Internal/Analyzer/IssetGuardedProperties.php
  • Cyclomatic Complexity · ArithmeticOpAnalyzer.isChangeableByLoop (cyclomatic 23) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php
  • Cyclomatic Complexity · AssertionReconciler.restoreTemplateKeyOrValueOf (cyclomatic 23) src/Psalm/Internal/Type/AssertionReconciler.php
  • Cyclomatic Complexity · ForeachAnalyzer.mayWriteTheArrayOtherwise (cyclomatic 22) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php
  • Cyclomatic Complexity · MissingMethodCallHandler.overloadAcceptsArgs (cyclomatic 22) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MissingMethodCallHandler.php
  • Cyclomatic Complexity · Cache.consolidate (cyclomatic 22) src/Psalm/Internal/Cache.php
  • Cyclomatic Complexity · ArrayAnalyzer.castArrayKeyType (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php
  • Cyclomatic Complexity · AssertionFinder.getStringLengthComparison (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Cyclomatic Complexity · UnsetAnalyzer.removeOffset (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/UnsetAnalyzer.php
  • Cyclomatic Complexity · CliUtils.parseOptions (cyclomatic 21) src/Psalm/Internal/CliUtils.php
  • Cyclomatic Complexity · UnshippedCode.fromContents (cyclomatic 21) src/Psalm/Internal/Codebase/UnshippedCode.php
  • Cyclomatic Complexity · Reconciler.getPathType (cyclomatic 21) src/Psalm/Type/Reconciler.php
  • Cyclomatic Complexity · LoopAnalyzer.setVarsAssignedInCondition (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php
  • Cyclomatic Complexity · MethodCallPurityAnalyzer.getUnaffectedPropertyGetters (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php
  • Cyclomatic Complexity · ReturnAnalyzer.collectGeneratorReturnTypes (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php
  • Cyclomatic Complexity · UnsetAnalyzer.replaceElement (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/UnsetAnalyzer.php
  • Cyclomatic Complexity · CodeUseGraph.reach (cyclomatic 20) src/Psalm/Internal/Codebase/CodeUseGraph.php
  • Cyclomatic Complexity · ExpressionResolver.fileDeclaresKind (cyclomatic 20) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php
  • Cyclomatic Complexity · ReflectorVisitor.recordThisPropertyMutation (cyclomatic 20) src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php
  • Cyclomatic Complexity · Context.filterClauses (cyclomatic 19) src/Psalm/Context.php
  • Cyclomatic Complexity · DoAnalyzer.analyze (cyclomatic 19) src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php
  • Cyclomatic Complexity · DoAnalyzer.hasExitToTheLoop (cyclomatic 19) src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php
  • Cyclomatic Complexity · AssertionReconciler.getCompatibleStringType (cyclomatic 19) src/Psalm/Internal/Type/AssertionReconciler.php
  • Cyclomatic Complexity · AssertionReconciler.canBeIntersected (cyclomatic 19) src/Psalm/Internal/Type/AssertionReconciler.php
  • Cyclomatic Complexity · ParseTreeCreator.parseCallableParam (cyclomatic 19) src/Psalm/Internal/Type/ParseTreeCreator.php
  • Cyclomatic Complexity · ParseTreeCreator.handleComma (cyclomatic 19) src/Psalm/Internal/Type/ParseTreeCreator.php
  • Cyclomatic Complexity · SimpleAssertionReconciler.reconcileIsset (cyclomatic 19) src/Psalm/Internal/Type/SimpleAssertionReconciler.php
  • Cyclomatic Complexity · TemplateStandinTypeReplacer.replace (cyclomatic 19) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php
  • Cyclomatic Complexity · ClosureAnalyzer.widenLiteralsOfByRefCapture (cyclomatic 18) src/Psalm/Internal/Analyzer/ClosureAnalyzer.php
  • Cyclomatic Complexity · LoopAnalyzer.analyzeForOrWhile (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php
  • Cyclomatic Complexity · AssertionFinder.getNullInequalityAssertions (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Cyclomatic Complexity · ArgumentAnalyzer.getDispatchRoutes (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php
  • Cyclomatic Complexity · ThrowAnalyzer.analyze (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Expression/ThrowAnalyzer.php
  • Cyclomatic Complexity · SimpleAssertionReconciler.reconcileStringArrayAccess (cyclomatic 18) src/Psalm/Internal/Type/SimpleAssertionReconciler.php
  • Cyclomatic Complexity · Context.resetMutatedStaticProperties (cyclomatic 17) src/Psalm/Context.php
  • Cyclomatic Complexity · AlgebraAnalyzer.findImplication (cyclomatic 17) src/Psalm/Internal/Analyzer/AlgebraAnalyzer.php
  • Cyclomatic Complexity · IfConditionalAnalyzer.getAssignmentStates (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php
  • Cyclomatic Complexity · LoopAnalyzer.applyPreConditionToLoopContext (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php
  • Cyclomatic Complexity · AssertionFinder.getNullEqualityAssertions (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Cyclomatic Complexity · AssertionFinder.getGetdebugtypeEqualityAssertions (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Cyclomatic Complexity · AssertionFinder.getComparedVarId (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Cyclomatic Complexity · ArrayAssignmentAnalyzer.updateParentTypes (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php
  • Cyclomatic Complexity · AssignmentAnalyzer.makeReferencedArrayNonNull (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php
  • Cyclomatic Complexity · CallAnalyzer.checkFunctionExists (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php
  • Cyclomatic Complexity · ConstFetchAnalyzer.getConstType (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ConstFetchAnalyzer.php
  • Cyclomatic Complexity · ExpressionAnalyzer.analyze (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php
  • Cyclomatic Complexity · Clause.calculateNegation (cyclomatic 17) src/Psalm/Internal/Clause.php
  • Cyclomatic Complexity · JsonEncodeTainter.removeTaints (cyclomatic 17) src/Psalm/Internal/Provider/AddRemoveTaints/JsonEncodeTainter.php
  • Cyclomatic Complexity · PregReplaceCallbackParamsProvider.getFunctionParams (cyclomatic 17) src/Psalm/Internal/Provider/ParamsProvider/PregReplaceCallbackParamsProvider.php
  • Cyclomatic Complexity · ArrayColumnReturnTypeProvider.castToArrayKey (cyclomatic 17) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayColumnReturnTypeProvider.php
  • Cyclomatic Complexity · ArrayIntersectKeyReturnTypeProvider.getFunctionReturnType (cyclomatic 17) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayIntersectKeyReturnTypeProvider.php
  • Cyclomatic Complexity · CallableTypeComparator.getCallableFromMethodId (cyclomatic 17) src/Psalm/Internal/Type/Comparator/CallableTypeComparator.php
  • Cyclomatic Complexity · SimpleAssertionReconciler.getListOfSealedShape (cyclomatic 17) src/Psalm/Internal/Type/SimpleAssertionReconciler.php
  • Cyclomatic Complexity · TypeCombination.fallbackKeyAlwaysContains (cyclomatic 17) src/Psalm/Internal/Type/TypeCombination.php
  • Cyclomatic Complexity · Config.resolveCompressor (cyclomatic 16) src/Psalm/Config.php
  • Cyclomatic Complexity · Context.update (cyclomatic 16) src/Psalm/Context.php
  • Cyclomatic Complexity · NamespaceAnalyzer.collectAnalyzableInformation (cyclomatic 16) src/Psalm/Internal/Analyzer/NamespaceAnalyzer.php
  • Cyclomatic Complexity · ForeachAnalyzer.addItemsWrittenByRef (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php
  • Cyclomatic Complexity · ForeachAnalyzer.mayPassByReference (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php
  • Cyclomatic Complexity · MethodCallPurityAnalyzer.resetWrittenProperties (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php
  • Cyclomatic Complexity · ExistingAtomicStaticCallAnalyzer.getStaticClassType (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php
  • Cyclomatic Complexity · CallAnalyzer.resolveStaticPropertyAssertionClasses (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php
  • Cyclomatic Complexity · InstanceofAnalyzer.analyze (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/InstanceofAnalyzer.php
  • Cyclomatic Complexity · IntMaskComparisonAnalyzer.analyzeBinaryOp (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/IntMaskComparisonAnalyzer.php
  • Cyclomatic Complexity · ReturnAnalyzer.getTemplateParamEqualToLiteral (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php
  • Cyclomatic Complexity · ClassLikeNodeScanner.getTypeAliasesFromCommentLines (cyclomatic 16) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php
  • Cyclomatic Complexity · AtomicParts.split (cyclomatic 16) src/Psalm/Internal/Type/AtomicParts.php
  • Cyclomatic Complexity · KeyedArrayComparator.coerceToObjectWithProperties (cyclomatic 16) src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php
  • Cyclomatic Complexity · ParseTreeCreator.handleAmpersand (cyclomatic 16) src/Psalm/Internal/Type/ParseTreeCreator.php
  • Cyclomatic Complexity · TypeParser.unescapeStringLiteral (cyclomatic 16) src/Psalm/Internal/Type/TypeParser.php
  • Cognitive Complexity · ReturnAnalyzer.analyzeReturn (cognitive 329) src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php
  • Cognitive Complexity · AssignmentAnalyzer.analyzeAfterTheKeys (cognitive 157) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php
  • Cognitive Complexity · ClassAnalyzer.analyzeClass (cognitive 151) src/Psalm/Internal/Analyzer/ClassAnalyzer.php
  • Cognitive Complexity · ArgumentsAnalyzer.analyzeArguments (cognitive 107) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php
  • Cognitive Complexity · ClassLikes.getPotentialDynamicMethodCalls (cognitive 77) src/Psalm/Internal/Codebase/ClassLikes.php
  • Cognitive Complexity · LoopAnalyzer.setLoopVars (cognitive 66) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.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: 152 findings

These 152 critical or serious findings were in the previous survey, on 5 November 2026, and are gone from this one. The first 100 are listed here.

  • Cyclomatic Complexity · ReturnAnalyzer.analyze (cyclomatic 111) src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php
  • Cyclomatic Complexity · AssignmentAnalyzer.analyze (cyclomatic 94) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php
  • Cyclomatic Complexity · ArgumentsAnalyzer.analyze (cyclomatic 90) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php
  • Cyclomatic Complexity · ClassAnalyzer.analyze (cyclomatic 76) src/Psalm/Internal/Analyzer/ClassAnalyzer.php
  • Cyclomatic Complexity · SimpleAssertionReconciler.reconcile (cyclomatic 58) src/Psalm/Internal/Type/SimpleAssertionReconciler.php
  • Cyclomatic Complexity · LoopAnalyzer.doesEnterLoop (cyclomatic 23) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php
  • Cyclomatic Complexity · Populator.populateDataFromParentClass (cyclomatic 21) src/Psalm/Internal/Codebase/Populator.php
  • Cyclomatic Complexity · Populator.inheritPropertiesFromParent (cyclomatic 18) src/Psalm/Internal/Codebase/Populator.php
  • Cyclomatic Complexity · AssertionFinder.hasNonEmptyCountEqualityCheck (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Cyclomatic Complexity · AssertionFinder.hasLessThanCountEqualityCheck (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Cyclomatic Complexity · TaintFlowGraph.isCallSpecialized (cyclomatic 17) src/Psalm/Internal/Codebase/TaintFlowGraph.php
  • Cyclomatic Complexity · FunctionLikeAnalyzer.checkParamReferences (cyclomatic 16) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php
  • Cyclomatic Complexity · Cache.getItem (cyclomatic 16) src/Psalm/Internal/Cache.php
  • Cyclomatic Complexity · PropertyVisibilityResolver.resolve (cyclomatic 16) src/Psalm/Internal/PhpVisitor/Reflector/PropertyVisibilityResolver.php
  • Cognitive Complexity · ReturnAnalyzer.analyze (cognitive 328) src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php
  • Cognitive Complexity · ClassAnalyzer.analyze (cognitive 155) src/Psalm/Internal/Analyzer/ClassAnalyzer.php
  • Cognitive Complexity · AssignmentAnalyzer.analyze (cognitive 142) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php
  • Cognitive Complexity · ArgumentsAnalyzer.analyze (cognitive 123) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php
  • Cognitive Complexity · SimpleAssertionReconciler.reconcile (cognitive 65) src/Psalm/Internal/Type/SimpleAssertionReconciler.php
  • Cognitive Complexity · LoopAnalyzer.doesEnterLoop (cognitive 41) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php
  • Cognitive Complexity · AtomicMethodCallAnalyzer.handleTemplatedMixins (cognitive 37) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php
  • Cognitive Complexity · CodeUseGraph.resolve (cognitive 36) src/Psalm/Internal/Codebase/CodeUseGraph.php
  • Cognitive Complexity · ClassLikeAnalyzer.getMethodMutations (cognitive 35) src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php
  • Cognitive Complexity · Populator.populateDataFromParentClass (cognitive 26) src/Psalm/Internal/Codebase/Populator.php
  • Cognitive Complexity · FormulaGenerator.getAssignedVarIds (cognitive 21) src/Psalm/Internal/Algebra/FormulaGenerator.php
  • Cognitive Complexity · MethodComparator.comparePseudoMethods (cognitive 18) src/Psalm/Internal/Analyzer/MethodComparator.php
  • Cognitive Complexity · AssertionFinder.hasNonEmptyCountEqualityCheck (cognitive 18) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Cognitive Complexity · AssertionFinder.hasLessThanCountEqualityCheck (cognitive 18) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Cognitive Complexity · TaintFlowGraph.isCallSpecialized (cognitive 18) src/Psalm/Internal/Codebase/TaintFlowGraph.php
  • Cognitive Complexity · IssetAnalyzer.analyze (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/IssetAnalyzer.php
  • Cognitive Complexity · Cache.getItem (cognitive 17) src/Psalm/Internal/Cache.php
  • Cognitive Complexity · TypeParser.getTypeFromIntersectionTree (cognitive 17) src/Psalm/Internal/Type/TypeParser.php
  • Cognitive Complexity · AtomicMethodCallAnalyzer.handleRegularMixins (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php
  • Cognitive Complexity · Scanner.scanFilePaths (cognitive 16) src/Psalm/Internal/Codebase/Scanner.php
  • God Classes · MethodTooLong: ReturnAnalyzer.analyze src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php
  • God Classes · MethodTooLong: AssignmentAnalyzer.analyze src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php
  • God Classes · MethodTooLong: ClassAnalyzer.analyze src/Psalm/Internal/Analyzer/ClassAnalyzer.php
  • God Classes · MethodTooLong: SimpleAssertionReconciler.reconcile src/Psalm/Internal/Type/SimpleAssertionReconciler.php
  • God Classes · MethodTooLong: UnsetAnalyzer.analyze src/Psalm/Internal/Analyzer/Statements/UnsetAnalyzer.php
  • God Classes · MethodTooLong: TemplateStandinTypeReplacer.findMatchingAtomicTypesForTemplate src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php
  • Code Duplication · Near-duplicate member family (4 members, 53 shared lines) src/Psalm/Internal/Type/SimpleAssertionReconciler.php
  • Code Duplication · Members sharing a duplicated core (16 members, 50+ identical tokens) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/Psalm/Internal/Analyzer/Statements/BreakAnalyzer.php
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/Psalm/Internal/Cli/LanguageServer.php
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/Psalm/Internal/ExecutionEnvironment/BuildInfoCollector.php
  • Code Duplication · Duplicated block (49 lines × 2) src/Psalm/Internal/Type/SimpleAssertionReconciler.php
  • Code Duplication · Duplicated block (48 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php
  • Code Duplication · Duplicated block (40 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Code Duplication · Duplicated block (39–40 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Code Duplication · Duplicated block (37–38 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php
  • Code Duplication · Duplicated block (38 lines × 2) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php
  • Code Duplication · Duplicated block (37 lines × 4) src/Psalm/Internal/Type/SimpleAssertionReconciler.php
  • Code Duplication · Duplicated block (32 lines × 2) src/Psalm/Report/ByIssueLevelAndTypeReport.php
  • Code Duplication · Duplicated block (31 lines × 4) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php
  • Code Duplication · Duplicated block (28–29 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php
  • Code Duplication · Duplicated block (26 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Code Duplication · Duplicated block (25 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php
  • Code Duplication · Duplicated block (24 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php
  • Code Duplication · Duplicated block (24 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php
  • Code Duplication · Duplicated block (24 lines × 2) src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php
  • Code Duplication · Duplicated block (23 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php
  • Code Duplication · Duplicated block (23 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php
  • Code Duplication · Duplicated block (21–23 lines × 2) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php
  • Code Duplication · Duplicated block (22 lines × 2) src/Psalm/Internal/Algebra/FormulaGenerator.php
  • Code Duplication · Duplicated block (21 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php
  • Code Duplication · Duplicated block (20 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/StaticPropertyAssignmentAnalyzer.php
  • Code Duplication · Duplicated block (19–20 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php
  • Code Duplication · Duplicated block (19 lines × 2) src/Psalm/Internal/Algebra/FormulaGenerator.php
  • Code Duplication · Duplicated block (19 lines × 2) src/Psalm/Internal/Algebra/FormulaGenerator.php
  • Code Duplication · Duplicated block (19 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Code Duplication · Duplicated block (19 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php
  • Code Duplication · Duplicated block (18 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php
  • Code Duplication · Duplicated block (18 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php
  • Code Duplication · Duplicated block (18 lines × 2) src/Psalm/Internal/Cli/Psalter.php
  • Code Duplication · Duplicated block (13–18 lines × 2) src/Psalm/Internal/Codebase/Populator.php
  • Code Duplication · Duplicated block (18 lines × 2) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php
  • Code Duplication · Duplicated block (17 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php
  • Code Duplication · Duplicated block (16 lines × 3) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php
  • Code Duplication · Duplicated block (16 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php
  • Code Duplication · Duplicated block (16 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Code Duplication · Duplicated block (16 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php
  • Code Duplication · Duplicated block (16 lines × 2) src/Psalm/Internal/Cli/LanguageServer.php
  • Code Duplication · Duplicated block (16 lines × 2) src/Psalm/Internal/Cli/LanguageServer.php
  • Code Duplication · Duplicated block (16 lines × 2) src/Psalm/Internal/Type/SimpleAssertionReconciler.php
  • Code Duplication · Duplicated block (15 lines × 3) src/Psalm/Type/Atomic.php
  • Code Duplication · Duplicated block (15 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php
  • Code Duplication · Duplicated block (13–15 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php
  • Code Duplication · Duplicated block (14 lines × 2) src/Psalm/Config/FileFilter.php
  • Code Duplication · Duplicated block (12–14 lines × 2) src/Psalm/Type/Reconciler.php
  • Code Duplication · Duplicated block (13 lines × 4) src/Psalm/Internal/Analyzer/Statements/BreakAnalyzer.php
  • Code Duplication · Duplicated block (13 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
  • Code Duplication · Duplicated block (13 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php
  • Code Duplication · Duplicated block (11–13 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php
  • Code Duplication · Duplicated block (13 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
Rebuild cost: about €3,500,000 · Estimate
Cost to rebuild€1,200,000 to €5,800,000, for 19,291 to 61,200 hours of work, about 24.0 person-years for 14 to 46 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.9 at a score of 66. 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.
SizeVery large: 2,659,812 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 7 High secret finding(s) in Secrets (history) — start with REDACTED (5), REDACTED (2).
Raises the score by about 3.4 points · Low effort · Secrets (history)
2
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.
Raises the score by about 1.5 points · Low effort · Static Analysis (SAST)
3
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.
Raises the score by about 1.5 points · Low effort · Static Analysis (SAST)

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 €3,500,000 to build again, about 24.0 person-years of work. Its weakest lens is Security and Compliance, at 61.8 (Adequate). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Resolve the 7 High secret finding(s) in Secrets (history). Of all the actions in this report, it raises the score most for the work it takes: about 3.4 points for low effort, because it clears the 7 Secrets (history) 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 5.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 1,750,628 lines over the last 90 days, which is about 7,099,769 lines a year. At that pace, the extra work comes to an estimated 963.6 to 5781.6 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 — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch (root) (root) dictionaries dictionaries src/Psalm Psalm dictionaries->src/Psalm

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 293 dependencies between them. One loop runs through 28 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 Node2 Progress3 Internal.LanguageServer.Server4 Internal.Provider5 Internal.Scope6 Report7 Type.Atomic8 Internal.FileManipulation9 Internal.LanguageServer10 Internal.TypeVisitor11 Internal.Type12 Type13 Internal.Scanner14 Plugin.EventHandler15 Storage16 Internal.DataFlow17 Internal.Codebase18 Internal.Analyzer19 Plugin20 Plugin.EventHandler.Event21 Internal22 Internal.Provider.ParamsProvider23 Psalm24 Internal.Algebra25 Internal.Analyzer.FunctionLike26 Internal.Analyzer.Statements27 Internal.Analyzer.Statements.Block28 Internal.Analyzer.Statements.Expression29 Internal.Analyzer.Statements.Expression.Assignment30 Internal.Analyzer.Statements.Expression.BinaryOp31 Internal.Analyzer.Statements.Expression.Call.StaticMethod32 Internal.Analyzer.Statements.Expression.Fetch33 Internal.Cli34 Internal.PhpVisitor35 Internal.PhpVisitor.Reflector36 Internal.Provider.ReturnTypeProvider37 Internal.Stubs.Generator38 Internal.Type.Comparator39 Internal.Analyzer.Statements.Expression.Call40 Internal.Analyzer.Statements.Expression.Call.Method
1 Node
2 Progress
3 Internal.LanguageServer.Server222
4 Internal.Provider115512439
5 Internal.Scope4
6 Report618
7 Type.Atomic195011320
8 Internal.FileManipulation131
9 Internal.LanguageServer2212
10 Internal.TypeVisitor1948118
11 Internal.Type1351387322
12 Type612217
13 Internal.Scanner1114
14 Plugin.EventHandler13131
15 Storage21131115
16 Internal.DataFlow212
17 Internal.Codebase631311152301015349
18 Internal.Analyzer11111311103162952
19 Plugin11211112
20 Plugin.EventHandler.Event25278
21 Internal11111182
22 Internal.Provider.ParamsProvider5115
23 Psalm28422262619852
24 Internal.Algebra1112
25 Internal.Analyzer.FunctionLike21135
26 Internal.Analyzer.Statements153119115
27 Internal.Analyzer.Statements.Block715110114
28 Internal.Analyzer.Statements.Expression312121181132349
29 Internal.Analyzer.Statements.Expression.Assignment1522137
30 Internal.Analyzer.Statements.Expression.BinaryOp113612
31 Internal.Analyzer.Statements.Expression.Call.StaticMethod2253225
32 Internal.Analyzer.Statements.Expression.Fetch18911116113
33 Internal.Cli121111
34 Internal.PhpVisitor41113
35 Internal.PhpVisitor.Reflector41322125
36 Internal.Provider.ReturnTypeProvider4615545512
37 Internal.Stubs.Generator2122
38 Internal.Type.Comparator1511211110
39 Internal.Analyzer.Statements.Expression.Call611151944167294
40 Internal.Analyzer.Statements.Expression.Call.Method451271278202
Uses a module listed above itPart of a loopThe module itself
1 Node2 Progress3 Internal.LanguageServer.Server4 Internal.Provider5 Internal.Scope6 Report7 Type.Atomic8 Internal.FileManipulation9 Internal.LanguageServer10 Internal.TypeVisitor11 Internal.Type12 Type13 Internal.Scanner14 Plugin.EventHandler15 Storage16 Internal.DataFlow17 Internal.Codebase18 Internal.Analyzer19 Plugin20 Plugin.EventHandler.Event21 Internal22 Internal.Provider.ParamsProvider23 Psalm24 Internal.Algebra25 Internal.Analyzer.FunctionLike26 Internal.Analyzer.Statements27 Internal.Analyzer.Statements.Block28 Internal.Analyzer.Statements.Expression29 Internal.Analyzer.Statements.Expression.Assignment30 Internal.Analyzer.Statements.Expression.BinaryOp31 Internal.Analyzer.Statements.Expression.Call.StaticMethod32 Internal.Analyzer.Statements.Expression.Fetch33 Internal.Cli34 Internal.PhpVisitor35 Internal.PhpVisitor.Reflector36 Internal.Provider.ReturnTypeProvider37 Internal.Stubs.Generator38 Internal.Type.Comparator39 Internal.Analyzer.Statements.Expression.Call40 Internal.Analyzer.Statements.Expression.Call.MethodNode1Progress2Internal.LanguageServer.Server3Internal.Provider4Internal.Scope5Report6Type.Atomic7Internal.FileManipulation8Internal.LanguageServer9Internal.TypeVisitor10Internal.Type11Type12Internal.Scanner13Plugin.EventHandler14Storage15Internal.DataFlow16Internal.Codebase17Internal.Analyzer18Plugin19Plugin.EventHandler.Event20Internal21Internal.Provider.ParamsProvider22Psalm23Internal.Algebra24Internal.Analyzer.FunctionLike25Internal.Analyzer.Statements26Internal.Analyzer.Statements.Block27Internal.Analyzer.Statements.Expression28Internal.Analyzer.Statements.Expression.Assignment29Internal.Analyzer.Statements.Expression.BinaryOp30Internal.Analyzer.Statements.Expression.Call.StaticMethod31Internal.Analyzer.Statements.Expression.Fetch32Internal.Cli33Internal.PhpVisitor34Internal.PhpVisitor.Reflector35Internal.Provider.ReturnTypeProvider36Internal.Stubs.Generator37Internal.Type.Comparator38Internal.Analyzer.Statements.Expression.Call39Internal.Analyzer.Statements.Expression.Call.Method402221155124394618195011320131221219481181351387322612217111413131211311152126313111523010153491111131110316295211211112252781111118251152842226261985211122113515311911571511011431212118113234915221371136122253225189111161131211114111341322125461554551221221511211110611151944167294451271278202+37 more modules (most-connected shown)

At a glance — Code Health · 75.8 · Adequate · gated by D1, D2 ·

At a glance — Architecture · 88.8 · Adequate · gated by D5 ·

At a glance — Maturity · 71.3 · Strong ·

At a glance — Readiness · 62.6 · Adequate ·

At a glance — Security · 61.8 · Adequate · gated by D28 ·

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
A07:2025 — Authentication Failures8High / Critical
A03:2025 — Software Supply Chain Failures5Medium
A05:2025 — Injection3High / Critical

Roadmap

Top priorities: Resolve the 235 No assertions finding(s) in Test Quality — start with StubTest.php (36), ThrowsAnnotationTest.php (24), ArrayAccessTest.php (17); Resolve the 7 High secret finding(s) in Secrets (history) — start with REDACTED (5), REDACTED (2); Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.

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

Do thisHelpsEffortDimension
Resolve the 7 High secret finding(s) in Secrets (history) — start with REDACTED (5), REDACTED (2).+3.4 ptsLowSecrets (history)
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.+1.5 ptsLowStatic Analysis (SAST)
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.+1.5 ptsLowStatic Analysis (SAST)
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED.+1.5 ptsLowSupply-chain Provenance & Signing
Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md.+1.3 ptsLowDocumentation Quality
Resolve the 235 No assertions finding(s) in Test Quality — start with StubTest.php (36), ThrowsAnnotationTest.php (24), ArrayAccessTest.php (17).+3.6 ptsHighTest Quality
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.+0.9 ptsLowStatic Analysis (SAST)
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.+1.8 ptsMediumDeployment & Rollback

File quality

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

FileScoreBandWorst signal
REDACTED5.1MixedSecrets (history): High secret: REDACTED
src/Psalm/Codebase.php5.5MixedCyclomatic Complexity: Codebase.getCompletionItemsForClassishThing (cyclomatic 34)
src/Psalm/Context.php5.5MixedCyclomatic Complexity: Context.findReferenceRebinding (cyclomatic 26)
src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php5.6MixedCyclomatic Complexity: IfElseAnalyzer.analyze (cyclomatic 96)
src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php5.6MixedCyclomatic Complexity: ElseAnalyzer.analyze (cyclomatic 45)
REDACTED5.8MixedSecrets (history): High secret: REDACTED
REDACTED5.8MixedSecrets (history): High secret: REDACTED
src/Psalm/Internal/Analyzer/InterfaceAnalyzer.php5.9MixedCyclomatic Complexity: InterfaceAnalyzer.analyze (cyclomatic 28)
src/Psalm/Internal/Cache.php5.9MixedCyclomatic Complexity: Cache.consolidate (cyclomatic 22)
src/Psalm/Internal/Type/TypeCombiner.php6.0MixedExplicit Debt: TodoComment
src/Psalm/Config.php6.0MixedExplicit Debt: HackComment
src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php6.0MixedExplicit Debt: HackComment
src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php6.0MixedExplicit Debt: TodoComment
src/Psalm/Type/Atomic.php6.0MixedExplicit Debt: TodoComment
src/Psalm/Internal/Codebase/Methods.php6.0MixedExplicit Debt: XxxComment
src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php6.0MixedExplicit Debt: TodoComment
src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php6.0MixedExplicit Debt: HackComment
src/Psalm/Internal/Codebase/ClassLikes.php6.0MixedExplicit Debt: FixmeComment
src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php6.0MixedExplicit Debt: TodoComment
src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php6.0MixedExplicit Debt: TodoComment

How the grades work

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

Critical — 13

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

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

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

Could not be resolved — 20

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

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, 2948 of 2961 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 01a1e9ef-91a4-7adf-bc63-805303cbc4d3.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.php) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
  • 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. This repository declares 2 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.php), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
  • 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. Not scored — 21 direct Composer requirement(s) were read, but the outdated signal needs Packagist, and no committed composer.lock resolves them to releases, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • 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.
  • 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 — 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.
  • 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)` (220805 LoC, 1342 module-visible types across 79 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.
  • D30 Dependency Vulnerabilities — 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. Osv: osv-scanner exited 127 with no findings — dependency CVEs were not measured. 'osv-scanner' exited 127 and produced no findings, and that exit code has no documented repo-side meaning — so this run measured nothing, and nothing here is a statement about the repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `bin/ci/announce-release.php`, `bin/hack-conformance/Transpiler.php`, `bin/hack-conformance/transpile.php`, `bin/perf/lib/compare.php`, `bin/perf/lib/report.php`, … (+213 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • D43 Malicious Dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Osv: osv-scanner exited 127 with no findings — dependency CVEs were not measured. 'osv-scanner' exited 127 and produced no findings, and that exit code has no documented repo-side meaning — so this run measured nothing, and nothing here is a statement about the repository.
  • 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, Scala, Rust and Java source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Java 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, Scala and Rust source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust 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.
  • X10 Duplicated predicate — 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. 73 further occurrence(s) are not listed individually; the score already reflects all 113.
  • 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, Kotlin, Java and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin, Java or Rust 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, Kotlin, Rust and Java source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin, Rust or Java 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, Java, Python, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Python, Dart, Ruby, Scala, Kotlin or Rust 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.
  • 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, Rust, Go, Swift, Erlang, F# and Visual Basic 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.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • 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.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • 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.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic 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

632 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was FilterUtils.getReturnType at 279. A further 4 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 Shepherd.getCurlSslErrorMessage at 34 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: src/Psalm/Plugin/Shepherd.php (Shepherd.getCurlSslErrorMessage at 34). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

FilterUtils.getReturnType (cyclomatic 279)src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:664
AtomicTypeComparator.isContainedBy (cyclomatic 244)src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php:77
FunctionLikeAnalyzer.analyze (cyclomatic 235)src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:304
ArithmeticOpAnalyzer.analyzeOperands (cyclomatic 225)src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:412
ReturnTypeAnalyzer.verifyReturnType (cyclomatic 209)src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:135

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

What to do

  1. Bring the 84 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with FilterUtils.getReturnType (cyclomatic 279), AtomicTypeComparator.isContainedBy (cyclomatic 244), FunctionLikeAnalyzer.analyze (cyclomatic 235). — 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 84 together lifts Cyclomatic Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D2 · Cognitive Complexity2.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 2.0 / 10 · rule-coverage 100% · ceiling Prevented

852 method(s) exceeded the cognitive complexity threshold of 15; the worst was FilterUtils.getReturnType at 520.

FilterUtils.getReturnType (cognitive 520)src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:664
ArithmeticOpAnalyzer.analyzeOperands (cognitive 398)src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:412
AtomicTypeComparator.isContainedBy (cognitive 391)src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php:77
ClassLikeNodeScanner.start (cognitive 381)src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:155
FunctionLikeAnalyzer.analyze (cognitive 351)src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:304

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

What to do

  1. Bring the 852 bodies over 15 down to 15 or less in Cognitive Complexity — start with FilterUtils.getReturnType (cognitive 520), ArithmeticOpAnalyzer.analyzeOperands (cognitive 398), AtomicTypeComparator.isContainedBy (cognitive 391). — 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 852 together lifts Cognitive Complexity from 2.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 Classes9.7 / 10Stronggated by 419 serious findings✓ 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 9.7 / 10 · rule-coverage 100% · ceiling Prevented

419 god class(es) detected.

MethodTooLong: FunctionLikeAnalyzer.analyze · ×237src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:304
ClassTooLong: AssertionFinder · ×82src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:144
FileTooLong: Expression/AssertionFinder.php · ×76src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php
TooManyMethods: Codebase · ×24src/Psalm/Codebase.php:126

What to do

  1. Resolve the 237 MethodTooLong finding(s) in God Classes — start with ClassAnalyzer.php (7), ArrayFetchAnalyzer.php (7), AssertionReconciler.php (6). — One of this dimension's main actionable groups (237 warning-level).
  2. Resolve the 82 ClassTooLong finding(s) in God Classes — start with AssertionFinder.php, SimpleAssertionReconciler.php, AssignmentAnalyzer.php. — One of this dimension's main actionable groups (82 warning-level).
  3. Resolve the 76 FileTooLong finding(s) in God Classes — start with AssertionFinder.php, SimpleAssertionReconciler.php, AssignmentAnalyzer.php. — One of this dimension's main actionable groups (76 warning-level).

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

D4 · Code Duplication9.8 / 10Stronggated by 420 serious findings✓ 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 9.8 / 10 · rule-coverage 100% · ceiling Verified

323 duplicated block group(s) detected. 0.5 % of the production lines (13,929 of 2,659,812) are in a reported copy. A further 97 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 2 of the 420 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (16 lines × 2) · ×14src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:232
Duplicated block (14 lines × 2) · ×14src/Psalm/Internal/Algebra/FormulaGenerator.php:708
Duplicated block (11 lines × 2) · ×13src/Psalm/CodeLocation/ParseErrorLocation.php:32
Duplicated block (19 lines × 2) · ×11src/Psalm/Internal/Algebra/FormulaGenerator.php:277
Duplicated block (17 lines × 2) · ×11src/Psalm/Internal/Algebra/FormulaGenerator.php:357

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

What to do

  1. Resolve the 14 Duplicated block (16 lines × 2) finding(s) in Code Duplication — start with AssignmentAnalyzer.php (2), ForeachAnalyzer.php, AssertionFinder.php. — One of this dimension's main actionable groups (14 warning-level).
  2. Resolve the 14 Duplicated block (14 lines × 2) finding(s) in Code Duplication — start with FormulaGenerator.php, LoopAnalyzer.php, BreakAnalyzer.php. — One of this dimension's main actionable groups (14 warning-level).
  3. Resolve the 13 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with TaintFlowResolution.php (2), ParseErrorLocation.php, ErrorLevelFileFilter.php. — One of this dimension's main actionable groups (13 warning-level).

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

D5 · Coupling0.0 / 10Critical✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

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

3 production modules (source-import), 1 dependency cycle(s), 0 unstable depended-on module(s). No manifest declares this repository's modules, so the modules are its top-level source directories and the edges the imports between them; 0 module(s) off the main sequence, with abstractness counted on 1 of the 3 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Circular dependencydictionaries/ImpureFunctionsList.php:7

What to do

  1. Resolve the 1 Circular dependency finding(s) in Coupling — start with ImpureFunctionsList.php. — One of this dimension's main actionable groups (1 issue-level).

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

D6 · Cohesion (LCOM4)9.5 / 10Stronggated by 6 serious findings✓ 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.5 / 10 · rule-coverage 100% · ceiling Verified

6 of 151 classes have LCOM4 above 3.

Low cohesion: Codebase (LCOM4 9) · ×6src/Psalm/Codebase.php:126

What to do

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

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

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

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

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

Detailed fixes: d7_recommendation.md.

D10 · Test Quality7.8 / 10Strong✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

41 skipped (41 with a documented reason), 240 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1602 tests.

No assertions: testInvalidParamDefaultButAllowedInConfig · ×235tests/AnnotationTest.php:144
Skipped (documented): testArrayFirstLastUserDefinedBeforePhp85 · ×41tests/ArrayFunctionCallTest.php:48
No assertions (declared): testClassExistsGuardDoesNotRunTheAutoloader · ×5tests/ClassLikeStringTest.php:57

What to do

  1. Resolve the 235 No assertions finding(s) in Test Quality — start with StubTest.php (36), ThrowsAnnotationTest.php (24), ArrayAccessTest.php (17). — One of this dimension's main actionable groups (235 warning-level).

Detailed fixes: d10_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 Hotspots8.7 / 10Strong✓ 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 8.7 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php (101×235=23735); src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php (90×133=11970); src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php (66×169=11154) Repeated repair below the complexity floor: src/Psalm/Internal/Provider/ClassLikeStorageProvider.php (7 of 8 changes were fixes); src/Psalm/Internal/Provider/FileStorageProvider.php (6 of 8 changes were fixes); src/Psalm/Internal/Codebase/MixinLookup.php (6 of 6 changes were fixes)

Hotspot: src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php · ×167src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:304
Repeated repair: src/Psalm/Internal/Provider/ClassLikeStorageProvider.php · ×12src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:118

What to do

  1. Resolve the 167 Hotspot finding(s) in Churn × Complexity Hotspots — start with FunctionLikeAnalyzer.php, ArgumentsAnalyzer.php, ClassLikeNodeScanner.php. — One of this dimension's main actionable groups (167 warning-level).
  2. Resolve the 12 Repeated repair finding(s) in Churn × Complexity Hotspots — start with ClassLikeStorageProvider.php, FileStorageProvider.php, MixinLookup.php. — One of this dimension's main actionable groups (12 warning-level).

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

D16 · Bus Factor8.5 / 10Strong✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

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

63 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/Psalm/Internal/Codebase/TaintFlowResolution.php. Counted over 412 of the 1318 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

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

What to do

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

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

D17 · Explicit Debt10.0 / 10Stronggated by 38 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

51 deducted task-comment markers across 2659812 LoC (0.0/KLoC) → score 10.0. 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 · ×19tests/ArrayFunctionCallTest.php:3480
HackComment · ×8tests/HackConformanceTranspiledTest.php:381
FixmeComment · ×8tests/ReportOutputTest.php:654
XxxComment · ×2src/Psalm/Internal/Codebase/Methods.php:727
HackComment repeated across 14 filestests/ExtImagickStubTest.php:27

What to do

  1. Resolve the 19 TodoComment finding(s) in Explicit Debt — start with CastAnalyzer.php (3), Atomic.php (2), AssignmentAnalyzer.php (2). — One of this dimension's main actionable groups (19 warning-level).
  2. Resolve the 8 HackComment finding(s) in Explicit Debt — start with HackConformanceTranspiledTest.php (2), ProjectCheckerTest.php, TypeVariableTest.php. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 8 FixmeComment finding(s) in Explicit Debt — start with ClassLikes.php (3), ReportOutputTest.php (2), ObjectComparator.php. — One of this dimension's main actionable groups (8 warning-level).

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

D19 · Documentation Quality7.5 / 10Strong✓ Tool-verified

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

1 of 2 documentation facets pass in full; short on: F2 example. 382 document(s) read across 4 unit(s).

Documentation: no build, run or usage exampleassets/psalm-phar/README.md:1

What to do

  1. Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).

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

D20 · ADR Quality10.0 / 10Exemplary○ Nothing flagged

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

0 of 1 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.

✓ On the Gold path — maintain.

Detailed fixes: d20_recommendation.md.

D27 · Navigability8.7 / 10Strong✓ 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 8.7 / 10 · rule-coverage 100% · ceiling Documented

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

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)3.0 / 10Weak✓ Tool-verified

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

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

REDACTED
REDACTED

What to do

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

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

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

3 finding(s): 0 critical, 2 high, 1 medium, 0 low. semgrep hit a parse error in 224 file(s) — `bin/ci/announce-release.php` (line 217), `bin/docker/Dockerfile` (lines 23–236), `bin/docker/docker-php-ext-enable` (line 52, line 100), `bin/docker/docker-php-ext-install` (line 73), `bin/hack-conformance/Transpiler.php` (line 153, line 396, line 397, …), … (+219 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 3 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

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 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. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

D34 · Knowledge Freshness9.3 / 10Exemplary✓ 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 9.3 / 10 · rule-coverage 100% · ceiling Documented

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

Orphaned file · ×27src/Psalm/Internal/Provider/ReturnTypeProvider/SprintfReturnTypeProvider.php:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.8 / 10Stronggated by 7 serious findings✓ Tool-verified

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

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

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

Strongest change-coupling: ClassLikeStorageCacheProvider.php↔FileStorageCacheProvider.php 73%; Cache.php↔Providers.php 70%; CallMap_80_delta.php↔CallMap_81_delta.php 60%

Change coupling: Cache.php ↔ Providers.php · ×6src/Psalm/Internal/Cache.php:1
Change coupling clique: ClassLikeStorageCacheProvider.php, FileStorageCacheProvider.php, ParserCacheProvider.php, ProjectCacheProvider.phpsrc/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php

What to do

  1. Resolve the 6 Change coupling finding(s) in Change Coupling — start with Cache.php, CallMap_80_delta.php, InterfaceAnalyzer.php. — One of this dimension's main actionable groups (6 warning-level).
  2. Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with ClassLikeStorageCacheProvider.php. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

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

AX3 · Project dependency cycles5.0 / 10Adequate✓ Tool-verified

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

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

  • The projects dictionaries → src/Psalm → dictionaries form a reference cycle. Cyclic dependencies prevent independent build/test/deploy, blur ownership, and tend to grow into a big ball of mud. Break the cycle by extracting the shared types into a separate project both can reference. — dictionaries/ImpureFunctionsList.php:7

What to do

  • Break project reference cycles by extracting shared abstractions into a separate project; keep the graph a DAG.
AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

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

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

AX6 · Interface segregation9.8 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

  • `StatementsSource` declares 20 methods: `getNamespace`, `getAliasedClassesFlipped`, `getAliasedClassesFlippedReplaceable`, `getFQCLN`, `getClassName`, `getParentFQCLN`, `getTemplateTypeMap`, `setRootFilePath`, `hasParentFilePath`, `hasAlreadyRequiredFilePath`, `getRequireNesting`, `isStatic`, `getSource`, `getCodebase`, `getSuppressedIssues`, `addSuppressedIssues`, `removeSuppressedIssues`, `getNodeTypeProvider`, `signalMutationOnlyInferred`, `signalMutation`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/Psalm/StatementsSource.php:17

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

M1 · Documentation (README)7.2 / 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.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation4.0 / 10Weak✓ 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.

  • 1 ADR-shaped document(s) detected by content — `.agents/skills/purity-capabilities/SKILL.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.

What to do

  • Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
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 · Observability7.0 / 10Strong✓ Tool-verified

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

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

P3 · Security & performance tooling6.0 / 10Adequate✓ Tool-verified

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

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

  • `announce-release.yml`, `apply-queued-changes.yml`, `auto-release.yml`, `build-docker.yml` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.
  • `REDACTED` schedules updates, but no `package-ecosystem` entry covers `composer`, `gitsubmodule`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list. — REDACTED:2

What to do

  • Trigger your SAST workflow on pull requests — a scan that only runs on a cron reports history, it does not gate.
  • Dependabot is configured but does not watch `composer`, `gitsubmodule` — add those `package-ecosystem` entries to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

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

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

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

What to do

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

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

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

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

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

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

X19 · Unrestored process-global state5.1 / 10Adequate✓ 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.

  • `loadDomDocument` 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 870, put back at line 876) — 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/Psalm/Config.php:863
  • `validateXmlConfig` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — libxml's internal-error mode (changed at line 893, put back at line 921) — 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/Psalm/Config.php:884
  • `isRegularExpression` 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 471, reset at line 476) — 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/Psalm/Config/FileFilter.php:465

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.

X23 · Unguarded diagnostic materialisation6.3 / 10Adequate✓ Tool-verified

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

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

  • `logDebug` at line 715 is called with an argument built by `array_keys($files)` (line 716), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because logDebug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on. — src/Psalm/Internal/LanguageServer/LanguageServer.php:715

What to do

  • In PHP, put the construction behind the logger's own check (`if ($logger->isHandling(Logger::DEBUG))` for Monolog, a debug flag for a line only a debug build needs), or pass the collection through the PSR-3 context array with a `{placeholder}` (`$logger->debug('rows: {rows}', ['rows' => $rows])`) so the handler renders it only when the record is written. Concatenating or interpolating the value into the message is not the fix: PHP builds the string, and every `array_map`, `implode` or `json_encode` inside it, before the call is entered.
X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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

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

X27 · Collection changed while being enumerated8.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether a `foreach` leaves the array or collection it is walking alone — PHP raises nothing, but the loop's view and the collection part: an array walked by value (and a Doctrine or Laravel collection) is walked as the snapshot taken when the loop began, so an element added in the body is never visited and one removed is visited anyway; an array walked by reference (`as &$v`) and an SPL container (`SplObjectStorage`, `ArrayObject`, `SplQueue`) are walked live, so an added element is walked too and a removal skips the next one; and after an `array_splice`, `array_shift` or sort every later key names a different element.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

  • line 122 walks `$cloned_clauses` by value, so the walk is the snapshot taken when the loop began, and line 200 changes that same collection with `unset($cloned_clauses[…])` before the next iteration: the removed element is still visited by the rest of the loop. PHP raises nothing, so the loop completes over a different set than the code meant. — src/Psalm/Internal/Algebra.php:122
  • line 3219 walks `$types` by value, so the walk is the snapshot taken when the loop began, and line 3237 changes that same collection with `$types[] = …` before the next iteration: the added element is never visited by this loop, so whatever it was added for is not done here. PHP raises nothing, so the loop completes over a different set than the code meant. — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:3219
  • line 728 walks `$fixed_type_tokens` by value, so the walk is the snapshot taken when the loop began, and line 777 changes that same collection with `unset($fixed_type_tokens[…])` before the next iteration: the removed element is still visited by the rest of the loop. PHP raises nothing, so the loop completes over a different set than the code meant. — src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:728
  • line 197 walks `$lhs_types` by value, so the walk is the snapshot taken when the loop began, and line 199 changes that same collection with `$lhs_types = …` before the next iteration: the loop carries on over the old value while the body now works on the new one. PHP raises nothing, so the loop completes over a different set than the code meant. — src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php:197

What to do

  • Each finding names the two lines that cannot both stand — the `foreach` over the collection, and the change to it in the body. Confirm from those two, then pick one: build the result instead of editing the walked collection (`$kept = array_filter($items, $keep)`, `$batch->reject(…)`); for a worklist, loop `while (($next = array_shift($queue)) !== null)` so what is added is visited; walk a copy (`foreach (array_values($items) as …)`, `foreach (clone $storage as …)`) and change the original; remove only the CURRENT element (`unset($items[$key])`), which an array walk tolerates; or — where only the first match was ever meant — `break` straight after the change.
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.

X29 · Per-element action decided by a fixed element8.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

  • This loop runs once per element of `$context.vars_in_scope`, and the statement it guards acts on the element it is on — `$var_id`. The test deciding whether that statement runs does not: `$getter_receiver_id === $receiver_id || str_starts_with($getter_receiver_id, ...` reads `$context.vars_in_scope[$getter_receiver_id]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 920, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php:917

What to do

  • Each finding names the test and the statement it guards, which index the same collection at two different subscripts — one fixed, one the loop variable. Confirm from the two, then decide which subscript the test meant. If it was meant to be per-element, give it the loop variable so each element is judged on itself. If it really is one answer for the whole collection, hoist the test OUT of the loop, where a reader can see it is asked once and where it is not re-evaluated on every pass — leaving it inside, reading a fixed element, is the one arrangement that cannot be right under either reading.
X3 · Exception handling6.7 / 10Adequate✓ Tool-verified

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

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

  • `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×6) — src/Psalm/Codebase.php:2613, src/Psalm/Codebase.php:2688, src/Psalm/Internal/Type/Comparator/CallableTypeComparator.php:297, …
  • `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×3) — src/Psalm/Type/Atomic/TKeyedArray.php:812, src/Psalm/Internal/PhpVisitor/TraitFinder.php:80, src/Psalm/Internal/Codebase/MutationLevelResolver.php:294
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×4) — src/Psalm/Internal/LanguageServer/LanguageServer.php:975, src/Psalm/Internal/Codebase/Functions.php:381, src/Psalm/Internal/Cli/Psalm.php:1092, …
  • `catch (PhpParser\Error)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — src/Psalm/Internal/Analyzer/FileAnalyzer.php:160
  • `catch (Error)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/CoalesceAnalyzer.php:56

What to do

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

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

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

X5 · Nullable reference types10.0 / 10Exemplary✓ 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.

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 Health75.8Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture88.8Adequate — gated by D5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity71.3StrongStrongest area.
Readiness62.6AdequateAcceptable, with room to improve.
Security61.8Adequate — gated by D28Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Unscored — 3 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.

  • D11 Test Reliability — 2 observation(s) recorded · This repository declares 2 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.php), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 65 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.
  • 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
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • 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.
  • D12 Dependency Hygiene — Not scored — 21 direct Composer requirement(s) were read, but the outdated signal needs Packagist, and no committed composer.lock resolves them to releases, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — Composer package licences not graded — this repository commits no composer.lock and this pass does not run Composer's solver
  • 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"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments 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.
  • D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • 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 — Scanner failed to run — not a clean result
  • 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) — 218 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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 — Scanner failed to run — not a clean result
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 59 value object(s); 19 domain event(s); its domain events are published by services or handlers — no domain entity raises one
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, 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
  • 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
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — no C# was loaded; this repository's PHP was read and makes no request a caller can cancel (amphp's HttpClient or connect) — synchronous PHP offers its callers no cancellation to take
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • 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.
  • 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.
  • 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 — 13 finding(s)
D28 · Secrets (history) · High secret · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D11 · Test Reliability · Test declared unreliable · ×2
  • Test declared unreliable: tests/LanguageServer/DiagnosticTest.php tests/LanguageServer/DiagnosticTest.php:147 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Flaky on Windows". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
  • Test declared unreliable: tests/LanguageServer/DiagnosticTest.php tests/LanguageServer/DiagnosticTest.php:209 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Flaky on Windows". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
AX3 · Project dependency cycles · Project dependency cycle · ×1
  • Project dependency cycle dictionaries/ImpureFunctionsList.php:7 — The projects dictionaries → src/Psalm → dictionaries form a reference cycle. Cyclic dependencies prevent independent build/test/deploy, blur ownership, and tend to grow into a big ball of mud. Break the cycle by extracting the shared types into a separate project both can reference.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D5 · Coupling · Circular dependency · ×1
  • Circular dependency dictionaries/ImpureFunctionsList.php:7 — dictionaries → src/Psalm → dictionaries
Serious — 2815 finding(s)
D3 · God Classes · MethodTooLong · ×237
  • MethodTooLong: FunctionLikeAnalyzer.analyze src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:304 — MethodTooLong — analyze runs 668 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 568 over it, 6.68× 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: ClassLikeNodeScanner.start src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:155 — MethodTooLong — start runs 652 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 552 over it, 6.52× 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: FilterUtils.getReturnType src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:664 — MethodTooLong — getReturnType runs 562 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 462 over it, 5.62× 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: AtomicTypeComparator.isContainedBy src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php:77 — MethodTooLong — isContainedBy runs 557 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 457 over it, 5.57× 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: ReturnTypeAnalyzer.verifyReturnType src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:135 — MethodTooLong — verifyReturnType runs 514 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 414 over it, 5.14× 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: InstancePropertyAssignmentAnalyzer.analyzeAtomicAssignment src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1221 — MethodTooLong — analyzeAtomicAssignment runs 464 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 364 over it, 4.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: ArithmeticOpAnalyzer.analyzeOperands src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:412 — MethodTooLong — analyzeOperands runs 455 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 355 over it, 4.55× 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: ClassConstAnalyzer.analyzeFetch src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:113 — MethodTooLong — analyzeFetch runs 441 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 341 over it, 4.41× 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: LoopAnalyzer.analyze src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:73 — MethodTooLong — analyze runs 436 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 336 over it, 4.36× 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: AtomicStaticCallAnalyzer.handleNamedCall src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php:362 — MethodTooLong — handleNamedCall runs 435 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 335 over it, 4.35× 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: FormulaGenerator.getFormula src/Psalm/Internal/Algebra/FormulaGenerator.php:61 — MethodTooLong — getFormula runs 422 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 322 over it, 4.22× 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: TypeExpander.expandAtomic src/Psalm/Internal/Type/TypeExpander.php:235 — MethodTooLong — expandAtomic runs 421 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 321 over it, 4.21× 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: ExistingAtomicStaticCallAnalyzer.analyze src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php:71 — MethodTooLong — analyze runs 411 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 311 over it, 4.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TypeCombiner.scrapeTypeProperties src/Psalm/Internal/Type/TypeCombiner.php:485 — MethodTooLong — scrapeTypeProperties runs 411 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 311 over it, 4.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AtomicMethodCallAnalyzer.analyze src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php:69 — MethodTooLong — analyze runs 405 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 305 over it, 4.05× 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: AtomicPropertyFetchAnalyzer.analyze src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:89 — MethodTooLong — analyze runs 403 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 303 over it, 4.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: FunctionLikeNodeScanner.start src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:108 — MethodTooLong — start runs 403 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 303 over it, 4.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ExistingAtomicMethodCallAnalyzer.analyze src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:74 — MethodTooLong — analyze runs 386 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 286 over it, 3.86× 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: TypeParser.getTypeFromGenericTree src/Psalm/Internal/Type/TypeParser.php:756 — MethodTooLong — getTypeFromGenericTree 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: ReturnAnalyzer.analyzeReturn src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php:175 — MethodTooLong — analyzeReturn runs 367 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 267 over it, 3.67× 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: AssignmentAnalyzer.analyzeAfterTheKeys src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:339 — MethodTooLong — analyzeAfterTheKeys runs 357 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 257 over it, 3.57× 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: ClassLikeDocblockParser.parse src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:60 — MethodTooLong — parse runs 336 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 236 over it, 3.36× 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: TryAnalyzer.analyze src/Psalm/Internal/Analyzer/Statements/Block/TryAnalyzer.php:43 — MethodTooLong — analyze runs 330 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 230 over it, 3.30× 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: ScalarTypeComparator.isContainedBy src/Psalm/Internal/Type/Comparator/ScalarTypeComparator.php:55 — MethodTooLong — isContainedBy runs 328 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 228 over it, 3.28× 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.fromXmlAndPaths src/Psalm/Config.php:1089 — MethodTooLong — fromXmlAndPaths runs 327 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 227 over it, 3.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.
  • + 212 more in this group — see findings.md.
D10 · Test Quality · No assertions · ×235
  • No assertions: testInvalidParamDefaultButAllowedInConfig tests/AnnotationTest.php:144 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testPseudoPropertyOfAClassWithoutAMagicGetterIsReadableWithTheConfigOption tests/ArgTest.php:48 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testEnsureArrayOffsetsExistWithIssetCheck tests/ArrayAccessTest.php:56 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testEnsureArrayOffsetsExistForOffsetsPassedByReference tests/ArrayAccessTest.php:79 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testDontEnsureArrayOffsetsExist tests/ArrayAccessTest.php:150 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testEnsureArrayOffsetsExistWithIssetCheckFollowedByIsArray tests/ArrayAccessTest.php:169 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testNoIssueWhenUsingArrayValuesOnNonEmptyArray tests/ArrayAccessTest.php:231 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testNoIssueWhenUsingArrayValuesOnNonEmptyArrayCheckedWithSizeof tests/ArrayAccessTest.php:250 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testNoIssueAfterManyIssets tests/ArrayAccessTest.php:269 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testEnsureListOffsetExistsNotEmpty tests/ArrayAccessTest.php:293 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testEnsureOffsetExistsAfterArrayPush tests/ArrayAccessTest.php:334 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testEnsureOffsetExistsAfterNestedIsset tests/ArrayAccessTest.php:348 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testEnsureListOffsetExistsAfterCountValueInRange tests/ArrayAccessTest.php:372 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testCountOnKeyedArrayInRange tests/ArrayAccessTest.php:422 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testCountOnKeyedArrayInRangeWithUpdate tests/ArrayAccessTest.php:443 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testDontWorryWhenUnionedWithPositiveInt tests/ArrayAccessTest.php:537 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testListOffsetAfterIssetCheckWithTaintAnalysis tests/ArrayAccessTest.php:1305 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testListOffsetFromVariableAfterIssetCheckWithTaintAnalysis tests/ArrayAccessTest.php:1321 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testListOffsetAfterAssignmentInABranchWithTaintAnalysis tests/ArrayAccessTest.php:1338 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testDontForgetAssertionAfterMutationFreeCall tests/AssertAnnotationTest.php:21 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testArrayKeyExistsAssertionOfAnArgumentOffset tests/AssertAnnotationTest.php:59 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testArrayKeyExistsAssertionOfNamedArguments tests/AssertAnnotationTest.php:106 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testAssertsAlongCallStaticMethodWork tests/AssertAnnotationTest.php:189 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testStubsWithDifferentAttributes tests/AttributeTest.php:20 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testPowOfDifferingNumericLiteralTypesInStrictMode tests/BinaryOperationTest.php:286 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • + 210 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×167
  • Hotspot: src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:304 — src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php changed 101 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 235 in FunctionLikeAnalyzer.analyze at line 304. 30 of those changes were fix/bug commits, and the other 71 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:1057 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php changed 90 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 133 in ArgumentsAnalyzer.checkArgumentsMatch at line 1057. 37 of those changes were fix/bug commits, and the other 53 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:155 — src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php changed 66 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 169 in ClassLikeNodeScanner.start at line 155. 31 of those changes were fix/bug commits, and the other 35 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:339 — src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php changed 103 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 102 in AssignmentAnalyzer.analyzeAfterTheKeys at line 339. 33 of those changes were fix/bug commits, and the other 70 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Type/Reconciler.php src/Psalm/Type/Reconciler.php:134 — src/Psalm/Type/Reconciler.php changed 67 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 142 in Reconciler.reconcileKeyedTypes at line 134. 32 of those changes were fix/bug commits, and the other 35 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Type/Reconciler.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Config.php src/Psalm/Config.php:1089 — src/Psalm/Config.php changed 64 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 143 in Config.fromXmlAndPaths at line 1089. 19 of those changes were fix/bug commits, and the other 45 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Config.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php:77 — src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 244 in AtomicTypeComparator.isContainedBy at line 77. 15 of those changes were fix/bug commits, and the other 21 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:412 — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 225 in ArithmeticOpAnalyzer.analyzeOperands at line 412. 24 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:883 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 151 in ArgumentAnalyzer.verifyType at line 883. 24 of those changes were fix/bug commits, and the other 29 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1221 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php changed 58 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 130 in InstancePropertyAssignmentAnalyzer.analyzeAtomicAssignment at line 1221. 22 of those changes were fix/bug commits, and the other 36 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:108 — src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php changed 45 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 164 in FunctionLikeNodeScanner.start at line 108. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:73 — src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php changed 62 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 112 in LoopAnalyzer.analyze at line 73. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Type/TypeParser.php src/Psalm/Internal/Type/TypeParser.php:756 — src/Psalm/Internal/Type/TypeParser.php changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 141 in TypeParser.getTypeFromGenericTree at line 756. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Type/TypeParser.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php:362 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php changed 56 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 108 in AtomicStaticCallAnalyzer.handleNamedCall at line 362. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:135 — src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 209 in ReturnTypeAnalyzer.verifyReturnType at line 135. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Type/TypeCombiner.php src/Psalm/Internal/Type/TypeCombiner.php:485 — src/Psalm/Internal/Type/TypeCombiner.php changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 168 in TypeCombiner.scrapeTypeProperties at line 485. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Type/TypeCombiner.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/ClassAnalyzer.php src/Psalm/Internal/Analyzer/ClassAnalyzer.php:699 — src/Psalm/Internal/Analyzer/ClassAnalyzer.php changed 59 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 87 in ClassAnalyzer.addContextProperties at line 699. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/ClassAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:114 — src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php changed 59 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in ForeachAnalyzer.analyze at line 114. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:862 — src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php changed 59 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 82 in ArrayFetchAnalyzer.getArrayAccessTypeGivenOffset at line 862. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:113 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php changed 60 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in FunctionCallAnalyzer.analyze at line 113. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php:71 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in ExistingAtomicStaticCallAnalyzer.analyze at line 71. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php:356 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php changed 75 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in MethodCallPurityAnalyzer.analyze at line 356. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:94 — src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php changed 55 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in FunctionLikeDocblockScanner.addDocblockInfo at line 94. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:76 — src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in IfElseAnalyzer.analyze at line 76. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: src/Psalm/Internal/Algebra/FormulaGenerator.php src/Psalm/Internal/Algebra/FormulaGenerator.php:61 — src/Psalm/Internal/Algebra/FormulaGenerator.php changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 110 in FormulaGenerator.getFormula at line 61. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Algebra/FormulaGenerator.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 142 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×82
  • ClassTooLong: AssertionFinder src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:144 — ClassTooLong — 3078 significant lines (blank, comment-only and punctuation-only lines excluded), 81 methods. The bar is 400 significant lines; this is 2678 over it, 7.70× 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: SimpleAssertionReconciler src/Psalm/Internal/Type/SimpleAssertionReconciler.php:108 — ClassTooLong — 2197 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 1797 over it, 5.49× 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: AssignmentAnalyzer src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:131 — ClassTooLong — 1954 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 1554 over it, 4.89× 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: PreloaderList src/Psalm/Internal/PreloaderList.php:12 — ClassTooLong — 1897 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 1497 over it, 4.74× 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: ClassAnalyzer src/Psalm/Internal/Analyzer/ClassAnalyzer.php:127 — ClassTooLong — 1818 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 1418 over it, 4.55× 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: FunctionLikeAnalyzer src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:128 — ClassTooLong — 1806 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 1406 over it, 4.52× 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: ClassLikes src/Psalm/Internal/Codebase/ClassLikes.php:96 — ClassTooLong — 1757 significant lines (blank, comment-only and punctuation-only lines excluded), 70 methods. The bar is 400 significant lines; this is 1357 over it, 4.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: TaintFlowResolution src/Psalm/Internal/Codebase/TaintFlowResolution.php:69 — ClassTooLong — 1700 significant lines (blank, comment-only and punctuation-only lines excluded), 80 methods. The bar is 400 significant lines; this is 1300 over it, 4.25× 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: ArrayFetchAnalyzer src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:122 — ClassTooLong — 1687 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 1287 over it, 4.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ClassLikeNodeScanner src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:114 — ClassTooLong — 1682 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 1282 over it, 4.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TypeParser src/Psalm/Internal/Type/TypeParser.php:139 — ClassTooLong — 1610 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 1210 over it, 4.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Codebase src/Psalm/Codebase.php:126 — ClassTooLong — 1605 significant lines (blank, comment-only and punctuation-only lines excluded), 125 methods. The bar is 400 significant lines; this is 1205 over it, 4.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Config src/Psalm/Config.php:167 — ClassTooLong — 1588 significant lines (blank, comment-only and punctuation-only lines excluded), 96 methods. The bar is 400 significant lines; this is 1188 over it, 3.97× 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: SimpleNegatedAssertionReconciler src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:79 — ClassTooLong — 1456 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 1056 over it, 3.64× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AssertionReconciler src/Psalm/Internal/Type/AssertionReconciler.php:98 — ClassTooLong — 1449 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 1049 over it, 3.62× 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: ForeachAnalyzer src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:109 — ClassTooLong — 1387 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 987 over it, 3.47× 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: NewAnalyzer src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:96 — ClassTooLong — 1352 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 952 over it, 3.38× 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: FunctionLikeDocblockScanner src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:88 — ClassTooLong — 1339 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 939 over it, 3.35× 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: InstancePropertyAssignmentAnalyzer src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:98 — ClassTooLong — 1306 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 906 over it, 3.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FunctionCallAnalyzer src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:108 — ClassTooLong — 1289 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 889 over it, 3.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Reconciler src/Psalm/Type/Reconciler.php:110 — ClassTooLong — 1267 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 867 over it, 3.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FunctionCallReturnTypeFetcher src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:79 — ClassTooLong — 1218 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 818 over it, 3.05× 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: TypeCombiner src/Psalm/Internal/Type/TypeCombiner.php:87 — ClassTooLong — 1207 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 807 over it, 3.02× 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: MethodComparator src/Psalm/Internal/Analyzer/MethodComparator.php:59 — ClassTooLong — 1147 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 747 over it, 2.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ArithmeticOpAnalyzer src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:76 — ClassTooLong — 1108 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 708 over it, 2.77× 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.
  • + 57 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×76
  • FileTooLong: Expression/AssertionFinder.php src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php — FileTooLong — 3208 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: AssertionFinder (144-5077). The bar is 500 significant lines; this is 2708 over it, 6.42× 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: Type/SimpleAssertionReconciler.php src/Psalm/Internal/Type/SimpleAssertionReconciler.php — FileTooLong — 2291 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: SimpleAssertionReconciler (108-3396). The bar is 500 significant lines; this is 1791 over it, 4.58× 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: Expression/AssignmentAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php — FileTooLong — 2075 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: AssignmentAnalyzer (131-3225). The bar is 500 significant lines; this is 1575 over it, 4.15× 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: Analyzer/ClassAnalyzer.php src/Psalm/Internal/Analyzer/ClassAnalyzer.php — FileTooLong — 1936 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: ClassAnalyzer (127-2970). The bar is 500 significant lines; this is 1436 over it, 3.87× 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: Analyzer/FunctionLikeAnalyzer.php src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php — FileTooLong — 1922 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: FunctionLikeAnalyzer (128-3332). The bar is 500 significant lines; this is 1422 over it, 3.84× 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: Call/ArgumentsAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php — FileTooLong — 1922 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1422 over it, 3.84× 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: Internal/PreloaderList.php src/Psalm/Internal/PreloaderList.php — FileTooLong — 1900 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: PreloaderList (12-1911). The bar is 500 significant lines; this is 1400 over it, 3.80× 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: Codebase/ClassLikes.php src/Psalm/Internal/Codebase/ClassLikes.php — FileTooLong — 1840 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: ClassLikes (96-3277). The bar is 500 significant lines; this is 1340 over it, 3.68× 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: Fetch/ArrayFetchAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php — FileTooLong — 1800 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: ArrayFetchAnalyzer (122-2811). The bar is 500 significant lines; this is 1300 over it, 3.60× 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: Reflector/ClassLikeNodeScanner.php src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php — FileTooLong — 1786 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: ClassLikeNodeScanner (114-2860). The bar is 500 significant lines; this is 1286 over it, 3.57× 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: Call/ArgumentAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php — FileTooLong — 1760 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1260 over it, 3.52× 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: Psalm/Config.php src/Psalm/Config.php — FileTooLong — 1743 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: Config (167-3601). The bar is 500 significant lines; this is 1243 over it, 3.49× 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: Type/TypeParser.php src/Psalm/Internal/Type/TypeParser.php — FileTooLong — 1737 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: TypeParser (139-2903). The bar is 500 significant lines; this is 1237 over it, 3.47× 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: Codebase/TaintFlowResolution.php src/Psalm/Internal/Codebase/TaintFlowResolution.php — FileTooLong — 1734 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: TaintFlowResolution (69-4236). The bar is 500 significant lines; this is 1234 over it, 3.47× 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: Psalm/Codebase.php src/Psalm/Codebase.php — FileTooLong — 1721 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: Codebase (126-3475). The bar is 500 significant lines; this is 1221 over it, 3.44× 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: Type/AssertionReconciler.php src/Psalm/Internal/Type/AssertionReconciler.php — FileTooLong — 1538 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: AssertionReconciler (98-2509). The bar is 500 significant lines; this is 1038 over it, 3.08× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Type/SimpleNegatedAssertionReconciler.php src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php — FileTooLong — 1526 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: SimpleNegatedAssertionReconciler (79-2204). The bar is 500 significant lines; this is 1026 over it, 3.05× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Block/ForeachAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php — FileTooLong — 1485 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: ForeachAnalyzer (109-2375). The bar is 500 significant lines; this is 985 over it, 2.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: Call/NewAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php — FileTooLong — 1438 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: NewAnalyzer (96-2343). The bar is 500 significant lines; this is 938 over it, 2.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: Reflector/FunctionLikeDocblockScanner.php src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php — FileTooLong — 1418 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: FunctionLikeDocblockScanner (88-2203). The bar is 500 significant lines; this is 918 over it, 2.84× 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: Assignment/InstancePropertyAssignmentAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php — FileTooLong — 1395 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: InstancePropertyAssignmentAnalyzer (98-2130). The bar is 500 significant lines; this is 895 over it, 2.79× 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: Call/FunctionCallAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php — FileTooLong — 1387 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: FunctionCallAnalyzer (108-2181). The bar is 500 significant lines; this is 887 over it, 2.77× 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: Type/Reconciler.php src/Psalm/Type/Reconciler.php — FileTooLong — 1368 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: Reconciler (110-2244). The bar is 500 significant lines; this is 868 over it, 2.74× 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: Call/FunctionCallReturnTypeFetcher.php src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php — FileTooLong — 1287 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: FunctionCallReturnTypeFetcher (79-2108). The bar is 500 significant lines; this is 787 over it, 2.57× 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: Type/TypeCombiner.php src/Psalm/Internal/Type/TypeCombiner.php — FileTooLong — 1284 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: TypeCombiner (87-2050). The bar is 500 significant lines; this is 784 over it, 2.57× 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.
  • + 51 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×24
  • TooManyMethods: Codebase src/Psalm/Codebase.php:126 — TooManyMethods — 125 methods. The bar is 30 methods; this is 95 over it, 4.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UnionTrait src/Psalm/Type/UnionTrait.php:75 — TooManyMethods — 103 methods. The bar is 30 methods; this is 73 over it, 3.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Config src/Psalm/Config.php:167 — TooManyMethods — 96 methods. The bar is 30 methods; this is 66 over it, 3.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AssertionFinder src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:144 — TooManyMethods — 81 methods. The bar is 30 methods; this is 51 over it, 2.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TaintFlowResolution src/Psalm/Internal/Codebase/TaintFlowResolution.php:69 — TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ClassLikes src/Psalm/Internal/Codebase/ClassLikes.php:96 — TooManyMethods — 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Context src/Psalm/Context.php:64 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Type src/Psalm/Type.php:85 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FunctionLikeAnalyzer src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:128 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ProjectAnalyzer src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:102 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: IssueBuffer src/Psalm/IssueBuffer.php:96 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TaintFlowGraph src/Psalm/Internal/Codebase/TaintFlowGraph.php:72 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DataFlowNode src/Psalm/Internal/DataFlow/DataFlowNode.php:51 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CodeUseGraph src/Psalm/Internal/Codebase/CodeUseGraph.php:43 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Analyzer src/Psalm/Internal/Codebase/Analyzer.php:98 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FileAnalyzer src/Psalm/Internal/Analyzer/FileAnalyzer.php:46 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: StatementsAnalyzer src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:107 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TypeParser src/Psalm/Internal/Type/TypeParser.php:139 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SimpleAssertionReconciler src/Psalm/Internal/Type/SimpleAssertionReconciler.php:108 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Populator src/Psalm/Internal/Codebase/Populator.php:67 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Psalm src/Psalm/Internal/Cli/Psalm.php:115 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FileReferenceProvider src/Psalm/Internal/Provider/FileReferenceProvider.php:30 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Atomic src/Psalm/Type/Atomic.php:90 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: NewAnalyzer src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:96 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D17 · Explicit Debt · TodoComment · ×19
  • TodoComment tests/ArrayFunctionCallTest.php:3480 — // TODO: improve key type — 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/ArrayKeysTest.php:186 — // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment tests/ConstantTest.php:236 — // TODO: Waiting for https://github.com/vimeo/psalm/issues/7125
  • TodoComment tests/TaintTest.php:15508 — // TODO: ("Caught" . $e) does not work. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment tests/ValueOfTest.php:338 — // TODO turn this into an InvalidDocblock with a better error message. This is difficult because it — 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 src/Psalm/Type/Atomic.php:200 — // TODO implement TUppercaseString — 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 src/Psalm/Type/Atomic.php:315 — // TODO implement TNonEmptyUppercaseString — 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 src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:737 — // TODO: This is technically wrong, but for some reason we get a — 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 src/Psalm/Internal/Type/TypeCombiner.php:1181 — // todo: figure out what to do with class-string<A&B>|class-string<A&C> — 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 src/Psalm/Internal/Scanner/DocblockParser.php:310 — // assert($psalm_internal === array_filter($psalm_internal)); // TODO get this to work — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Psalm/Internal/LanguageServer/LanguageServer.php:914 — //TODO: Investigate if we can use error_log instead — 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 src/Psalm/Internal/Codebase/Methods.php:918 — // TODO: fix — 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 src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1745 — // TODO get node type provider here somehow and check literal ints and int ranges — 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 src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1562 — // TODO handle differently so it's detected as unused if the array is unused? — 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 src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1576 — // TODO handle differently so it's detected as unused if the object is unused? — 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 src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:525 — // todo: emit error here — 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 src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:716 — // todo: emit error here — 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 src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:910 — // todo: emit error here — 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 src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:372 — // TODO support references with destructuring — 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.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×14
  • Duplicated block (16 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:232 — src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:232-247 | src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1161-1176 — 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/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:232` 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 (16 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4436 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4436-4451 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4685-4700 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4436` 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/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1049 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1049-1064 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:170-185 — 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/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1049` 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/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1397 — src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1397-1412 | src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:739-754 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1397` 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/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:3108 — src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:3108-3123 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php:571-586 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (16 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/BooleanNotAnalyzer.php:41 — src/Psalm/Internal/Analyzer/Statements/Expression/BooleanNotAnalyzer.php:41-56 | src/Psalm/Internal/Analyzer/Statements/Expression/EmptyAnalyzer.php:63-78 — 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/Psalm/Internal/Analyzer/Statements/Expression/BooleanNotAnalyzer.php:41` 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/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:450 — src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:450-465 | src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:641-656 — 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/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:450` 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/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:243 — src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:243-258 | src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:628-643 — 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/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:243` 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/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:240` calls `getUnAliasedName` and `src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:625` 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 (16 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:1337 — src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:1337-1352 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/StaticPropertyFetchAnalyzer.php:329-344 — 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/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:1337` 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 (16 lines × 2) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:602 — src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:602-617 | src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:652-667 — 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/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:602` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:619` calls `fromType` and `src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:669` 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 (16 lines × 2) src/Psalm/Internal/Provider/ReturnTypeProvider/PowReturnTypeProvider.php:46 — src/Psalm/Internal/Provider/ReturnTypeProvider/PowReturnTypeProvider.php:46-61 | src/Psalm/Internal/Provider/ReturnTypeProvider/PowReturnTypeProvider.php:63-78 — 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/Psalm/Internal/Scanner/PhpStormMetaScanner.php:251 — src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:251-266 | src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:385-400 — 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 (16 lines × 2) src/Psalm/Internal/Diff/AstDiffer.php:91 — src/Psalm/Internal/Diff/AstDiffer.php:91-106 | src/Psalm/Internal/Diff/FileDiffer.php:79-94 — before extracting anything, compare `src/Psalm/Internal/Diff/AstDiffer.php` and `src/Psalm/Internal/Diff/FileDiffer.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 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/Psalm/Internal/Diff/AstDiffer.php:91` 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/Psalm/Internal/Provider/FunctionParamsProvider.php:85 — src/Psalm/Internal/Provider/FunctionParamsProvider.php:85-100 | src/Psalm/Internal/Provider/FunctionReturnTypeProvider.php:178-193 — 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 (14 lines × 2) · ×14
  • Duplicated block (14 lines × 2) src/Psalm/Internal/Algebra/FormulaGenerator.php:708 — src/Psalm/Internal/Algebra/FormulaGenerator.php:708-721 | src/Psalm/Internal/Analyzer/Statements/Expression/NullsafeChainState.php:107-120 — 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 (14 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:261 — src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:261-274 | src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:516-529 — 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/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:261` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/Psalm/Internal/Analyzer/Statements/BreakAnalyzer.php:166 — src/Psalm/Internal/Analyzer/Statements/BreakAnalyzer.php:166-179 | src/Psalm/Internal/Analyzer/Statements/ContinueAnalyzer.php:108-121 — 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/Psalm/Internal/Analyzer/Statements/BreakAnalyzer.php:166` 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2973 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2973-2986 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3727-3740 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2973` 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 (14 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:2793 — src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:2793-2806 | src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:3180-3193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:1610 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:1610-1623 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php:561-574 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:1610` 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/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:280 — src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:280-293 | src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:647-660 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/Psalm/Internal/Cli/Psalm.php:1170 — src/Psalm/Internal/Cli/Psalm.php:1170-1183 | src/Psalm/Internal/Cli/Psalter.php:514-527 — 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/Psalm/Internal/Cli/Psalm.php:1170` 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/Psalm/Internal/Codebase/ClassLikes.php:1062 — src/Psalm/Internal/Codebase/ClassLikes.php:1062-1075 | src/Psalm/Internal/Codebase/ClassLikes.php:1097-1110 — 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/Psalm/Internal/Codebase/ClassLikes.php:1062` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:365 — src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:365-378 | src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:381-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1910 — src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1910-1923 | src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:2218-2231 — 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/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1910` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:825 — src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:825-838 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1022-1035 — 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 (14 lines × 2) src/Psalm/Type/Atomic/TKeyedArray.php:679 — src/Psalm/Type/Atomic/TKeyedArray.php:679-692 | src/Psalm/Type/Atomic/TKeyedArray.php:719-732 — 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 (14 lines × 2) src/Psalm/Type/UnionTrait.php:1129 — src/Psalm/Type/UnionTrait.php:1129-1142 | src/Psalm/Type/UnionTrait.php:1160-1173 — 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 (11 lines × 2) · ×13
  • Duplicated block (11 lines × 2) src/Psalm/CodeLocation/ParseErrorLocation.php:32 — src/Psalm/CodeLocation/ParseErrorLocation.php:32-42 | src/Psalm/CodeLocation/Raw.php:30-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.
  • Duplicated block (11 lines × 2) src/Psalm/Config/ErrorLevelFileFilter.php:29 — src/Psalm/Config/ErrorLevelFileFilter.php:29-39 | src/Psalm/Config/ErrorLevelFileFilter.php:50-60 — 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (11 lines × 2) src/Psalm/Internal/Analyzer/CommentAnalyzer.php:269 — src/Psalm/Internal/Analyzer/CommentAnalyzer.php:269-279 | src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:243-253 — 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/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php:205 — src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php:205-215 | src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:410-420 — 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/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php:205` 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2852 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2852-2862 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2913-2923 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2852` 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/Psalm/Internal/Codebase/TaintFlowResolution.php:2974 — src/Psalm/Internal/Codebase/TaintFlowResolution.php:2974-2984 | src/Psalm/Internal/Codebase/TaintFlowResolution.php:3039-3049 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) src/Psalm/Internal/Codebase/TaintFlowResolution.php:3637 — src/Psalm/Internal/Codebase/TaintFlowResolution.php:3637-3647 | src/Psalm/Internal/Codebase/TaintFlowResolution.php:3753-3763 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayRandReturnTypeProvider.php:41 — src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayRandReturnTypeProvider.php:41-51 | src/Psalm/Internal/Provider/ReturnTypeProvider/ArraySpliceReturnTypeProvider.php:40-50 — 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/Psalm/Internal/Provider/ReturnTypeProvider/ArrayRandReturnTypeProvider.php:41` 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/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:855 — src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:855-865 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1057-1067 — 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/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:855` 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/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:851` calls `TFloat` and `src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1055` 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 (11 lines × 2) src/Psalm/Internal/Type/AssertionReconciler.php:980 — src/Psalm/Internal/Type/AssertionReconciler.php:980-990 | src/Psalm/Type.php:1009-1019 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/Psalm/Internal/Type/AssertionReconciler.php:980` 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:712 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:712-722 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1829-1839 — 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:712` 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/Psalm/Internal/Diff/AstDiffer.php:50 — src/Psalm/Internal/Diff/AstDiffer.php:50-60 | src/Psalm/Internal/Diff/FileDiffer.php:44-54 — before extracting anything, compare `src/Psalm/Internal/Diff/AstDiffer.php` and `src/Psalm/Internal/Diff/FileDiffer.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 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/Psalm/Internal/Diff/AstDiffer.php:50` 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/Psalm/Internal/PluginManager/Command/DisableCommand.php:36 — src/Psalm/Internal/PluginManager/Command/DisableCommand.php:36-46 | src/Psalm/Internal/PluginManager/Command/EnableCommand.php:36-46 — before extracting anything, compare `src/Psalm/Internal/PluginManager/Command/DisableCommand.php` and `src/Psalm/Internal/PluginManager/Command/EnableCommand.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×12
  • Repeated repair: src/Psalm/Internal/Provider/ClassLikeStorageProvider.php src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:118 — src/Psalm/Internal/Provider/ClassLikeStorageProvider.php changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is ClassLikeStorageProvider.addMore at line 118), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(language-server): keep consolidated cache entries when evicting storages #13779”; “fix(language-server): evict class storage cache entries by the removed file #13779”; “fix(language-server): drop cached storages that reloadFiles() removes #13779”; “Fix: warm-cache crash when a file is reached under two spellings of its path”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Provider/ClassLikeStorageProvider.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/Psalm/Internal/Provider/FileStorageProvider.php src/Psalm/Internal/Provider/FileStorageProvider.php:65 — src/Psalm/Internal/Provider/FileStorageProvider.php changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is FileStorageProvider.has at line 65), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(language-server): keep consolidated cache entries when evicting storages #13779”; “fix(language-server): drop cached storages that reloadFiles() removes #13779”; “Fix: warm-cache crash when a file is reached under two spellings of its path”; “fix: remove only the class-like storages exhumed for the rescanned file”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Provider/FileStorageProvider.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/Psalm/Internal/Codebase/MixinLookup.php src/Psalm/Internal/Codebase/MixinLookup.php:122 — src/Psalm/Internal/Codebase/MixinLookup.php changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is MixinLookup.find at line 122), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mixins): trait self/static, magic member reachability, deprecated 7.5.0 members”; “fix(mixins): a static call goes to a non-generic mixin, through a generic one to the class”; “fix(mixins): static calls go through the instance call, provider methods of the class first”; “fix(mixins): a static call by class name binds static to that class”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Codebase/MixinLookup.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/Psalm/Internal/Analyzer/TraitAnalyzer.php src/Psalm/Internal/Analyzer/TraitAnalyzer.php:73 — src/Psalm/Internal/Analyzer/TraitAnalyzer.php changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is TraitAnalyzer.analyze at line 73), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mixins): trait self/static, magic member reachability, deprecated 7.5.0 members”; “fix(mixins): keep shared scopes bound to the class, check trait mixins”; “fix: report the scan-time issues of a file when it is analysed, whatever the early returns of the analysis”; “fix: report the issues found while scanning when the analysis skips the file or the trait is unused”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Analyzer/TraitAnalyzer.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php:29 — src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is ClassLikeStorageCacheProvider.__construct at line 29), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(language-server): keep consolidated cache entries when evicting storages #13779”; “fix(language-server): drop cached storages that reloadFiles() removes #13779”; “fix(populator): inherit parent @var of a redeclared property #6575”; “Fix: warm-cache crash when a file is reached under two spellings of its path”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/Psalm/Storage/Possibilities.php src/Psalm/Storage/Possibilities.php:43 — src/Psalm/Storage/Possibilities.php changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is Possibilities.getUntemplatedCopy at line 43), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(assert): self of a trait assertion is the class the method appears in, at any depth, for every call #6165”; “fix(assertions): resolve static in an assertion to the receiver type with its template arguments #6164”; “fix(assertions): inherit assert-if-true/false from an overridden method and resolve static to the called class #6164”; “fix(assert): resolve self in an assertion of a trait method to the class using it #6165”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Storage/Possibilities.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/Psalm/Internal/Type/TemplateDefaults.php src/Psalm/Internal/Type/TemplateDefaults.php:383 — src/Psalm/Internal/Type/TemplateDefaults.php changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is TemplateDefaults.parseDefaults at line 383), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(templates): mark TemplateDefaults::getUsedTemplates pure #5407”; “fix(templates): check method defaults in their class and report undefined classes #5407”; “fix(templates): resolve key-of and value-of of earlier templates in defaults #5407”; “fix(templates): say "at least N" when trailing purity templates may be left out #12446”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Type/TemplateDefaults.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php:199 — src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is PropertyDocblockManipulator.getManipulationsForFile at line 199), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Merge remote-tracking branch 'origin/master' into fix/6891-conditional-on-never”; “fix(analysis): check property initialisation at every constructor return #5422”; “fix(psalter): leave properties declared together alone instead of crashing #8636”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/Psalm/Internal/Provider/ParserCacheProvider.php src/Psalm/Internal/Provider/ParserCacheProvider.php:48 — src/Psalm/Internal/Provider/ParserCacheProvider.php changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is ParserCacheProvider.loadStatementsFromCache at line 48), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Fix: cache reads crash while another worker rewrites the entry”; “fix(cache): reanalyse files without a usable stored hash and reject truncated headers”; “fix(cache): replay parse errors on a parser cache hit”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Provider/ParserCacheProvider.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/Psalm/Internal/Type/TemplateResult.php src/Psalm/Internal/Type/TemplateResult.php:64 — src/Psalm/Internal/Type/TemplateResult.php changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is TemplateResult.__construct at line 64), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(types): set the call's static context only where it is known before the arguments #13488”; “fix(types): keep the call's static context when merging template results #13488”; “fix(types): decide param conditionals on static in callee scope #13488”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/Type/TemplateResult.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/Psalm/Type/Atomic/TObjectWithProperties.php src/Psalm/Type/Atomic/TObjectWithProperties.php:206 — src/Psalm/Type/Atomic/TObjectWithProperties.php changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is TObjectWithProperties.equals at line 206), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(isset): the narrowed property of an object shape is forgotten with the property fact #5077”; “fix(types): only keep named objects next to an object with properties #3474”; “fix(types): keep named objects and other shapes next to an object with properties #3474”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Type/Atomic/TObjectWithProperties.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: src/Psalm/Internal/TypeVisitor/ContainsStaticVisitor.php src/Psalm/Internal/TypeVisitor/ContainsStaticVisitor.php:32 — src/Psalm/Internal/TypeVisitor/ContainsStaticVisitor.php changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is ContainsStaticVisitor.enterNode at line 32), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(types): keep master's decision when a bound holds the declared static #13488”; “fix(types): set the call's static context only where it is known before the arguments #13488”; “fix(types): decide param conditionals on static in callee scope #13488”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 15:22:17 +01:00' --until='2026-11-17 15:22:17 +01:00' --full-history --no-merges -- src/Psalm/Internal/TypeVisitor/ContainsStaticVisitor.php`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×11
  • Duplicated block (19 lines × 2) src/Psalm/Internal/Algebra/FormulaGenerator.php:277 — src/Psalm/Internal/Algebra/FormulaGenerator.php:277-295 | src/Psalm/Internal/Algebra/FormulaGenerator.php:580-598 — 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/Psalm/Internal/Algebra/FormulaGenerator.php:277` 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 (19 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:329 — src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:329-347 | src/Psalm/Internal/Analyzer/Statements/Block/IfElse/IfAnalyzer.php:132-150 — 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 (19 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:273 — src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:273-291 | src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php:176-194 — 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 (19 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:184 — src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:184-202 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2789-2807 — 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/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:184` 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 (19 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:154 — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:154-172 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:180-198 — 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/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:154` 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 (19 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1733 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1733-1751 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1380-1398 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1733` 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 (19 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:199 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:199-217 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:365-383 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:199` 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 lines × 2) src/Psalm/Internal/Diff/FileStatementsDiffer.php:125 — src/Psalm/Internal/Diff/FileStatementsDiffer.php:125-143 | src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php:106-124 — before extracting anything, compare `src/Psalm/Internal/Diff/FileStatementsDiffer.php` and `src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 114 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/Psalm/Internal/Diff/FileStatementsDiffer.php:125` 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 (19 lines × 2) src/Psalm/Internal/Diff/FileStatementsDiffer.php:158 — src/Psalm/Internal/Diff/FileStatementsDiffer.php:158-176 | src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php:126-144 — before extracting anything, compare `src/Psalm/Internal/Diff/FileStatementsDiffer.php` and `src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 114 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/Psalm/Internal/Diff/FileStatementsDiffer.php:158` 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 (19 lines × 2) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php:87 — src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php:87-105 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterVarReturnTypeProvider.php:66-84 — before extracting anything, compare `src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php` and `src/Psalm/Internal/Provider/ReturnTypeProvider/FilterVarReturnTypeProvider.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 67 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/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php:87` 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/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php:106` calls `getContext` and `src/Psalm/Internal/Provider/ReturnTypeProvider/FilterVarReturnTypeProvider.php:85` 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 (19 lines × 2) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1247 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1247-1265 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1739-1757 — 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1247` 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 lines × 2) · ×11
  • Duplicated block (17 lines × 2) src/Psalm/Internal/Algebra/FormulaGenerator.php:357 — src/Psalm/Internal/Algebra/FormulaGenerator.php:357-373 | src/Psalm/Internal/Algebra/FormulaGenerator.php:436-452 — 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/Psalm/Internal/Algebra/FormulaGenerator.php:357` 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 (17 lines × 2) src/Psalm/Internal/Algebra/FormulaGenerator.php:375 — src/Psalm/Internal/Algebra/FormulaGenerator.php:375-391 | src/Psalm/Internal/Algebra/FormulaGenerator.php:454-470 — 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/Psalm/Internal/Algebra/FormulaGenerator.php:375` 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 (17 lines × 2) src/Psalm/Internal/Algebra/FormulaGenerator.php:365 — src/Psalm/Internal/Algebra/FormulaGenerator.php:365-381 | src/Psalm/Internal/Algebra/FormulaGenerator.php:401-417 — 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/Psalm/Internal/Algebra/FormulaGenerator.php:365` 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. 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/Psalm/Internal/Algebra/FormulaGenerator.php:393 — src/Psalm/Internal/Algebra/FormulaGenerator.php:393-409 | src/Psalm/Internal/Algebra/FormulaGenerator.php:472-488 — 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/Psalm/Internal/Algebra/FormulaGenerator.php:393` 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 (17 lines × 2) src/Psalm/Internal/Algebra/FormulaGenerator.php:444 — src/Psalm/Internal/Algebra/FormulaGenerator.php:444-460 | src/Psalm/Internal/Algebra/FormulaGenerator.php:480-496 — 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/Psalm/Internal/Algebra/FormulaGenerator.php:444` 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. 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1195 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1195-1211 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1278-1294 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1195` 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/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:2539 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:2539-2555 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php:951-967 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:2539` 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/Psalm/Internal/Codebase/DataFlowGraph.php:60 — src/Psalm/Internal/Codebase/DataFlowGraph.php:60-76 | src/Psalm/Internal/Codebase/VariableUseGraph.php:68-84 — 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 (17 lines × 2) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:909 — src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:909-925 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1107-1123 — 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/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:909` 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3596 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3596-3612 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3663-3679 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3596` 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/Psalm/Internal/Provider/PropertyExistenceProvider.php:77 — src/Psalm/Internal/Provider/PropertyExistenceProvider.php:77-93 | src/Psalm/Internal/Provider/PropertyVisibilityProvider.php:74-90 — 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 (13 lines × 2) · ×11
  • Duplicated block (13 lines × 2) src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:418 — src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:418-430 | src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:453-465 — 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/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:418` 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/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:417` calls `isMixed` and `src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:451` 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 (13 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1846 — src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1846-1858 | src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1860-1872 — 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 (13 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1668 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1668-1680 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1702-1714 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1668` 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/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php:565 — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php:565-577 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php:597-610 — 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/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php:565` 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/Psalm/Internal/Codebase/ClassLikes.php:1750 — src/Psalm/Internal/Codebase/ClassLikes.php:1750-1762 | src/Psalm/Internal/Codebase/ClassLikes.php:1907-1919 — 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/Psalm/Internal/Codebase/ClassLikes.php:1906` calls `foreach` and `src/Psalm/Internal/Codebase/ClassLikes.php:1748` 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 (13 lines × 2) src/Psalm/Internal/Type/ParseTreeCreator.php:657 — src/Psalm/Internal/Type/ParseTreeCreator.php:657-669 | src/Psalm/Internal/Type/ParseTreeCreator.php:673-685 — 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/Psalm/Internal/Type/ParseTreeCreator.php:657` 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/Psalm/Internal/Type/ParseTreeCreator.php:1070 — src/Psalm/Internal/Type/ParseTreeCreator.php:1070-1082 | src/Psalm/Internal/Type/ParseTreeCreator.php:1149-1161 — 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/Psalm/Internal/Type/ParseTreeCreator.php:1070` 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 (13 lines × 2) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2098 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2098-2110 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2228-2240 — 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:2098` 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:2127 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2127-2139 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:2049-2061 — before extracting anything, compare `src/Psalm/Internal/Type/SimpleAssertionReconciler.php` and `src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 139 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:2127` 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/Psalm/Type/Atomic/TKeyedArray.php:220 — src/Psalm/Type/Atomic/TKeyedArray.php:220-232 | src/Psalm/Type/Atomic/TKeyedArray.php:298-312 — 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/Psalm/Type/Atomic/TKeyedArray.php:220` 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) examples/TemplateChecker.php:51 — examples/TemplateChecker.php:51-63 | examples/TemplateScanner.php:36-48 — 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 `examples/TemplateChecker.php:51` 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×11
  • Swallowed exception (caught, then discarded) src/Psalm/Codebase.php:2613 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/Psalm/Codebase.php:2688 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/Psalm/Type/Atomic/TKeyedArray.php:812 — `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/Psalm/Internal/Type/Comparator/CallableTypeComparator.php:297 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/Psalm/Internal/PhpVisitor/TraitFinder.php:80 — `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/Psalm/Internal/LanguageServer/ProtocolStreamReader.php:106 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/Psalm/Internal/Codebase/Functions.php:595 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/Psalm/Internal/Codebase/MutationLevelResolver.php:294 — `catch (Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:634 — `catch (Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/Psalm/Internal/Analyzer/FileAnalyzer.php:160 — `catch (PhpParser\Error)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/CoalesceAnalyzer.php:56 — `catch (Error)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×10
  • Duplicated block (20 lines × 2) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:2008 — src/Psalm/Internal/Analyzer/ClassAnalyzer.php:2008-2027 | src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:1144-1163 — 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 (20 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1733 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1733-1752 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:570-589 — 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/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1733` 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 (20 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:734 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:734-753 | src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:534-553 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:734` 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 (20 lines × 2) src/Psalm/Internal/Cli/LanguageServer.php:149 — src/Psalm/Internal/Cli/LanguageServer.php:149-168 | src/Psalm/Internal/Cli/Refactor.php:90-109 — 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/Psalm/Internal/Cli/LanguageServer.php:149` 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 (20 lines × 2) src/Psalm/Internal/Codebase/TaintFlowGraph.php:977 — src/Psalm/Internal/Codebase/TaintFlowGraph.php:977-996 | src/Psalm/Internal/Codebase/TaintFlowGraph.php:1011-1030 — 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/Psalm/Internal/Codebase/TaintFlowGraph.php:977` 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 (20 lines × 2) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:196 — src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:196-215 | src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:1373-1392 — 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 (20 lines × 2) src/Psalm/Internal/PluginManager/Command/DisableCommand.php:54 — src/Psalm/Internal/PluginManager/Command/DisableCommand.php:54-73 | src/Psalm/Internal/PluginManager/Command/EnableCommand.php:54-73 — before extracting anything, compare `src/Psalm/Internal/PluginManager/Command/DisableCommand.php` and `src/Psalm/Internal/PluginManager/Command/EnableCommand.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) src/Psalm/Report/ByIssueLevelAndTypeReport.php:151 — src/Psalm/Report/ByIssueLevelAndTypeReport.php:151-170 | src/Psalm/Report/ConsoleReport.php:121-140 — before extracting anything, compare `src/Psalm/Report/ByIssueLevelAndTypeReport.php` and `src/Psalm/Report/ConsoleReport.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) src/Psalm/Type/Atomic/TKeyedArray.php:627 — src/Psalm/Type/Atomic/TKeyedArray.php:627-646 | src/Psalm/Type/Atomic/TObjectWithProperties.php:255-274 — 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/Psalm/Type/Atomic/TKeyedArray.php:627` 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 (20 lines × 2) src/Psalm/Type/MutableUnion.php:211 — src/Psalm/Type/MutableUnion.php:211-230 | src/Psalm/Type/UnionTrait.php:100-119 — 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 (15 lines × 2) · ×10
  • Duplicated block (15 lines × 2) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:473 — src/Psalm/Internal/Analyzer/ClassAnalyzer.php:473-487 | src/Psalm/Internal/Analyzer/ClassAnalyzer.php:1754-1768 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Psalm/Internal/Analyzer/ClassAnalyzer.php:473` 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/Psalm/Internal/Analyzer/ClassAnalyzer.php:488` calls `getAliases` and `src/Psalm/Internal/Analyzer/ClassAnalyzer.php:1769` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:190 — src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:190-204 | src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:526-544 — 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/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (15 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4407 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4407-4421 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4710-4724 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4407` 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/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:776 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:776-790 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:1089-1105 — 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/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:1089` 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/Psalm/Internal/Codebase/Populator.php:1537 — src/Psalm/Internal/Codebase/Populator.php:1537-1551 | src/Psalm/Internal/Codebase/Populator.php:1597-1611 — 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 (15 lines × 2) src/Psalm/Internal/Codebase/Properties.php:123 — src/Psalm/Internal/Codebase/Properties.php:123-137 | src/Psalm/Internal/Codebase/Properties.php:154-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.
  • Duplicated block (15 lines × 2) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:681 — src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:681-695 | src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:655-669 — 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/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:681` 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/Psalm/Internal/Provider/ReturnTypeProvider/ArrayCombineReturnTypeProvider.php:47 — src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayCombineReturnTypeProvider.php:47-61 | src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayCombineReturnTypeProvider.php:63-77 — 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 (15 lines × 2) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:883 — src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:883-897 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1081-1095 — 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/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:883` 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1898 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1898-1912 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:2021-2035 — 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1898` 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) · ×10
  • Duplicated block (12 lines × 2) src/Psalm/Config.php:2831 — src/Psalm/Config.php:2831-2842 | src/Psalm/Config.php:2979-2990 — 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/Psalm/Config.php:2831` 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/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:257 — src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:257-268 | src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php:163-174 — 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/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:257` 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 (12 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:660 — src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:660-671 | src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:704-715 — 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/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:660` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1510 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1510-1521 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1531-1542 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1510` 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1732 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1732-1743 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php:928-939 — 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/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1732` 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 (12 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:399 — src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:399-410 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/StaticPropertyFetchAnalyzer.php:476-487 — 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/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:399` 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/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:641 — src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:641-652 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:973-984 — 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/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:641` 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 (12 lines × 2) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionScanner.php:371 — src/Psalm/Internal/PhpVisitor/Reflector/ExpressionScanner.php:371-382 | src/Psalm/Internal/PhpVisitor/Reflector/ExpressionScanner.php:384-395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php:59 — src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php:59-70 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterVarReturnTypeProvider.php:49-60 — before extracting anything, compare `src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php` and `src/Psalm/Internal/Provider/ReturnTypeProvider/FilterVarReturnTypeProvider.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:854 — src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:854-865 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1021-1032 — 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/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:854` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×10
  • Duplicated block (10 lines × 2) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:2543 — src/Psalm/Internal/Analyzer/ClassAnalyzer.php:2543-2554 | src/Psalm/Internal/Analyzer/ClassAnalyzer.php:2789-2798 — 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/Psalm/Internal/Analyzer/ClassAnalyzer.php:2543` 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 (10 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1789 — src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1789-1798 | src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1800-1809 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2844 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2844-2853 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3588-3597 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2844` 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/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:326 — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:326-335 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php:177-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/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:326` 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/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:1128 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:1128-1137 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:1170-1179 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:1128` 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/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:104 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:104-113 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:169-178 — 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/Psalm/Internal/Cli/Psalm.php:220 — src/Psalm/Internal/Cli/Psalm.php:220-229 | src/Psalm/Internal/Cli/Psalter.php:116-125 — 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/Psalm/Internal/Cli/Psalm.php:220` 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/Psalm/Internal/Diff/FileStatementsDiffer.php:94 — src/Psalm/Internal/Diff/FileStatementsDiffer.php:94-103 | src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php:99-108 — before extracting anything, compare `src/Psalm/Internal/Diff/FileStatementsDiffer.php` and `src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 114 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/Psalm/Internal/Diff/FileStatementsDiffer.php:94` 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 (10 lines × 2) src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:198 — src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:198-207 | src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:250-259 — 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 (10 lines × 2) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2111 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2111-2120 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:2036-2045 — before extracting anything, compare `src/Psalm/Internal/Type/SimpleAssertionReconciler.php` and `src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 139 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:2111` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×9
  • Duplicated block (22 lines × 2) src/Psalm/Config/FileFilter.php:152 — src/Psalm/Config/FileFilter.php:152-173 | src/Psalm/Config/FileFilter.php:269-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Psalm/Config/FileFilter.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.
  • Duplicated block (22 lines × 2) src/Psalm/Internal/Analyzer/CommentAnalyzer.php:646 — src/Psalm/Internal/Analyzer/CommentAnalyzer.php:646-667 | src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php:226-247 — 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/Psalm/Internal/Analyzer/CommentAnalyzer.php:646` 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 (22 lines × 2) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2182 — src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2182-2203 | src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2216-2237 — 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/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2182` 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 (22 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1884 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1884-1905 | src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:1208-1229 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:1207` calls `isset` and `src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1883` 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 (22 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php:204 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php:204-225 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/StaticPropertyFetchAnalyzer.php:80-101 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php:204` 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 (22 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:307 — src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:307-328 | src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:662-683 — 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/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:307` 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/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:330` calls `getFirst` and `src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:684` 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 (22 lines × 2) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1233 — src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1233-1254 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1358-1379 — 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/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1233` 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 (22 lines × 2) src/Psalm/Internal/Type/AssertionReconciler.php:1955 — src/Psalm/Internal/Type/AssertionReconciler.php:1955-1976 | src/Psalm/Internal/Type/AssertionReconciler.php:2099-2120 — 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/Psalm/Internal/Type/AssertionReconciler.php:1955` 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 (22 lines × 2) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1807 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1807-1828 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2981-3002 — 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:1807` 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.
D17 · Explicit Debt · HackComment · ×8
  • HackComment tests/HackConformanceTranspiledTest.php:381 — // Hack's expected-type propagation, not of its constraint solving, and — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment tests/HackConformanceTranspiledTest.php:881 — // (Hack: "Expected Item ... But got mixed"). — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment tests/ProjectCheckerTest.php:57 — // hack to stop Psalm seeing the phpunit arguments — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment tests/Template/TypeVariableTest.php:1634 — // (Hack reports the invariant `nothing` mismatch, "Expected nothing — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/Psalm/Config.php:1398 — // Hack for Symfonys own argv resolution. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/Psalm/Internal/CliUtils.php:94 — // hack required for JsonMapper — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:162 — // Hack has a similar issue: https://github.com/facebook/hhvm/issues/5164 — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1259 — // Hack has a similar issue: https://github.com/facebook/hhvm/issues/5164 — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D17 · Explicit Debt · FixmeComment · ×8
  • FixmeComment tests/ReportOutputTest.php:654 — // FIXME: The XML parser only return strings, all int value are casted, so the assertSame failed — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment tests/ReportOutputTest.php:730 — // FIXME: The XML parser only return strings, all int value are casted, so the assertSame failed — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment src/Psalm/Internal/Type/Comparator/ObjectComparator.php:61 — // FIXME Missing analysis for additional cases, for example : — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment src/Psalm/Internal/Codebase/ClassLikes.php:374 — // fixme: this looks like a crazy caching hack — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment src/Psalm/Internal/Codebase/ClassLikes.php:416 — // fixme: this looks like a crazy caching hack — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment src/Psalm/Internal/Codebase/ClassLikes.php:458 — // fixme: this looks like a crazy caching hack — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:509 — // FIXME: the following line look superfluous, but removing it makes — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentMapPopulator.php:45 — // FIXME: There are weird ::__construct calls in the AST for `extends` — 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×8
  • Duplicated block (8 lines × 2) src/Psalm/Internal/Analyzer/NamespaceAnalyzer.php:282 — src/Psalm/Internal/Analyzer/NamespaceAnalyzer.php:282-289 | src/Psalm/Internal/Analyzer/NamespaceAnalyzer.php:291-298 — 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/Psalm/Internal/Analyzer/NamespaceAnalyzer.php:282` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:559 — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:559-566 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:643-650 — 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/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:559` 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/Psalm/Internal/Codebase/ClassLikes.php:195 — src/Psalm/Internal/Codebase/ClassLikes.php:195-202 | src/Psalm/Internal/Codebase/ClassLikes.php:211-218 — 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/Psalm/Internal/Codebase/ClassLikes.php:195` 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/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:504 — src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:504-511 | src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:2098-2105 — 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/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:504` 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/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:586 — src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:586-593 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:595-602 — 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/Psalm/Internal/Scanner/PhpStormMetaScanner.php:103 — src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:103-110 | src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:112-119 — 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:2149 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2149-2156 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:2071-2078 — before extracting anything, compare `src/Psalm/Internal/Type/SimpleAssertionReconciler.php` and `src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 139 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:2149` 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 (8 lines × 2) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1625 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1625-1632 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1729-1736 — 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1625` 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 (18 lines × 2) · ×7
  • Duplicated block (18 lines × 2) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:1005 — src/Psalm/Internal/Analyzer/ClassAnalyzer.php:1005-1022 | src/Psalm/Internal/Analyzer/Statements/Expression/YieldAnalyzer.php:214-231 — 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/Psalm/Internal/Analyzer/ClassAnalyzer.php:1005` 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/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php:121 — src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php:121-138 | src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php:119-136 — 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/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php:121` 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/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:240 — src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:240-257 | src/Psalm/Internal/Analyzer/Statements/Expression/YieldAnalyzer.php:113-130 — 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/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:240` 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1142 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1142-1159 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1232-1249 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1142` 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/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1209 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1209-1227 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php:356-373 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1209` 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/Psalm/Internal/LanguageServer/Client/Progress/Progress.php:69 — src/Psalm/Internal/LanguageServer/Client/Progress/Progress.php:69-86 | src/Psalm/Internal/LanguageServer/Client/Progress/Progress.php:96-113 — 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 (18 lines × 2) src/Psalm/Internal/LanguageServer/LanguageServer.php:785 — src/Psalm/Internal/LanguageServer/LanguageServer.php:785-802 | src/Psalm/IssueBuffer.php:807-824 — 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/Psalm/Internal/LanguageServer/LanguageServer.php:785` 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.
D35 · Change Coupling · Change coupling · ×6
  • Change coupling: Cache.php ↔ Providers.php src/Psalm/Internal/Cache.php:1 — `src/Psalm/Internal/Cache.php` and `src/Psalm/Internal/Provider/Providers.php` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `14e670ff` cs-fix; `567601d0` Cleanup; `42690e75` Fix — run `git show` on any of them.
  • Change coupling: CallMap_80_delta.php ↔ CallMap_81_delta.php dictionaries/override/CallMap_80_delta.php:1 — `dictionaries/override/CallMap_80_delta.php` and `dictionaries/override/CallMap_81_delta.php` change together 60% of the time (9 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `ed1ea524` Fix #10398: add missing methods of ReflectionProperty class in CallMa… (at that commit the files were still `dictionaries/CallMap_80_delta.php` and `dictionaries/CallMap_81_delta.php`); `8bd22670` Fix DOM callmaps (at that commit the files were still `dictionaries/CallMap_80_delta.php` and `dictionaries/CallMap_81_delta.php`); `74a67a04` Update Phar callmaps (at that commit the files were still `dictionaries/CallMap_80_delta.php` and `dictionaries/CallMap_81_delta.php`) — run `git show` on any of them.
  • Change coupling: InterfaceAnalyzer.php ↔ TraitAnalyzer.php src/Psalm/Internal/Analyzer/InterfaceAnalyzer.php:1 — `src/Psalm/Internal/Analyzer/InterfaceAnalyzer.php` and `src/Psalm/Internal/Analyzer/TraitAnalyzer.php` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `c827f537` fix(mixins): trait self/static, magic member reachability, deprecated…; `5f1a1374` fix(templates): check method defaults in their class and report undef…; `a08c951c` feat(templates): apply class template defaults #12446 — run `git show` on any of them.
  • Change coupling: FunctionDocblockComment.php ↔ FunctionLikeStorage.php src/Psalm/Internal/Scanner/FunctionDocblockComment.php:1 — `src/Psalm/Internal/Scanner/FunctionDocblockComment.php` and `src/Psalm/Storage/FunctionLikeStorage.php` change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `a0f81174` fix(docblock): check the classes of @global types #9182 #9183; `0852633f` refactor(templates): tighten the comments #5407; `fe0120dc` feat(templates): apply function and method template defaults #5407 — run `git show` on any of them.
  • Change coupling: IfElseAnalyzer.php ↔ TernaryAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:1 — `src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php` and `src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php` change together 50% of the time (15 of the 30 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `c8189ea5` Address review: switch, ternary, property roots made non-null; `67e58dec` Count a variable passed by reference in a condition as assigned there; `d7369600` Rebuild a too complicated negation only where master did, keep $this … — run `git show` on any of them.
  • Change coupling: ElseAnalyzer.php ↔ ElseIfAnalyzer.php src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php:1 — `src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php` and `src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php` change together 50% of the time (9 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `c8189ea5` Address review: switch, ternary, property roots made non-null; `34f38735` Address review: references rebound in blocks, raw generics, array-ite…; `9c8673b5` Keep the clauses a condition's reconciled types do not express — run `git show` on any of them.
D6 · Cohesion (LCOM4) · Low cohesion · ×6
  • Low cohesion: Codebase (LCOM4 9) src/Psalm/Codebase.php:126 — Codebase's methods fall into 9 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 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ClassLikeStorage (LCOM4 6) src/Psalm/Storage/ClassLikeStorage.php:32 — ClassLikeStorage's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Union (LCOM4 6) src/Psalm/Type/Union.php:49 — Union's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Config (LCOM4 5) src/Psalm/Config.php:167 — Config's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Context (LCOM4 5) src/Psalm/Context.php:64 — Context's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: NodeTable (LCOM4 5) src/Psalm/Internal/DataFlow/NodeTable.php:42 — NodeTable's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×5
  • Edited copy of a member (13 corresponding lines) src/Psalm/Internal/Codebase/Properties.php:185 — src/Psalm/Internal/Codebase/Properties.php:185-200 | src/Psalm/Internal/Codebase/Properties.php:209-221 — 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.
  • Edited copy of a member (13 corresponding lines) src/Psalm/CodeLocation/ParseErrorLocation.php:29 — src/Psalm/CodeLocation/ParseErrorLocation.php:29-42 | src/Psalm/CodeLocation/Raw.php:28-40 — 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.
  • Edited copy of a member (13 corresponding lines) src/Psalm/Config/ErrorLevelFileFilter.php:27 — src/Psalm/Config/ErrorLevelFileFilter.php:27-39 | src/Psalm/Config/ErrorLevelFileFilter.php:48-60 — 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.
  • Edited copy of a member (13 corresponding lines) src/Psalm/Internal/Analyzer/AlgebraAnalyzer.php:67 — src/Psalm/Internal/Analyzer/AlgebraAnalyzer.php:67-79 | src/Psalm/Internal/Analyzer/AlgebraAnalyzer.php:96-110 — 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.
  • Edited copy of a member (13 corresponding lines) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1589 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1589-1601 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1611-1625 — 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 (7 corresponding lines) · ×5
  • Edited copy of a member (7 corresponding lines) src/Psalm/Internal/Codebase/TaintStore.php:336 — src/Psalm/Internal/Codebase/TaintStore.php:336-342 | src/Psalm/Internal/Codebase/TaintStore.php:356-363 — 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.
  • Edited copy of a member (7 corresponding lines) src/Psalm/Internal/Analyzer/InheritedMethodTaints.php:205 — src/Psalm/Internal/Analyzer/InheritedMethodTaints.php:205-211 | src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:983-989 — 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.
  • Edited copy of a member (7 corresponding lines) src/Psalm/Internal/GzipSerializer.php:47 — src/Psalm/Internal/GzipSerializer.php:47-53 | src/Psalm/Internal/Lz4Serializer.php:41-47 — 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.
  • Edited copy of a member (7 corresponding lines) src/Psalm/Internal/Provider/FileReferenceProvider.php:442 — src/Psalm/Internal/Provider/FileReferenceProvider.php:442-451 | src/Psalm/IssueBuffer.php:629-635 — 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.
  • Edited copy of a member (7 corresponding lines) src/Psalm/Internal/Provider/FunctionExistenceProvider.php:41 — src/Psalm/Internal/Provider/FunctionExistenceProvider.php:41-47 | src/Psalm/Internal/Provider/FunctionReturnTypeProvider.php:141-147 — 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 · Duplicated block (20 lines × 3) · ×5
  • Duplicated block (20 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2381 — src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2381-2412 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2420-2439 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2442-2461 — 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/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2381` 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 (20 lines × 3) src/Psalm/Internal/Codebase/ClassLikes.php:1375 — src/Psalm/Internal/Codebase/ClassLikes.php:1375-1394 | src/Psalm/Internal/Codebase/ClassLikes.php:1560-1579 | src/Psalm/Internal/Codebase/ClassLikes.php:1636-1655 — 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/Psalm/Internal/Codebase/ClassLikes.php:1375` 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 (20 lines × 3) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1241 — src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1241-1260 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1366-1385 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1446-1465 — 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/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1241` 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 (20 lines × 3) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:793 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:793-812 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:912-931 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:676-695 — before extracting anything, compare `src/Psalm/Internal/Type/SimpleAssertionReconciler.php` and `src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 139 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:793` 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 (20 lines × 3) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1365 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1365-1384 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1450-1469 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2482-2501 — 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:1365` 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 (12–13 lines × 2) · ×5
  • Duplicated block (12–13 lines × 2) src/Psalm/Internal/Analyzer/MethodComparator.php:1227 — src/Psalm/Internal/Analyzer/MethodComparator.php:1227-1239 | src/Psalm/Internal/Analyzer/MethodComparator.php:1248-1259 — 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/Psalm/Internal/Analyzer/MethodComparator.php:1227` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:404 — src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:404-415 | src/Psalm/Internal/Analyzer/Statements/Block/IfElse/IfAnalyzer.php:182-194 — 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–13 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:1378 — src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:1378-1389 | src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:1393-1405 — 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/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:1378` 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–13 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1231 — src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1231-1242 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2576-2588 — 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/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1231` 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 (12–13 lines × 2) src/Psalm/Type/Atomic/TClosure.php:108 — src/Psalm/Type/Atomic/TClosure.php:108-119 | src/Psalm/Type/Atomic/TClosure.php:161-173 — 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/Psalm/Type/Atomic/TClosure.php:161` 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 (11 lines × 3) · ×5
  • Duplicated block (11 lines × 3) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1643 — src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1643-1653 | src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:2237-2247 | src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMapReturnTypeProvider.php:496-506 — 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 (11 lines × 3) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1669 — src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1669-1679 | src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:2263-2273 | src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMapReturnTypeProvider.php:547-557 — 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 (11 lines × 3) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php:119 — src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php:119-129 | src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:330-340 | src/Psalm/Internal/Analyzer/Statements/Block/IfElse/IfAnalyzer.php:133-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php:119` 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/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:341` calls `array_key_exists` and `src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php:130` 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 (11 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1481 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1481-1491 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1509-1519 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1530-1540 — 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. 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 × 3) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:825 — src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:825-835 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:855-865 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:1022-1032 — 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/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:825` 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 lines × 2) · ×5
  • Duplicated block (9 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1184 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1184-1192 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1264-1272 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1184` 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/Psalm/Internal/CliUtils.php:442 — src/Psalm/Internal/CliUtils.php:442-450 | src/Psalm/Internal/CliUtils.php:503-511 — 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/Psalm/Internal/CliUtils.php:442` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) src/Psalm/Internal/Codebase/Properties.php:185 — src/Psalm/Internal/Codebase/Properties.php:185-193 | src/Psalm/Internal/Codebase/Properties.php:209-217 — 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/Psalm/Internal/Codebase/Properties.php:185` 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/Psalm/Internal/FileManipulation/ClassDocblockManipulator.php:50 — src/Psalm/Internal/FileManipulation/ClassDocblockManipulator.php:50-58 | src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php:60-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) src/Psalm/Internal/Type/TypeCombination.php:138 — src/Psalm/Internal/Type/TypeCombination.php:138-146 | src/Psalm/Internal/Type/TypeCombination.php:169-177 — 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/Psalm/Internal/Type/TypeCombination.php:138` 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 (7 lines × 2) · ×5
  • Duplicated block (7 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:1575 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:1575-1581 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php:474-481 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:534 — src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:534-540 | src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:570-576 — 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/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:534` 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 (7 lines × 2) src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:46 — src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:46-53 | src/Psalm/Internal/Provider/FileStorageProvider.php:45-51 — 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 (7 lines × 2) src/Psalm/Type/Atomic/TNamedObject.php:213 — src/Psalm/Type/Atomic/TNamedObject.php:213-219 | src/Psalm/Type/Atomic/TTemplateParam.php:171-177 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:174 — src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:174-180 | src/Psalm/Internal/Provider/FileStorageProvider.php:145-151 — 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.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×5
  • Duplicated block (6 lines × 2) src/Psalm/Internal/Analyzer/CanAlias.php:116 — src/Psalm/Internal/Analyzer/CanAlias.php:116-121 | src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:746-751 — 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/Psalm/Internal/Analyzer/CanAlias.php:116` 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/Psalm/Internal/Analyzer/CanAlias.php:114` calls `getCodebase` and `src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:744` 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 (6 lines × 2) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1348 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1348-1353 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1433-1438 — 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:1348` 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 (6 lines × 2) src/Psalm/Type/UnionTrait.php:825 — src/Psalm/Type/UnionTrait.php:825-830 | src/Psalm/Type/UnionTrait.php:910-915 — 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. 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/Psalm/Internal/Cli/Psalm.php:727 — src/Psalm/Internal/Cli/Psalm.php:727-732 | src/Psalm/Internal/LanguageServer/LanguageServer.php:228-233 — 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/Psalm/Internal/Cli/Psalm.php:727` 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/Psalm/Report/ConsoleReport.php:27 — src/Psalm/Report/ConsoleReport.php:27-32 | src/Psalm/Report/PhpStormReport.php:27-32 — before extracting anything, compare `src/Psalm/Report/ConsoleReport.php` and `src/Psalm/Report/PhpStormReport.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/Psalm/Internal/Analyzer/Statements/BreakAnalyzer.php:31 — src/Psalm/Internal/Analyzer/Statements/BreakAnalyzer.php:31-218 | src/Psalm/Internal/Analyzer/Statements/ContinueAnalyzer.php:29-123 | src/Psalm/Internal/Analyzer/Statements/Expression/ThrowAnalyzer.php:34-132 | src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php:180-751 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2457 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2457-2562 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2579-2719 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3212-3325 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3342-3481 — 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/Psalm/Internal/Cli/LanguageServer.php:67 — src/Psalm/Internal/Cli/LanguageServer.php:67-432 | src/Psalm/Internal/Cli/Psalm.php:1002-1024 | src/Psalm/Internal/Cli/Psalter.php:101-503 | src/Psalm/Internal/Cli/Refactor.php:71-391 — 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/Psalm/Internal/Cli/LanguageServer.php:67 — src/Psalm/Internal/Cli/LanguageServer.php:67-432 | src/Psalm/Internal/Cli/Psalm.php:1161-1183 | src/Psalm/Internal/Cli/Psalter.php:513-531 | src/Psalm/Internal/Cli/Refactor.php:71-391 — 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 (19 corresponding lines) · ×4
  • Edited copy of a member (19 corresponding lines) src/Psalm/Internal/Codebase/TaintFlowResolution.php:3512 — src/Psalm/Internal/Codebase/TaintFlowResolution.php:3512-3542 | src/Psalm/Internal/Codebase/TaintFlowResolution.php:3752-3770 — 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.
  • Edited copy of a member (19 corresponding lines) src/Psalm/Internal/Analyzer/Statements/Expression/BitwiseNotAnalyzer.php:124 — src/Psalm/Internal/Analyzer/Statements/Expression/BitwiseNotAnalyzer.php:124-142 | src/Psalm/Internal/Analyzer/Statements/Expression/UnaryPlusMinusAnalyzer.php:120-140 — 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.
  • Edited copy of a member (19 corresponding lines) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ConstFetchAnalyzer.php:146 — src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ConstFetchAnalyzer.php:146-166 | src/Psalm/Internal/Codebase/InternalTaintSourceMap.php:60-78 — 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.
  • Edited copy of a member (19 corresponding lines) src/Psalm/Storage/FunctionLikeStorage.php:463 — src/Psalm/Storage/FunctionLikeStorage.php:463-486 | src/Psalm/Storage/FunctionLikeStorage.php:494-512 — 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 (17 corresponding lines) · ×4
  • Edited copy of a member (17 corresponding lines) src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:191 — src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:191-207 | src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:243-259 — These two members are one piece of code written twice and then edited apart: 17 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 (17 corresponding lines) src/Psalm/Type/MutableUnion.php:465 — src/Psalm/Type/MutableUnion.php:465-481 | src/Psalm/Type/Union.php:365-382 — These two members are one piece of code written twice and then edited apart: 17 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 (17 corresponding lines) src/Psalm/Internal/Provider/MethodCapabilitiesProvider.php:78 — src/Psalm/Internal/Provider/MethodCapabilitiesProvider.php:78-94 | src/Psalm/Internal/Provider/MethodReturnTypeProvider.php:93-112 — These two members are one piece of code written twice and then edited apart: 17 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 (17 corresponding lines) src/Psalm/Type/Atomic/TTemplateKeyOf.php:93 — src/Psalm/Type/Atomic/TTemplateKeyOf.php:93-109 | src/Psalm/Type/Atomic/TTemplateValueOf.php:93-109 — These two members are one piece of code written twice and then edited apart: 17 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 (26 lines × 2) · ×4
  • Duplicated block (26 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:106 — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:106-131 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:133-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.
  • Duplicated block (26 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:505 — src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:505-530 | src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:696-721 — 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/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:505` 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 (26 lines × 2) src/Psalm/Internal/Cli/Psalter.php:229 — src/Psalm/Internal/Cli/Psalter.php:229-254 | src/Psalm/Internal/Cli/Refactor.php:175-200 — before extracting anything, compare `src/Psalm/Internal/Cli/Psalter.php` and `src/Psalm/Internal/Cli/Refactor.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 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/Psalm/Internal/Cli/Psalter.php:229` 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 (26 lines × 2) src/Psalm/Type/Atomic/TClosure.php:139 — src/Psalm/Type/Atomic/TClosure.php:139-164 | src/Psalm/Type/Atomic/TGenericObject.php:181-206 — 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/Psalm/Type/Atomic/TClosure.php:139` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×4
  • Duplicated block (23–24 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:523 — src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:523-546 | src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:571-593 — 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/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:523` 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/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:547` calls `getRemovedTaints` and `src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:594` 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 (23–24 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/ExitAnalyzer.php:65 — src/Psalm/Internal/Analyzer/Statements/Expression/ExitAnalyzer.php:65-88 | src/Psalm/Internal/Analyzer/Statements/Expression/PrintAnalyzer.php:35-57 — 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/Psalm/Internal/Analyzer/Statements/Expression/ExitAnalyzer.php:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23–24 lines × 2) src/Psalm/Internal/Diff/AstDiffer.php:108 — src/Psalm/Internal/Diff/AstDiffer.php:108-130 | src/Psalm/Internal/Diff/FileDiffer.php:95-118 — before extracting anything, compare `src/Psalm/Internal/Diff/AstDiffer.php` and `src/Psalm/Internal/Diff/FileDiffer.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 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/Psalm/Internal/Diff/AstDiffer.php:108` 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. 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 (23–24 lines × 2) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:228 — src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:228-251 | src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:343-365 — 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/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:228` 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 (19 lines × 3) · ×4
  • Duplicated block (19 lines × 3) src/Psalm/Internal/Codebase/ClassLikes.php:2307 — src/Psalm/Internal/Codebase/ClassLikes.php:2307-2325 | src/Psalm/Internal/Codebase/ClassLikes.php:2574-2592 | src/Psalm/Internal/Codebase/ClassLikes.php:2643-2661 — 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 (19 lines × 3) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:1666 — src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:1666-1684 | src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:1725-1743 | src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:1787-1805 — 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/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:1666` 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 (19 lines × 3) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1347 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1347-1365 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1440-1458 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1635-1653 — 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1347` 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 lines × 3) src/Psalm/Report/ByIssueLevelAndTypeReport.php:76 — src/Psalm/Report/ByIssueLevelAndTypeReport.php:76-94 | src/Psalm/Report/ConsoleReport.php:50-68 | src/Psalm/Report/PhpStormReport.php:50-68 — before extracting anything, compare `src/Psalm/Report/ByIssueLevelAndTypeReport.php` and `src/Psalm/Report/ConsoleReport.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 60 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/Psalm/Report/ByIssueLevelAndTypeReport.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.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×4
  • Duplicated block (5 lines × 2) src/Psalm/Internal/Analyzer/FileAnalyzer.php:687 — src/Psalm/Internal/Analyzer/FileAnalyzer.php:687-691 | src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2812-2816 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) src/Psalm/Internal/Analyzer/FileAnalyzer.php:701 — src/Psalm/Internal/Analyzer/FileAnalyzer.php:701-705 | src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2826-2830 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) src/Psalm/Type/Atomic/TTemplateKeyOf.php:42 — src/Psalm/Type/Atomic/TTemplateKeyOf.php:42-46 | src/Psalm/Type/Atomic/TTemplateValueOf.php:42-46 — before extracting anything, compare `src/Psalm/Type/Atomic/TTemplateKeyOf.php` and `src/Psalm/Type/Atomic/TTemplateValueOf.php` as WHOLE FILES: 89% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) src/Psalm/Internal/Provider/DynamicFunctionStorageProvider.php:40 — src/Psalm/Internal/Provider/DynamicFunctionStorageProvider.php:40-44 | src/Psalm/Internal/Provider/FunctionParamsProvider.php:50-54 — 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.
X27 · Collection changed while being enumerated · Collection is structurally changed while it is being enumerated · ×4
  • Collection is structurally changed while it is being enumerated src/Psalm/Internal/Algebra.php:122 — line 122 walks `$cloned_clauses` by value, so the walk is the snapshot taken when the loop began, and line 200 changes that same collection with `unset($cloned_clauses[…])` before the next iteration: the removed element is still visited by the rest of the loop. PHP raises nothing, so the loop completes over a different set than the code meant.
  • Collection is structurally changed while it is being enumerated src/Psalm/Internal/Type/SimpleAssertionReconciler.php:3219 — line 3219 walks `$types` by value, so the walk is the snapshot taken when the loop began, and line 3237 changes that same collection with `$types[] = …` before the next iteration: the added element is never visited by this loop, so whatever it was added for is not done here. PHP raises nothing, so the loop completes over a different set than the code meant.
  • Collection is structurally changed while it is being enumerated src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:728 — line 728 walks `$fixed_type_tokens` by value, so the walk is the snapshot taken when the loop began, and line 777 changes that same collection with `unset($fixed_type_tokens[…])` before the next iteration: the removed element is still visited by the rest of the loop. PHP raises nothing, so the loop completes over a different set than the code meant.
  • Collection is structurally changed while it is being enumerated src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php:197 — line 197 walks `$lhs_types` by value, so the walk is the snapshot taken when the loop began, and line 199 changes that same collection with `$lhs_types = …` before the next iteration: the loop carries on over the old value while the body now works on the new one. PHP raises nothing, so the loop completes over a different set than the code meant.
X3 · Exception handling · Swallowed exception (empty catch) · ×4
  • Swallowed exception (empty catch) src/Psalm/Internal/LanguageServer/LanguageServer.php:975 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/Psalm/Internal/Codebase/Functions.php:381 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/Psalm/Internal/Cli/Psalm.php:1092 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php:1165 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×3
  • Edited copy of a member (29 corresponding lines) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:119 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:119-611 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:639-870 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) src/Psalm/Internal/Diff/AstDiffer.php:44 — src/Psalm/Internal/Diff/AstDiffer.php:44-78 | src/Psalm/Internal/Diff/FileDiffer.php:39-67 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) src/Psalm/Type/Atomic/TKeyedArray.php:89 — src/Psalm/Type/Atomic/TKeyedArray.php:89-117 | src/Psalm/Type/Atomic/TKeyedArray.php:149-180 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2356 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2356-2441 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2457-2562 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2733-2796 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3121-3196 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3495-3553 — 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.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:511 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:511-581 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:712-770 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:787-850 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:867-930 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1829-1882 — 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.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:511 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:511-581 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1151-1220 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1237-1319 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1430-1513 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1530-1608 — 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 (20 corresponding lines) · ×3
  • Edited copy of a member (20 corresponding lines) src/Psalm/PluginFileExtensionsSocket.php:54 — src/Psalm/PluginFileExtensionsSocket.php:54-73 | src/Psalm/PluginFileExtensionsSocket.php:91-110 — 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/Psalm/Internal/Codebase/ReceiverPropertyTaints.php:905 — src/Psalm/Internal/Codebase/ReceiverPropertyTaints.php:905-925 | src/Psalm/Internal/Codebase/ReceiverPropertyTaints.php:939-958 — 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/Psalm/Storage/Capabilities.php:332 — src/Psalm/Storage/Capabilities.php:332-357 | src/Psalm/Storage/Capabilities.php:369-388 — 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 · Edited copy of a member (18 corresponding lines) · ×3
  • Edited copy of a member (18 corresponding lines) src/Psalm/Config.php:1001 — src/Psalm/Config.php:1001-1018 | src/Psalm/Config.php:1027-1044 — These two members are one piece of code written twice and then edited apart: 18 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 (18 corresponding lines) src/Psalm/Type/UnionTrait.php:1127 — src/Psalm/Type/UnionTrait.php:1127-1144 | src/Psalm/Type/UnionTrait.php:1152-1175 — These two members are one piece of code written twice and then edited apart: 18 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 (18 corresponding lines) src/Psalm/Type/Atomic/TArray.php:135 — src/Psalm/Type/Atomic/TArray.php:135-152 | src/Psalm/Type/Atomic/TNamedObject.php:238-255 — These two members are one piece of code written twice and then edited apart: 18 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 (14 corresponding lines) · ×3
  • Edited copy of a member (14 corresponding lines) src/Psalm/Internal/Codebase/ReceiverPropertyTaints.php:619 — src/Psalm/Internal/Codebase/ReceiverPropertyTaints.php:619-639 | src/Psalm/Internal/Codebase/ReceiverPropertyTaints.php:656-669 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2121 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2121-2139 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2160-2173 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) src/Psalm/Report/EmacsReport.php:25 — src/Psalm/Report/EmacsReport.php:25-39 | src/Psalm/Report/TextReport.php:25-38 — These two members are one piece of code written twice and then edited apart: 14 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 (4 corresponding lines) · ×3
  • Edited copy of a member (4 corresponding lines) src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php:974 — src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php:974-980 | src/Psalm/Type/Atomic/TKeyedArray.php:204-207 — These two members are one piece of code written twice and then edited apart: 4 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 (4 corresponding lines) src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:113 — src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:113-116 | src/Psalm/Internal/Analyzer/TraitAnalyzer.php:31-36 — These two members are one piece of code written twice and then edited apart: 4 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 (4 corresponding lines) src/Psalm/Type/Atomic/TCallable.php:47 — src/Psalm/Type/Atomic/TCallable.php:47-50 | src/Psalm/Type/Atomic/TClosure.php:57-66 — These two members are one piece of code written twice and then edited apart: 4 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 (35 lines × 2) · ×3
  • Duplicated block (35 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1641 — src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1641-1675 | src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:2235-2269 — 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/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1641` 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 (35 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:483 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:483-517 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:706-740 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:483` 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 (35 lines × 2) src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:202 — src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:202-236 | src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:246-280 — 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/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:202` 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 (24 lines × 2) · ×3
  • Duplicated block (24 lines × 2) src/Psalm/Internal/LanguageServer/Server/TextDocument.php:166 — src/Psalm/Internal/LanguageServer/Server/TextDocument.php:166-189 | src/Psalm/Internal/LanguageServer/Server/TextDocument.php:217-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/Psalm/Internal/LanguageServer/Server/TextDocument.php:166` 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 (24 lines × 2) src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:332 — src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:332-355 | src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:362-385 — 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/Psalm/Internal/Scanner/PhpStormMetaScanner.php:332` 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 (24 lines × 2) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2780 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2780-2803 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2841-2864 — 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:2780` 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 (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2582 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2582-2604 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3345-3367 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2582` 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 (23 lines × 2) src/Psalm/Internal/Codebase/ClassLikes.php:2295 — src/Psalm/Internal/Codebase/ClassLikes.php:2295-2317 | src/Psalm/Internal/Codebase/ClassLikes.php:2631-2653 — 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/Psalm/Internal/Codebase/ClassLikes.php:2295` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) src/Psalm/Internal/Codebase/ClassLikes.php:2450 — src/Psalm/Internal/Codebase/ClassLikes.php:2450-2472 | src/Psalm/Internal/Codebase/ClassLikes.php:2496-2518 — 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/Psalm/Internal/Codebase/ClassLikes.php:2450` 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 lines × 3) · ×3
  • Duplicated block (17 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:272 — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:272-288 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:294-310 | src/Psalm/Internal/Analyzer/Statements/Expression/BitwiseNotAnalyzer.php:90-106 — 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 (17 lines × 3) src/Psalm/Internal/Cli/LanguageServer.php:264 — src/Psalm/Internal/Cli/LanguageServer.php:264-280 | src/Psalm/Internal/Cli/Psalter.php:226-242 | src/Psalm/Internal/Cli/Refactor.php:172-188 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Psalm/Internal/Cli/Psalter.php:245` calls `captureServer` and `src/Psalm/Internal/Cli/LanguageServer.php:282` 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 (17 lines × 3) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1372 — src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1372-1388 | src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1458-1474 | src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1544-1560 — 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/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1372` 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–17 lines × 2) · ×3
  • Duplicated block (16–17 lines × 2) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1680 — src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1680-1696 | src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:2021-2036 — 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/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1680` 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 (16–17 lines × 2) src/Psalm/Internal/Type/TemplateInferredTypeReplacer.php:154 — src/Psalm/Internal/Type/TemplateInferredTypeReplacer.php:154-169 | src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:314-330 — 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/Psalm/Internal/Type/TemplateInferredTypeReplacer.php:154` 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 (16–17 lines × 2) src/Psalm/Internal/Type/TypeParser.php:818 — src/Psalm/Internal/Type/TypeParser.php:818-834 | src/Psalm/Internal/Type/TypeParser.php:2342-2357 — 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/Psalm/Internal/Type/TypeParser.php:818` 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 (16 lines × 3) · ×3
  • Duplicated block (16 lines × 3) src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:930 — src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:930-945 | src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:1036-1051 | src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:1102-1117 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:924` calls `visitPreloadedStubFiles`, `checkDirWithConfig`, `initializePlugins` and `src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:1100` 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 (16 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2579 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2579-2594 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3212-3227 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3342-3357 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2579` 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 × 3) src/Psalm/Internal/Provider/ParamsProvider/ArrayMultisortParamsProvider.php:80 — src/Psalm/Internal/Provider/ParamsProvider/ArrayMultisortParamsProvider.php:80-95 | src/Psalm/Internal/Provider/ParamsProvider/PregReplaceCallbackParamsProvider.php:128-143 | src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayUniqueReturnTypeProvider.php:82-97 — 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 (11 lines × 4) · ×3
  • Duplicated block (11 lines × 4) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2828 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2828-2838 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2897-2907 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2970-2980 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3647-3657 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2828` 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 × 4) src/Psalm/Internal/Cli/LanguageServer.php:149 — src/Psalm/Internal/Cli/LanguageServer.php:149-159 | src/Psalm/Internal/Cli/Psalm.php:1169-1179 | src/Psalm/Internal/Cli/Psalter.php:513-523 | src/Psalm/Internal/Cli/Refactor.php:90-100 — 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.
  • Duplicated block (11 lines × 4) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2096 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2096-2106 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2226-2236 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1901-1911 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:2024-2034 — before extracting anything, compare `src/Psalm/Internal/Type/SimpleAssertionReconciler.php` and `src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 139 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:2096` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×3
  • Duplicated block (10 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:491 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:491-500 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1218-1227 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2565-2574 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:491` 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/Psalm/Internal/Codebase/Analyzer.php:754 — src/Psalm/Internal/Codebase/Analyzer.php:754-763 | src/Psalm/Internal/Codebase/Analyzer.php:790-799 | src/Psalm/Internal/Codebase/Analyzer.php:826-835 — 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/Psalm/Internal/Codebase/Analyzer.php:754` 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/Psalm/Internal/Diff/FileStatementsDiffer.php:163 — src/Psalm/Internal/Diff/FileStatementsDiffer.php:163-173 | src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php:116-125 | src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php:131-141 — before extracting anything, compare `src/Psalm/Internal/Diff/FileStatementsDiffer.php` and `src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 114 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/Psalm/Internal/Diff/FileStatementsDiffer.php:163` 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.
X19 · Unrestored process-global state · Process-global state is restored only on the happy path · ×3
  • Process-global state is restored only on the happy path src/Psalm/Config.php:863 — `loadDomDocument` 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 870, put back at line 876) — 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/Psalm/Config.php:884 — `validateXmlConfig` changes state that belongs to the whole PROCESS and changes it back at the end of the same body — libxml's internal-error mode (changed at line 893, put back at line 921) — 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/Psalm/Config/FileFilter.php:465 — `isRegularExpression` 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 471, reset at line 476) — 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.
D17 · Explicit Debt · XxxComment · ×2
  • XxxComment src/Psalm/Internal/Codebase/Methods.php:727 — // XXX: why TString? Perhaps it should be string|int? — 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.
  • XxxComment src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:818 — // XXX: what if we need both? — 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.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×2
  • Edited copy of a member (36 corresponding lines) src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:908 — src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:908-945 | src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:1016-1051 — 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.
  • Edited copy of a member (36 corresponding lines) src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php:418 — src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php:418-453 | src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php:462-497 — 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 (27 corresponding lines) · ×2
  • Edited copy of a member (27 corresponding lines) src/Psalm/Internal/Codebase/TaintFlowResolution.php:2968 — src/Psalm/Internal/Codebase/TaintFlowResolution.php:2968-2994 | src/Psalm/Internal/Codebase/TaintFlowResolution.php:3033-3059 — These two members are one piece of code written twice and then edited apart: 27 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 (27 corresponding lines) src/Psalm/Internal/Codebase/TaintFlowGraph.php:977 — src/Psalm/Internal/Codebase/TaintFlowGraph.php:977-1003 | src/Psalm/Internal/Codebase/TaintFlowGraph.php:1011-1037 — These two members are one piece of code written twice and then edited apart: 27 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 (33 corresponding lines) · ×2
  • Edited copy of a member (33 corresponding lines) src/Psalm/Internal/PluginManager/Command/DisableCommand.php:52 — src/Psalm/Internal/PluginManager/Command/DisableCommand.php:52-84 | src/Psalm/Internal/PluginManager/Command/EnableCommand.php:52-84 — These two members are one piece of code written twice and then edited apart: 33 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 (33 corresponding lines) src/Psalm/Internal/Type/AssertionReconciler.php:980 — src/Psalm/Internal/Type/AssertionReconciler.php:980-1012 | src/Psalm/Type.php:996-1034 — These two members are one piece of code written twice and then edited apart: 33 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 (21 corresponding lines) · ×2
  • Edited copy of a member (21 corresponding lines) src/Psalm/Internal/Type/TypeCombination.php:133 — src/Psalm/Internal/Type/TypeCombination.php:133-153 | src/Psalm/Internal/Type/TypeCombination.php:164-186 — These two members are one piece of code written twice and then edited apart: 21 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 (21 corresponding lines) src/Psalm/Internal/Codebase/Properties.php:123 — src/Psalm/Internal/Codebase/Properties.php:123-143 | src/Psalm/Internal/Codebase/Properties.php:154-176 — These two members are one piece of code written twice and then edited apart: 21 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 (26 corresponding lines) · ×2
  • Edited copy of a member (26 corresponding lines) src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php:31 — src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php:31-56 | src/Psalm/Internal/Provider/FileStorageCacheProvider.php:32-57 — 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.
  • Edited copy of a member (26 corresponding lines) src/Psalm/Internal/Codebase/ClassLikes.php:1993 — src/Psalm/Internal/Codebase/ClassLikes.php:1993-2019 | src/Psalm/Internal/Codebase/ClassLikes.php:2032-2057 — 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 copies of one member (3 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 15+ corresponding lines) src/Psalm/Type/Atomic/TArray.php:80 — src/Psalm/Type/Atomic/TArray.php:80-101 | src/Psalm/Type/Atomic/TGenericObject.php:128-146 | src/Psalm/Type/Atomic/TIterable.php:175-189 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 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.
  • Edited copies of one member (3 members, 15+ corresponding lines) src/Psalm/Internal/Provider/ReturnTypeProvider/FirstArgStringReturnTypeProvider.php:39 — src/Psalm/Internal/Provider/ReturnTypeProvider/FirstArgStringReturnTypeProvider.php:39-55 | src/Psalm/Internal/Provider/ReturnTypeProvider/GetClassMethodsReturnTypeProvider.php:34-48 | src/Psalm/Internal/Provider/ReturnTypeProvider/GetObjectVarsReturnTypeProvider.php:165-184 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 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 (11 corresponding lines) · ×2
  • Edited copy of a member (11 corresponding lines) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:5009 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:5009-5019 | src/Psalm/Internal/Analyzer/Statements/Expression/IntMaskComparisonAnalyzer.php:204-214 — These two members are one piece of code written twice and then edited apart: 11 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 (11 corresponding lines) src/Psalm/Type/MutableTypeVisitor.php:31 — src/Psalm/Type/MutableTypeVisitor.php:31-42 | src/Psalm/Type/TypeVisitor.php:24-34 — These two members are one piece of code written twice and then edited apart: 11 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 (49 lines × 2) · ×2
  • Duplicated block (49 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1837 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1837-1885 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1898-1946 — 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 (49 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:408 — src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:408-456 | src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:748-796 — 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/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.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 (44 lines × 2) · ×2
  • Duplicated block (44 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:436 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:436-479 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:511-554 — 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 (44 lines × 2) src/Psalm/Internal/Stubs/Generator/ClassLikeStubGenerator.php:230 — src/Psalm/Internal/Stubs/Generator/ClassLikeStubGenerator.php:230-273 | src/Psalm/Internal/Stubs/Generator/StubsGenerator.php:224-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.
D4 · Code Duplication · Duplicated block (43 lines × 2) · ×2
  • Duplicated block (43 lines × 2) src/Psalm/Internal/Provider/AddRemoveTaints/HtmlFunctionTainter.php:31 — src/Psalm/Internal/Provider/AddRemoveTaints/HtmlFunctionTainter.php:31-73 | src/Psalm/Internal/Provider/AddRemoveTaints/HtmlFunctionTainter.php:82-124 — 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 (43 lines × 2) src/Psalm/Plugin/EventHandler/Event/AfterFunctionLikeAnalysisEvent.php:44 — src/Psalm/Plugin/EventHandler/Event/AfterFunctionLikeAnalysisEvent.php:44-102 | src/Psalm/Plugin/EventHandler/Event/AfterStatementAnalysisEvent.php:40-82 — before extracting anything, compare `src/Psalm/Plugin/EventHandler/Event/AfterFunctionLikeAnalysisEvent.php` and `src/Psalm/Plugin/EventHandler/Event/AfterStatementAnalysisEvent.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. 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/Psalm/Plugin/EventHandler/Event/AfterFunctionLikeAnalysisEvent.php:44` 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. 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 (32 lines × 2) · ×2
  • Duplicated block (32 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:2095 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:2095-2126 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:807-838 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:805` calls `setType`, `Union` and `src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:2093` 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 (32 lines × 2) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2485 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2485-2516 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2697-2728 — 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:2485` 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. 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 (31 lines × 2) · ×2
  • Duplicated block (31 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2938 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2938-2968 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3694-3724 — 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 (31 lines × 2) src/Psalm/Internal/PhpTraverser/CustomTraverser.php:42 — src/Psalm/Internal/PhpTraverser/CustomTraverser.php:42-72 | src/Psalm/Internal/PhpTraverser/CustomTraverser.php:104-134 — 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/Psalm/Internal/PhpTraverser/CustomTraverser.php:42` 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 (30 lines × 2) · ×2
  • Duplicated block (30 lines × 2) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2254 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2254-2283 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1928-1957 — before extracting anything, compare `src/Psalm/Internal/Type/SimpleAssertionReconciler.php` and `src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 139 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:2254` 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 (30 lines × 2) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1280 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1280-1309 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1673-1702 — 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1280` 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 (29 lines × 3) · ×2
  • Duplicated block (29 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2814 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2814-2842 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2883-2911 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3633-3661 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2814` 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 (29 lines × 3) src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:172 — src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:172-200 | src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:206-234 | src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:250-278 — 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/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:172` 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 (29 lines × 2) · ×2
  • Duplicated block (29 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:553 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:553-581 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:760-788 — 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 (29 lines × 2) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1684 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1684-1712 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1784-1812 — 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1684` 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 (28 lines × 2) · ×2
  • Duplicated block (28 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php:167 — src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php:167-194 | src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:375-402 — 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 (28 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:521 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:521-548 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:557-584 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:521` 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 (27 lines × 2) · ×2
  • Duplicated block (27 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:267 — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:267-293 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:295-321 — 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/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:295` 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 (27 lines × 2) src/Psalm/Internal/Type/AssertionReconciler.php:1808 — src/Psalm/Internal/Type/AssertionReconciler.php:1808-1834 | src/Psalm/Internal/Type/AssertionReconciler.php:1997-2023 — 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/Psalm/Internal/Type/AssertionReconciler.php:1808` 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 (21–22 lines × 2) · ×2
  • Duplicated block (21–22 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php:287 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php:287-307 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php:766-787 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php:766` 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/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php:284` calls `getInstance` and `src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php:763` 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 (21–22 lines × 2) src/Psalm/Internal/Codebase/StorageByPatternResolver.php:35 — src/Psalm/Internal/Codebase/StorageByPatternResolver.php:35-56 | src/Psalm/Internal/Codebase/StorageByPatternResolver.php:68-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Psalm/Internal/Codebase/StorageByPatternResolver.php:35` 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 (21 lines × 3) · ×2
  • Duplicated block (21 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2409 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2409-2429 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2531-2551 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2686-2706 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2409` 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 (21 lines × 3) src/Psalm/Report/ByIssueLevelAndTypeReport.php:121 — src/Psalm/Report/ByIssueLevelAndTypeReport.php:121-141 | src/Psalm/Report/ConsoleReport.php:93-113 | src/Psalm/Report/PhpStormReport.php:88-108 — before extracting anything, compare `src/Psalm/Report/ByIssueLevelAndTypeReport.php` and `src/Psalm/Report/ConsoleReport.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 60 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/Psalm/Report/ByIssueLevelAndTypeReport.php:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4439 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4439-4459 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4713-4733 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4439` 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 (21 lines × 2) src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php:31 — src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php:31-51 | src/Psalm/Internal/Provider/FileStorageCacheProvider.php:32-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/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php:31` 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 (18 lines × 4) · ×2
  • Duplicated block (18 lines × 4) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2809 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2809-2826 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2878-2895 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3566-3583 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3628-3645 — 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.
  • Duplicated block (18 lines × 4) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:269 — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:269-286 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:296-313 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:962-979 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:1396-1413 — 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/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.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/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:266` calls `hasMixed`, `CodeLocation`, `getSource` and `src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:960` 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 (17–18 lines × 2) · ×2
  • Duplicated block (17–18 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:445 — src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:445-461 | src/Psalm/Internal/Analyzer/Statements/Expression/SimpleTypeInferer.php:692-709 — 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/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:445` 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–18 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php:344 — src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php:344-360 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php:483-500 — 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/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php:344` 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 (16–18 lines × 2) · ×2
  • Duplicated block (16–18 lines × 2) src/Psalm/Internal/Cli/Psalm.php:607 — src/Psalm/Internal/Cli/Psalm.php:607-622 | src/Psalm/Internal/Cli/Psalm.php:916-933 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16–18 lines × 2) src/Psalm/Internal/Provider/ParamsProvider/ArrayMultisortParamsProvider.php:80 — src/Psalm/Internal/Provider/ParamsProvider/ArrayMultisortParamsProvider.php:80-95 | src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayUniqueReturnTypeProvider.php:82-99 — 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/Psalm/Internal/Provider/ReturnTypeProvider/ArrayUniqueReturnTypeProvider.php:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (15–17 lines × 2) · ×2
  • Duplicated block (15–17 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:230 — src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:230-246 | src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:245-259 — 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/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:230` 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/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:243` calls `removeClausesOfVarsChangedSince`, `simplifyCNF` and `src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:230` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15–17 lines × 2) src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php:736 — src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php:736-752 | src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php:756-770 — 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/Psalm/Internal/Type/Comparator/UnionTypeComparator.php:736` 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 × 3) · ×2
  • Duplicated block (15–16 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:222 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:222-237 | src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:1753-1767 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:910-924 — 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/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:222` 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–16 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:756 — src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:756-771 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:1578-1593 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:1679-1693 — 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/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:756` 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 (15 lines × 5) · ×2
  • Duplicated block (15 lines × 5) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2356 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2356-2370 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2457-2471 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2733-2747 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3121-3135 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3495-3509 — all 5 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 (15 lines × 5) src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php:164 — src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php:164-178 | src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:118-132 | src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:183-197 | src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:217-231 | src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:261-275 — 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.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×2
  • Duplicated block (13 lines × 4) src/Psalm/Internal/Analyzer/Statements/BreakAnalyzer.php:166 — src/Psalm/Internal/Analyzer/Statements/BreakAnalyzer.php:166-178 | src/Psalm/Internal/Analyzer/Statements/ContinueAnalyzer.php:108-120 | src/Psalm/Internal/Analyzer/Statements/Expression/ThrowAnalyzer.php:80-92 | src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php:323-335 — 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.
  • Duplicated block (13 lines × 4) src/Psalm/Internal/Cli/LanguageServer.php:266 — src/Psalm/Internal/Cli/LanguageServer.php:266-278 | src/Psalm/Internal/Cli/Psalm.php:1010-1022 | src/Psalm/Internal/Cli/Psalter.php:228-240 | src/Psalm/Internal/Cli/Refactor.php:174-186 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Psalm/Internal/Cli/Psalter.php:245` calls `captureServer` and `src/Psalm/Internal/Cli/LanguageServer.php:282` 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 (10 lines × 4) · ×2
  • Duplicated block (10 lines × 4) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:689 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:689-698 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php:652-661 | src/Psalm/Internal/Analyzer/Statements/Expression/EncapsulatedStringAnalyzer.php:127-136 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:649-658 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Psalm/Internal/Analyzer/Statements/Expression/EncapsulatedStringAnalyzer.php:140` calls `getTaintsRemovedAfterUrlOrigins`, `foreach` and `src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:700` 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 × 4) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:579 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:579-589 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php:939-948 | src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:424-435 | src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:764-775 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:579` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×2
  • Duplicated block (8 lines × 3) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:672 — src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:672-679 | src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:177-184 | src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:646-653 — 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/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:672` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 3) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:471 — src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:471-478 | src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:489-496 | src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:507-514 — 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/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:471` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:187 — src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:187-192 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2792-2797 | src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayColumnReturnTypeProvider.php:346-351 — 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/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:187` 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 × 3) src/Psalm/Type/Atomic/TKeyedArray.php:92 — src/Psalm/Type/Atomic/TKeyedArray.php:92-97 | src/Psalm/Type/Atomic/TKeyedArray.php:680-685 | src/Psalm/Type/Atomic/TKeyedArray.php:720-725 — 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/Psalm/Type/Atomic/TKeyedArray.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. 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.
D1 · Cyclomatic Complexity · FilterUtils.getReturnType (cyclomatic 279) · ×1
  • FilterUtils.getReturnType (cyclomatic 279) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:664 — FilterUtils.getReturnType has cyclomatic complexity 279 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AtomicTypeComparator.isContainedBy (cyclomatic 244) · ×1
  • AtomicTypeComparator.isContainedBy (cyclomatic 244) src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php:77 — AtomicTypeComparator.isContainedBy has cyclomatic complexity 244 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionLikeAnalyzer.analyze (cyclomatic 235) · ×1
  • FunctionLikeAnalyzer.analyze (cyclomatic 235) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:304 — FunctionLikeAnalyzer.analyze has cyclomatic complexity 235 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArithmeticOpAnalyzer.analyzeOperands (cyclomatic 225) · ×1
  • ArithmeticOpAnalyzer.analyzeOperands (cyclomatic 225) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:412 — ArithmeticOpAnalyzer.analyzeOperands has cyclomatic complexity 225 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReturnTypeAnalyzer.verifyReturnType (cyclomatic 209) · ×1
  • ReturnTypeAnalyzer.verifyReturnType (cyclomatic 209) src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:135 — ReturnTypeAnalyzer.verifyReturnType has cyclomatic complexity 209 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ScalarTypeComparator.isContainedBy (cyclomatic 202) · ×1
  • ScalarTypeComparator.isContainedBy (cyclomatic 202) src/Psalm/Internal/Type/Comparator/ScalarTypeComparator.php:55 — ScalarTypeComparator.isContainedBy has cyclomatic complexity 202 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassLikeNodeScanner.start (cyclomatic 169) · ×1
  • ClassLikeNodeScanner.start (cyclomatic 169) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:155 — ClassLikeNodeScanner.start has cyclomatic complexity 169 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeCombiner.scrapeTypeProperties (cyclomatic 168) · ×1
  • TypeCombiner.scrapeTypeProperties (cyclomatic 168) src/Psalm/Internal/Type/TypeCombiner.php:485 — TypeCombiner.scrapeTypeProperties has cyclomatic complexity 168 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionLikeNodeScanner.start (cyclomatic 164) · ×1
  • FunctionLikeNodeScanner.start (cyclomatic 164) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:108 — FunctionLikeNodeScanner.start has cyclomatic complexity 164 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArgumentAnalyzer.verifyType (cyclomatic 151) · ×1
  • ArgumentAnalyzer.verifyType (cyclomatic 151) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:883 — ArgumentAnalyzer.verifyType has cyclomatic complexity 151 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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.fromXmlAndPaths (cyclomatic 143) · ×1
  • Config.fromXmlAndPaths (cyclomatic 143) src/Psalm/Config.php:1089 — Config.fromXmlAndPaths has cyclomatic complexity 143 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Reconciler.reconcileKeyedTypes (cyclomatic 142) · ×1
  • Reconciler.reconcileKeyedTypes (cyclomatic 142) src/Psalm/Type/Reconciler.php:134 — Reconciler.reconcileKeyedTypes has cyclomatic complexity 142 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassConstAnalyzer.analyzeFetch (cyclomatic 141) · ×1
  • ClassConstAnalyzer.analyzeFetch (cyclomatic 141) src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:113 — ClassConstAnalyzer.analyzeFetch has cyclomatic complexity 141 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeParser.getTypeFromGenericTree (cyclomatic 141) · ×1
  • TypeParser.getTypeFromGenericTree (cyclomatic 141) src/Psalm/Internal/Type/TypeParser.php:756 — TypeParser.getTypeFromGenericTree has cyclomatic complexity 141 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UnionTypeComparator.isContainedBy (cyclomatic 140) · ×1
  • UnionTypeComparator.isContainedBy (cyclomatic 140) src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php:59 — UnionTypeComparator.isContainedBy has cyclomatic complexity 140 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeCombiner.scrapeStringProperties (cyclomatic 136) · ×1
  • TypeCombiner.scrapeStringProperties (cyclomatic 136) src/Psalm/Internal/Type/TypeCombiner.php:1152 — TypeCombiner.scrapeStringProperties has cyclomatic complexity 136 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArgumentsAnalyzer.checkArgumentsMatch (cyclomatic 133) · ×1
  • ArgumentsAnalyzer.checkArgumentsMatch (cyclomatic 133) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:1057 — ArgumentsAnalyzer.checkArgumentsMatch 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 · InstancePropertyAssignmentAnalyzer.analyzeAtomicAssignment (cyclomatic 130) · ×1
  • InstancePropertyAssignmentAnalyzer.analyzeAtomicAssignment (cyclomatic 130) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1221 — InstancePropertyAssignmentAnalyzer.analyzeAtomicAssignment has cyclomatic complexity 130 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SimpleTypeInferer.infer (cyclomatic 128) · ×1
  • SimpleTypeInferer.infer (cyclomatic 128) src/Psalm/Internal/Analyzer/Statements/Expression/SimpleTypeInferer.php:53 — SimpleTypeInferer.infer has cyclomatic complexity 128 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LoopAnalyzer.analyze (cyclomatic 112) · ×1
  • LoopAnalyzer.analyze (cyclomatic 112) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:73 — LoopAnalyzer.analyze 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 · ReflectorVisitor.enterNode (cyclomatic 112) · ×1
  • ReflectorVisitor.enterNode (cyclomatic 112) src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:113 — ReflectorVisitor.enterNode 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 · FormulaGenerator.getFormula (cyclomatic 110) · ×1
  • FormulaGenerator.getFormula (cyclomatic 110) src/Psalm/Internal/Algebra/FormulaGenerator.php:61 — FormulaGenerator.getFormula has cyclomatic complexity 110 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReturnAnalyzer.analyzeReturn (cyclomatic 109) · ×1
  • ReturnAnalyzer.analyzeReturn (cyclomatic 109) src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php:175 — ReturnAnalyzer.analyzeReturn has cyclomatic complexity 109 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AtomicStaticCallAnalyzer.handleNamedCall (cyclomatic 108) · ×1
  • AtomicStaticCallAnalyzer.handleNamedCall (cyclomatic 108) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php:362 — AtomicStaticCallAnalyzer.handleNamedCall has cyclomatic complexity 108 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassLikeDocblockParser.parse (cyclomatic 107) · ×1
  • ClassLikeDocblockParser.parse (cyclomatic 107) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:60 — ClassLikeDocblockParser.parse has cyclomatic complexity 107 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TryAnalyzer.analyze (cyclomatic 106) · ×1
  • TryAnalyzer.analyze (cyclomatic 106) src/Psalm/Internal/Analyzer/Statements/Block/TryAnalyzer.php:43 — TryAnalyzer.analyze has cyclomatic complexity 106 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MethodCallAnalyzer.analyze (cyclomatic 106) · ×1
  • MethodCallAnalyzer.analyze (cyclomatic 106) src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php:54 — MethodCallAnalyzer.analyze has cyclomatic complexity 106 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExistingAtomicStaticCallAnalyzer.analyze (cyclomatic 104) · ×1
  • ExistingAtomicStaticCallAnalyzer.analyze (cyclomatic 104) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php:71 — ExistingAtomicStaticCallAnalyzer.analyze has cyclomatic complexity 104 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AssignmentAnalyzer.analyzeAfterTheKeys (cyclomatic 102) · ×1
  • AssignmentAnalyzer.analyzeAfterTheKeys (cyclomatic 102) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:339 — AssignmentAnalyzer.analyzeAfterTheKeys has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExistingAtomicMethodCallAnalyzer.analyze (cyclomatic 100) · ×1
  • ExistingAtomicMethodCallAnalyzer.analyze (cyclomatic 100) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:74 — ExistingAtomicMethodCallAnalyzer.analyze has cyclomatic complexity 100 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Atomic.createInner (cyclomatic 99) · ×1
  • Atomic.createInner (cyclomatic 99) src/Psalm/Type/Atomic.php:185 — Atomic.createInner has cyclomatic complexity 99 (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 · IfElseAnalyzer.analyze (cyclomatic 96) · ×1
  • IfElseAnalyzer.analyze (cyclomatic 96) src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:76 — IfElseAnalyzer.analyze has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PhpStormMetaScanner.handleOverride (cyclomatic 95) · ×1
  • PhpStormMetaScanner.handleOverride (cyclomatic 95) src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:33 — PhpStormMetaScanner.handleOverride 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 · Methods.getMethodReturnType (cyclomatic 91) · ×1
  • Methods.getMethodReturnType (cyclomatic 91) src/Psalm/Internal/Codebase/Methods.php:629 — Methods.getMethodReturnType has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NamedFunctionCallHandler.handle (cyclomatic 90) · ×1
  • NamedFunctionCallHandler.handle (cyclomatic 90) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:75 — NamedFunctionCallHandler.handle 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 · NegatedAssertionReconciler.reconcile (cyclomatic 90) · ×1
  • NegatedAssertionReconciler.reconcile (cyclomatic 90) src/Psalm/Internal/Type/NegatedAssertionReconciler.php:57 — NegatedAssertionReconciler.reconcile 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 · ScopeAnalyzer.getControlActions (cyclomatic 88) · ×1
  • ScopeAnalyzer.getControlActions (cyclomatic 88) src/Psalm/Internal/Analyzer/ScopeAnalyzer.php:44 — ScopeAnalyzer.getControlActions 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 · ClassAnalyzer.addContextProperties (cyclomatic 87) · ×1
  • ClassAnalyzer.addContextProperties (cyclomatic 87) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:699 — ClassAnalyzer.addContextProperties has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AtomicMethodCallAnalyzer.analyze (cyclomatic 86) · ×1
  • AtomicMethodCallAnalyzer.analyze (cyclomatic 86) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php:69 — AtomicMethodCallAnalyzer.analyze has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ForeachAnalyzer.analyze (cyclomatic 85) · ×1
  • ForeachAnalyzer.analyze (cyclomatic 85) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:114 — ForeachAnalyzer.analyze has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SwitchCaseAnalyzer.analyze (cyclomatic 85) · ×1
  • SwitchCaseAnalyzer.analyze (cyclomatic 85) src/Psalm/Internal/Analyzer/Statements/Block/SwitchCaseAnalyzer.php:66 — SwitchCaseAnalyzer.analyze has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeExpander.expandAtomic (cyclomatic 85) · ×1
  • TypeExpander.expandAtomic (cyclomatic 85) src/Psalm/Internal/Type/TypeExpander.php:235 — TypeExpander.expandAtomic has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AtomicPropertyFetchAnalyzer.analyze (cyclomatic 84) · ×1
  • AtomicPropertyFetchAnalyzer.analyze (cyclomatic 84) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:89 — AtomicPropertyFetchAnalyzer.analyze 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 · VariableFetchAnalyzer.analyze (cyclomatic 83) · ×1
  • VariableFetchAnalyzer.analyze (cyclomatic 83) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php:71 — VariableFetchAnalyzer.analyze has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StatementsAnalyzer.analyzeStatement (cyclomatic 83) · ×1
  • StatementsAnalyzer.analyzeStatement (cyclomatic 83) src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:615 — StatementsAnalyzer.analyzeStatement has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionLikeDocblockScanner.addDocblockInfo (cyclomatic 83) · ×1
  • FunctionLikeDocblockScanner.addDocblockInfo (cyclomatic 83) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:94 — FunctionLikeDocblockScanner.addDocblockInfo has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Reconciler.getValueForKey (cyclomatic 83) · ×1
  • Reconciler.getValueForKey (cyclomatic 83) src/Psalm/Type/Reconciler.php:1206 — Reconciler.getValueForKey has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArrayFetchAnalyzer.getArrayAccessTypeGivenOffset (cyclomatic 82) · ×1
  • ArrayFetchAnalyzer.getArrayAccessTypeGivenOffset (cyclomatic 82) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:862 — ArrayFetchAnalyzer.getArrayAccessTypeGivenOffset 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 · BinaryOpAnalyzer.analyze (cyclomatic 80) · ×1
  • BinaryOpAnalyzer.analyze (cyclomatic 80) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php:54 — BinaryOpAnalyzer.analyze has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArgumentsAnalyzer.analyzeArguments (cyclomatic 80) · ×1
  • ArgumentsAnalyzer.analyzeArguments (cyclomatic 80) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:150 — ArgumentsAnalyzer.analyzeArguments has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArgumentAnalyzer.checkFunctionLikeTypeMatches (cyclomatic 79) · ×1
  • ArgumentAnalyzer.checkFunctionLikeTypeMatches (cyclomatic 79) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:300 — ArgumentAnalyzer.checkFunctionLikeTypeMatches has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TypeCombiner.combine (cyclomatic 78) · ×1
  • TypeCombiner.combine (cyclomatic 78) src/Psalm/Internal/Type/TypeCombiner.php:103 — TypeCombiner.combine has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionCallAnalyzer.analyze (cyclomatic 77) · ×1
  • FunctionCallAnalyzer.analyze (cyclomatic 77) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:113 — FunctionCallAnalyzer.analyze has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Functions.getCallMapFunctionCapabilities (cyclomatic 77) · ×1
  • Functions.getCallMapFunctionCapabilities (cyclomatic 77) src/Psalm/Internal/Codebase/Functions.php:458 — Functions.getCallMapFunctionCapabilities has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassAnalyzer.checkPropertyInitialization (cyclomatic 76) · ×1
  • ClassAnalyzer.checkPropertyInitialization (cyclomatic 76) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:1191 — ClassAnalyzer.checkPropertyInitialization has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StaticCallAnalyzer.analyze (cyclomatic 76) · ×1
  • StaticCallAnalyzer.analyze (cyclomatic 76) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php:51 — StaticCallAnalyzer.analyze has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConstantTypeResolver.resolve (cyclomatic 76) · ×1
  • ConstantTypeResolver.resolve (cyclomatic 76) src/Psalm/Internal/Codebase/ConstantTypeResolver.php:120 — ConstantTypeResolver.resolve has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassLikeNodeScanner.visitPropertyDeclaration (cyclomatic 76) · ×1
  • ClassLikeNodeScanner.visitPropertyDeclaration (cyclomatic 76) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1989 — ClassLikeNodeScanner.visitPropertyDeclaration has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArrayFetchAnalyzer.analyze (cyclomatic 75) · ×1
  • ArrayFetchAnalyzer.analyze (cyclomatic 75) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:152 — ArrayFetchAnalyzer.analyze has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassAnalyzer.analyzeClass (cyclomatic 73) · ×1
  • ClassAnalyzer.analyzeClass (cyclomatic 73) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:213 — ClassAnalyzer.analyzeClass has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArgumentsAnalyzer.handlePossiblyMatchingByRefParam (cyclomatic 73) · ×1
  • ArgumentsAnalyzer.handlePossiblyMatchingByRefParam (cyclomatic 73) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:1669 — ArgumentsAnalyzer.handlePossiblyMatchingByRefParam has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClassLikes.checkMethodReferences (cyclomatic 73) · ×1
  • ClassLikes.checkMethodReferences (cyclomatic 73) src/Psalm/Internal/Codebase/ClassLikes.php:2290 — ClassLikes.checkMethodReferences has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TemplateStandinTypeReplacer.handleTemplateParamStandin (cyclomatic 73) · ×1
  • TemplateStandinTypeReplacer.handleTemplateParamStandin (cyclomatic 73) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:735 — TemplateStandinTypeReplacer.handleTemplateParamStandin has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InstancePropertyFetchAnalyzer.analyze (cyclomatic 72) · ×1
  • InstancePropertyFetchAnalyzer.analyze (cyclomatic 72) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:69 — InstancePropertyFetchAnalyzer.analyze 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 · ArrayMergeReturnTypeProvider.getFunctionReturnType (cyclomatic 72) · ×1
  • ArrayMergeReturnTypeProvider.getFunctionReturnType (cyclomatic 72) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMergeReturnTypeProvider.php:48 — ArrayMergeReturnTypeProvider.getFunctionReturnType 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 · FileFilter.loadFromArray (cyclomatic 71) · ×1
  • FileFilter.loadFromArray (cyclomatic 71) src/Psalm/Config/FileFilter.php:116 — FileFilter.loadFromArray has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArrayAssignmentAnalyzer.updateArrayAssignmentChildType (cyclomatic 69) · ×1
  • ArrayAssignmentAnalyzer.updateArrayAssignmentChildType (cyclomatic 69) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:927 — ArrayAssignmentAnalyzer.updateArrayAssignmentChildType has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionLikeDocblockParser.parse (cyclomatic 68) · ×1
  • FunctionLikeDocblockParser.parse (cyclomatic 68) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:63 — FunctionLikeDocblockParser.parse 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 · IssueBuffer.finish (cyclomatic 68) · ×1
  • IssueBuffer.finish (cyclomatic 68) src/Psalm/IssueBuffer.php:748 — IssueBuffer.finish 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 · FunctionLikeAnalyzer.processParams (cyclomatic 67) · ×1
  • FunctionLikeAnalyzer.processParams (cyclomatic 67) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:1781 — FunctionLikeAnalyzer.processParams 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 · ForeachAnalyzer.handleIterable (cyclomatic 67) · ×1
  • ForeachAnalyzer.handleIterable (cyclomatic 67) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1578 — ForeachAnalyzer.handleIterable 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 · ExpressionResolver.getUnresolvedClassConstExpr (cyclomatic 67) · ×1
  • ExpressionResolver.getUnresolvedClassConstExpr (cyclomatic 67) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:74 — ExpressionResolver.getUnresolvedClassConstExpr 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 · ArrayColumnReturnTypeProvider.getFunctionReturnType (cyclomatic 67) · ×1
  • ArrayColumnReturnTypeProvider.getFunctionReturnType (cyclomatic 67) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayColumnReturnTypeProvider.php:58 — ArrayColumnReturnTypeProvider.getFunctionReturnType 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 · ClassStatementsDiffer.diff (cyclomatic 66) · ×1
  • ClassStatementsDiffer.diff (cyclomatic 66) src/Psalm/Internal/Diff/ClassStatementsDiffer.php:35 — ClassStatementsDiffer.diff 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 · TypeTokenizer.tokenize (cyclomatic 66) · ×1
  • TypeTokenizer.tokenize (cyclomatic 66) src/Psalm/Internal/Type/TypeTokenizer.php:142 — TypeTokenizer.tokenize 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 · Algebra.simplifyCNF (cyclomatic 64) · ×1
  • Algebra.simplifyCNF (cyclomatic 64) src/Psalm/Internal/Algebra.php:81 — Algebra.simplifyCNF has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AssignmentAnalyzer.analyzeAssignmentRef (cyclomatic 64) · ×1
  • AssignmentAnalyzer.analyzeAssignmentRef (cyclomatic 64) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1343 — AssignmentAnalyzer.analyzeAssignmentRef has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionCallReturnTypeFetcher.getReturnTypeFromCallMapWithArgs (cyclomatic 63) · ×1
  • FunctionCallReturnTypeFetcher.getReturnTypeFromCallMapWithArgs (cyclomatic 63) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:407 — FunctionCallReturnTypeFetcher.getReturnTypeFromCallMapWithArgs has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KeyedArrayComparator.isContainedBy (cyclomatic 63) · ×1
  • KeyedArrayComparator.isContainedBy (cyclomatic 63) src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:30 — KeyedArrayComparator.isContainedBy has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SimpleNegatedAssertionReconciler.reconcile (cyclomatic 63) · ×1
  • SimpleNegatedAssertionReconciler.reconcile (cyclomatic 63) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:85 — SimpleNegatedAssertionReconciler.reconcile has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExpressionScanner.registerClassMapFunctionCall (cyclomatic 62) · ×1
  • ExpressionScanner.registerClassMapFunctionCall (cyclomatic 62) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionScanner.php:204 — ExpressionScanner.registerClassMapFunctionCall 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 · AssertionReconciler.filterAtomicWithAnother (cyclomatic 62) · ×1
  • AssertionReconciler.filterAtomicWithAnother (cyclomatic 62) src/Psalm/Internal/Type/AssertionReconciler.php:1154 — AssertionReconciler.filterAtomicWithAnother 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 · MethodCallPurityAnalyzer.analyze (cyclomatic 61) · ×1
  • MethodCallPurityAnalyzer.analyze (cyclomatic 61) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php:356 — MethodCallPurityAnalyzer.analyze 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 · Type.intersectAtomicTypes (cyclomatic 61) · ×1
  • Type.intersectAtomicTypes (cyclomatic 61) src/Psalm/Type.php:1037 — Type.intersectAtomicTypes 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 · AssertionReconciler.refine (cyclomatic 60) · ×1
  • AssertionReconciler.refine (cyclomatic 60) src/Psalm/Internal/Type/AssertionReconciler.php:648 — AssertionReconciler.refine 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 · AtomicTypeComparator.canBeIdentical (cyclomatic 60) · ×1
  • AtomicTypeComparator.canBeIdentical (cyclomatic 60) src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php:1083 — AtomicTypeComparator.canBeIdentical has cyclomatic complexity 60 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Reconciler.addNestedAssertions (cyclomatic 60) · ×1
  • Reconciler.addNestedAssertions (cyclomatic 60) src/Psalm/Type/Reconciler.php:787 — Reconciler.addNestedAssertions 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 · FunctionCallAnalyzer.getAnalyzeNamedExpression (cyclomatic 59) · ×1
  • FunctionCallAnalyzer.getAnalyzeNamedExpression (cyclomatic 59) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1393 — FunctionCallAnalyzer.getAnalyzeNamedExpression 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 · ArrayFilterReturnTypeProvider.getFunctionReturnType (cyclomatic 59) · ×1
  • ArrayFilterReturnTypeProvider.getFunctionReturnType (cyclomatic 59) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php:56 — ArrayFilterReturnTypeProvider.getFunctionReturnType 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 · SprintfReturnTypeProvider.getFunctionReturnType (cyclomatic 59) · ×1
  • SprintfReturnTypeProvider.getFunctionReturnType (cyclomatic 59) src/Psalm/Internal/Provider/ReturnTypeProvider/SprintfReturnTypeProvider.php:54 — SprintfReturnTypeProvider.getFunctionReturnType 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 · TypeTokenizer.getFullyQualifiedTokens (cyclomatic 59) · ×1
  • TypeTokenizer.getFullyQualifiedTokens (cyclomatic 59) src/Psalm/Internal/Type/TypeTokenizer.php:441 — TypeTokenizer.getFullyQualifiedTokens 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 · FunctionLikeAnalyzer.getFunctionInformation (cyclomatic 58) · ×1
  • FunctionLikeAnalyzer.getFunctionInformation (cyclomatic 58) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2871 — FunctionLikeAnalyzer.getFunctionInformation 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 · ExpressionAnalyzer.handleExpression (cyclomatic 58) · ×1
  • ExpressionAnalyzer.handleExpression (cyclomatic 58) src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php:241 — ExpressionAnalyzer.handleExpression has cyclomatic complexity 58 (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 · SimpleAssertionReconciler.reconcileAssertion (cyclomatic 58) · ×1
  • SimpleAssertionReconciler.reconcileAssertion (cyclomatic 58) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:158 — SimpleAssertionReconciler.reconcileAssertion has cyclomatic complexity 58 (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 · AssignmentAnalyzer.analyzeDestructuringAssignment (cyclomatic 57) · ×1
  • AssignmentAnalyzer.analyzeDestructuringAssignment (cyclomatic 57) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:2456 — AssignmentAnalyzer.analyzeDestructuringAssignment 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 · ArrayFunctionArgumentsAnalyzer.handleSplice (cyclomatic 57) · ×1
  • ArrayFunctionArgumentsAnalyzer.handleSplice (cyclomatic 57) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:368 — ArrayFunctionArgumentsAnalyzer.handleSplice 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 · StaticPropertyFetchAnalyzer.analyze (cyclomatic 57) · ×1
  • StaticPropertyFetchAnalyzer.analyze (cyclomatic 57) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/StaticPropertyFetchAnalyzer.php:49 — StaticPropertyFetchAnalyzer.analyze 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 · LanguageServer.run (cyclomatic 57) · ×1
  • LanguageServer.run (cyclomatic 57) src/Psalm/Internal/Cli/LanguageServer.php:65 — LanguageServer.run has cyclomatic complexity 57 (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 · Populator.populateClassLikeStorage (cyclomatic 57) · ×1
  • Populator.populateClassLikeStorage (cyclomatic 57) src/Psalm/Internal/Codebase/Populator.php:529 — Populator.populateClassLikeStorage 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 · ClosureAnalyzer.analyzeExpression (cyclomatic 56) · ×1
  • ClosureAnalyzer.analyzeExpression (cyclomatic 56) src/Psalm/Internal/Analyzer/ClosureAnalyzer.php:332 — ClosureAnalyzer.analyzeExpression 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 · ConcatAnalyzer.analyze (cyclomatic 56) · ×1
  • ConcatAnalyzer.analyze (cyclomatic 56) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:239 — ConcatAnalyzer.analyze 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 · ArrayFetchAnalyzer.handleArrayAccessOnKeyedArray (cyclomatic 56) · ×1
  • ArrayFetchAnalyzer.handleArrayAccessOnKeyedArray (cyclomatic 56) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1966 — ArrayFetchAnalyzer.handleArrayAccessOnKeyedArray 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 · Psalter.run (cyclomatic 56) · ×1
  • Psalter.run (cyclomatic 56) src/Psalm/Internal/Cli/Psalter.php:99 — Psalter.run 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 · GenericTypeComparator.isContainedBy (cyclomatic 56) · ×1
  • GenericTypeComparator.isContainedBy (cyclomatic 56) src/Psalm/Internal/Type/Comparator/GenericTypeComparator.php:26 — GenericTypeComparator.isContainedBy 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 · AssertionFinder.scrapeAssertions (cyclomatic 55) · ×1
  • AssertionFinder.scrapeAssertions (cyclomatic 55) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:154 — AssertionFinder.scrapeAssertions has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ObjectComparator.isIntersectionShallowlyContainedBy (cyclomatic 55) · ×1
  • ObjectComparator.isIntersectionShallowlyContainedBy (cyclomatic 55) src/Psalm/Internal/Type/Comparator/ObjectComparator.php:179 — ObjectComparator.isIntersectionShallowlyContainedBy has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SimpleAssertionReconciler.reconcileTruthyOrNonEmpty (cyclomatic 55) · ×1
  • SimpleAssertionReconciler.reconcileTruthyOrNonEmpty (cyclomatic 55) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:3051 — SimpleAssertionReconciler.reconcileTruthyOrNonEmpty has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ElseIfAnalyzer.analyze (cyclomatic 54) · ×1
  • ElseIfAnalyzer.analyze (cyclomatic 54) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:128 — ElseIfAnalyzer.analyze has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArrayAnalyzer.analyzeArrayItem (cyclomatic 54) · ×1
  • ArrayAnalyzer.analyzeArrayItem (cyclomatic 54) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:365 — ArrayAnalyzer.analyzeArrayItem has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AssertionFinder.getArrayKeyExistsAssertions (cyclomatic 54) · ×1
  • AssertionFinder.getArrayKeyExistsAssertions (cyclomatic 54) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4228 — AssertionFinder.getArrayKeyExistsAssertions has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionLikeNodeScanner.createStorageForFunctionLike (cyclomatic 54) · ×1
  • FunctionLikeNodeScanner.createStorageForFunctionLike (cyclomatic 54) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:1170 — FunctionLikeNodeScanner.createStorageForFunctionLike has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CallAnalyzer.applyAssertionsToContext (cyclomatic 53) · ×1
  • CallAnalyzer.applyAssertionsToContext (cyclomatic 53) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:951 — CallAnalyzer.applyAssertionsToContext 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 · InstancePropertyFetchAnalyzer.handleScopedProperty (cyclomatic 53) · ×1
  • InstancePropertyFetchAnalyzer.handleScopedProperty (cyclomatic 53) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:498 — InstancePropertyFetchAnalyzer.handleScopedProperty 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 · PartialParserVisitor.enterNode (cyclomatic 53) · ×1
  • PartialParserVisitor.enterNode (cyclomatic 53) src/Psalm/Internal/PhpVisitor/PartialParserVisitor.php:59 — PartialParserVisitor.enterNode 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 · NegatedAssertionReconciler.handleLiteralNegatedEquality (cyclomatic 53) · ×1
  • NegatedAssertionReconciler.handleLiteralNegatedEquality (cyclomatic 53) src/Psalm/Internal/Type/NegatedAssertionReconciler.php:384 — NegatedAssertionReconciler.handleLiteralNegatedEquality 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 · MethodComparator.compareMethodParams (cyclomatic 52) · ×1
  • MethodComparator.compareMethodParams (cyclomatic 52) src/Psalm/Internal/Analyzer/MethodComparator.php:700 — MethodComparator.compareMethodParams 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 · BreakAnalyzer.analyze (cyclomatic 52) · ×1
  • BreakAnalyzer.analyze (cyclomatic 52) src/Psalm/Internal/Analyzer/Statements/BreakAnalyzer.php:26 — BreakAnalyzer.analyze 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 · ArgumentsAnalyzer.handleClosureArg (cyclomatic 52) · ×1
  • ArgumentsAnalyzer.handleClosureArg (cyclomatic 52) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:625 — ArgumentsAnalyzer.handleClosureArg 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 · AtomicStaticCallAnalyzer.analyze (cyclomatic 52) · ×1
  • AtomicStaticCallAnalyzer.analyze (cyclomatic 52) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php:79 — AtomicStaticCallAnalyzer.analyze 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 · ExpressionIdentifier.getExtendedVarId (cyclomatic 52) · ×1
  • ExpressionIdentifier.getExtendedVarId (cyclomatic 52) src/Psalm/Internal/Analyzer/Statements/Expression/ExpressionIdentifier.php:160 — ExpressionIdentifier.getExtendedVarId 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 · TypeExpander.expandNamedObject (cyclomatic 52) · ×1
  • TypeExpander.expandNamedObject (cyclomatic 52) src/Psalm/Internal/Type/TypeExpander.php:834 — TypeExpander.expandNamedObject 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 · MatchAnalyzer.analyze (cyclomatic 51) · ×1
  • MatchAnalyzer.analyze (cyclomatic 51) src/Psalm/Internal/Analyzer/Statements/Expression/MatchAnalyzer.php:55 — MatchAnalyzer.analyze 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 · ClassTemplateParamCollector.collect (cyclomatic 50) · ×1
  • ClassTemplateParamCollector.collect (cyclomatic 50) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ClassTemplateParamCollector.php:37 — ClassTemplateParamCollector.collect has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArrayReduceReturnTypeProvider.getFunctionReturnType (cyclomatic 50) · ×1
  • ArrayReduceReturnTypeProvider.getFunctionReturnType (cyclomatic 50) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReduceReturnTypeProvider.php:49 — ArrayReduceReturnTypeProvider.getFunctionReturnType has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CallableTypeComparator.isContainedBy (cyclomatic 50) · ×1
  • CallableTypeComparator.isContainedBy (cyclomatic 50) src/Psalm/Internal/Type/Comparator/CallableTypeComparator.php:58 — CallableTypeComparator.isContainedBy has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MethodComparator.compare (cyclomatic 49) · ×1
  • MethodComparator.compare (cyclomatic 49) src/Psalm/Internal/Analyzer/MethodComparator.php:65 — MethodComparator.compare has cyclomatic complexity 49 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · InstancePropertyAssignmentAnalyzer.analyze (cyclomatic 49) · ×1
  • InstancePropertyAssignmentAnalyzer.analyze (cyclomatic 49) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:106 — InstancePropertyAssignmentAnalyzer.analyze has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Analyzer.shiftFileOffsets (cyclomatic 49) · ×1
  • Analyzer.shiftFileOffsets (cyclomatic 49) src/Psalm/Internal/Codebase/Analyzer.php:706 — Analyzer.shiftFileOffsets has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionLikeDocblockScanner.improveParamsFromDocblock (cyclomatic 49) · ×1
  • FunctionLikeDocblockScanner.improveParamsFromDocblock (cyclomatic 49) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:972 — FunctionLikeDocblockScanner.improveParamsFromDocblock has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArrayMapReturnTypeProvider.getFunctionReturnType (cyclomatic 49) · ×1
  • ArrayMapReturnTypeProvider.getFunctionReturnType (cyclomatic 49) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMapReturnTypeProvider.php:78 — ArrayMapReturnTypeProvider.getFunctionReturnType has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IfAnalyzer.analyze (cyclomatic 48) · ×1
  • IfAnalyzer.analyze (cyclomatic 48) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/IfAnalyzer.php:60 — IfAnalyzer.analyze 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 · FunctionDocblockManipulator.__construct (cyclomatic 48) · ×1
  • FunctionDocblockManipulator.__construct (cyclomatic 48) src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:125 — FunctionDocblockManipulator.__construct 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 · ArrayTypeComparator.isContainedBy (cyclomatic 48) · ×1
  • ArrayTypeComparator.isContainedBy (cyclomatic 48) src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php:29 — ArrayTypeComparator.isContainedBy 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 · TemplateStandinTypeReplacer.handleAtomicStandin (cyclomatic 48) · ×1
  • TemplateStandinTypeReplacer.handleAtomicStandin (cyclomatic 48) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:222 — TemplateStandinTypeReplacer.handleAtomicStandin 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 · ClassAnalyzer.checkImplementedInterfaces (cyclomatic 47) · ×1
  • ClassAnalyzer.checkImplementedInterfaces (cyclomatic 47) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:2375 — ClassAnalyzer.checkImplementedInterfaces 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 · AssertionFinder.processCustomAssertion (cyclomatic 47) · ×1
  • AssertionFinder.processCustomAssertion (cyclomatic 47) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1116 — AssertionFinder.processCustomAssertion 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 · ArgumentsAnalyzer.checkArgCount (cyclomatic 47) · ×1
  • ArgumentsAnalyzer.checkArgCount (cyclomatic 47) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:2532 — ArgumentsAnalyzer.checkArgCount 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 · CastAnalyzer.analyze (cyclomatic 47) · ×1
  • CastAnalyzer.analyze (cyclomatic 47) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:89 — CastAnalyzer.analyze 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 · ConstFetchAnalyzer.getGlobalConstType (cyclomatic 47) · ×1
  • ConstFetchAnalyzer.getGlobalConstType (cyclomatic 47) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ConstFetchAnalyzer.php:169 — ConstFetchAnalyzer.getGlobalConstType has cyclomatic complexity 47 (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 · TemplateInferredTypeReplacer.replace (cyclomatic 47) · ×1
  • TemplateInferredTypeReplacer.replace (cyclomatic 47) src/Psalm/Internal/Type/TemplateInferredTypeReplacer.php:58 — TemplateInferredTypeReplacer.replace 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 · TypeParser.getTypeFromKeyedArrayTree (cyclomatic 47) · ×1
  • TypeParser.getTypeFromKeyedArrayTree (cyclomatic 47) src/Psalm/Internal/Type/TypeParser.php:2416 — TypeParser.getTypeFromKeyedArrayTree 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 · ClassLikeAnalyzer.checkFullyQualifiedClassLikeName (cyclomatic 46) · ×1
  • ClassLikeAnalyzer.checkFullyQualifiedClassLikeName (cyclomatic 46) src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:335 — ClassLikeAnalyzer.checkFullyQualifiedClassLikeName has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CommentAnalyzer.splitDocLine (cyclomatic 46) · ×1
  • CommentAnalyzer.splitDocLine (cyclomatic 46) src/Psalm/Internal/Analyzer/CommentAnalyzer.php:299 — CommentAnalyzer.splitDocLine has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SwitchAnalyzer.analyze (cyclomatic 46) · ×1
  • SwitchAnalyzer.analyze (cyclomatic 46) src/Psalm/Internal/Analyzer/Statements/Block/SwitchAnalyzer.php:29 — SwitchAnalyzer.analyze has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArithmeticOpAnalyzer.analyze (cyclomatic 46) · ×1
  • ArithmeticOpAnalyzer.analyze (cyclomatic 46) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:84 — ArithmeticOpAnalyzer.analyze has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TernaryAnalyzer.analyze (cyclomatic 46) · ×1
  • TernaryAnalyzer.analyze (cyclomatic 46) src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php:48 — TernaryAnalyzer.analyze has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionDocblockManipulator.getDocblock (cyclomatic 46) · ×1
  • FunctionDocblockManipulator.getDocblock (cyclomatic 46) src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:344 — FunctionDocblockManipulator.getDocblock has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CallableTypeComparator.getCallableMethodIdFromTKeyedArray (cyclomatic 46) · ×1
  • CallableTypeComparator.getCallableMethodIdFromTKeyedArray (cyclomatic 46) src/Psalm/Internal/Type/Comparator/CallableTypeComparator.php:897 — CallableTypeComparator.getCallableMethodIdFromTKeyedArray has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ForeachAnalyzer.checkIteratorType (cyclomatic 45) · ×1
  • ForeachAnalyzer.checkIteratorType (cyclomatic 45) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1216 — ForeachAnalyzer.checkIteratorType 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 · ElseAnalyzer.analyze (cyclomatic 45) · ×1
  • ElseAnalyzer.analyze (cyclomatic 45) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php:40 — ElseAnalyzer.analyze 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 · IncludeAnalyzer.analyze (cyclomatic 45) · ×1
  • IncludeAnalyzer.analyze (cyclomatic 45) src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php:60 — IncludeAnalyzer.analyze 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 · ClassLikes.consolidateAnalyzedData (cyclomatic 45) · ×1
  • ClassLikes.consolidateAnalyzedData (cyclomatic 45) src/Psalm/Internal/Codebase/ClassLikes.php:864 — ClassLikes.consolidateAnalyzedData 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 · ArrayMultisortParamsProvider.getFunctionParams (cyclomatic 45) · ×1
  • ArrayMultisortParamsProvider.getFunctionParams (cyclomatic 45) src/Psalm/Internal/Provider/ParamsProvider/ArrayMultisortParamsProvider.php:58 — ArrayMultisortParamsProvider.getFunctionParams 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 · AssertionFinder.hasGetClassCheck (cyclomatic 44) · ×1
  • AssertionFinder.hasGetClassCheck (cyclomatic 44) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1632 — AssertionFinder.hasGetClassCheck has cyclomatic complexity 44 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ArgumentAnalyzer.verifyExplicitParam (cyclomatic 44) · ×1
  • ArgumentAnalyzer.verifyExplicitParam (cyclomatic 44) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:1744 — ArgumentAnalyzer.verifyExplicitParam 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 · Refactor.run (cyclomatic 44) · ×1
  • Refactor.run (cyclomatic 44) src/Psalm/Internal/Cli/Refactor.php:69 — Refactor.run 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 · Analyzer.loadCachedResults (cyclomatic 44) · ×1
  • Analyzer.loadCachedResults (cyclomatic 44) src/Psalm/Internal/Codebase/Analyzer.php:419 — Analyzer.loadCachedResults 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 · Methods.getMethodParams (cyclomatic 44) · ×1
  • Methods.getMethodParams (cyclomatic 44) src/Psalm/Internal/Codebase/Methods.php:282 — Methods.getMethodParams 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 · Type.combineUnionTypes (cyclomatic 44) · ×1
  • Type.combineUnionTypes (cyclomatic 44) src/Psalm/Type.php:649 — Type.combineUnionTypes 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 · Transpiler.docType (cyclomatic 43) · ×1
  • Transpiler.docType (cyclomatic 43) bin/hack-conformance/Transpiler.php:729 — Transpiler.docType has cyclomatic complexity 43 (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 · ClassLikeAnalyzer.checkTemplateParams (cyclomatic 43) · ×1
  • ClassLikeAnalyzer.checkTemplateParams (cyclomatic 43) src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:951 — ClassLikeAnalyzer.checkTemplateParams has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FunctionCallReturnTypeFetcher.fetch (cyclomatic 43) · ×1
  • FunctionCallReturnTypeFetcher.fetch (cyclomatic 43) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:84 — FunctionCallReturnTypeFetcher.fetch has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · YieldAnalyzer.analyze (cyclomatic 43) · ×1
  • YieldAnalyzer.analyze (cyclomatic 43) src/Psalm/Internal/Analyzer/Statements/Expression/YieldAnalyzer.php:37 — YieldAnalyzer.analyze has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Populator.populateOverriddenMethods (cyclomatic 43) · ×1
  • Populator.populateOverriddenMethods (cyclomatic 43) src/Psalm/Internal/Codebase/Populator.php:776 — Populator.populateOverriddenMethods has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AssertionFinder.processFunctionCall (cyclomatic 42) · ×1
  • AssertionFinder.processFunctionCall (cyclomatic 42) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:798 — AssertionFinder.processFunctionCall 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 · AssignmentAnalyzer.assignByRefParam (cyclomatic 42) · ×1
  • AssignmentAnalyzer.assignByRefParam (cyclomatic 42) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1995 — AssignmentAnalyzer.assignByRefParam 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 · ArgumentAnalyzer.processTaintedness (cyclomatic 42) · ×1
  • ArgumentAnalyzer.processTaintedness (cyclomatic 42) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:2068 — ArgumentAnalyzer.processTaintedness has cyclomatic complexity 42 (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 · NewAnalyzer.getNewType (cyclomatic 42) · ×1
  • NewAnalyzer.getNewType (cyclomatic 42) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1544 — NewAnalyzer.getNewType 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 · EncapsulatedStringAnalyzer.analyze (cyclomatic 42) · ×1
  • EncapsulatedStringAnalyzer.analyze (cyclomatic 42) src/Psalm/Internal/Analyzer/Statements/Expression/EncapsulatedStringAnalyzer.php:37 — EncapsulatedStringAnalyzer.analyze 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 · FunctionLikeDocblockScanner.handleReturn (cyclomatic 42) · ×1
  • FunctionLikeDocblockScanner.handleReturn (cyclomatic 42) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:1222 — FunctionLikeDocblockScanner.handleReturn 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 · ParseTreeCreator.create (cyclomatic 42) · ×1
  • ParseTreeCreator.create (cyclomatic 42) src/Psalm/Internal/Type/ParseTreeCreator.php:72 — ParseTreeCreator.create has cyclomatic complexity 42 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · SimpleNegatedAssertionReconciler.reconcileFalsyOrEmpty (cyclomatic 42) · ×1
  • SimpleNegatedAssertionReconciler.reconcileFalsyOrEmpty (cyclomatic 42) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:938 — SimpleNegatedAssertionReconciler.reconcileFalsyOrEmpty 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 · MethodComparator.compareMethodSignatureParams (cyclomatic 41) · ×1
  • MethodComparator.compareMethodSignatureParams (cyclomatic 41) src/Psalm/Internal/Analyzer/MethodComparator.php:963 — MethodComparator.compareMethodSignatureParams 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 · CallAnalyzer.collectSpecialInformation (cyclomatic 41) · ×1
  • CallAnalyzer.collectSpecialInformation (cyclomatic 41) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:86 — CallAnalyzer.collectSpecialInformation 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 · ArrayFetchAnalyzer.handleArrayAccessOnTArray (cyclomatic 41) · ×1
  • ArrayFetchAnalyzer.handleArrayAccessOnTArray (cyclomatic 41) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1672 — ArrayFetchAnalyzer.handleArrayAccessOnTArray 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 · DocblockParser.resolveTags (cyclomatic 41) · ×1
  • DocblockParser.resolveTags (cyclomatic 41) src/Psalm/Internal/Scanner/DocblockParser.php:171 — DocblockParser.resolveTags has cyclomatic complexity 41 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ArrayAssignmentAnalyzer.taintArrayAssignment (cyclomatic 40) · ×1
  • ArrayAssignmentAnalyzer.taintArrayAssignment (cyclomatic 40) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:685 — ArrayAssignmentAnalyzer.taintArrayAssignment has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArrayFunctionArgumentsAnalyzer.checkClosureTypeArgs (cyclomatic 40) · ×1
  • ArrayFunctionArgumentsAnalyzer.checkClosureTypeArgs (cyclomatic 40) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:956 — ArrayFunctionArgumentsAnalyzer.checkClosureTypeArgs has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MethodCallReturnTypeFetcher.fetch (cyclomatic 40) · ×1
  • MethodCallReturnTypeFetcher.fetch (cyclomatic 40) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php:60 — MethodCallReturnTypeFetcher.fetch has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NamedFunctionCallHandler.handleExtract (cyclomatic 40) · ×1
  • NamedFunctionCallHandler.handleExtract (cyclomatic 40) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:562 — NamedFunctionCallHandler.handleExtract has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TaintFlowResolution.getNextOpenAssignments (cyclomatic 40) · ×1
  • TaintFlowResolution.getNextOpenAssignments (cyclomatic 40) src/Psalm/Internal/Codebase/TaintFlowResolution.php:1380 — TaintFlowResolution.getNextOpenAssignments has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArithmeticOpAnalyzer.analyzeMulBetweenIntRange (cyclomatic 39) · ×1
  • ArithmeticOpAnalyzer.analyzeMulBetweenIntRange (cyclomatic 39) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1570 — ArithmeticOpAnalyzer.analyzeMulBetweenIntRange 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 · OrAnalyzer.analyze (cyclomatic 39) · ×1
  • OrAnalyzer.analyze (cyclomatic 39) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/OrAnalyzer.php:44 — OrAnalyzer.analyze 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 · ClassLikes.checkPropertyReferences (cyclomatic 39) · ×1
  • ClassLikes.checkPropertyReferences (cyclomatic 39) src/Psalm/Internal/Codebase/ClassLikes.php:2847 — ClassLikes.checkPropertyReferences 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 · FileStatementsDiffer.diff (cyclomatic 39) · ×1
  • FileStatementsDiffer.diff (cyclomatic 39) src/Psalm/Internal/Diff/FileStatementsDiffer.php:31 — FileStatementsDiffer.diff 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 · FunctionLikeDocblockParser.parseTaintTags (cyclomatic 39) · ×1
  • FunctionLikeDocblockParser.parseTaintTags (cyclomatic 39) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:476 — FunctionLikeDocblockParser.parseTaintTags 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 · Type.intersectUnionTypes (cyclomatic 39) · ×1
  • Type.intersectUnionTypes (cyclomatic 39) src/Psalm/Type.php:789 — Type.intersectUnionTypes 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 · ReturnTypeCollector.getReturnTypes (cyclomatic 38) · ×1
  • ReturnTypeCollector.getReturnTypes (cyclomatic 38) src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeCollector.php:38 — ReturnTypeCollector.getReturnTypes 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 · IfAnalyzer.updateIfScope (cyclomatic 38) · ×1
  • IfAnalyzer.updateIfScope (cyclomatic 38) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/IfAnalyzer.php:490 — IfAnalyzer.updateIfScope 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 · CastAnalyzer.castFloatAttempt (cyclomatic 38) · ×1
  • CastAnalyzer.castFloatAttempt (cyclomatic 38) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:549 — CastAnalyzer.castFloatAttempt 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 · Psalm.run (cyclomatic 38) · ×1
  • Psalm.run (cyclomatic 38) src/Psalm/Internal/Cli/Psalm.php:194 — Psalm.run has cyclomatic complexity 38 (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 · ArrayFilterParamsProvider.getFunctionParams (cyclomatic 38) · ×1
  • ArrayFilterParamsProvider.getFunctionParams (cyclomatic 38) src/Psalm/Internal/Provider/ParamsProvider/ArrayFilterParamsProvider.php:50 — ArrayFilterParamsProvider.getFunctionParams 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 · FunctionCallAnalyzer.checkFunctionCallPurity (cyclomatic 37) · ×1
  • FunctionCallAnalyzer.checkFunctionCallPurity (cyclomatic 37) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1928 — FunctionCallAnalyzer.checkFunctionCallPurity 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 · CastAnalyzer.castIntAttempt (cyclomatic 37) · ×1
  • CastAnalyzer.castIntAttempt (cyclomatic 37) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:354 — CastAnalyzer.castIntAttempt 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 · StatementsAnalyzer.checkUnreferencedVars (cyclomatic 37) · ×1
  • StatementsAnalyzer.checkUnreferencedVars (cyclomatic 37) src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:1045 — StatementsAnalyzer.checkUnreferencedVars 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 · CliUtils.getPathsToCheck (cyclomatic 37) · ×1
  • CliUtils.getPathsToCheck (cyclomatic 37) src/Psalm/Internal/CliUtils.php:462 — CliUtils.getPathsToCheck 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 · Methods.methodExists (cyclomatic 37) · ×1
  • Methods.methodExists (cyclomatic 37) src/Psalm/Internal/Codebase/Methods.php:95 — Methods.methodExists 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 · ClassLikeNodeScanner.visitClassConstDeclaration (cyclomatic 37) · ×1
  • ClassLikeNodeScanner.visitClassConstDeclaration (cyclomatic 37) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1640 — ClassLikeNodeScanner.visitClassConstDeclaration 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 · TypeVariableTracker.reconcileLowerBoundsWithUpperBounds (cyclomatic 37) · ×1
  • TypeVariableTracker.reconcileLowerBoundsWithUpperBounds (cyclomatic 37) src/Psalm/Internal/Type/TypeVariableTracker.php:246 — TypeVariableTracker.reconcileLowerBoundsWithUpperBounds 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 · ArrayAssignmentAnalyzer.updateArrayType (cyclomatic 36) · ×1
  • ArrayAssignmentAnalyzer.updateArrayType (cyclomatic 36) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:127 — ArrayAssignmentAnalyzer.updateArrayType 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 · NonComparisonOpAnalyzer.analyze (cyclomatic 36) · ×1
  • NonComparisonOpAnalyzer.analyze (cyclomatic 36) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/NonComparisonOpAnalyzer.php:23 — NonComparisonOpAnalyzer.analyze 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 · ArgumentsAnalyzer.evaluateArbitraryParam (cyclomatic 36) · ×1
  • ArgumentsAnalyzer.evaluateArbitraryParam (cyclomatic 36) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:2056 — ArgumentsAnalyzer.evaluateArbitraryParam has cyclomatic complexity 36 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ArgumentsAnalyzer.handleByRefFunctionArg (cyclomatic 36) · ×1
  • ArgumentsAnalyzer.handleByRefFunctionArg (cyclomatic 36) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:2223 — ArgumentsAnalyzer.handleByRefFunctionArg 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 · AtomicMethodCallAnalyzer.handleInvalidClass (cyclomatic 36) · ×1
  • AtomicMethodCallAnalyzer.handleInvalidClass (cyclomatic 36) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php:722 — AtomicMethodCallAnalyzer.handleInvalidClass 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 · MethodVisibilityAnalyzer.analyze (cyclomatic 36) · ×1
  • MethodVisibilityAnalyzer.analyze (cyclomatic 36) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodVisibilityAnalyzer.php:31 — MethodVisibilityAnalyzer.analyze 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 · ArrayFetchAnalyzer.taintArrayFetch (cyclomatic 36) · ×1
  • ArrayFetchAnalyzer.taintArrayFetch (cyclomatic 36) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:615 — ArrayFetchAnalyzer.taintArrayFetch 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 · InternalCallMapHandler.getMatchingCallableFromCallMapOptions (cyclomatic 36) · ×1
  • InternalCallMapHandler.getMatchingCallableFromCallMapOptions (cyclomatic 36) src/Psalm/Internal/Codebase/InternalCallMapHandler.php:134 — InternalCallMapHandler.getMatchingCallableFromCallMapOptions 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 · ReflectorVisitor.recordExternalEffects (cyclomatic 36) · ×1
  • ReflectorVisitor.recordExternalEffects (cyclomatic 36) src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:521 — ReflectorVisitor.recordExternalEffects has cyclomatic complexity 36 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SimpleNameResolver.enterNode (cyclomatic 36) · ×1
  • SimpleNameResolver.enterNode (cyclomatic 36) src/Psalm/Internal/PhpVisitor/SimpleNameResolver.php:60 — SimpleNameResolver.enterNode 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 · AssertionReconciler.reconcile (cyclomatic 36) · ×1
  • AssertionReconciler.reconcile (cyclomatic 36) src/Psalm/Internal/Type/AssertionReconciler.php:113 — AssertionReconciler.reconcile 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 · CallableTypeComparator.getCallableFromAtomic (cyclomatic 36) · ×1
  • CallableTypeComparator.getCallableFromAtomic (cyclomatic 36) src/Psalm/Internal/Type/Comparator/CallableTypeComparator.php:554 — CallableTypeComparator.getCallableFromAtomic 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 · TemplateInferredTypeReplacer.replaceConditional (cyclomatic 36) · ×1
  • TemplateInferredTypeReplacer.replaceConditional (cyclomatic 36) src/Psalm/Internal/Type/TemplateInferredTypeReplacer.php:453 — TemplateInferredTypeReplacer.replaceConditional 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 · TypeParser.getTypeFromTree (cyclomatic 36) · ×1
  • TypeParser.getTypeFromTree (cyclomatic 36) src/Psalm/Internal/Type/TypeParser.php:394 — TypeParser.getTypeFromTree 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 · Transpiler.emit (cyclomatic 35) · ×1
  • Transpiler.emit (cyclomatic 35) bin/hack-conformance/Transpiler.php:1443 — Transpiler.emit 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 · LoopAnalyzer.setLoopVars (cyclomatic 35) · ×1
  • LoopAnalyzer.setLoopVars (cyclomatic 35) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:1284 — LoopAnalyzer.setLoopVars 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 · AssignmentAnalyzer.getReferencedPropertyType (cyclomatic 35) · ×1
  • AssignmentAnalyzer.getReferencedPropertyType (cyclomatic 35) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1690 — AssignmentAnalyzer.getReferencedPropertyType 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 · AssignmentAnalyzer.analyzeAssignmentToVariable (cyclomatic 35) · ×1
  • AssignmentAnalyzer.analyzeAssignmentToVariable (cyclomatic 35) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:2926 — AssignmentAnalyzer.analyzeAssignmentToVariable 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 · ArrayFunctionArgumentsAnalyzer.handleAddition (cyclomatic 35) · ×1
  • ArrayFunctionArgumentsAnalyzer.handleAddition (cyclomatic 35) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:149 — ArrayFunctionArgumentsAnalyzer.handleAddition 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 · NewAnalyzer.analyze (cyclomatic 35) · ×1
  • NewAnalyzer.analyze (cyclomatic 35) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:145 — NewAnalyzer.analyze 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 · AtomicPropertyFetchAnalyzer.handleNonExistentClass (cyclomatic 35) · ×1
  • AtomicPropertyFetchAnalyzer.handleNonExistentClass (cyclomatic 35) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:1367 — AtomicPropertyFetchAnalyzer.handleNonExistentClass 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 · FilterInputReturnTypeProvider.getFunctionReturnType (cyclomatic 35) · ×1
  • FilterInputReturnTypeProvider.getFunctionReturnType (cyclomatic 35) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php:51 — FilterInputReturnTypeProvider.getFunctionReturnType 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 · MinMaxReturnTypeProvider.getFunctionReturnType (cyclomatic 35) · ×1
  • MinMaxReturnTypeProvider.getFunctionReturnType (cyclomatic 35) src/Psalm/Internal/Provider/ReturnTypeProvider/MinMaxReturnTypeProvider.php:43 — MinMaxReturnTypeProvider.getFunctionReturnType 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 · Codebase.getCompletionItemsForClassishThing (cyclomatic 34) · ×1
  • Codebase.getCompletionItemsForClassishThing (cyclomatic 34) src/Psalm/Codebase.php:2366 — Codebase.getCompletionItemsForClassishThing 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 · Algebra.getTruthsFromFormula (cyclomatic 34) · ×1
  • Algebra.getTruthsFromFormula (cyclomatic 34) src/Psalm/Internal/Algebra.php:342 — Algebra.getTruthsFromFormula 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 · InstancePropertyAssignmentAnalyzer.analyzeRegularAssignment (cyclomatic 34) · ×1
  • InstancePropertyAssignmentAnalyzer.analyzeRegularAssignment (cyclomatic 34) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:995 — InstancePropertyAssignmentAnalyzer.analyzeRegularAssignment 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 · ArgumentAnalyzer.coerceValueAfterGatekeeperArgument (cyclomatic 34) · ×1
  • ArgumentAnalyzer.coerceValueAfterGatekeeperArgument (cyclomatic 34) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:1933 — ArgumentAnalyzer.coerceValueAfterGatekeeperArgument 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 · MethodCallReturnTypeFetcher.taintMethodCallResult (cyclomatic 34) · ×1
  • MethodCallReturnTypeFetcher.taintMethodCallResult (cyclomatic 34) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php:455 — MethodCallReturnTypeFetcher.taintMethodCallResult 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 · FunctionLikeDocblockScanner.handleAssertions (cyclomatic 34) · ×1
  • FunctionLikeDocblockScanner.handleAssertions (cyclomatic 34) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:1649 — FunctionLikeDocblockScanner.handleAssertions 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 · ReflectorVisitor.leaveNode (cyclomatic 34) · ×1
  • ReflectorVisitor.leaveNode (cyclomatic 34) src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:779 — ReflectorVisitor.leaveNode 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 · AssertionReconciler.handleIsA (cyclomatic 34) · ×1
  • AssertionReconciler.handleIsA (cyclomatic 34) src/Psalm/Internal/Type/AssertionReconciler.php:2276 — AssertionReconciler.handleIsA 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 · ParseTreeCreator.handleValue (cyclomatic 34) · ×1
  • ParseTreeCreator.handleValue (cyclomatic 34) src/Psalm/Internal/Type/ParseTreeCreator.php:1012 — ParseTreeCreator.handleValue 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 · SimpleAssertionReconciler.reconcileList (cyclomatic 34) · ×1
  • SimpleAssertionReconciler.reconcileList (cyclomatic 34) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2615 — SimpleAssertionReconciler.reconcileList 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 · Reconciler.reconcileAbsentArrayValue (cyclomatic 34) · ×1
  • Reconciler.reconcileAbsentArrayValue (cyclomatic 34) src/Psalm/Type/Reconciler.php:1818 — Reconciler.reconcileAbsentArrayValue 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 · ClassLikeAnalyzer.checkPropertyVisibility (cyclomatic 33) · ×1
  • ClassLikeAnalyzer.checkPropertyVisibility (cyclomatic 33) src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:698 — ClassLikeAnalyzer.checkPropertyVisibility 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 · AssertionFinder.getTrueInequalityAssertions (cyclomatic 33) · ×1
  • AssertionFinder.getTrueInequalityAssertions (cyclomatic 33) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2570 — AssertionFinder.getTrueInequalityAssertions 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 · AssertionFinder.getIsaAssertions (cyclomatic 33) · ×1
  • AssertionFinder.getIsaAssertions (cyclomatic 33) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3909 — AssertionFinder.getIsaAssertions 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 · ConcatAnalyzer.analyzeOperand (cyclomatic 33) · ×1
  • ConcatAnalyzer.analyzeOperand (cyclomatic 33) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:525 — ConcatAnalyzer.analyzeOperand 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 · IncludeAnalyzer.getPathTo (cyclomatic 33) · ×1
  • IncludeAnalyzer.getPathTo (cyclomatic 33) src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php:347 — IncludeAnalyzer.getPathTo 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 · Scanner.scanFile (cyclomatic 33) · ×1
  • Scanner.scanFile (cyclomatic 33) src/Psalm/Internal/Codebase/Scanner.php:693 — Scanner.scanFile 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 · AssignmentMapVisitor.enterNode (cyclomatic 33) · ×1
  • AssignmentMapVisitor.enterNode (cyclomatic 33) src/Psalm/Internal/PhpVisitor/AssignmentMapVisitor.php:45 — AssignmentMapVisitor.enterNode 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 · ImplodeReturnTypeProvider.getFunctionReturnType (cyclomatic 33) · ×1
  • ImplodeReturnTypeProvider.getFunctionReturnType (cyclomatic 33) src/Psalm/Internal/Provider/ReturnTypeProvider/ImplodeReturnTypeProvider.php:50 — ImplodeReturnTypeProvider.getFunctionReturnType 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 · TypeCombiner.handleKeyedArrayEntries (cyclomatic 33) · ×1
  • TypeCombiner.handleKeyedArrayEntries (cyclomatic 33) src/Psalm/Internal/Type/TypeCombiner.php:1778 — TypeCombiner.handleKeyedArrayEntries 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 · MutableUnion.substitute (cyclomatic 33) · ×1
  • MutableUnion.substitute (cyclomatic 33) src/Psalm/Type/MutableUnion.php:356 — MutableUnion.substitute 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 · Algebra.combineOredClauses (cyclomatic 32) · ×1
  • Algebra.combineOredClauses (cyclomatic 32) src/Psalm/Internal/Algebra.php:594 — Algebra.combineOredClauses 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 · ProjectAnalyzer.interpretRefactors (cyclomatic 32) · ×1
  • ProjectAnalyzer.interpretRefactors (cyclomatic 32) src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:591 — ProjectAnalyzer.interpretRefactors 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 · AssertionFinder.scrapeEqualityAssertions (cyclomatic 32) · ×1
  • AssertionFinder.scrapeEqualityAssertions (cyclomatic 32) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:408 — AssertionFinder.scrapeEqualityAssertions 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 · AssertionFinder.getFalseEqualityAssertions (cyclomatic 32) · ×1
  • AssertionFinder.getFalseEqualityAssertions (cyclomatic 32) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3333 — AssertionFinder.getFalseEqualityAssertions 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 · StaticPropertyAssignmentAnalyzer.analyze (cyclomatic 32) · ×1
  • StaticPropertyAssignmentAnalyzer.analyze (cyclomatic 32) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/StaticPropertyAssignmentAnalyzer.php:46 — StaticPropertyAssignmentAnalyzer.analyze 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 · ArrayFunctionArgumentsAnalyzer.handleByRefArrayAdjustment (cyclomatic 32) · ×1
  • ArrayFunctionArgumentsAnalyzer.handleByRefArrayAdjustment (cyclomatic 32) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:653 — ArrayFunctionArgumentsAnalyzer.handleByRefArrayAdjustment 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 · ArrayFunctionArgumentsAnalyzer.checkClosureType (cyclomatic 32) · ×1
  • ArrayFunctionArgumentsAnalyzer.checkClosureType (cyclomatic 32) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:792 — ArrayFunctionArgumentsAnalyzer.checkClosureType 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 · FunctionCallAnalyzer.handleNamedFunction (cyclomatic 32) · ×1
  • FunctionCallAnalyzer.handleNamedFunction (cyclomatic 32) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:788 — FunctionCallAnalyzer.handleNamedFunction 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 · FunctionCallReturnTypeFetcher.simpleExclusion (cyclomatic 32) · ×1
  • FunctionCallReturnTypeFetcher.simpleExclusion (cyclomatic 32) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:2039 — FunctionCallReturnTypeFetcher.simpleExclusion has cyclomatic complexity 32 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PartialApplicationAnalyzer.bind (cyclomatic 32) · ×1
  • PartialApplicationAnalyzer.bind (cyclomatic 32) src/Psalm/Internal/Analyzer/Statements/Expression/Call/PartialApplicationAnalyzer.php:294 — PartialApplicationAnalyzer.bind 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 · CastAnalyzer.castStringAttempt (cyclomatic 32) · ×1
  • CastAnalyzer.castStringAttempt (cyclomatic 32) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:740 — CastAnalyzer.castStringAttempt 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 · NamespaceStatementsDiffer.diff (cyclomatic 32) · ×1
  • NamespaceStatementsDiffer.diff (cyclomatic 32) src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php:31 — NamespaceStatementsDiffer.diff 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 · ExpressionResolver.functionEvaluatesToTrue (cyclomatic 32) · ×1
  • ExpressionResolver.functionEvaluatesToTrue (cyclomatic 32) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:446 — ExpressionResolver.functionEvaluatesToTrue 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 · TemplateStandinTypeReplacer.getMappedGenericTypeParams (cyclomatic 32) · ×1
  • TemplateStandinTypeReplacer.getMappedGenericTypeParams (cyclomatic 32) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:1506 — TemplateStandinTypeReplacer.getMappedGenericTypeParams 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 · TypeParser.intersectAtomicTypes (cyclomatic 32) · ×1
  • TypeParser.intersectAtomicTypes (cyclomatic 32) src/Psalm/Internal/Type/TypeParser.php:1825 — TypeParser.intersectAtomicTypes has cyclomatic complexity 32 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · FileAnalyzer.analyze (cyclomatic 31) · ×1
  • FileAnalyzer.analyze (cyclomatic 31) src/Psalm/Internal/Analyzer/FileAnalyzer.php:119 — FileAnalyzer.analyze 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 · ArrayAnalyzer.analyze (cyclomatic 31) · ×1
  • ArrayAnalyzer.analyze (cyclomatic 31) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:63 — ArrayAnalyzer.analyze 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 · AssertionFinder.getGetclassEqualityAssertions (cyclomatic 31) · ×1
  • AssertionFinder.getGetclassEqualityAssertions (cyclomatic 31) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3688 — AssertionFinder.getGetclassEqualityAssertions 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 · ArgumentAnalyzer.checkArgumentMatches (cyclomatic 31) · ×1
  • ArgumentAnalyzer.checkArgumentMatches (cyclomatic 31) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:155 — ArgumentAnalyzer.checkArgumentMatches 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 · DestructorAnalyzer.getHeldType (cyclomatic 31) · ×1
  • DestructorAnalyzer.getHeldType (cyclomatic 31) src/Psalm/Internal/Analyzer/Statements/Expression/DestructorAnalyzer.php:123 — DestructorAnalyzer.getHeldType 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 · SimpleTypeInferer.handleArrayItem (cyclomatic 31) · ×1
  • SimpleTypeInferer.handleArrayItem (cyclomatic 31) src/Psalm/Internal/Analyzer/Statements/Expression/SimpleTypeInferer.php:633 — SimpleTypeInferer.handleArrayItem 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 · UnusedAssignmentRemover.findAssignStmt (cyclomatic 31) · ×1
  • UnusedAssignmentRemover.findAssignStmt (cyclomatic 31) src/Psalm/Internal/Analyzer/Statements/UnusedAssignmentRemover.php:243 — UnusedAssignmentRemover.findAssignStmt 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 · Populator.inheritPropertyTypes (cyclomatic 31) · ×1
  • Populator.inheritPropertyTypes (cyclomatic 31) src/Psalm/Internal/Codebase/Populator.php:1909 — Populator.inheritPropertyTypes 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 · TaintFlowGraph.reportTaintedFlow (cyclomatic 31) · ×1
  • TaintFlowGraph.reportTaintedFlow (cyclomatic 31) src/Psalm/Internal/Codebase/TaintFlowGraph.php:1363 — TaintFlowGraph.reportTaintedFlow has cyclomatic complexity 31 (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 · TemplateStandinTypeReplacer.handleTemplateParamClassStandin (cyclomatic 31) · ×1
  • TemplateStandinTypeReplacer.handleTemplateParamClassStandin (cyclomatic 31) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:1141 — TemplateStandinTypeReplacer.handleTemplateParamClassStandin 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 · TypeCombiner.getArrayTypeFromGenericParams (cyclomatic 31) · ×1
  • TypeCombiner.getArrayTypeFromGenericParams (cyclomatic 31) src/Psalm/Internal/Type/TypeCombiner.php:1897 — TypeCombiner.getArrayTypeFromGenericParams 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 · Reconciler.adjustTKeyedArrayType (cyclomatic 31) · ×1
  • Reconciler.adjustTKeyedArrayType (cyclomatic 31) src/Psalm/Type/Reconciler.php:2021 — Reconciler.adjustTKeyedArrayType 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 · Codebase.getCompletionItemsForPartialSymbol (cyclomatic 30) · ×1
  • Codebase.getCompletionItemsForPartialSymbol (cyclomatic 30) src/Psalm/Codebase.php:2591 — Codebase.getCompletionItemsForPartialSymbol 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 · Config.getParentIssueType (cyclomatic 30) · ×1
  • Config.getParentIssueType (cyclomatic 30) src/Psalm/Config.php:2425 — Config.getParentIssueType has cyclomatic complexity 30 (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 · DoAnalyzer.getUnsureBounds (cyclomatic 30) · ×1
  • DoAnalyzer.getUnsureBounds (cyclomatic 30) src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php:338 — DoAnalyzer.getUnsureBounds 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 · AssertionFinder.getGetclassInequalityAssertions (cyclomatic 30) · ×1
  • AssertionFinder.getGetclassInequalityAssertions (cyclomatic 30) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2932 — AssertionFinder.getGetclassInequalityAssertions 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 · ArrayAssignmentAnalyzer.analyzeNestedArrayAssignment (cyclomatic 30) · ×1
  • ArrayAssignmentAnalyzer.analyzeNestedArrayAssignment (cyclomatic 30) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:1238 — ArrayAssignmentAnalyzer.analyzeNestedArrayAssignment 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 · AndAnalyzer.analyze (cyclomatic 30) · ×1
  • AndAnalyzer.analyze (cyclomatic 30) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/AndAnalyzer.php:41 — AndAnalyzer.analyze 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 · HighOrderFunctionArgHandler.getCallableArgInfo (cyclomatic 30) · ×1
  • HighOrderFunctionArgHandler.getCallableArgInfo (cyclomatic 30) src/Psalm/Internal/Analyzer/Statements/Expression/Call/HighOrderFunctionArgHandler.php:175 — HighOrderFunctionArgHandler.getCallableArgInfo 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 · NewAnalyzer.analyzeNamedConstructor (cyclomatic 30) · ×1
  • NewAnalyzer.analyzeNamedConstructor (cyclomatic 30) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:629 — NewAnalyzer.analyzeNamedConstructor 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 · ArrayFetchAnalyzer.handleArrayAccessOnNamedObject (cyclomatic 30) · ×1
  • ArrayFetchAnalyzer.handleArrayAccessOnNamedObject (cyclomatic 30) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2299 — ArrayFetchAnalyzer.handleArrayAccessOnNamedObject 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 · FreshObjectFinder.use (cyclomatic 30) · ×1
  • FreshObjectFinder.use (cyclomatic 30) src/Psalm/Internal/Analyzer/Statements/FreshObjectFinder.php:127 — FreshObjectFinder.use has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ExpressionResolver.enterConditional (cyclomatic 30) · ×1
  • ExpressionResolver.enterConditional (cyclomatic 30) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:369 — ExpressionResolver.enterConditional 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 · ExpressionScanner.scanGlobalWrites (cyclomatic 30) · ×1
  • ExpressionScanner.scanGlobalWrites (cyclomatic 30) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionScanner.php:114 — ExpressionScanner.scanGlobalWrites has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · StatementsProvider.getStatementsForFile (cyclomatic 30) · ×1
  • StatementsProvider.getStatementsForFile (cyclomatic 30) src/Psalm/Internal/Provider/StatementsProvider.php:113 — StatementsProvider.getStatementsForFile 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 · SimpleAssertionReconciler.reconcileCallable (cyclomatic 30) · ×1
  • SimpleAssertionReconciler.reconcileCallable (cyclomatic 30) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2877 — SimpleAssertionReconciler.reconcileCallable 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 · TemplateStandinTypeReplacer.findMatchingAtomicTypesForTemplate (cyclomatic 30) · ×1
  • TemplateStandinTypeReplacer.findMatchingAtomicTypesForTemplate (cyclomatic 30) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:588 — TemplateStandinTypeReplacer.findMatchingAtomicTypesForTemplate 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 · Transpiler.nativeType (cyclomatic 29) · ×1
  • Transpiler.nativeType (cyclomatic 29) bin/hack-conformance/Transpiler.php:832 — Transpiler.nativeType has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Transpiler.emitClass (cyclomatic 29) · ×1
  • Transpiler.emitClass (cyclomatic 29) bin/hack-conformance/Transpiler.php:1126 — Transpiler.emitClass 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 · CodeLocation.calculateRealLocation (cyclomatic 29) · ×1
  • CodeLocation.calculateRealLocation (cyclomatic 29) src/Psalm/CodeLocation.php:248 — CodeLocation.calculateRealLocation 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 · CommentAnalyzer.arrayToDocblocks (cyclomatic 29) · ×1
  • CommentAnalyzer.arrayToDocblocks (cyclomatic 29) src/Psalm/Internal/Analyzer/CommentAnalyzer.php:88 — CommentAnalyzer.arrayToDocblocks 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 · AssertionFinder.getNativeSymbolGuardAssertion (cyclomatic 29) · ×1
  • AssertionFinder.getNativeSymbolGuardAssertion (cyclomatic 29) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:932 — AssertionFinder.getNativeSymbolGuardAssertion 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 · AssertionFinder.getTypedValueEqualityAssertions (cyclomatic 29) · ×1
  • AssertionFinder.getTypedValueEqualityAssertions (cyclomatic 29) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3793 — AssertionFinder.getTypedValueEqualityAssertions has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ArrayAssignmentAnalyzer.getElementCopySource (cyclomatic 29) · ×1
  • ArrayAssignmentAnalyzer.getElementCopySource (cyclomatic 29) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:578 — ArrayAssignmentAnalyzer.getElementCopySource has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · FunctionCallReturnTypeFetcher.taintReturnType (cyclomatic 29) · ×1
  • FunctionCallReturnTypeFetcher.taintReturnType (cyclomatic 29) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:1562 — FunctionCallReturnTypeFetcher.taintReturnType 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 · ClassLikes.getPotentialDynamicMethodCalls (cyclomatic 29) · ×1
  • ClassLikes.getPotentialDynamicMethodCalls (cyclomatic 29) src/Psalm/Internal/Codebase/ClassLikes.php:2162 — ClassLikes.getPotentialDynamicMethodCalls 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 · TaintStore.getKnownStart (cyclomatic 29) · ×1
  • TaintStore.getKnownStart (cyclomatic 29) src/Psalm/Internal/Codebase/TaintStore.php:466 — TaintStore.getKnownStart 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 · ArrayUniqueReturnTypeProvider.getFunctionReturnType (cyclomatic 29) · ×1
  • ArrayUniqueReturnTypeProvider.getFunctionReturnType (cyclomatic 29) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayUniqueReturnTypeProvider.php:55 — ArrayUniqueReturnTypeProvider.getFunctionReturnType 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 · ObjectComparator.isShallowlyContainedBy (cyclomatic 29) · ×1
  • ObjectComparator.isShallowlyContainedBy (cyclomatic 29) src/Psalm/Internal/Type/Comparator/ObjectComparator.php:35 — ObjectComparator.isShallowlyContainedBy 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 · Atomic.isTruthy (cyclomatic 29) · ×1
  • Atomic.isTruthy (cyclomatic 29) src/Psalm/Type/Atomic.php:872 — Atomic.isTruthy has cyclomatic complexity 29 (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 · Config.visitStubFiles (cyclomatic 28) · ×1
  • Config.visitStubFiles (cyclomatic 28) src/Psalm/Config.php:2855 — Config.visitStubFiles 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 · AlgebraAnalyzer.checkForParadox (cyclomatic 28) · ×1
  • AlgebraAnalyzer.checkForParadox (cyclomatic 28) src/Psalm/Internal/Analyzer/AlgebraAnalyzer.php:307 — AlgebraAnalyzer.checkForParadox has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · InterfaceAnalyzer.analyze (cyclomatic 28) · ×1
  • InterfaceAnalyzer.analyze (cyclomatic 28) src/Psalm/Internal/Analyzer/InterfaceAnalyzer.php:44 — InterfaceAnalyzer.analyze 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 · ArgumentAnalyzer.verifyCallableInContext (cyclomatic 28) · ×1
  • ArgumentAnalyzer.verifyCallableInContext (cyclomatic 28) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:1652 — ArgumentAnalyzer.verifyCallableInContext 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 · NamedFunctionCallHandler.handleDependentTypeFunction (cyclomatic 28) · ×1
  • NamedFunctionCallHandler.handleDependentTypeFunction (cyclomatic 28) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:685 — NamedFunctionCallHandler.handleDependentTypeFunction 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 · TaintFlowResolution.buildTrace (cyclomatic 28) · ×1
  • TaintFlowResolution.buildTrace (cyclomatic 28) src/Psalm/Internal/Codebase/TaintFlowResolution.php:4017 — TaintFlowResolution.buildTrace 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 · AssertionReconciler.handleLiteralEqualityWithInt (cyclomatic 28) · ×1
  • AssertionReconciler.handleLiteralEqualityWithInt (cyclomatic 28) src/Psalm/Internal/Type/AssertionReconciler.php:1700 — AssertionReconciler.handleLiteralEqualityWithInt 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 · AssertionReconciler.handleLiteralEqualityWithString (cyclomatic 28) · ×1
  • AssertionReconciler.handleLiteralEqualityWithString (cyclomatic 28) src/Psalm/Internal/Type/AssertionReconciler.php:1872 — AssertionReconciler.handleLiteralEqualityWithString 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 · TemplateInferredTypeReplacer.replaceTemplateParam (cyclomatic 28) · ×1
  • TemplateInferredTypeReplacer.replaceTemplateParam (cyclomatic 28) src/Psalm/Internal/Type/TemplateInferredTypeReplacer.php:270 — TemplateInferredTypeReplacer.replaceTemplateParam 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 · ReturnTypeAnalyzer.checkReturnType (cyclomatic 27) · ×1
  • ReturnTypeAnalyzer.checkReturnType (cyclomatic 27) src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:911 — ReturnTypeAnalyzer.checkReturnType 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 · FunctionLikeAnalyzer.alterParams (cyclomatic 27) · ×1
  • FunctionLikeAnalyzer.alterParams (cyclomatic 27) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2165 — FunctionLikeAnalyzer.alterParams 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 · MethodComparator.compareMethodDocblockReturnTypes (cyclomatic 27) · ×1
  • MethodComparator.compareMethodDocblockReturnTypes (cyclomatic 27) src/Psalm/Internal/Analyzer/MethodComparator.php:1440 — MethodComparator.compareMethodDocblockReturnTypes 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 · IfConditionalAnalyzer.analyze (cyclomatic 27) · ×1
  • IfConditionalAnalyzer.analyze (cyclomatic 27) src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php:46 — IfConditionalAnalyzer.analyze 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 · LoopAnalyzer.addAlwaysWrittenVarIds (cyclomatic 27) · ×1
  • LoopAnalyzer.addAlwaysWrittenVarIds (cyclomatic 27) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:1091 — LoopAnalyzer.addAlwaysWrittenVarIds has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AssignmentAnalyzer.analyzeAssignmentOperation (cyclomatic 27) · ×1
  • AssignmentAnalyzer.analyzeAssignmentOperation (cyclomatic 27) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1246 — AssignmentAnalyzer.analyzeAssignmentOperation has cyclomatic complexity 27 (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 · ArgumentAnalyzer.getDispatchNode (cyclomatic 27) · ×1
  • ArgumentAnalyzer.getDispatchNode (cyclomatic 27) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:2422 — ArgumentAnalyzer.getDispatchNode 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 · StaticCallAnalyzer.taintReturnType (cyclomatic 27) · ×1
  • StaticCallAnalyzer.taintReturnType (cyclomatic 27) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php:477 — StaticCallAnalyzer.taintReturnType has cyclomatic complexity 27 (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 · CallAnalyzer.checkTemplateResult (cyclomatic 27) · ×1
  • CallAnalyzer.checkTemplateResult (cyclomatic 27) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:1266 — CallAnalyzer.checkTemplateResult 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 · ExpressionIdentifier.getVarId (cyclomatic 27) · ×1
  • ExpressionIdentifier.getVarId (cyclomatic 27) src/Psalm/Internal/Analyzer/Statements/Expression/ExpressionIdentifier.php:50 — ExpressionIdentifier.getVarId 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 · NullsafeAnalyzer.analyze (cyclomatic 27) · ×1
  • NullsafeAnalyzer.analyze (cyclomatic 27) src/Psalm/Internal/Analyzer/Statements/Expression/NullsafeAnalyzer.php:66 — NullsafeAnalyzer.analyze has cyclomatic complexity 27 (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 · GlobalAnalyzer.analyze (cyclomatic 27) · ×1
  • GlobalAnalyzer.analyze (cyclomatic 27) src/Psalm/Internal/Analyzer/Statements/GlobalAnalyzer.php:50 — GlobalAnalyzer.analyze 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 · TaintFlowResolution.takeEdge (cyclomatic 27) · ×1
  • TaintFlowResolution.takeEdge (cyclomatic 27) src/Psalm/Internal/Codebase/TaintFlowResolution.php:2240 — TaintFlowResolution.takeEdge 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 · TaintFlowResolution.addEntryCaller (cyclomatic 27) · ×1
  • TaintFlowResolution.addEntryCaller (cyclomatic 27) src/Psalm/Internal/Codebase/TaintFlowResolution.php:2667 — TaintFlowResolution.addEntryCaller has cyclomatic complexity 27 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · TypeHintResolver.resolve (cyclomatic 27) · ×1
  • TypeHintResolver.resolve (cyclomatic 27) src/Psalm/Internal/PhpVisitor/Reflector/TypeHintResolver.php:78 — TypeHintResolver.resolve 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 · ArrayFillReturnTypeProvider.getFunctionReturnType (cyclomatic 27) · ×1
  • ArrayFillReturnTypeProvider.getFunctionReturnType (cyclomatic 27) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFillReturnTypeProvider.php:36 — ArrayFillReturnTypeProvider.getFunctionReturnType 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 · FilterUtils.getOptionsArgValueOrError (cyclomatic 27) · ×1
  • FilterUtils.getOptionsArgValueOrError (cyclomatic 27) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:161 — FilterUtils.getOptionsArgValueOrError 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 · AssertionReconciler.handleLiteralEqualityWithFloat (cyclomatic 27) · ×1
  • AssertionReconciler.handleLiteralEqualityWithFloat (cyclomatic 27) src/Psalm/Internal/Type/AssertionReconciler.php:2030 — AssertionReconciler.handleLiteralEqualityWithFloat 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 · SimpleAssertionReconciler.reconcileNonEmptyCountable (cyclomatic 27) · ×1
  • SimpleAssertionReconciler.reconcileNonEmptyCountable (cyclomatic 27) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:683 — SimpleAssertionReconciler.reconcileNonEmptyCountable 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 · UnionTrait.equals (cyclomatic 27) · ×1
  • UnionTrait.equals (cyclomatic 27) src/Psalm/Type/UnionTrait.php:1617 — UnionTrait.equals has cyclomatic complexity 27 (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 · Context.findReferenceRebinding (cyclomatic 26) · ×1
  • Context.findReferenceRebinding (cyclomatic 26) src/Psalm/Context.php:832 — Context.findReferenceRebinding has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Context.removeMutableObjectVars (cyclomatic 26) · ×1
  • Context.removeMutableObjectVars (cyclomatic 26) src/Psalm/Context.php:1628 — Context.removeMutableObjectVars has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ClassAnalyzer.analyzeClassMethod (cyclomatic 26) · ×1
  • ClassAnalyzer.analyzeClassMethod (cyclomatic 26) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:2031 — ClassAnalyzer.analyzeClassMethod 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 · ArrayAnalyzer.handleUnpackedArray (cyclomatic 26) · ×1
  • ArrayAnalyzer.handleUnpackedArray (cyclomatic 26) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:717 — ArrayAnalyzer.handleUnpackedArray 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 · CoalesceAnalyzer.analyze (cyclomatic 26) · ×1
  • CoalesceAnalyzer.analyze (cyclomatic 26) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/CoalesceAnalyzer.php:79 — CoalesceAnalyzer.analyze has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · GuardedClasses.whenResult (cyclomatic 26) · ×1
  • GuardedClasses.whenResult (cyclomatic 26) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/GuardedClasses.php:67 — GuardedClasses.whenResult has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PartialApplicationAnalyzer.analyze (cyclomatic 26) · ×1
  • PartialApplicationAnalyzer.analyze (cyclomatic 26) src/Psalm/Internal/Analyzer/Statements/Expression/Call/PartialApplicationAnalyzer.php:63 — PartialApplicationAnalyzer.analyze 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 · TaintFlowResolution.applyPathType (cyclomatic 26) · ×1
  • TaintFlowResolution.applyPathType (cyclomatic 26) src/Psalm/Internal/Codebase/TaintFlowResolution.php:1509 — TaintFlowResolution.applyPathType 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 · TaintFlowResolution.walk (cyclomatic 26) · ×1
  • TaintFlowResolution.walk (cyclomatic 26) src/Psalm/Internal/Codebase/TaintFlowResolution.php:2063 — TaintFlowResolution.walk has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TaintFlowResolution.passesFetch (cyclomatic 26) · ×1
  • TaintFlowResolution.passesFetch (cyclomatic 26) src/Psalm/Internal/Codebase/TaintFlowResolution.php:3092 — TaintFlowResolution.passesFetch has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FunctionLikeNodeScanner.getTrivialConstructorCapabilities (cyclomatic 26) · ×1
  • FunctionLikeNodeScanner.getTrivialConstructorCapabilities (cyclomatic 26) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:788 — FunctionLikeNodeScanner.getTrivialConstructorCapabilities has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ArrayCombineReturnTypeProvider.getFunctionReturnType (cyclomatic 26) · ×1
  • ArrayCombineReturnTypeProvider.getFunctionReturnType (cyclomatic 26) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayCombineReturnTypeProvider.php:37 — ArrayCombineReturnTypeProvider.getFunctionReturnType has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FilterUtils.getOptions (cyclomatic 26) · ×1
  • FilterUtils.getOptions (cyclomatic 26) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:513 — FilterUtils.getOptions 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 · DocblockParser.parse (cyclomatic 26) · ×1
  • DocblockParser.parse (cyclomatic 26) src/Psalm/Internal/Scanner/DocblockParser.php:45 — DocblockParser.parse 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 · ScalarTypeComparator.isContainedByDecimalIntString (cyclomatic 26) · ×1
  • ScalarTypeComparator.isContainedByDecimalIntString (cyclomatic 26) src/Psalm/Internal/Type/Comparator/ScalarTypeComparator.php:677 — ScalarTypeComparator.isContainedByDecimalIntString 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 · SimpleAssertionReconciler.reconcileIsGreaterThan (cyclomatic 26) · ×1
  • SimpleAssertionReconciler.reconcileIsGreaterThan (cyclomatic 26) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2080 — SimpleAssertionReconciler.reconcileIsGreaterThan 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 · UnionTrait.getNonDefaultProperties (cyclomatic 26) · ×1
  • UnionTrait.getNonDefaultProperties (cyclomatic 26) src/Psalm/Type/UnionTrait.php:135 — UnionTrait.getNonDefaultProperties has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Algebra.groupImpossibilities (cyclomatic 25) · ×1
  • Algebra.groupImpossibilities (cyclomatic 25) src/Psalm/Internal/Algebra.php:467 — Algebra.groupImpossibilities 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 · SourceAnalyzer.signalMutationOnlyInferred (cyclomatic 25) · ×1
  • SourceAnalyzer.signalMutationOnlyInferred (cyclomatic 25) src/Psalm/Internal/Analyzer/SourceAnalyzer.php:246 — SourceAnalyzer.signalMutationOnlyInferred 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 · ArithmeticOpAnalyzer.arithmeticOperation (cyclomatic 25) · ×1
  • ArithmeticOpAnalyzer.arithmeticOperation (cyclomatic 25) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1132 — ArithmeticOpAnalyzer.arithmeticOperation 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 · ArithmeticOpAnalyzer.analyzePowBetweenIntRange (cyclomatic 25) · ×1
  • ArithmeticOpAnalyzer.analyzePowBetweenIntRange (cyclomatic 25) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1750 — ArithmeticOpAnalyzer.analyzePowBetweenIntRange 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 · ClassConstAnalyzer.getOverriddenConstant (cyclomatic 25) · ×1
  • ClassConstAnalyzer.getOverriddenConstant (cyclomatic 25) src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:986 — ClassConstAnalyzer.getOverriddenConstant 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 · TaintFlowResolution.reach (cyclomatic 25) · ×1
  • TaintFlowResolution.reach (cyclomatic 25) src/Psalm/Internal/Codebase/TaintFlowResolution.php:1946 — TaintFlowResolution.reach 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 · FunctionLikeDocblockScanner.getAssertionParts (cyclomatic 25) · ×1
  • FunctionLikeDocblockScanner.getAssertionParts (cyclomatic 25) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:835 — FunctionLikeDocblockScanner.getAssertionParts 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 · AtomicTypeComparator.getTraversableHalf (cyclomatic 25) · ×1
  • AtomicTypeComparator.getTraversableHalf (cyclomatic 25) src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php:1005 — AtomicTypeComparator.getTraversableHalf has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ClassLikeStringComparator.isContainedBy (cyclomatic 25) · ×1
  • ClassLikeStringComparator.isContainedBy (cyclomatic 25) src/Psalm/Internal/Type/Comparator/ClassLikeStringComparator.php:109 — ClassLikeStringComparator.isContainedBy has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SimpleAssertionReconciler.reconcileIsLessThan (cyclomatic 25) · ×1
  • SimpleAssertionReconciler.reconcileIsLessThan (cyclomatic 25) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2210 — SimpleAssertionReconciler.reconcileIsLessThan 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 · MethodComparator.compareMethodSignatureReturnTypes (cyclomatic 24) · ×1
  • MethodComparator.compareMethodSignatureReturnTypes (cyclomatic 24) src/Psalm/Internal/Analyzer/MethodComparator.php:1323 — MethodComparator.compareMethodSignatureReturnTypes 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 · LoopAnalyzer.widenIntRanges (cyclomatic 24) · ×1
  • LoopAnalyzer.widenIntRanges (cyclomatic 24) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:1839 — LoopAnalyzer.widenIntRanges 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 · AssertionFinder.getInarrayAssertions (cyclomatic 24) · ×1
  • AssertionFinder.getInarrayAssertions (cyclomatic 24) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4120 — AssertionFinder.getInarrayAssertions 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 · StaticCallAnalyzer.analyzeParentPropertyHookCall (cyclomatic 24) · ×1
  • StaticCallAnalyzer.analyzeParentPropertyHookCall (cyclomatic 24) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php:390 — StaticCallAnalyzer.analyzeParentPropertyHookCall has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CallAnalyzer.getFunctionIdsFromCallableArg (cyclomatic 24) · ×1
  • CallAnalyzer.getFunctionIdsFromCallableArg (cyclomatic 24) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:545 — CallAnalyzer.getFunctionIdsFromCallableArg has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ClassLikes.rebuildStructuralEdges (cyclomatic 24) · ×1
  • ClassLikes.rebuildStructuralEdges (cyclomatic 24) src/Psalm/Internal/Codebase/ClassLikes.php:1053 — ClassLikes.rebuildStructuralEdges 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 · ClassLikes.handleClassLikeReferenceInMigration (cyclomatic 24) · ×1
  • ClassLikes.handleClassLikeReferenceInMigration (cyclomatic 24) src/Psalm/Internal/Codebase/ClassLikes.php:1668 — ClassLikes.handleClassLikeReferenceInMigration 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 · ClassLikes.findPossibleMethodParamTypes (cyclomatic 24) · ×1
  • ClassLikes.findPossibleMethodParamTypes (cyclomatic 24) src/Psalm/Internal/Codebase/ClassLikes.php:2629 — ClassLikes.findPossibleMethodParamTypes 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 · Reflection.registerClass (cyclomatic 24) · ×1
  • Reflection.registerClass (cyclomatic 24) src/Psalm/Internal/Codebase/Reflection.php:72 — Reflection.registerClass 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 · PurityWildcardPaths.collectEdits (cyclomatic 24) · ×1
  • PurityWildcardPaths.collectEdits (cyclomatic 24) src/Psalm/Internal/Type/PurityWildcardPaths.php:134 — PurityWildcardPaths.collectEdits 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 · SimpleAssertionReconciler.reconcileExactlyCountable (cyclomatic 24) · ×1
  • SimpleAssertionReconciler.reconcileExactlyCountable (cyclomatic 24) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:818 — SimpleAssertionReconciler.reconcileExactlyCountable 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 · TypeCombiner.scrapeIntProperties (cyclomatic 24) · ×1
  • TypeCombiner.scrapeIntProperties (cyclomatic 24) src/Psalm/Internal/Type/TypeCombiner.php:1606 — TypeCombiner.scrapeIntProperties 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 · TypeExpander.expandPropertiesOf (cyclomatic 24) · ×1
  • TypeExpander.expandPropertiesOf (cyclomatic 24) src/Psalm/Internal/Type/TypeExpander.php:1277 — TypeExpander.expandPropertiesOf 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 · TypeParser.intersectScalarTypes (cyclomatic 24) · ×1
  • TypeParser.intersectScalarTypes (cyclomatic 24) src/Psalm/Internal/Type/TypeParser.php:2013 — TypeParser.intersectScalarTypes 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 · TypeChecker.checkGenericParams (cyclomatic 24) · ×1
  • TypeChecker.checkGenericParams (cyclomatic 24) src/Psalm/Internal/TypeVisitor/TypeChecker.php:342 — TypeChecker.checkGenericParams 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 · Transpiler.parseType (cyclomatic 23) · ×1
  • Transpiler.parseType (cyclomatic 23) bin/hack-conformance/Transpiler.php:627 — Transpiler.parseType has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Config.visitPreloadedStubFiles (cyclomatic 23) · ×1
  • Config.visitPreloadedStubFiles (cyclomatic 23) src/Psalm/Config.php:2751 — Config.visitPreloadedStubFiles 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 · IssetGuardedProperties.walk (cyclomatic 23) · ×1
  • IssetGuardedProperties.walk (cyclomatic 23) src/Psalm/Internal/Analyzer/IssetGuardedProperties.php:68 — IssetGuardedProperties.walk 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 · AssertionFinder.getFalseInequalityAssertions (cyclomatic 23) · ×1
  • AssertionFinder.getFalseInequalityAssertions (cyclomatic 23) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2448 — AssertionFinder.getFalseInequalityAssertions 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 · AssertionFinder.getTrueEqualityAssertions (cyclomatic 23) · ×1
  • AssertionFinder.getTrueEqualityAssertions (cyclomatic 23) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3203 — AssertionFinder.getTrueEqualityAssertions 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 · ArithmeticOpAnalyzer.isChangeableByLoop (cyclomatic 23) · ×1
  • ArithmeticOpAnalyzer.isChangeableByLoop (cyclomatic 23) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1260 — ArithmeticOpAnalyzer.isChangeableByLoop 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 · MethodCallReturnTypeFetcher.getReturnDispatchNode (cyclomatic 23) · ×1
  • MethodCallReturnTypeFetcher.getReturnDispatchNode (cyclomatic 23) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php:866 — MethodCallReturnTypeFetcher.getReturnDispatchNode 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 · CloneAnalyzer.analyzeClonedType (cyclomatic 23) · ×1
  • CloneAnalyzer.analyzeClonedType (cyclomatic 23) src/Psalm/Internal/Analyzer/Statements/Expression/CloneAnalyzer.php:233 — CloneAnalyzer.analyzeClonedType 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 · ArrayFetchAnalyzer.handleArrayAccessOnArray (cyclomatic 23) · ×1
  • ArrayFetchAnalyzer.handleArrayAccessOnArray (cyclomatic 23) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1538 — ArrayFetchAnalyzer.handleArrayAccessOnArray 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 · Populator.inheritMethodsFromParent (cyclomatic 23) · ×1
  • Populator.inheritMethodsFromParent (cyclomatic 23) src/Psalm/Internal/Codebase/Populator.php:1707 — Populator.inheritMethodsFromParent 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 · FunctionLikeNodeScanner.inferPropertyTypeFromConstructor (cyclomatic 23) · ×1
  • FunctionLikeNodeScanner.inferPropertyTypeFromConstructor (cyclomatic 23) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:937 — FunctionLikeNodeScanner.inferPropertyTypeFromConstructor 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 · ArrayMapReturnTypeProvider.getElementMarker (cyclomatic 23) · ×1
  • ArrayMapReturnTypeProvider.getElementMarker (cyclomatic 23) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMapReturnTypeProvider.php:334 — ArrayMapReturnTypeProvider.getElementMarker has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AssertionReconciler.restoreTemplateKeyOrValueOf (cyclomatic 23) · ×1
  • AssertionReconciler.restoreTemplateKeyOrValueOf (cyclomatic 23) src/Psalm/Internal/Type/AssertionReconciler.php:370 — AssertionReconciler.restoreTemplateKeyOrValueOf 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 · SimpleAssertionReconciler.reconcileHasMethod (cyclomatic 23) · ×1
  • SimpleAssertionReconciler.reconcileHasMethod (cyclomatic 23) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:938 — SimpleAssertionReconciler.reconcileHasMethod 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 · SimpleAssertionReconciler.reconcileObject (cyclomatic 23) · ×1
  • SimpleAssertionReconciler.reconcileObject (cyclomatic 23) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1665 — SimpleAssertionReconciler.reconcileObject 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 · Reconciler.breakUpPathIntoParts (cyclomatic 23) · ×1
  • Reconciler.breakUpPathIntoParts (cyclomatic 23) src/Psalm/Type/Reconciler.php:1072 — Reconciler.breakUpPathIntoParts 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 · Codebase.getMarkupContentForSymbolByReference (cyclomatic 22) · ×1
  • Codebase.getMarkupContentForSymbolByReference (cyclomatic 22) src/Psalm/Codebase.php:1704 — Codebase.getMarkupContentForSymbolByReference 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 · Codebase.getCompletionDataAtPosition (cyclomatic 22) · ×1
  • Codebase.getCompletionDataAtPosition (cyclomatic 22) src/Psalm/Codebase.php:2225 — Codebase.getCompletionDataAtPosition 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.reportIssueInFile (cyclomatic 22) · ×1
  • Config.reportIssueInFile (cyclomatic 22) src/Psalm/Config.php:2167 — Config.reportIssueInFile has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ClosureAnalyzer.analyzeClosureUses (cyclomatic 22) · ×1
  • ClosureAnalyzer.analyzeClosureUses (cyclomatic 22) src/Psalm/Internal/Analyzer/ClosureAnalyzer.php:637 — ClosureAnalyzer.analyzeClosureUses 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 · FunctionLikeAnalyzer.findAssignments (cyclomatic 22) · ×1
  • FunctionLikeAnalyzer.findAssignments (cyclomatic 22) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2550 — FunctionLikeAnalyzer.findAssignments 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 · ForeachAnalyzer.mayWriteTheArrayOtherwise (cyclomatic 22) · ×1
  • ForeachAnalyzer.mayWriteTheArrayOtherwise (cyclomatic 22) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:798 — ForeachAnalyzer.mayWriteTheArrayOtherwise has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SwitchCaseAnalyzer.handleNonReturningCase (cyclomatic 22) · ×1
  • SwitchCaseAnalyzer.handleNonReturningCase (cyclomatic 22) src/Psalm/Internal/Analyzer/Statements/Block/SwitchCaseAnalyzer.php:604 — SwitchCaseAnalyzer.handleNonReturningCase 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 · ContinueAnalyzer.analyze (cyclomatic 22) · ×1
  • ContinueAnalyzer.analyze (cyclomatic 22) src/Psalm/Internal/Analyzer/Statements/ContinueAnalyzer.php:24 — ContinueAnalyzer.analyze 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 · AssignmentAnalyzer.assignTypeFromVarDocblock (cyclomatic 22) · ×1
  • AssignmentAnalyzer.assignTypeFromVarDocblock (cyclomatic 22) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1070 — AssignmentAnalyzer.assignTypeFromVarDocblock has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AssignmentAnalyzer.analyzePropertyAssignment (cyclomatic 22) · ×1
  • AssignmentAnalyzer.analyzePropertyAssignment (cyclomatic 22) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:2827 — AssignmentAnalyzer.analyzePropertyAssignment 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 · MissingMethodCallHandler.overloadAcceptsArgs (cyclomatic 22) · ×1
  • MissingMethodCallHandler.overloadAcceptsArgs (cyclomatic 22) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MissingMethodCallHandler.php:666 — MissingMethodCallHandler.overloadAcceptsArgs 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 · NewAnalyzer.taintNewObject (cyclomatic 22) · ×1
  • NewAnalyzer.taintNewObject (cyclomatic 22) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:939 — NewAnalyzer.taintNewObject has cyclomatic complexity 22 (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 · Cache.consolidate (cyclomatic 22) · ×1
  • Cache.consolidate (cyclomatic 22) src/Psalm/Internal/Cache.php:196 — Cache.consolidate 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 · Populator.populateFileStorage (cyclomatic 22) · ×1
  • Populator.populateFileStorage (cyclomatic 22) src/Psalm/Internal/Codebase/Populator.php:1484 — Populator.populateFileStorage has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · FunctionDocblockManipulator.getManipulationsForFile (cyclomatic 22) · ×1
  • FunctionDocblockManipulator.getManipulationsForFile (cyclomatic 22) src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:543 — FunctionDocblockManipulator.getManipulationsForFile 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 · CheckTrivialExprVisitor.checkNonTrivialExpr (cyclomatic 22) · ×1
  • CheckTrivialExprVisitor.checkNonTrivialExpr (cyclomatic 22) src/Psalm/Internal/PhpVisitor/CheckTrivialExprVisitor.php:17 — CheckTrivialExprVisitor.checkNonTrivialExpr has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ClassLikeNodeScanner.handleTraitUse (cyclomatic 22) · ×1
  • ClassLikeNodeScanner.handleTraitUse (cyclomatic 22) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1238 — ClassLikeNodeScanner.handleTraitUse 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 · ClassLikeNodeScanner.visitEnumDeclaration (cyclomatic 22) · ×1
  • ClassLikeNodeScanner.visitEnumDeclaration (cyclomatic 22) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1838 — ClassLikeNodeScanner.visitEnumDeclaration 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 · StringStartScanner.scan (cyclomatic 22) · ×1
  • StringStartScanner.scan (cyclomatic 22) src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:91 — StringStartScanner.scan 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 · TemplateTagParser.findDefaultSeparator (cyclomatic 22) · ×1
  • TemplateTagParser.findDefaultSeparator (cyclomatic 22) src/Psalm/Internal/PhpVisitor/Reflector/TemplateTagParser.php:171 — TemplateTagParser.findDefaultSeparator 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 · IteratorToArrayReturnTypeProvider.getFunctionReturnType (cyclomatic 22) · ×1
  • IteratorToArrayReturnTypeProvider.getFunctionReturnType (cyclomatic 22) src/Psalm/Internal/Provider/ReturnTypeProvider/IteratorToArrayReturnTypeProvider.php:43 — IteratorToArrayReturnTypeProvider.getFunctionReturnType 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 · PowReturnTypeProvider.getFunctionReturnType (cyclomatic 22) · ×1
  • PowReturnTypeProvider.getFunctionReturnType (cyclomatic 22) src/Psalm/Internal/Provider/ReturnTypeProvider/PowReturnTypeProvider.php:35 — PowReturnTypeProvider.getFunctionReturnType has cyclomatic complexity 22 (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 · StubsGenerator.getAll (cyclomatic 22) · ×1
  • StubsGenerator.getAll (cyclomatic 22) src/Psalm/Internal/Stubs/Generator/StubsGenerator.php:61 — StubsGenerator.getAll 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 · ParseTreeCreator.handleQuestionMark (cyclomatic 22) · ×1
  • ParseTreeCreator.handleQuestionMark (cyclomatic 22) src/Psalm/Internal/Type/ParseTreeCreator.php:769 — ParseTreeCreator.handleQuestionMark 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 · SimpleAssertionReconciler.reconcileString (cyclomatic 22) · ×1
  • SimpleAssertionReconciler.reconcileString (cyclomatic 22) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1049 — SimpleAssertionReconciler.reconcileString 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 · SimpleNegatedAssertionReconciler.reconcileIsLessThanOrEqualTo (cyclomatic 22) · ×1
  • SimpleNegatedAssertionReconciler.reconcileIsLessThanOrEqualTo (cyclomatic 22) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1888 — SimpleNegatedAssertionReconciler.reconcileIsLessThanOrEqualTo 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. This shape REPEATS in the file: one other method here (SimpleNegatedAssertionReconciler.reconcileIsGreaterThanOrEqualTo) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · SimpleNegatedAssertionReconciler.reconcileIsGreaterThanOrEqualTo (cyclomatic 22) · ×1
  • SimpleNegatedAssertionReconciler.reconcileIsGreaterThanOrEqualTo (cyclomatic 22) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:2011 — SimpleNegatedAssertionReconciler.reconcileIsGreaterThanOrEqualTo 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. This shape REPEATS in the file: one other method here (SimpleNegatedAssertionReconciler.reconcileIsLessThanOrEqualTo) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · Reconciler.triggerIssueForImpossible (cyclomatic 22) · ×1
  • Reconciler.triggerIssueForImpossible (cyclomatic 22) src/Psalm/Type/Reconciler.php:1676 — Reconciler.triggerIssueForImpossible 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.getReportingLevelForIssue (cyclomatic 21) · ×1
  • Config.getReportingLevelForIssue (cyclomatic 21) src/Psalm/Config.php:2359 — Config.getReportingLevelForIssue has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AttributesAnalyzer.analyze (cyclomatic 21) · ×1
  • AttributesAnalyzer.analyze (cyclomatic 21) src/Psalm/Internal/Analyzer/AttributesAnalyzer.php:58 — AttributesAnalyzer.analyze 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 · ClassAnalyzer.checkParentClass (cyclomatic 21) · ×1
  • ClassAnalyzer.checkParentClass (cyclomatic 21) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:2683 — ClassAnalyzer.checkParentClass has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · InheritedMethodTaints.getBodySuffix (cyclomatic 21) · ×1
  • InheritedMethodTaints.getBodySuffix (cyclomatic 21) src/Psalm/Internal/Analyzer/InheritedMethodTaints.php:45 — InheritedMethodTaints.getBodySuffix has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MethodComparator.compareMethodDocblockParams (cyclomatic 21) · ×1
  • MethodComparator.compareMethodDocblockParams (cyclomatic 21) src/Psalm/Internal/Analyzer/MethodComparator.php:1126 — MethodComparator.compareMethodDocblockParams 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 · ArrayAnalyzer.castArrayKeyType (cyclomatic 21) · ×1
  • ArrayAnalyzer.castArrayKeyType (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:249 — ArrayAnalyzer.castArrayKeyType 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 · AssertionFinder.scrapeInequalityAssertions (cyclomatic 21) · ×1
  • AssertionFinder.scrapeInequalityAssertions (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:631 — AssertionFinder.scrapeInequalityAssertions 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 · AssertionFinder.hasSuperiorNumberCheck (cyclomatic 21) · ×1
  • AssertionFinder.hasSuperiorNumberCheck (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1832 — AssertionFinder.hasSuperiorNumberCheck has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (AssertionFinder.hasInferiorNumberCheck) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · AssertionFinder.hasInferiorNumberCheck (cyclomatic 21) · ×1
  • AssertionFinder.hasInferiorNumberCheck (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1893 — AssertionFinder.hasInferiorNumberCheck has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (AssertionFinder.hasSuperiorNumberCheck) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · AssertionFinder.getGreaterAssertions (cyclomatic 21) · ×1
  • AssertionFinder.getGreaterAssertions (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4389 — AssertionFinder.getGreaterAssertions 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 · AssertionFinder.getStringLengthComparison (cyclomatic 21) · ×1
  • AssertionFinder.getStringLengthComparison (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4569 — AssertionFinder.getStringLengthComparison 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 · AssertionFinder.getSmallerAssertions (cyclomatic 21) · ×1
  • AssertionFinder.getSmallerAssertions (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4668 — AssertionFinder.getSmallerAssertions 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 · ArrayAssignmentAnalyzer.updateTypeWithKeyValues (cyclomatic 21) · ×1
  • ArrayAssignmentAnalyzer.updateTypeWithKeyValues (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:424 — ArrayAssignmentAnalyzer.updateTypeWithKeyValues 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 · ArrayAssignmentAnalyzer.getArrayAssignmentOffsetType (cyclomatic 21) · ×1
  • ArrayAssignmentAnalyzer.getArrayAssignmentOffsetType (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:1776 — ArrayAssignmentAnalyzer.getArrayAssignmentOffsetType 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 · InstancePropertyAssignmentAnalyzer.checkReadonlyPropertyWrite (cyclomatic 21) · ×1
  • InstancePropertyAssignmentAnalyzer.checkReadonlyPropertyWrite (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:539 — InstancePropertyAssignmentAnalyzer.checkReadonlyPropertyWrite has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MissingMethodCallHandler.handleMissingOrMagicMethod (cyclomatic 21) · ×1
  • MissingMethodCallHandler.handleMissingOrMagicMethod (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MissingMethodCallHandler.php:376 — MissingMethodCallHandler.handleMissingOrMagicMethod 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 · PartialApplicationAnalyzer.captureReference (cyclomatic 21) · ×1
  • PartialApplicationAnalyzer.captureReference (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/Call/PartialApplicationAnalyzer.php:528 — PartialApplicationAnalyzer.captureReference 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 · ArrayFetchAnalyzer.handleArrayAccessOnString (cyclomatic 21) · ×1
  • ArrayFetchAnalyzer.handleArrayAccessOnString (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2549 — ArrayFetchAnalyzer.handleArrayAccessOnString 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 · FreshObjectFinder.walk (cyclomatic 21) · ×1
  • FreshObjectFinder.walk (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/FreshObjectFinder.php:65 — FreshObjectFinder.walk 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 · UnsetAnalyzer.removeOffset (cyclomatic 21) · ×1
  • UnsetAnalyzer.removeOffset (cyclomatic 21) src/Psalm/Internal/Analyzer/Statements/UnsetAnalyzer.php:194 — UnsetAnalyzer.removeOffset 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 · Review.run (cyclomatic 21) · ×1
  • Review.run (cyclomatic 21) src/Psalm/Internal/Cli/Review.php:68 — Review.run has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CliUtils.parseOptions (cyclomatic 21) · ×1
  • CliUtils.parseOptions (cyclomatic 21) src/Psalm/Internal/CliUtils.php:288 — CliUtils.parseOptions 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 · ClassLikes.handleDocblockTypeInMigration (cyclomatic 21) · ×1
  • ClassLikes.handleDocblockTypeInMigration (cyclomatic 21) src/Psalm/Internal/Codebase/ClassLikes.php:1853 — ClassLikes.handleDocblockTypeInMigration 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 · Functions.getMatchingFunctionNames (cyclomatic 21) · ×1
  • Functions.getMatchingFunctionNames (cyclomatic 21) src/Psalm/Internal/Codebase/Functions.php:330 — Functions.getMatchingFunctionNames 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 · Scanner.queueFilesOfInheritedMethods (cyclomatic 21) · ×1
  • Scanner.queueFilesOfInheritedMethods (cyclomatic 21) src/Psalm/Internal/Codebase/Scanner.php:413 — Scanner.queueFilesOfInheritedMethods 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 · TaintStore.getKnownStartOfMember (cyclomatic 21) · ×1
  • TaintStore.getKnownStartOfMember (cyclomatic 21) src/Psalm/Internal/Codebase/TaintStore.php:733 — TaintStore.getKnownStartOfMember has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · UnshippedCode.fromContents (cyclomatic 21) · ×1
  • UnshippedCode.fromContents (cyclomatic 21) src/Psalm/Internal/Codebase/UnshippedCode.php:74 — UnshippedCode.fromContents has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · EventDispatcher.registerClass (cyclomatic 21) · ×1
  • EventDispatcher.registerClass (cyclomatic 21) src/Psalm/Internal/EventDispatcher.php:208 — EventDispatcher.registerClass has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StringStartScanner.getReturnStart (cyclomatic 21) · ×1
  • StringStartScanner.getReturnStart (cyclomatic 21) src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:364 — StringStartScanner.getReturnStart 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 · ArrayFirstLastReturnTypeProvider.getElementType (cyclomatic 21) · ×1
  • ArrayFirstLastReturnTypeProvider.getElementType (cyclomatic 21) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFirstLastReturnTypeProvider.php:101 — ArrayFirstLastReturnTypeProvider.getElementType 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 · ArrayReverseReturnTypeProvider.getFunctionReturnType (cyclomatic 21) · ×1
  • ArrayReverseReturnTypeProvider.getFunctionReturnType (cyclomatic 21) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReverseReturnTypeProvider.php:37 — ArrayReverseReturnTypeProvider.getFunctionReturnType 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 · GetObjectVarsReturnTypeProvider.getGetObjectVarsReturnType (cyclomatic 21) · ×1
  • GetObjectVarsReturnTypeProvider.getGetObjectVarsReturnType (cyclomatic 21) src/Psalm/Internal/Provider/ReturnTypeProvider/GetObjectVarsReturnTypeProvider.php:49 — GetObjectVarsReturnTypeProvider.getGetObjectVarsReturnType 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 · SimpleAssertionReconciler.reconcileInt (cyclomatic 21) · ×1
  • SimpleAssertionReconciler.reconcileInt (cyclomatic 21) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1144 — SimpleAssertionReconciler.reconcileInt 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 · SimpleAssertionReconciler.reconcileNumeric (cyclomatic 21) · ×1
  • SimpleAssertionReconciler.reconcileNumeric (cyclomatic 21) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1562 — SimpleAssertionReconciler.reconcileNumeric 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 · SimpleAssertionReconciler.reconcileArray (cyclomatic 21) · ×1
  • SimpleAssertionReconciler.reconcileArray (cyclomatic 21) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2407 — SimpleAssertionReconciler.reconcileArray 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 · SimpleNegatedAssertionReconciler.reconcileNotNonEmptyCountable (cyclomatic 21) · ×1
  • SimpleNegatedAssertionReconciler.reconcileNotNonEmptyCountable (cyclomatic 21) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:587 — SimpleNegatedAssertionReconciler.reconcileNotNonEmptyCountable 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 · Reconciler.getPathType (cyclomatic 21) · ×1
  • Reconciler.getPathType (cyclomatic 21) src/Psalm/Type/Reconciler.php:989 — Reconciler.getPathType 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 · Transpiler.resolveContext (cyclomatic 20) · ×1
  • Transpiler.resolveContext (cyclomatic 20) bin/hack-conformance/Transpiler.php:916 — Transpiler.resolveContext 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 · ClassAnalyzer.analyzeTraitUse (cyclomatic 20) · ×1
  • ClassAnalyzer.analyzeTraitUse (cyclomatic 20) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:1610 — ClassAnalyzer.analyzeTraitUse 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 · CommentAnalyzer.isHashNotation (cyclomatic 20) · ×1
  • CommentAnalyzer.isHashNotation (cyclomatic 20) src/Psalm/Internal/Analyzer/CommentAnalyzer.php:497 — CommentAnalyzer.isHashNotation 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 · LoopAnalyzer.setVarsAssignedInCondition (cyclomatic 20) · ×1
  • LoopAnalyzer.setVarsAssignedInCondition (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:1172 — LoopAnalyzer.setVarsAssignedInCondition 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 · AssertionFinder.getInstanceOfAssertions (cyclomatic 20) · ×1
  • AssertionFinder.getInstanceOfAssertions (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1398 — AssertionFinder.getInstanceOfAssertions 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 · BinaryOpAnalyzer.addDataFlow (cyclomatic 20) · ×1
  • BinaryOpAnalyzer.addDataFlow (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php:472 — BinaryOpAnalyzer.addDataFlow 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 · MethodCallPurityAnalyzer.getUnaffectedPropertyGetters (cyclomatic 20) · ×1
  • MethodCallPurityAnalyzer.getUnaffectedPropertyGetters (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php:884 — MethodCallPurityAnalyzer.getUnaffectedPropertyGetters 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 · NewAnalyzer.getUnconstrainableTemplates (cyclomatic 20) · ×1
  • NewAnalyzer.getUnconstrainableTemplates (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1987 — NewAnalyzer.getUnconstrainableTemplates 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 · CloneAnalyzer.analyzeFuncCall (cyclomatic 20) · ×1
  • CloneAnalyzer.analyzeFuncCall (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/Expression/CloneAnalyzer.php:97 — CloneAnalyzer.analyzeFuncCall 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 · ArrayFetchAnalyzer.taintSuperGlobalFetch (cyclomatic 20) · ×1
  • ArrayFetchAnalyzer.taintSuperGlobalFetch (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:522 — ArrayFetchAnalyzer.taintSuperGlobalFetch has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AtomicPropertyFetchAnalyzer.propertyFetchCanBeAnalyzed (cyclomatic 20) · ×1
  • AtomicPropertyFetchAnalyzer.propertyFetchCanBeAnalyzed (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:706 — AtomicPropertyFetchAnalyzer.propertyFetchCanBeAnalyzed 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 · MagicConstAnalyzer.analyze (cyclomatic 20) · ×1
  • MagicConstAnalyzer.analyze (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/Expression/MagicConstAnalyzer.php:31 — MagicConstAnalyzer.analyze 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 · ReturnAnalyzer.collectGeneratorReturnTypes (cyclomatic 20) · ×1
  • ReturnAnalyzer.collectGeneratorReturnTypes (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php:882 — ReturnAnalyzer.collectGeneratorReturnTypes 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 · UnsetAnalyzer.replaceElement (cyclomatic 20) · ×1
  • UnsetAnalyzer.replaceElement (cyclomatic 20) src/Psalm/Internal/Analyzer/Statements/UnsetAnalyzer.php:345 — UnsetAnalyzer.replaceElement 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 · CodeUseGraph.reach (cyclomatic 20) · ×1
  • CodeUseGraph.reach (cyclomatic 20) src/Psalm/Internal/Codebase/CodeUseGraph.php:720 — CodeUseGraph.reach 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 · ReceiverPropertyTaints.taintCall (cyclomatic 20) · ×1
  • ReceiverPropertyTaints.taintCall (cyclomatic 20) src/Psalm/Internal/Codebase/ReceiverPropertyTaints.php:173 — ReceiverPropertyTaints.taintCall has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · TaintFlowAnnotation.parse (cyclomatic 20) · ×1
  • TaintFlowAnnotation.parse (cyclomatic 20) src/Psalm/Internal/Codebase/TaintFlowAnnotation.php:115 — TaintFlowAnnotation.parse 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 · TaintFlowResolution.composeOpenAssignments (cyclomatic 20) · ×1
  • TaintFlowResolution.composeOpenAssignments (cyclomatic 20) src/Psalm/Internal/Codebase/TaintFlowResolution.php:1741 — TaintFlowResolution.composeOpenAssignments 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 · CustomTraverser.traverseArray (cyclomatic 20) · ×1
  • CustomTraverser.traverseArray (cyclomatic 20) src/Psalm/Internal/PhpTraverser/CustomTraverser.php:98 — CustomTraverser.traverseArray 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 · ExpressionResolver.fileDeclaresKind (cyclomatic 20) · ×1
  • ExpressionResolver.fileDeclaresKind (cyclomatic 20) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:590 — ExpressionResolver.fileDeclaresKind 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 · ExpressionScanner.scan (cyclomatic 20) · ×1
  • ExpressionScanner.scan (cyclomatic 20) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionScanner.php:46 — ExpressionScanner.scan 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 · FunctionLikeDocblockScanner.handleTaintFlow (cyclomatic 20) · ×1
  • FunctionLikeDocblockScanner.handleTaintFlow (cyclomatic 20) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:1402 — FunctionLikeDocblockScanner.handleTaintFlow 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 · StringStartScanner.getStart (cyclomatic 20) · ×1
  • StringStartScanner.getStart (cyclomatic 20) src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:624 — StringStartScanner.getStart 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 · ReflectorVisitor.recordThisPropertyMutation (cyclomatic 20) · ×1
  • ReflectorVisitor.recordThisPropertyMutation (cyclomatic 20) src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:583 — ReflectorVisitor.recordThisPropertyMutation has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ClassLikeStubGenerator.getMethodNodes (cyclomatic 20) · ×1
  • ClassLikeStubGenerator.getMethodNodes (cyclomatic 20) src/Psalm/Internal/Stubs/Generator/ClassLikeStubGenerator.php:215 — ClassLikeStubGenerator.getMethodNodes 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 · UnionTypeComparator.mergeAlternativeBounds (cyclomatic 20) · ×1
  • UnionTypeComparator.mergeAlternativeBounds (cyclomatic 20) src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php:713 — UnionTypeComparator.mergeAlternativeBounds has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · TypeCombiner.combineDecimalIntString (cyclomatic 20) · ×1
  • TypeCombiner.combineDecimalIntString (cyclomatic 20) src/Psalm/Internal/Type/TypeCombiner.php:1553 — TypeCombiner.combineDecimalIntString 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 · TypeExpander.expandConditional (cyclomatic 20) · ×1
  • TypeExpander.expandConditional (cyclomatic 20) src/Psalm/Internal/Type/TypeExpander.php:1048 — TypeExpander.expandConditional 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 · Atomic.isFalsy (cyclomatic 20) · ×1
  • Atomic.isFalsy (cyclomatic 20) src/Psalm/Type/Atomic.php:957 — Atomic.isFalsy 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 · GenericTrait.toNamespacedString (cyclomatic 20) · ×1
  • GenericTrait.toNamespacedString (cyclomatic 20) src/Psalm/Type/Atomic/GenericTrait.php:127 — GenericTrait.toNamespacedString 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 · Config.removeCacheDirectory (cyclomatic 19) · ×1
  • Config.removeCacheDirectory (cyclomatic 19) src/Psalm/Config.php:3332 — Config.removeCacheDirectory 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 · Context.filterClauses (cyclomatic 19) · ×1
  • Context.filterClauses (cyclomatic 19) src/Psalm/Context.php:1125 — Context.filterClauses 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 · ClassAnalyzer.analyzeProperty (cyclomatic 19) · ×1
  • ClassAnalyzer.analyzeProperty (cyclomatic 19) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:1791 — ClassAnalyzer.analyzeProperty has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · FunctionLikeAnalyzer.detectUnusedParameters (cyclomatic 19) · ×1
  • FunctionLikeAnalyzer.detectUnusedParameters (cyclomatic 19) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:3215 — FunctionLikeAnalyzer.detectUnusedParameters 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 · MethodComparator.checkForObviousMethodMismatches (cyclomatic 19) · ×1
  • MethodComparator.checkForObviousMethodMismatches (cyclomatic 19) src/Psalm/Internal/Analyzer/MethodComparator.php:490 — MethodComparator.checkForObviousMethodMismatches has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · DoAnalyzer.analyze (cyclomatic 19) · ×1
  • DoAnalyzer.analyze (cyclomatic 19) src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php:41 — DoAnalyzer.analyze has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DoAnalyzer.hasExitToTheLoop (cyclomatic 19) · ×1
  • DoAnalyzer.hasExitToTheLoop (cyclomatic 19) src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php:564 — DoAnalyzer.hasExitToTheLoop 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 · InstancePropertyAssignmentAnalyzer.trackPropertyImpurity (cyclomatic 19) · ×1
  • InstancePropertyAssignmentAnalyzer.trackPropertyImpurity (cyclomatic 19) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:429 — InstancePropertyAssignmentAnalyzer.trackPropertyImpurity 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 · MissingMethodCallHandler.handleMagicMethod (cyclomatic 19) · ×1
  • MissingMethodCallHandler.handleMagicMethod (cyclomatic 19) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MissingMethodCallHandler.php:51 — MissingMethodCallHandler.handleMagicMethod 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 · UnaryPlusMinusAnalyzer.analyze (cyclomatic 19) · ×1
  • UnaryPlusMinusAnalyzer.analyze (cyclomatic 19) src/Psalm/Internal/Analyzer/Statements/Expression/UnaryPlusMinusAnalyzer.php:35 — UnaryPlusMinusAnalyzer.analyze 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 · Psalm.restart (cyclomatic 19) · ×1
  • Psalm.restart (cyclomatic 19) src/Psalm/Internal/Cli/Psalm.php:1027 — Psalm.restart 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 · CliUtils.requireAutoloaders (cyclomatic 19) · ×1
  • CliUtils.requireAutoloaders (cyclomatic 19) src/Psalm/Internal/CliUtils.php:79 — CliUtils.requireAutoloaders 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 · Analyzer.removeExistingDataForFile (cyclomatic 19) · ×1
  • Analyzer.removeExistingDataForFile (cyclomatic 19) src/Psalm/Internal/Codebase/Analyzer.php:1283 — Analyzer.removeExistingDataForFile 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 · FunctionLikeDocblockScanner.getConditionalSanitizedTypeTokens (cyclomatic 19) · ×1
  • FunctionLikeDocblockScanner.getConditionalSanitizedTypeTokens (cyclomatic 19) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:705 — FunctionLikeDocblockScanner.getConditionalSanitizedTypeTokens 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 · ArrayFillKeysReturnTypeProvider.getFunctionReturnType (cyclomatic 19) · ×1
  • ArrayFillKeysReturnTypeProvider.getFunctionReturnType (cyclomatic 19) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFillKeysReturnTypeProvider.php:37 — ArrayFillKeysReturnTypeProvider.getFunctionReturnType 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 · MbInternalEncodingReturnTypeProvider.getFunctionReturnType (cyclomatic 19) · ×1
  • MbInternalEncodingReturnTypeProvider.getFunctionReturnType (cyclomatic 19) src/Psalm/Internal/Provider/ReturnTypeProvider/MbInternalEncodingReturnTypeProvider.php:38 — MbInternalEncodingReturnTypeProvider.getFunctionReturnType 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 · AssertionReconciler.handleLiteralEquality (cyclomatic 19) · ×1
  • AssertionReconciler.handleLiteralEquality (cyclomatic 19) src/Psalm/Internal/Type/AssertionReconciler.php:1562 — AssertionReconciler.handleLiteralEquality 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 · AssertionReconciler.getCompatibleStringType (cyclomatic 19) · ×1
  • AssertionReconciler.getCompatibleStringType (cyclomatic 19) src/Psalm/Internal/Type/AssertionReconciler.php:2200 — AssertionReconciler.getCompatibleStringType has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AssertionReconciler.canBeIntersected (cyclomatic 19) · ×1
  • AssertionReconciler.canBeIntersected (cyclomatic 19) src/Psalm/Internal/Type/AssertionReconciler.php:2463 — AssertionReconciler.canBeIntersected 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 · IntegerRangeComparator.reduceRangeIncrementally (cyclomatic 19) · ×1
  • IntegerRangeComparator.reduceRangeIncrementally (cyclomatic 19) src/Psalm/Internal/Type/Comparator/IntegerRangeComparator.php:98 — IntegerRangeComparator.reduceRangeIncrementally 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 · ParseTreeCreator.parseCallableParam (cyclomatic 19) · ×1
  • ParseTreeCreator.parseCallableParam (cyclomatic 19) src/Psalm/Internal/Type/ParseTreeCreator.php:283 — ParseTreeCreator.parseCallableParam 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 · ParseTreeCreator.handleComma (cyclomatic 19) · ×1
  • ParseTreeCreator.handleComma (cyclomatic 19) src/Psalm/Internal/Type/ParseTreeCreator.php:534 — ParseTreeCreator.handleComma has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ParseTreeCreator.handleColon (cyclomatic 19) · ×1
  • ParseTreeCreator.handleColon (cyclomatic 19) src/Psalm/Internal/Type/ParseTreeCreator.php:647 — ParseTreeCreator.handleColon has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SimpleAssertionReconciler.reconcileIsset (cyclomatic 19) · ×1
  • SimpleAssertionReconciler.reconcileIsset (cyclomatic 19) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:601 — SimpleAssertionReconciler.reconcileIsset 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 · SimpleNegatedAssertionReconciler.reconcileInt (cyclomatic 19) · ×1
  • SimpleNegatedAssertionReconciler.reconcileInt (cyclomatic 19) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1420 — SimpleNegatedAssertionReconciler.reconcileInt 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 · SimpleNegatedAssertionReconciler.reconcileArray (cyclomatic 19) · ×1
  • SimpleNegatedAssertionReconciler.reconcileArray (cyclomatic 19) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1719 — SimpleNegatedAssertionReconciler.reconcileArray 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 · StringRefinement.get (cyclomatic 19) · ×1
  • StringRefinement.get (cyclomatic 19) src/Psalm/Internal/Type/StringRefinement.php:51 — StringRefinement.get has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · TemplateStandinTypeReplacer.replace (cyclomatic 19) · ×1
  • TemplateStandinTypeReplacer.replace (cyclomatic 19) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:107 — TemplateStandinTypeReplacer.replace 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 · TypeChecker.enterNode (cyclomatic 19) · ×1
  • TypeChecker.enterNode (cyclomatic 19) src/Psalm/Internal/TypeVisitor/TypeChecker.php:121 — TypeChecker.enterNode has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · IssueBuffer.add (cyclomatic 19) · ×1
  • IssueBuffer.add (cyclomatic 19) src/Psalm/IssueBuffer.php:365 — IssueBuffer.add 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. This is NOT this file's highest cyclomatic complexity: IssueBuffer.getOutput (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · LongProgress.taskDone (cyclomatic 19) · ×1
  • LongProgress.taskDone (cyclomatic 19) src/Psalm/Progress/LongProgress.php:121 — LongProgress.taskDone 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 · MutableUnion.addType (cyclomatic 19) · ×1
  • MutableUnion.addType (cyclomatic 19) src/Psalm/Type/MutableUnion.php:241 — MutableUnion.addType 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 · ClosureAnalyzer.widenLiteralsOfByRefCapture (cyclomatic 18) · ×1
  • ClosureAnalyzer.widenLiteralsOfByRefCapture (cyclomatic 18) src/Psalm/Internal/Analyzer/ClosureAnalyzer.php:218 — ClosureAnalyzer.widenLiteralsOfByRefCapture 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 · ForeachAnalyzer.getIterationCapabilities (cyclomatic 18) · ×1
  • ForeachAnalyzer.getIterationCapabilities (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1986 — ForeachAnalyzer.getIterationCapabilities 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 · LoopAnalyzer.analyzeForOrWhile (cyclomatic 18) · ×1
  • LoopAnalyzer.analyzeForOrWhile (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:869 — LoopAnalyzer.analyzeForOrWhile has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AssertionFinder.getNullInequalityAssertions (cyclomatic 18) · ×1
  • AssertionFinder.getNullInequalityAssertions (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2349 — AssertionFinder.getNullInequalityAssertions 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 · BitwiseNotAnalyzer.analyze (cyclomatic 18) · ×1
  • BitwiseNotAnalyzer.analyze (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Expression/BitwiseNotAnalyzer.php:34 — BitwiseNotAnalyzer.analyze 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 · ArgumentAnalyzer.getDispatchRoutes (cyclomatic 18) · ×1
  • ArgumentAnalyzer.getDispatchRoutes (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:2337 — ArgumentAnalyzer.getDispatchRoutes 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 · ArgumentMapPopulator.recordArgumentPositions (cyclomatic 18) · ×1
  • ArgumentMapPopulator.recordArgumentPositions (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentMapPopulator.php:31 — ArgumentMapPopulator.recordArgumentPositions 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 · FunctionCallReturnTypeFetcher.taintCallableParamCall (cyclomatic 18) · ×1
  • FunctionCallReturnTypeFetcher.taintCallableParamCall (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:822 — FunctionCallReturnTypeFetcher.taintCallableParamCall 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 · ExistingAtomicMethodCallAnalyzer.getMagicGetterOrSetterProperty (cyclomatic 18) · ×1
  • ExistingAtomicMethodCallAnalyzer.getMagicGetterOrSetterProperty (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:651 — ExistingAtomicMethodCallAnalyzer.getMagicGetterOrSetterProperty 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 · CastAnalyzer.castScalarToString (cyclomatic 18) · ×1
  • CastAnalyzer.castScalarToString (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:945 — CastAnalyzer.castScalarToString 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 · ThrowAnalyzer.analyze (cyclomatic 18) · ×1
  • ThrowAnalyzer.analyze (cyclomatic 18) src/Psalm/Internal/Analyzer/Statements/Expression/ThrowAnalyzer.php:29 — ThrowAnalyzer.analyze 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 · Psalm.generateConfig (cyclomatic 18) · ×1
  • Psalm.generateConfig (cyclomatic 18) src/Psalm/Internal/Cli/Psalm.php:563 — Psalm.generateConfig 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 · Populator.extendTemplateParams (cyclomatic 18) · ×1
  • Populator.extendTemplateParams (cyclomatic 18) src/Psalm/Internal/Codebase/Populator.php:1317 — Populator.extendTemplateParams 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 · ReceiverPropertyTaints.getElementCopySource (cyclomatic 18) · ×1
  • ReceiverPropertyTaints.getElementCopySource (cyclomatic 18) src/Psalm/Internal/Codebase/ReceiverPropertyTaints.php:551 — ReceiverPropertyTaints.getElementCopySource has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · TaintFlowGraph.linkGeneratorSends (cyclomatic 18) · ×1
  • TaintFlowGraph.linkGeneratorSends (cyclomatic 18) src/Psalm/Internal/Codebase/TaintFlowGraph.php:1140 — TaintFlowGraph.linkGeneratorSends 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 · ClassLikeDocblockParser.keepTemplatesInParamTypes (cyclomatic 18) · ×1
  • ClassLikeDocblockParser.keepTemplatesInParamTypes (cyclomatic 18) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:633 — ClassLikeDocblockParser.keepTemplatesInParamTypes has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · StringStartScanner.getCallArguments (cyclomatic 18) · ×1
  • StringStartScanner.getCallArguments (cyclomatic 18) src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:430 — StringStartScanner.getCallArguments 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 · ArrayReplaceRecursiveReturnTypeProvider.replaceArray (cyclomatic 18) · ×1
  • ArrayReplaceRecursiveReturnTypeProvider.replaceArray (cyclomatic 18) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReplaceRecursiveReturnTypeProvider.php:179 — ArrayReplaceRecursiveReturnTypeProvider.replaceArray 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 · ParseTreeCreator.handleIsOrAs (cyclomatic 18) · ×1
  • ParseTreeCreator.handleIsOrAs (cyclomatic 18) src/Psalm/Internal/Type/ParseTreeCreator.php:953 — ParseTreeCreator.handleIsOrAs 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 · SimpleAssertionReconciler.reconcileFalse (cyclomatic 18) · ×1
  • SimpleAssertionReconciler.reconcileFalse (cyclomatic 18) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1317 — SimpleAssertionReconciler.reconcileFalse 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. This shape REPEATS in the file: one other method here (SimpleAssertionReconciler.reconcileTrue) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · SimpleAssertionReconciler.reconcileTrue (cyclomatic 18) · ×1
  • SimpleAssertionReconciler.reconcileTrue (cyclomatic 18) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1402 — SimpleAssertionReconciler.reconcileTrue 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. This shape REPEATS in the file: one other method here (SimpleAssertionReconciler.reconcileFalse) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · SimpleAssertionReconciler.reconcileStringArrayAccess (cyclomatic 18) · ×1
  • SimpleAssertionReconciler.reconcileStringArrayAccess (cyclomatic 18) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2735 — SimpleAssertionReconciler.reconcileStringArrayAccess 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 · SimpleNegatedAssertionReconciler.reconcileNumeric (cyclomatic 18) · ×1
  • SimpleNegatedAssertionReconciler.reconcileNumeric (cyclomatic 18) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1326 — SimpleNegatedAssertionReconciler.reconcileNumeric 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 · SimpleNegatedAssertionReconciler.reconcileString (cyclomatic 18) · ×1
  • SimpleNegatedAssertionReconciler.reconcileString (cyclomatic 18) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1615 — SimpleNegatedAssertionReconciler.reconcileString 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 · TKeyedArray.replaceTemplateTypesWithStandins (cyclomatic 18) · ×1
  • TKeyedArray.replaceTemplateTypesWithStandins (cyclomatic 18) src/Psalm/Type/Atomic/TKeyedArray.php:574 — TKeyedArray.replaceTemplateTypesWithStandins has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · FileFilter.loadFromXMLElement (cyclomatic 17) · ×1
  • FileFilter.loadFromXMLElement (cyclomatic 17) src/Psalm/Config/FileFilter.php:390 — FileFilter.loadFromXMLElement has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · Context.resetMutatedStaticProperties (cyclomatic 17) · ×1
  • Context.resetMutatedStaticProperties (cyclomatic 17) src/Psalm/Context.php:1446 — Context.resetMutatedStaticProperties 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 · AlgebraAnalyzer.findImplication (cyclomatic 17) · ×1
  • AlgebraAnalyzer.findImplication (cyclomatic 17) src/Psalm/Internal/Analyzer/AlgebraAnalyzer.php:489 — AlgebraAnalyzer.findImplication 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 · AttributesAnalyzer.analyzeGetAttributes (cyclomatic 17) · ×1
  • AttributesAnalyzer.analyzeGetAttributes (cyclomatic 17) src/Psalm/Internal/Analyzer/AttributesAnalyzer.php:392 — AttributesAnalyzer.analyzeGetAttributes has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · MethodAnalyzer.isMethodVisible (cyclomatic 17) · ×1
  • MethodAnalyzer.isMethodVisible (cyclomatic 17) src/Psalm/Internal/Analyzer/MethodAnalyzer.php:298 — MethodAnalyzer.isMethodVisible 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 · ProjectAnalyzer.migrateCode (cyclomatic 17) · ×1
  • ProjectAnalyzer.migrateCode (cyclomatic 17) src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:813 — ProjectAnalyzer.migrateCode 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 · IfConditionalAnalyzer.getAssignmentStates (cyclomatic 17) · ×1
  • IfConditionalAnalyzer.getAssignmentStates (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php:625 — IfConditionalAnalyzer.getAssignmentStates 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 · LoopAnalyzer.applyPreConditionToLoopContext (cyclomatic 17) · ×1
  • LoopAnalyzer.applyPreConditionToLoopContext (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:1585 — LoopAnalyzer.applyPreConditionToLoopContext 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 · AssertionFinder.hasTypedValueComparison (cyclomatic 17) · ×1
  • AssertionFinder.hasTypedValueComparison (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1974 — AssertionFinder.hasTypedValueComparison has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AssertionFinder.getNullEqualityAssertions (cyclomatic 17) · ×1
  • AssertionFinder.getNullEqualityAssertions (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3114 — AssertionFinder.getNullEqualityAssertions 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 · AssertionFinder.getGetdebugtypeEqualityAssertions (cyclomatic 17) · ×1
  • AssertionFinder.getGetdebugtypeEqualityAssertions (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3622 — AssertionFinder.getGetdebugtypeEqualityAssertions 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 · AssertionFinder.getComparedVarId (cyclomatic 17) · ×1
  • AssertionFinder.getComparedVarId (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4027 — AssertionFinder.getComparedVarId 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 · ArrayAssignmentAnalyzer.updateParentTypes (cyclomatic 17) · ×1
  • ArrayAssignmentAnalyzer.updateParentTypes (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:1449 — ArrayAssignmentAnalyzer.updateParentTypes 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 · InstancePropertyAssignmentAnalyzer.taintUnspecializedProperty (cyclomatic 17) · ×1
  • InstancePropertyAssignmentAnalyzer.taintUnspecializedProperty (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:764 — InstancePropertyAssignmentAnalyzer.taintUnspecializedProperty has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AssignmentAnalyzer.makeReferencedArrayNonNull (cyclomatic 17) · ×1
  • AssignmentAnalyzer.makeReferencedArrayNonNull (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1932 — AssignmentAnalyzer.makeReferencedArrayNonNull 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 · ArithmeticOpAnalyzer.analyzeOperandsBetweenIntRange (cyclomatic 17) · ×1
  • ArithmeticOpAnalyzer.analyzeOperandsBetweenIntRange (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1449 — ArithmeticOpAnalyzer.analyzeOperandsBetweenIntRange 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 · PipeAnalyzer.getDirectCall (cyclomatic 17) · ×1
  • PipeAnalyzer.getDirectCall (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/PipeAnalyzer.php:103 — PipeAnalyzer.getDirectCall 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 · ArgumentsAnalyzer.getProvisionalTemplateResultForFunctionLike (cyclomatic 17) · ×1
  • ArgumentsAnalyzer.getProvisionalTemplateResultForFunctionLike (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:2438 — ArgumentsAnalyzer.getProvisionalTemplateResultForFunctionLike 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 · ArrayFunctionArgumentsAnalyzer.checkArgumentsMatch (cyclomatic 17) · ×1
  • ArrayFunctionArgumentsAnalyzer.checkArgumentsMatch (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:70 — ArrayFunctionArgumentsAnalyzer.checkArgumentsMatch 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 · CallAnalyzer.checkFunctionExists (cyclomatic 17) · ×1
  • CallAnalyzer.checkFunctionExists (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:708 — CallAnalyzer.checkFunctionExists has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ConstFetchAnalyzer.getConstType (cyclomatic 17) · ×1
  • ConstFetchAnalyzer.getConstType (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ConstFetchAnalyzer.php:315 — ConstFetchAnalyzer.getConstType 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 · IncDecExpressionAnalyzer.analyze (cyclomatic 17) · ×1
  • IncDecExpressionAnalyzer.analyze (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/Expression/IncDecExpressionAnalyzer.php:31 — IncDecExpressionAnalyzer.analyze 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 · ExpressionAnalyzer.analyze (cyclomatic 17) · ×1
  • ExpressionAnalyzer.analyze (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php:81 — ExpressionAnalyzer.analyze has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · UnsetAnalyzer.analyze (cyclomatic 17) · ×1
  • UnsetAnalyzer.analyze (cyclomatic 17) src/Psalm/Internal/Analyzer/Statements/UnsetAnalyzer.php:79 — UnsetAnalyzer.analyze 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 · StatementsAnalyzer.analyze (cyclomatic 17) · ×1
  • StatementsAnalyzer.analyze (cyclomatic 17) src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:277 — StatementsAnalyzer.analyze has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Clause.calculateNegation (cyclomatic 17) · ×1
  • Clause.calculateNegation (cyclomatic 17) src/Psalm/Internal/Clause.php:292 — Clause.calculateNegation has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Analyzer.doAnalysis (cyclomatic 17) · ×1
  • Analyzer.doAnalysis (cyclomatic 17) src/Psalm/Internal/Codebase/Analyzer.php:309 — Analyzer.doAnalysis has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · InternalCallMapHandler.getCallablesFromCallMap (cyclomatic 17) · ×1
  • InternalCallMapHandler.getCallablesFromCallMap (cyclomatic 17) src/Psalm/Internal/Codebase/InternalCallMapHandler.php:281 — InternalCallMapHandler.getCallablesFromCallMap 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 · PropertyBagTaints.taintAssignment (cyclomatic 17) · ×1
  • PropertyBagTaints.taintAssignment (cyclomatic 17) src/Psalm/Internal/Codebase/PropertyBagTaints.php:75 — PropertyBagTaints.taintAssignment 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 · TaintFlowResolution.prepareGraph (cyclomatic 17) · ×1
  • TaintFlowResolution.prepareGraph (cyclomatic 17) src/Psalm/Internal/Codebase/TaintFlowResolution.php:895 — TaintFlowResolution.prepareGraph has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · TaintFlowResolution.reportFlow (cyclomatic 17) · ×1
  • TaintFlowResolution.reportFlow (cyclomatic 17) src/Psalm/Internal/Codebase/TaintFlowResolution.php:3921 — TaintFlowResolution.reportFlow 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 · VariableUseGraph.getChildNodes (cyclomatic 17) · ×1
  • VariableUseGraph.getChildNodes (cyclomatic 17) src/Psalm/Internal/Codebase/VariableUseGraph.php:192 — VariableUseGraph.getChildNodes 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 · CustomTraverser.traverseNode (cyclomatic 17) · ×1
  • CustomTraverser.traverseNode (cyclomatic 17) src/Psalm/Internal/PhpTraverser/CustomTraverser.php:31 — CustomTraverser.traverseNode 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 · ParamReplacementVisitor.enterNode (cyclomatic 17) · ×1
  • ParamReplacementVisitor.enterNode (cyclomatic 17) src/Psalm/Internal/PhpVisitor/ParamReplacementVisitor.php:39 — ParamReplacementVisitor.enterNode 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 · ClassLikeNodeScanner.nodesUseProperty (cyclomatic 17) · ×1
  • ClassLikeNodeScanner.nodesUseProperty (cyclomatic 17) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:2351 — ClassLikeNodeScanner.nodesUseProperty 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 · JsonEncodeTainter.removeTaints (cyclomatic 17) · ×1
  • JsonEncodeTainter.removeTaints (cyclomatic 17) src/Psalm/Internal/Provider/AddRemoveTaints/JsonEncodeTainter.php:39 — JsonEncodeTainter.removeTaints 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 · PregReplaceCallbackParamsProvider.getFunctionParams (cyclomatic 17) · ×1
  • PregReplaceCallbackParamsProvider.getFunctionParams (cyclomatic 17) src/Psalm/Internal/Provider/ParamsProvider/PregReplaceCallbackParamsProvider.php:51 — PregReplaceCallbackParamsProvider.getFunctionParams 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 · ArrayColumnReturnTypeProvider.castToArrayKey (cyclomatic 17) · ×1
  • ArrayColumnReturnTypeProvider.castToArrayKey (cyclomatic 17) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayColumnReturnTypeProvider.php:338 — ArrayColumnReturnTypeProvider.castToArrayKey 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 · ArrayIntersectKeyReturnTypeProvider.getFunctionReturnType (cyclomatic 17) · ×1
  • ArrayIntersectKeyReturnTypeProvider.getFunctionReturnType (cyclomatic 17) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayIntersectKeyReturnTypeProvider.php:36 — ArrayIntersectKeyReturnTypeProvider.getFunctionReturnType 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 · DirnameReturnTypeProvider.getFunctionReturnType (cyclomatic 17) · ×1
  • DirnameReturnTypeProvider.getFunctionReturnType (cyclomatic 17) src/Psalm/Internal/Provider/ReturnTypeProvider/DirnameReturnTypeProvider.php:35 — DirnameReturnTypeProvider.getFunctionReturnType 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 · FilterUtils.checkRedundantFlags (cyclomatic 17) · ×1
  • FilterUtils.checkRedundantFlags (cyclomatic 17) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:411 — FilterUtils.checkRedundantFlags 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 · AssertionReconciler.inferTemplateParamsFromParent (cyclomatic 17) · ×1
  • AssertionReconciler.inferTemplateParamsFromParent (cyclomatic 17) src/Psalm/Internal/Type/AssertionReconciler.php:1022 — AssertionReconciler.inferTemplateParamsFromParent 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 · CallableTypeComparator.getCallableFromMethodId (cyclomatic 17) · ×1
  • CallableTypeComparator.getCallableFromMethodId (cyclomatic 17) src/Psalm/Internal/Type/Comparator/CallableTypeComparator.php:326 — CallableTypeComparator.getCallableFromMethodId 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 · ParseTreeCreator.handleEllipsisOrEquals (cyclomatic 17) · ×1
  • ParseTreeCreator.handleEllipsisOrEquals (cyclomatic 17) src/Psalm/Internal/Type/ParseTreeCreator.php:587 — ParseTreeCreator.handleEllipsisOrEquals 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 · SimpleAssertionReconciler.getListOfSealedShape (cyclomatic 17) · ×1
  • SimpleAssertionReconciler.getListOfSealedShape (cyclomatic 17) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2527 — SimpleAssertionReconciler.getListOfSealedShape 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 · SimpleNegatedAssertionReconciler.reconcileBool (cyclomatic 17) · ×1
  • SimpleNegatedAssertionReconciler.reconcileBool (cyclomatic 17) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:501 — SimpleNegatedAssertionReconciler.reconcileBool 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 · SimpleNegatedAssertionReconciler.reconcileFloat (cyclomatic 17) · ×1
  • SimpleNegatedAssertionReconciler.reconcileFloat (cyclomatic 17) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1520 — SimpleNegatedAssertionReconciler.reconcileFloat 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 · TypeCombination.fallbackKeyAlwaysContains (cyclomatic 17) · ×1
  • TypeCombination.fallbackKeyAlwaysContains (cyclomatic 17) src/Psalm/Internal/Type/TypeCombination.php:162 — TypeCombination.fallbackKeyAlwaysContains 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 · TypeExpander.expandKeyOfValueOf (cyclomatic 17) · ×1
  • TypeExpander.expandKeyOfValueOf (cyclomatic 17) src/Psalm/Internal/Type/TypeExpander.php:1386 — TypeExpander.expandKeyOfValueOf 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 · UnionTrait.toPhpString (cyclomatic 17) · ×1
  • UnionTrait.toPhpString (cyclomatic 17) src/Psalm/Type/UnionTrait.php:425 — UnionTrait.toPhpString 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 · Transpiler.emitLambda (cyclomatic 16) · ×1
  • Transpiler.emitLambda (cyclomatic 16) bin/hack-conformance/Transpiler.php:1708 — Transpiler.emitLambda 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 · Config.resolveCompressor (cyclomatic 16) · ×1
  • Config.resolveCompressor (cyclomatic 16) src/Psalm/Config.php:936 — Config.resolveCompressor has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · FileFilter.allows (cyclomatic 16) · ×1
  • FileFilter.allows (cyclomatic 16) src/Psalm/Config/FileFilter.php:526 — FileFilter.allows 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 · Context.update (cyclomatic 16) · ×1
  • Context.update (cyclomatic 16) src/Psalm/Context.php:586 — Context.update 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 · NamespaceAnalyzer.collectAnalyzableInformation (cyclomatic 16) · ×1
  • NamespaceAnalyzer.collectAnalyzableInformation (cyclomatic 16) src/Psalm/Internal/Analyzer/NamespaceAnalyzer.php:55 — NamespaceAnalyzer.collectAnalyzableInformation 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 · PurityWildcardInference.markReceiverTemplates (cyclomatic 16) · ×1
  • PurityWildcardInference.markReceiverTemplates (cyclomatic 16) src/Psalm/Internal/Analyzer/PurityWildcardInference.php:100 — PurityWildcardInference.markReceiverTemplates 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 · PurityWildcardInference.findParamPath (cyclomatic 16) · ×1
  • PurityWildcardInference.findParamPath (cyclomatic 16) src/Psalm/Internal/Analyzer/PurityWildcardInference.php:295 — PurityWildcardInference.findParamPath 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 · ForeachAnalyzer.addItemsWrittenByRef (cyclomatic 16) · ×1
  • ForeachAnalyzer.addItemsWrittenByRef (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:523 — ForeachAnalyzer.addItemsWrittenByRef 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 · ForeachAnalyzer.mayPassByReference (cyclomatic 16) · ×1
  • ForeachAnalyzer.mayPassByReference (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:926 — ForeachAnalyzer.mayPassByReference 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 · ForeachAnalyzer.taintItemsWrittenByRef (cyclomatic 16) · ×1
  • ForeachAnalyzer.taintItemsWrittenByRef (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1015 — ForeachAnalyzer.taintItemsWrittenByRef 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 · AssertionFinder.getTypedValueInequalityAssertions (cyclomatic 16) · ×1
  • AssertionFinder.getTypedValueInequalityAssertions (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3031 — AssertionFinder.getTypedValueInequalityAssertions 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 · ArithmeticOpAnalyzer.analyzeModBetweenIntRange (cyclomatic 16) · ×1
  • ArithmeticOpAnalyzer.analyzeModBetweenIntRange (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1826 — ArithmeticOpAnalyzer.analyzeModBetweenIntRange 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 · FunctionCallReturnTypeFetcher.taintArrayColumn (cyclomatic 16) · ×1
  • FunctionCallReturnTypeFetcher.taintArrayColumn (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:1400 — FunctionCallReturnTypeFetcher.taintArrayColumn 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 · MethodCallPurityAnalyzer.resetWrittenProperties (cyclomatic 16) · ×1
  • MethodCallPurityAnalyzer.resetWrittenProperties (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php:671 — MethodCallPurityAnalyzer.resetWrittenProperties 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 · ExistingAtomicStaticCallAnalyzer.getStaticClassType (cyclomatic 16) · ×1
  • ExistingAtomicStaticCallAnalyzer.getStaticClassType (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php:798 — ExistingAtomicStaticCallAnalyzer.getStaticClassType 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 · CallAnalyzer.resolveStaticPropertyAssertionClasses (cyclomatic 16) · ×1
  • CallAnalyzer.resolveStaticPropertyAssertionClasses (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:876 — CallAnalyzer.resolveStaticPropertyAssertionClasses 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 · VariableFetchAnalyzer.addDataFlowToVariable (cyclomatic 16) · ×1
  • VariableFetchAnalyzer.addDataFlowToVariable (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php:555 — VariableFetchAnalyzer.addDataFlowToVariable 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 · InstanceofAnalyzer.analyze (cyclomatic 16) · ×1
  • InstanceofAnalyzer.analyze (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/InstanceofAnalyzer.php:27 — InstanceofAnalyzer.analyze 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 · IntMaskComparisonAnalyzer.analyzeBinaryOp (cyclomatic 16) · ×1
  • IntMaskComparisonAnalyzer.analyzeBinaryOp (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/Expression/IntMaskComparisonAnalyzer.php:43 — IntMaskComparisonAnalyzer.analyzeBinaryOp has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ReturnAnalyzer.getTemplateParamEqualToLiteral (cyclomatic 16) · ×1
  • ReturnAnalyzer.getTemplateParamEqualToLiteral (cyclomatic 16) src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php:78 — ReturnAnalyzer.getTemplateParamEqualToLiteral 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 · ClassLikes.getFinalInsertionPosition (cyclomatic 16) · ×1
  • ClassLikes.getFinalInsertionPosition (cyclomatic 16) src/Psalm/Internal/Codebase/ClassLikes.php:1410 — ClassLikes.getFinalInsertionPosition 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 · Functions.getStorage (cyclomatic 16) · ×1
  • Functions.getStorage (cyclomatic 16) src/Psalm/Internal/Codebase/Functions.php:77 — Functions.getStorage 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 · NosqlEqualityOperand.markArgument (cyclomatic 16) · ×1
  • NosqlEqualityOperand.markArgument (cyclomatic 16) src/Psalm/Internal/Codebase/NosqlEqualityOperand.php:49 — NosqlEqualityOperand.markArgument has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ReceiverPropertyTaints.taintWrites (cyclomatic 16) · ×1
  • ReceiverPropertyTaints.taintWrites (cyclomatic 16) src/Psalm/Internal/Codebase/ReceiverPropertyTaints.php:359 — ReceiverPropertyTaints.taintWrites 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 · TaintStore.addFlow (cyclomatic 16) · ×1
  • TaintStore.addFlow (cyclomatic 16) src/Psalm/Internal/Codebase/TaintStore.php:83 — TaintStore.addFlow 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 · PsalmRestarter.requiresRestart (cyclomatic 16) · ×1
  • PsalmRestarter.requiresRestart (cyclomatic 16) src/Psalm/Internal/Fork/PsalmRestarter.php:93 — PsalmRestarter.requiresRestart 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 · ClassLikeNodeScanner.getTypeAliasesFromCommentLines (cyclomatic 16) · ×1
  • ClassLikeNodeScanner.getTypeAliasesFromCommentLines (cyclomatic 16) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:2529 — ClassLikeNodeScanner.getTypeAliasesFromCommentLines 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 · FunctionLikeNodeScanner.addParams (cyclomatic 16) · ×1
  • FunctionLikeNodeScanner.addParams (cyclomatic 16) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:1454 — FunctionLikeNodeScanner.addParams 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 · FileReferenceProvider.loadReferenceCache (cyclomatic 16) · ×1
  • FileReferenceProvider.loadReferenceCache (cyclomatic 16) src/Psalm/Internal/Provider/FileReferenceProvider.php:278 — FileReferenceProvider.loadReferenceCache 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 · ClosureReturnTypeProvider.getMethodReturnType (cyclomatic 16) · ×1
  • ClosureReturnTypeProvider.getMethodReturnType (cyclomatic 16) src/Psalm/Internal/Provider/ReturnTypeProvider/ClosureReturnTypeProvider.php:37 — ClosureReturnTypeProvider.getMethodReturnType 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 · FilterVarReturnTypeProvider.getFunctionReturnType (cyclomatic 16) · ×1
  • FilterVarReturnTypeProvider.getFunctionReturnType (cyclomatic 16) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterVarReturnTypeProvider.php:40 — FilterVarReturnTypeProvider.getFunctionReturnType 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 · PdoStatementReturnTypeProvider.handleFetch (cyclomatic 16) · ×1
  • PdoStatementReturnTypeProvider.handleFetch (cyclomatic 16) src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php:55 — PdoStatementReturnTypeProvider.handleFetch has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: PdoStatementReturnTypeProvider.handleFetchAll (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · RoundReturnTypeProvider.getFunctionReturnType (cyclomatic 16) · ×1
  • RoundReturnTypeProvider.getFunctionReturnType (cyclomatic 16) src/Psalm/Internal/Provider/ReturnTypeProvider/RoundReturnTypeProvider.php:35 — RoundReturnTypeProvider.getFunctionReturnType 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 · AtomicParts.split (cyclomatic 16) · ×1
  • AtomicParts.split (cyclomatic 16) src/Psalm/Internal/Type/AtomicParts.php:53 — AtomicParts.split 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 · KeyedArrayComparator.coerceToObjectWithProperties (cyclomatic 16) · ×1
  • KeyedArrayComparator.coerceToObjectWithProperties (cyclomatic 16) src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:351 — KeyedArrayComparator.coerceToObjectWithProperties has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · ParseTreeCreator.handleAmpersand (cyclomatic 16) · ×1
  • ParseTreeCreator.handleAmpersand (cyclomatic 16) src/Psalm/Internal/Type/ParseTreeCreator.php:877 — ParseTreeCreator.handleAmpersand 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 · SimpleNegatedAssertionReconciler.reconcileObject (cyclomatic 16) · ×1
  • SimpleNegatedAssertionReconciler.reconcileObject (cyclomatic 16) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1227 — SimpleNegatedAssertionReconciler.reconcileObject 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 · TypeParser.intersectObjectTypes (cyclomatic 16) · ×1
  • TypeParser.intersectObjectTypes (cyclomatic 16) src/Psalm/Internal/Type/TypeParser.php:1607 — TypeParser.intersectObjectTypes 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 · TypeParser.intersectStringTypes (cyclomatic 16) · ×1
  • TypeParser.intersectStringTypes (cyclomatic 16) src/Psalm/Internal/Type/TypeParser.php:2129 — TypeParser.intersectStringTypes 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 · TypeParser.unescapeStringLiteral (cyclomatic 16) · ×1
  • TypeParser.unescapeStringLiteral (cyclomatic 16) src/Psalm/Internal/Type/TypeParser.php:2834 — TypeParser.unescapeStringLiteral 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 · TypeChecker.checkNamedObject (cyclomatic 16) · ×1
  • TypeChecker.checkNamedObject (cyclomatic 16) src/Psalm/Internal/TypeVisitor/TypeChecker.php:248 — TypeChecker.checkNamedObject 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 · TypeLocalizer.enterNode (cyclomatic 16) · ×1
  • TypeLocalizer.enterNode (cyclomatic 16) src/Psalm/Internal/TypeVisitor/TypeLocalizer.php:36 — TypeLocalizer.enterNode 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 · CallableTrait.replaceCallableTemplateTypesWithStandins (cyclomatic 16) · ×1
  • CallableTrait.replaceCallableTemplateTypesWithStandins (cyclomatic 16) src/Psalm/Type/Atomic/CallableTrait.php:282 — CallableTrait.replaceCallableTemplateTypesWithStandins 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 · TKeyedArray.toNamespacedString (cyclomatic 16) · ×1
  • TKeyedArray.toNamespacedString (cyclomatic 16) src/Psalm/Type/Atomic/TKeyedArray.php:270 — TKeyedArray.toNamespacedString 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 · TValueOf.getValueType (cyclomatic 16) · ×1
  • TValueOf.getValueType (cyclomatic 16) src/Psalm/Type/Atomic/TValueOf.php:126 — TValueOf.getValueType 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.
D17 · Explicit Debt · HackComment repeated across 14 files · ×1
  • HackComment repeated across 14 files tests/ExtImagickStubTest.php:27 — The identical HackComment appears in 14 files (14 occurrences) — almost certainly one boilerplate line from a single migration or decision, not 14 independent debts. Fix the systemic cause once rather than file-by-file. Text: "// hack to isolate Psalm from PHPUnit cli arguments". Source code is not a task system: track the cleanup where tasks live. (Every occurrence still counts toward the score and metrics.)
D2 · Cognitive Complexity · FilterUtils.getReturnType (cognitive 520) · ×1
  • FilterUtils.getReturnType (cognitive 520) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:664 — FilterUtils.getReturnType has cognitive complexity 520 (threshold 15). Drivers by points: if/else 114 (353 pts), boolean chains 119, loops 12 (26 pts), ternaries 6 (21 pts), match/switch 1 (nesting depth added 268). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArithmeticOpAnalyzer.analyzeOperands (cognitive 398) · ×1
  • ArithmeticOpAnalyzer.analyzeOperands (cognitive 398) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:412 — ArithmeticOpAnalyzer.analyzeOperands has cognitive complexity 398 (threshold 15). Drivers by points: if/else 102 (233 pts), boolean chains 125, ternaries 5 (27 pts), loops 4 (13 pts) (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 · AtomicTypeComparator.isContainedBy (cognitive 391) · ×1
  • AtomicTypeComparator.isContainedBy (cognitive 391) src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php:77 — AtomicTypeComparator.isContainedBy has cognitive complexity 391 (threshold 15). Drivers by points: if/else 112 (246 pts), boolean chains 119, loops 11 (26 pts) (nesting depth added 149). 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 · ClassLikeNodeScanner.start (cognitive 381) · ×1
  • ClassLikeNodeScanner.start (cognitive 381) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:155 — ClassLikeNodeScanner.start has cognitive complexity 381 (threshold 15). Drivers by points: if/else 78 (194 pts), error handling 15 (57 pts), loops 22 (49 pts), boolean chains 47, ternaries 10 (34 pts) (nesting depth added 209). 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 · FunctionLikeAnalyzer.analyze (cognitive 351) · ×1
  • FunctionLikeAnalyzer.analyze (cognitive 351) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:304 — FunctionLikeAnalyzer.analyze has cognitive complexity 351 (threshold 15). Drivers by points: if/else 88 (163 pts), boolean chains 104, loops 23 (42 pts), ternaries 18 (42 pts) (nesting depth added 118). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArgumentsAnalyzer.checkArgumentsMatch (cognitive 336) · ×1
  • ArgumentsAnalyzer.checkArgumentsMatch (cognitive 336) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:1057 — ArgumentsAnalyzer.checkArgumentsMatch has cognitive complexity 336 (threshold 15). Drivers by points: if/else 58 (183 pts), ternaries 15 (77 pts), boolean chains 40, loops 15 (36 pts) (nesting depth added 208). 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 · ReturnAnalyzer.analyzeReturn (cognitive 329) · ×1
  • ReturnAnalyzer.analyzeReturn (cognitive 329) src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php:175 — ReturnAnalyzer.analyzeReturn has cognitive complexity 329 (threshold 15). Drivers by points: if/else 58 (224 pts), loops 8 (46 pts), boolean chains 43, ternaries 3 (14 pts), error handling 1 (2 pts) (nesting depth added 216). 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 · ReturnTypeAnalyzer.verifyReturnType (cognitive 310) · ×1
  • ReturnTypeAnalyzer.verifyReturnType (cognitive 310) src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:135 — ReturnTypeAnalyzer.verifyReturnType has cognitive complexity 310 (threshold 15). Drivers by points: if/else 74 (171 pts), boolean chains 126, ternaries 6 (11 pts), loops 1 (2 pts) (nesting depth added 103). 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 · UnionTypeComparator.isContainedBy (cognitive 302) · ×1
  • UnionTypeComparator.isContainedBy (cognitive 302) src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php:59 — UnionTypeComparator.isContainedBy has cognitive complexity 302 (threshold 15). Drivers by points: if/else 72 (209 pts), boolean chains 61, loops 7 (21 pts), ternaries 3 (11 pts) (nesting depth added 159). 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 · TypeCombiner.scrapeTypeProperties (cognitive 302) · ×1
  • TypeCombiner.scrapeTypeProperties (cognitive 302) src/Psalm/Internal/Type/TypeCombiner.php:485 — TypeCombiner.scrapeTypeProperties has cognitive complexity 302 (threshold 15). Drivers by points: if/else 112 (220 pts), boolean chains 51, loops 10 (23 pts), ternaries 4 (8 pts) (nesting depth added 125). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionLikeNodeScanner.start (cognitive 296) · ×1
  • FunctionLikeNodeScanner.start (cognitive 296) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:108 — FunctionLikeNodeScanner.start has cognitive complexity 296 (threshold 15). Drivers by points: if/else 62 (163 pts), boolean chains 82, loops 8 (24 pts), error handling 5 (17 pts), ternaries 3 (10 pts) (nesting depth added 136). 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 · Reconciler.reconcileKeyedTypes (cognitive 290) · ×1
  • Reconciler.reconcileKeyedTypes (cognitive 290) src/Psalm/Type/Reconciler.php:134 — Reconciler.reconcileKeyedTypes has cognitive complexity 290 (threshold 15). Drivers by points: if/else 45 (140 pts), boolean chains 73, loops 16 (57 pts), ternaries 5 (20 pts) (nesting depth added 151). 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.fromXmlAndPaths (cognitive 260) · ×1
  • Config.fromXmlAndPaths (cognitive 260) src/Psalm/Config.php:1089 — Config.fromXmlAndPaths has cognitive complexity 260 (threshold 15). Drivers by points: if/else 87 (156 pts), loops 25 (59 pts), boolean chains 29, ternaries 4 (16 pts) (nesting depth added 115). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScalarTypeComparator.isContainedBy (cognitive 260) · ×1
  • ScalarTypeComparator.isContainedBy (cognitive 260) src/Psalm/Internal/Type/Comparator/ScalarTypeComparator.php:55 — ScalarTypeComparator.isContainedBy has cognitive complexity 260 (threshold 15). Drivers by points: if/else 99 (152 pts), boolean chains 100, ternaries 3 (8 pts) (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoopAnalyzer.analyze (cognitive 256) · ×1
  • LoopAnalyzer.analyze (cognitive 256) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:73 — LoopAnalyzer.analyze has cognitive complexity 256 (threshold 15). Drivers by points: if/else 54 (144 pts), loops 24 (63 pts), boolean chains 32, ternaries 6 (15 pts), error handling 1 (2 pts) (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 · ArgumentAnalyzer.verifyType (cognitive 246) · ×1
  • ArgumentAnalyzer.verifyType (cognitive 246) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:883 — ArgumentAnalyzer.verifyType has cognitive complexity 246 (threshold 15). Drivers by points: if/else 61 (135 pts), boolean chains 68, ternaries 10 (24 pts), loops 8 (19 pts) (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 · ClassConstAnalyzer.analyzeFetch (cognitive 240) · ×1
  • ClassConstAnalyzer.analyzeFetch (cognitive 240) src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:113 — ClassConstAnalyzer.analyzeFetch has cognitive complexity 240 (threshold 15). Drivers by points: if/else 69 (162 pts), boolean chains 54, loops 4 (10 pts), error handling 4 (8 pts), ternaries 2 (6 pts) (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 · TypeCombiner.scrapeStringProperties (cognitive 239) · ×1
  • TypeCombiner.scrapeStringProperties (cognitive 239) src/Psalm/Internal/Type/TypeCombiner.php:1152 — TypeCombiner.scrapeStringProperties has cognitive complexity 239 (threshold 15). Drivers by points: if/else 44 (127 pts), boolean chains 55, loops 8 (37 pts), ternaries 5 (20 pts) (nesting depth added 127). 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 · ClassLikeDocblockParser.parse (cognitive 233) · ×1
  • ClassLikeDocblockParser.parse (cognitive 233) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:60 — ClassLikeDocblockParser.parse has cognitive complexity 233 (threshold 15). Drivers by points: if/else 61 (145 pts), loops 16 (34 pts), ternaries 5 (20 pts), error handling 5 (19 pts), boolean chains 15 (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 · TypeParser.getTypeFromGenericTree (cognitive 225) · ×1
  • TypeParser.getTypeFromGenericTree (cognitive 225) src/Psalm/Internal/Type/TypeParser.php:756 — TypeParser.getTypeFromGenericTree has cognitive complexity 225 (threshold 15). Drivers by points: if/else 70 (141 pts), boolean chains 54, ternaries 6 (18 pts), loops 7 (12 pts) (nesting depth added 88). 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 · TryAnalyzer.analyze (cognitive 223) · ×1
  • TryAnalyzer.analyze (cognitive 223) src/Psalm/Internal/Analyzer/Statements/Block/TryAnalyzer.php:43 — TryAnalyzer.analyze has cognitive complexity 223 (threshold 15). Drivers by points: if/else 49 (124 pts), loops 28 (60 pts), boolean chains 28, ternaries 3 (11 pts) (nesting depth added 115). 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 · InstancePropertyAssignmentAnalyzer.analyzeAtomicAssignment (cognitive 211) · ×1
  • InstancePropertyAssignmentAnalyzer.analyzeAtomicAssignment (cognitive 211) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1221 — InstancePropertyAssignmentAnalyzer.analyzeAtomicAssignment has cognitive complexity 211 (threshold 15). Drivers by points: if/else 60 (119 pts), boolean chains 62, ternaries 7 (17 pts), loops 4 (13 pts) (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 · Reconciler.getValueForKey (cognitive 209) · ×1
  • Reconciler.getValueForKey (cognitive 209) src/Psalm/Type/Reconciler.php:1206 — Reconciler.getValueForKey has cognitive complexity 209 (threshold 15). Drivers by points: if/else 43 (165 pts), boolean chains 28, loops 3 (9 pts), ternaries 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 132). 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 · SimpleTypeInferer.infer (cognitive 206) · ×1
  • SimpleTypeInferer.infer (cognitive 206) src/Psalm/Internal/Analyzer/Statements/Expression/SimpleTypeInferer.php:53 — SimpleTypeInferer.infer has cognitive complexity 206 (threshold 15). Drivers by points: if/else 67 (132 pts), boolean chains 53, ternaries 4 (11 pts), loops 2 (6 pts), error handling 1 (4 pts) (nesting depth added 79). 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 · ScopeAnalyzer.getControlActions (cognitive 196) · ×1
  • ScopeAnalyzer.getControlActions (cognitive 196) src/Psalm/Internal/Analyzer/ScopeAnalyzer.php:44 — ScopeAnalyzer.getControlActions has cognitive complexity 196 (threshold 15). Drivers by points: if/else 37 (120 pts), boolean chains 38, ternaries 5 (20 pts), loops 5 (15 pts), match/switch 1 (3 pts) (nesting depth added 110). 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 · ClassLikes.checkMethodReferences (cognitive 196) · ×1
  • ClassLikes.checkMethodReferences (cognitive 196) src/Psalm/Internal/Codebase/ClassLikes.php:2290 — ClassLikes.checkMethodReferences has cognitive complexity 196 (threshold 15). Drivers by points: if/else 33 (112 pts), boolean chains 32, ternaries 6 (30 pts), loops 4 (14 pts), error handling 2 (8 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 · Algebra.simplifyCNF (cognitive 195) · ×1
  • Algebra.simplifyCNF (cognitive 195) src/Psalm/Internal/Algebra.php:81 — Algebra.simplifyCNF has cognitive complexity 195 (threshold 15). Drivers by points: if/else 35 (136 pts), loops 14 (42 pts), boolean chains 17 (nesting depth added 129). 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 · ClassAnalyzer.addContextProperties (cognitive 194) · ×1
  • ClassAnalyzer.addContextProperties (cognitive 194) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:699 — ClassAnalyzer.addContextProperties has cognitive complexity 194 (threshold 15). Drivers by points: if/else 30 (100 pts), boolean chains 42, loops 8 (27 pts), ternaries 5 (20 pts), error handling 1 (5 pts) (nesting depth added 108). 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 · FileFilter.loadFromArray (cognitive 193) · ×1
  • FileFilter.loadFromArray (cognitive 193) src/Psalm/Config/FileFilter.php:116 — FileFilter.loadFromArray has cognitive complexity 193 (threshold 15). Drivers by points: if/else 43 (146 pts), loops 11 (28 pts), boolean chains 19 (nesting depth added 120). 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 · FormulaGenerator.getFormula (cognitive 188) · ×1
  • FormulaGenerator.getFormula (cognitive 188) src/Psalm/Internal/Algebra/FormulaGenerator.php:61 — FormulaGenerator.getFormula has cognitive complexity 188 (threshold 15). Drivers by points: if/else 41 (83 pts), boolean chains 52, loops 11 (37 pts), ternaries 5 (16 pts) (nesting depth added 79). 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 · Methods.getMethodReturnType (cognitive 188) · ×1
  • Methods.getMethodReturnType (cognitive 188) src/Psalm/Internal/Codebase/Methods.php:629 — Methods.getMethodReturnType has cognitive complexity 188 (threshold 15). Drivers by points: if/else 48 (130 pts), boolean chains 37, loops 5 (13 pts), error handling 1 (5 pts), ternaries 1 (3 pts) (nesting depth added 96). 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 · PhpStormMetaScanner.handleOverride (cognitive 188) · ×1
  • PhpStormMetaScanner.handleOverride (cognitive 188) src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:33 — PhpStormMetaScanner.handleOverride has cognitive complexity 188 (threshold 15). Drivers by points: if/else 43 (137 pts), boolean chains 40, ternaries 3 (9 pts), loops 1 (2 pts) (nesting depth added 101). 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 · ArrayMergeReturnTypeProvider.getFunctionReturnType (cognitive 186) · ×1
  • ArrayMergeReturnTypeProvider.getFunctionReturnType (cognitive 186) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMergeReturnTypeProvider.php:48 — ArrayMergeReturnTypeProvider.getFunctionReturnType has cognitive complexity 186 (threshold 15). Drivers by points: if/else 39 (127 pts), loops 8 (27 pts), boolean chains 25, ternaries 3 (7 pts) (nesting depth added 111). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartialParserVisitor.enterNode (cognitive 185) · ×1
  • PartialParserVisitor.enterNode (cognitive 185) src/Psalm/Internal/PhpVisitor/PartialParserVisitor.php:59 — PartialParserVisitor.enterNode has cognitive complexity 185 (threshold 15). Drivers by points: if/else 34 (128 pts), loops 7 (32 pts), boolean chains 13, ternaries 2 (12 pts) (nesting depth added 129). 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 · VariableFetchAnalyzer.analyze (cognitive 182) · ×1
  • VariableFetchAnalyzer.analyze (cognitive 182) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php:71 — VariableFetchAnalyzer.analyze has cognitive complexity 182 (threshold 15). Drivers by points: if/else 53 (132 pts), boolean chains 31, ternaries 5 (12 pts), loops 2 (7 pts) (nesting depth added 91). 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 · ReflectorVisitor.enterNode (cognitive 182) · ×1
  • ReflectorVisitor.enterNode (cognitive 182) src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:113 — ReflectorVisitor.enterNode has cognitive complexity 182 (threshold 15). Drivers by points: if/else 40 (99 pts), boolean chains 40, loops 12 (28 pts), error handling 3 (8 pts), ternaries 2 (7 pts) (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 · TemplateStandinTypeReplacer.handleTemplateParamStandin (cognitive 180) · ×1
  • TemplateStandinTypeReplacer.handleTemplateParamStandin (cognitive 180) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:735 — TemplateStandinTypeReplacer.handleTemplateParamStandin has cognitive complexity 180 (threshold 15). Drivers by points: if/else 40 (115 pts), loops 12 (40 pts), boolean chains 25 (nesting depth added 103). 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 · AtomicStaticCallAnalyzer.handleNamedCall (cognitive 175) · ×1
  • AtomicStaticCallAnalyzer.handleNamedCall (cognitive 175) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php:362 — AtomicStaticCallAnalyzer.handleNamedCall has cognitive complexity 175 (threshold 15). Drivers by points: if/else 43 (100 pts), boolean chains 51, ternaries 9 (18 pts), loops 2 (6 pts) (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 · NamedFunctionCallHandler.handle (cognitive 163) · ×1
  • NamedFunctionCallHandler.handle (cognitive 163) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:75 — NamedFunctionCallHandler.handle has cognitive complexity 163 (threshold 15). Drivers by points: if/else 68 (123 pts), boolean chains 32, loops 3 (8 pts) (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 · StaticCallAnalyzer.analyze (cognitive 162) · ×1
  • StaticCallAnalyzer.analyze (cognitive 162) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php:51 — StaticCallAnalyzer.analyze has cognitive complexity 162 (threshold 15). Drivers by points: if/else 34 (86 pts), boolean chains 31, loops 7 (25 pts), ternaries 6 (20 pts) (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 · ExistingAtomicStaticCallAnalyzer.analyze (cognitive 160) · ×1
  • ExistingAtomicStaticCallAnalyzer.analyze (cognitive 160) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php:71 — ExistingAtomicStaticCallAnalyzer.analyze has cognitive complexity 160 (threshold 15). Drivers by points: if/else 38 (74 pts), boolean chains 51, loops 5 (20 pts), ternaries 9 (15 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeExpander.expandAtomic (cognitive 160) · ×1
  • TypeExpander.expandAtomic (cognitive 160) src/Psalm/Internal/Type/TypeExpander.php:235 — TypeExpander.expandAtomic has cognitive complexity 160 (threshold 15). Drivers by points: if/else 50 (101 pts), loops 11 (28 pts), boolean chains 16, ternaries 4 (12 pts), error handling 1 (3 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 · ForeachAnalyzer.handleIterable (cognitive 159) · ×1
  • ForeachAnalyzer.handleIterable (cognitive 159) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1578 — ForeachAnalyzer.handleIterable has cognitive complexity 159 (threshold 15). Drivers by points: if/else 29 (117 pts), boolean chains 36, loops 2 (6 pts) (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 · Reconciler.addNestedAssertions (cognitive 158) · ×1
  • Reconciler.addNestedAssertions (cognitive 158) src/Psalm/Type/Reconciler.php:787 — Reconciler.addNestedAssertions has cognitive complexity 158 (threshold 15). Drivers by points: if/else 31 (104 pts), boolean chains 24, ternaries 4 (16 pts), loops 6 (14 pts) (nesting depth added 93). 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 · AssignmentAnalyzer.analyzeAfterTheKeys (cognitive 157) · ×1
  • AssignmentAnalyzer.analyzeAfterTheKeys (cognitive 157) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:339 — AssignmentAnalyzer.analyzeAfterTheKeys has cognitive complexity 157 (threshold 15). Drivers by points: if/else 49 (90 pts), boolean chains 44, ternaries 5 (14 pts), loops 4 (9 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArgumentAnalyzer.checkFunctionLikeTypeMatches (cognitive 156) · ×1
  • ArgumentAnalyzer.checkFunctionLikeTypeMatches (cognitive 156) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:300 — ArgumentAnalyzer.checkFunctionLikeTypeMatches has cognitive complexity 156 (threshold 15). Drivers by points: if/else 43 (105 pts), boolean chains 26, ternaries 7 (16 pts), loops 3 (9 pts) (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 · ConstantTypeResolver.resolve (cognitive 155) · ×1
  • ConstantTypeResolver.resolve (cognitive 155) src/Psalm/Internal/Codebase/ConstantTypeResolver.php:120 — ConstantTypeResolver.resolve has cognitive complexity 155 (threshold 15). Drivers by points: if/else 48 (118 pts), boolean chains 24, ternaries 2 (7 pts), loops 2 (6 pts) (nesting depth added 79). 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 · ClassAnalyzer.analyzeClass (cognitive 151) · ×1
  • ClassAnalyzer.analyzeClass (cognitive 151) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:213 — ClassAnalyzer.analyzeClass has cognitive complexity 151 (threshold 15). Drivers by points: if/else 38 (96 pts), loops 13 (34 pts), boolean chains 11, ternaries 3 (6 pts), error handling 1 (4 pts) (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 · ArgumentAnalyzer.verifyExplicitParam (cognitive 151) · ×1
  • ArgumentAnalyzer.verifyExplicitParam (cognitive 151) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:1744 — ArgumentAnalyzer.verifyExplicitParam has cognitive complexity 151 (threshold 15). Drivers by points: if/else 21 (113 pts), loops 5 (19 pts), boolean chains 12, match/switch 1 (7 pts) (nesting depth added 112). 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 · ClassAnalyzer.checkPropertyInitialization (cognitive 150) · ×1
  • ClassAnalyzer.checkPropertyInitialization (cognitive 150) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:1191 — ClassAnalyzer.checkPropertyInitialization has cognitive complexity 150 (threshold 15). Drivers by points: if/else 38 (87 pts), boolean chains 27, ternaries 6 (20 pts), loops 6 (16 pts) (nesting depth added 73). 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 · IfElseAnalyzer.analyze (cognitive 146) · ×1
  • IfElseAnalyzer.analyze (cognitive 146) src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:76 — IfElseAnalyzer.analyze has cognitive complexity 146 (threshold 15). Drivers by points: if/else 38 (74 pts), boolean chains 29, loops 16 (27 pts), ternaries 10 (14 pts), error handling 2 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SwitchCaseAnalyzer.analyze (cognitive 145) · ×1
  • SwitchCaseAnalyzer.analyze (cognitive 145) src/Psalm/Internal/Analyzer/Statements/Block/SwitchCaseAnalyzer.php:66 — SwitchCaseAnalyzer.analyze has cognitive complexity 145 (threshold 15). Drivers by points: if/else 49 (85 pts), boolean chains 28, ternaries 8 (19 pts), loops 4 (11 pts), error handling 1 (2 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayFetchAnalyzer.handleArrayAccessOnKeyedArray (cognitive 144) · ×1
  • ArrayFetchAnalyzer.handleArrayAccessOnKeyedArray (cognitive 144) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1966 — ArrayFetchAnalyzer.handleArrayAccessOnKeyedArray has cognitive complexity 144 (threshold 15). Drivers by points: if/else 29 (88 pts), ternaries 6 (22 pts), boolean chains 20, loops 3 (14 pts) (nesting depth added 86). 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 · IssueBuffer.finish (cognitive 144) · ×1
  • IssueBuffer.finish (cognitive 144) src/Psalm/IssueBuffer.php:748 — IssueBuffer.finish has cognitive complexity 144 (threshold 15). Drivers by points: if/else 32 (74 pts), loops 12 (30 pts), boolean chains 19, ternaries 5 (19 pts), error handling 1 (2 pts) (nesting depth added 75). 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 · AssignmentAnalyzer.analyzeDestructuringAssignment (cognitive 143) · ×1
  • AssignmentAnalyzer.analyzeDestructuringAssignment (cognitive 143) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:2456 — AssignmentAnalyzer.analyzeDestructuringAssignment has cognitive complexity 143 (threshold 15). Drivers by points: if/else 33 (105 pts), boolean chains 20, ternaries 2 (8 pts), loops 3 (6 pts), error handling 1 (4 pts) (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 · ClassLikeNodeScanner.visitPropertyDeclaration (cognitive 143) · ×1
  • ClassLikeNodeScanner.visitPropertyDeclaration (cognitive 143) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1989 — ClassLikeNodeScanner.visitPropertyDeclaration has cognitive complexity 143 (threshold 15). Drivers by points: if/else 34 (84 pts), boolean chains 32, ternaries 7 (14 pts), loops 4 (9 pts), error handling 2 (4 pts) (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExistingAtomicMethodCallAnalyzer.analyze (cognitive 141) · ×1
  • ExistingAtomicMethodCallAnalyzer.analyze (cognitive 141) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:74 — ExistingAtomicMethodCallAnalyzer.analyze has cognitive complexity 141 (threshold 15). Drivers by points: if/else 43 (73 pts), boolean chains 47, loops 4 (10 pts), ternaries 5 (10 pts), error handling 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SprintfReturnTypeProvider.getFunctionReturnType (cognitive 139) · ×1
  • SprintfReturnTypeProvider.getFunctionReturnType (cognitive 139) src/Psalm/Internal/Provider/ReturnTypeProvider/SprintfReturnTypeProvider.php:54 — SprintfReturnTypeProvider.getFunctionReturnType has cognitive complexity 139 (threshold 15). Drivers by points: if/else 33 (100 pts), boolean chains 18, error handling 2 (8 pts), loops 4 (7 pts), ternaries 2 (6 pts) (nesting depth added 80). 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 · ArrayFetchAnalyzer.getArrayAccessTypeGivenOffset (cognitive 137) · ×1
  • ArrayFetchAnalyzer.getArrayAccessTypeGivenOffset (cognitive 137) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:862 — ArrayFetchAnalyzer.getArrayAccessTypeGivenOffset has cognitive complexity 137 (threshold 15). Drivers by points: if/else 50 (100 pts), boolean chains 30, loops 3 (7 pts) (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArgumentsAnalyzer.handlePossiblyMatchingByRefParam (cognitive 135) · ×1
  • ArgumentsAnalyzer.handlePossiblyMatchingByRefParam (cognitive 135) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:1669 — ArgumentsAnalyzer.handlePossiblyMatchingByRefParam has cognitive complexity 135 (threshold 15). Drivers by points: if/else 21 (59 pts), boolean chains 39, ternaries 10 (30 pts), loops 2 (7 pts) (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 · AtomicMethodCallAnalyzer.analyze (cognitive 135) · ×1
  • AtomicMethodCallAnalyzer.analyze (cognitive 135) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php:69 — AtomicMethodCallAnalyzer.analyze has cognitive complexity 135 (threshold 15). Drivers by points: if/else 39 (75 pts), boolean chains 35, ternaries 12 (19 pts), loops 2 (6 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassStatementsDiffer.diff (cognitive 135) · ×1
  • ClassStatementsDiffer.diff (cognitive 135) src/Psalm/Internal/Diff/ClassStatementsDiffer.php:35 — ClassStatementsDiffer.diff has cognitive complexity 135 (threshold 15). Drivers by points: if/else 35 (81 pts), loops 9 (34 pts), boolean chains 13, ternaries 2 (7 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 · NegatedAssertionReconciler.reconcile (cognitive 135) · ×1
  • NegatedAssertionReconciler.reconcile (cognitive 135) src/Psalm/Internal/Type/NegatedAssertionReconciler.php:57 — NegatedAssertionReconciler.reconcile has cognitive complexity 135 (threshold 15). Drivers by points: if/else 28 (72 pts), boolean chains 50, ternaries 3 (7 pts), loops 2 (6 pts) (nesting depth added 52). 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 · FunctionCallAnalyzer.getAnalyzeNamedExpression (cognitive 134) · ×1
  • FunctionCallAnalyzer.getAnalyzeNamedExpression (cognitive 134) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1393 — FunctionCallAnalyzer.getAnalyzeNamedExpression has cognitive complexity 134 (threshold 15). Drivers by points: if/else 29 (88 pts), boolean chains 18, ternaries 4 (18 pts), loops 3 (10 pts) (nesting depth added 80). 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 · ArrayColumnReturnTypeProvider.getFunctionReturnType (cognitive 133) · ×1
  • ArrayColumnReturnTypeProvider.getFunctionReturnType (cognitive 133) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayColumnReturnTypeProvider.php:58 — ArrayColumnReturnTypeProvider.getFunctionReturnType has cognitive complexity 133 (threshold 15). Drivers by points: if/else 36 (96 pts), boolean chains 25, ternaries 4 (9 pts), loops 1 (3 pts) (nesting depth added 67). 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 · BinaryOpAnalyzer.analyze (cognitive 132) · ×1
  • BinaryOpAnalyzer.analyze (cognitive 132) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php:54 — BinaryOpAnalyzer.analyze has cognitive complexity 132 (threshold 15). Drivers by points: if/else 33 (77 pts), boolean chains 48, loops 1 (4 pts), ternaries 1 (3 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 · ArgumentsAnalyzer.checkArgCount (cognitive 132) · ×1
  • ArgumentsAnalyzer.checkArgCount (cognitive 132) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:2532 — ArgumentsAnalyzer.checkArgCount has cognitive complexity 132 (threshold 15). Drivers by points: if/else 21 (79 pts), loops 6 (25 pts), boolean chains 17, ternaries 4 (11 pts) (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 · MethodCallAnalyzer.analyze (cognitive 132) · ×1
  • MethodCallAnalyzer.analyze (cognitive 132) src/Psalm/Internal/Analyzer/Statements/Expression/Call/MethodCallAnalyzer.php:54 — MethodCallAnalyzer.analyze has cognitive complexity 132 (threshold 15). Drivers by points: if/else 47 (72 pts), boolean chains 51, ternaries 4 (5 pts), loops 3 (4 pts) (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 · Analyzer.shiftFileOffsets (cognitive 132) · ×1
  • Analyzer.shiftFileOffsets (cognitive 132) src/Psalm/Internal/Codebase/Analyzer.php:706 — Analyzer.shiftFileOffsets has cognitive complexity 132 (threshold 15). Drivers by points: if/else 20 (64 pts), loops 20 (60 pts), boolean chains 8 (nesting depth added 84). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCallReturnTypeFetcher.getReturnTypeFromCallMapWithArgs (cognitive 131) · ×1
  • FunctionCallReturnTypeFetcher.getReturnTypeFromCallMapWithArgs (cognitive 131) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:407 — FunctionCallReturnTypeFetcher.getReturnTypeFromCallMapWithArgs has cognitive complexity 131 (threshold 15). Drivers by points: if/else 26 (103 pts), ternaries 4 (14 pts), boolean chains 9, match/switch 3 (5 pts) (nesting depth added 89). 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 · ArrayReduceReturnTypeProvider.getFunctionReturnType (cognitive 130) · ×1
  • ArrayReduceReturnTypeProvider.getFunctionReturnType (cognitive 130) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReduceReturnTypeProvider.php:49 — ArrayReduceReturnTypeProvider.getFunctionReturnType has cognitive complexity 130 (threshold 15). Drivers by points: if/else 27 (82 pts), ternaries 7 (29 pts), boolean chains 14, loops 2 (5 pts) (nesting depth added 80). 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 · FunctionLikeAnalyzer.processParams (cognitive 129) · ×1
  • FunctionLikeAnalyzer.processParams (cognitive 129) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:1781 — FunctionLikeAnalyzer.processParams has cognitive complexity 129 (threshold 15). Drivers by points: if/else 35 (91 pts), boolean chains 28, ternaries 2 (6 pts), error handling 1 (3 pts), loops 1 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConcatAnalyzer.analyze (cognitive 129) · ×1
  • ConcatAnalyzer.analyze (cognitive 129) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:239 — ConcatAnalyzer.analyze has cognitive complexity 129 (threshold 15). Drivers by points: if/else 25 (76 pts), boolean chains 23, loops 4 (19 pts), ternaries 3 (11 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 · AtomicPropertyFetchAnalyzer.analyze (cognitive 128) · ×1
  • AtomicPropertyFetchAnalyzer.analyze (cognitive 128) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:89 — AtomicPropertyFetchAnalyzer.analyze has cognitive complexity 128 (threshold 15). Drivers by points: if/else 43 (73 pts), boolean chains 30, ternaries 7 (17 pts), loops 3 (8 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstancePropertyFetchAnalyzer.handleScopedProperty (cognitive 126) · ×1
  • InstancePropertyFetchAnalyzer.handleScopedProperty (cognitive 126) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:498 — InstancePropertyFetchAnalyzer.handleScopedProperty has cognitive complexity 126 (threshold 15). Drivers by points: if/else 23 (77 pts), boolean chains 25, ternaries 3 (15 pts), loops 3 (9 pts) (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 · ArrayAssignmentAnalyzer.updateArrayAssignmentChildType (cognitive 124) · ×1
  • ArrayAssignmentAnalyzer.updateArrayAssignmentChildType (cognitive 124) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:927 — ArrayAssignmentAnalyzer.updateArrayAssignmentChildType has cognitive complexity 124 (threshold 15). Drivers by points: if/else 31 (76 pts), boolean chains 31, ternaries 4 (10 pts), loops 2 (7 pts) (nesting depth added 56). 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 · ArrayFilterReturnTypeProvider.getFunctionReturnType (cognitive 123) · ×1
  • ArrayFilterReturnTypeProvider.getFunctionReturnType (cognitive 123) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php:56 — ArrayFilterReturnTypeProvider.getFunctionReturnType has cognitive complexity 123 (threshold 15). Drivers by points: if/else 30 (73 pts), boolean chains 24, ternaries 4 (17 pts), error handling 1 (5 pts), loops 1 (4 pts) (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 · FunctionLikeAnalyzer.getFunctionInformation (cognitive 122) · ×1
  • FunctionLikeAnalyzer.getFunctionInformation (cognitive 122) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2871 — FunctionLikeAnalyzer.getFunctionInformation has cognitive complexity 122 (threshold 15). Drivers by points: if/else 28 (74 pts), boolean chains 21, loops 5 (15 pts), ternaries 4 (12 pts) (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 · BreakAnalyzer.analyze (cognitive 121) · ×1
  • BreakAnalyzer.analyze (cognitive 121) src/Psalm/Internal/Analyzer/Statements/BreakAnalyzer.php:26 — BreakAnalyzer.analyze has cognitive complexity 121 (threshold 15). Drivers by points: if/else 23 (62 pts), loops 10 (29 pts), boolean chains 15, ternaries 5 (15 pts) (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 · ArrayAnalyzer.analyzeArrayItem (cognitive 121) · ×1
  • ArrayAnalyzer.analyzeArrayItem (cognitive 121) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:365 — ArrayAnalyzer.analyzeArrayItem has cognitive complexity 121 (threshold 15). Drivers by points: if/else 39 (89 pts), boolean chains 12, ternaries 3 (12 pts), loops 2 (8 pts) (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 · CallAnalyzer.applyAssertionsToContext (cognitive 121) · ×1
  • CallAnalyzer.applyAssertionsToContext (cognitive 121) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:951 — CallAnalyzer.applyAssertionsToContext has cognitive complexity 121 (threshold 15). Drivers by points: if/else 21 (74 pts), loops 7 (26 pts), boolean chains 12, ternaries 1 (5 pts), error handling 1 (4 pts) (nesting depth added 79). 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 · StatementsAnalyzer.analyzeStatement (cognitive 121) · ×1
  • StatementsAnalyzer.analyzeStatement (cognitive 121) src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:615 — StatementsAnalyzer.analyzeStatement has cognitive complexity 121 (threshold 15). Drivers by points: if/else 33 (68 pts), loops 9 (26 pts), boolean chains 18, error handling 2 (6 pts), ternaries 1 (3 pts) (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 · ExpressionScanner.registerClassMapFunctionCall (cognitive 119) · ×1
  • ExpressionScanner.registerClassMapFunctionCall (cognitive 119) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionScanner.php:204 — ExpressionScanner.registerClassMapFunctionCall has cognitive complexity 119 (threshold 15). Drivers by points: if/else 29 (68 pts), boolean chains 24, loops 4 (12 pts), ternaries 4 (10 pts), error handling 1 (5 pts) (nesting depth added 57). 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 · Codebase.getCompletionItemsForClassishThing (cognitive 118) · ×1
  • Codebase.getCompletionItemsForClassishThing (cognitive 118) src/Psalm/Codebase.php:2366 — Codebase.getCompletionItemsForClassishThing has cognitive complexity 118 (threshold 15). Drivers by points: if/else 16 (59 pts), loops 11 (40 pts), error handling 3 (11 pts), ternaries 1 (5 pts), boolean chains 3 (nesting depth added 84). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClosureAnalyzer.analyzeExpression (cognitive 118) · ×1
  • ClosureAnalyzer.analyzeExpression (cognitive 118) src/Psalm/Internal/Analyzer/ClosureAnalyzer.php:332 — ClosureAnalyzer.analyzeExpression has cognitive complexity 118 (threshold 15). Drivers by points: if/else 25 (62 pts), loops 11 (27 pts), ternaries 5 (16 pts), boolean chains 13 (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArgumentsAnalyzer.handleClosureArg (cognitive 118) · ×1
  • ArgumentsAnalyzer.handleClosureArg (cognitive 118) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:625 — ArgumentsAnalyzer.handleClosureArg has cognitive complexity 118 (threshold 15). Drivers by points: if/else 20 (67 pts), loops 12 (26 pts), boolean chains 15, ternaries 5 (9 pts), error handling 1 (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 · ArrayFunctionArgumentsAnalyzer.checkClosureType (cognitive 117) · ×1
  • ArrayFunctionArgumentsAnalyzer.checkClosureType (cognitive 117) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:792 — ArrayFunctionArgumentsAnalyzer.checkClosureType has cognitive complexity 117 (threshold 15). Drivers by points: if/else 20 (70 pts), loops 6 (24 pts), ternaries 2 (10 pts), error handling 1 (5 pts), match/switch 1 (5 pts), boolean chains 3 (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 · FunctionLikeDocblockParser.parse (cognitive 117) · ×1
  • FunctionLikeDocblockParser.parse (cognitive 117) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:63 — FunctionLikeDocblockParser.parse has cognitive complexity 117 (threshold 15). Drivers by points: if/else 33 (64 pts), loops 16 (33 pts), boolean chains 14, error handling 1 (3 pts), ternaries 1 (3 pts) (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 · ExpressionResolver.getUnresolvedClassConstExpr (cognitive 115) · ×1
  • ExpressionResolver.getUnresolvedClassConstExpr (cognitive 115) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:74 — ExpressionResolver.getUnresolvedClassConstExpr has cognitive complexity 115 (threshold 15). Drivers by points: if/else 49 (90 pts), boolean chains 23, loops 1 (2 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionLikeDocblockScanner.addDocblockInfo (cognitive 115) · ×1
  • FunctionLikeDocblockScanner.addDocblockInfo (cognitive 115) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:94 — FunctionLikeDocblockScanner.addDocblockInfo has cognitive complexity 115 (threshold 15). Drivers by points: if/else 37 (59 pts), boolean chains 24, loops 16 (23 pts), ternaries 5 (7 pts), error handling 1 (2 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCallAnalyzer.analyze (cognitive 114) · ×1
  • FunctionCallAnalyzer.analyze (cognitive 114) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:113 — FunctionCallAnalyzer.analyze has cognitive complexity 114 (threshold 15). Drivers by points: if/else 47 (78 pts), boolean chains 26, loops 4 (6 pts), ternaries 2 (4 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionLikeNodeScanner.createStorageForFunctionLike (cognitive 114) · ×1
  • FunctionLikeNodeScanner.createStorageForFunctionLike (cognitive 114) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:1170 — FunctionLikeNodeScanner.createStorageForFunctionLike has cognitive complexity 114 (threshold 15). Drivers by points: if/else 28 (77 pts), boolean chains 20, ternaries 3 (10 pts), error handling 1 (4 pts), loops 1 (3 pts) (nesting depth added 61). 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 · AssertionFinder.getArrayKeyExistsAssertions (cognitive 113) · ×1
  • AssertionFinder.getArrayKeyExistsAssertions (cognitive 113) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4228 — AssertionFinder.getArrayKeyExistsAssertions has cognitive complexity 113 (threshold 15). Drivers by points: if/else 22 (58 pts), boolean chains 24, ternaries 5 (19 pts), loops 3 (12 pts) (nesting depth added 59). 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 · NegatedAssertionReconciler.handleLiteralNegatedEquality (cognitive 113) · ×1
  • NegatedAssertionReconciler.handleLiteralNegatedEquality (cognitive 113) src/Psalm/Internal/Type/NegatedAssertionReconciler.php:384 — NegatedAssertionReconciler.handleLiteralNegatedEquality has cognitive complexity 113 (threshold 15). Drivers by points: if/else 27 (83 pts), boolean chains 15, loops 4 (15 pts) (nesting depth added 67). 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 · ForeachAnalyzer.analyze (cognitive 112) · ×1
  • ForeachAnalyzer.analyze (cognitive 112) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:114 — ForeachAnalyzer.analyze has cognitive complexity 112 (threshold 15). Drivers by points: if/else 37 (61 pts), boolean chains 41, loops 3 (4 pts), ternaries 3 (4 pts), error handling 1 (2 pts) (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 · ArrayMultisortParamsProvider.getFunctionParams (cognitive 111) · ×1
  • ArrayMultisortParamsProvider.getFunctionParams (cognitive 111) src/Psalm/Internal/Provider/ParamsProvider/ArrayMultisortParamsProvider.php:58 — ArrayMultisortParamsProvider.getFunctionParams has cognitive complexity 111 (threshold 15). Drivers by points: if/else 31 (92 pts), boolean chains 9, ternaries 2 (6 pts), loops 2 (4 pts) (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayFetchAnalyzer.analyze (cognitive 110) · ×1
  • ArrayFetchAnalyzer.analyze (cognitive 110) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:152 — ArrayFetchAnalyzer.analyze has cognitive complexity 110 (threshold 15). Drivers by points: if/else 33 (64 pts), boolean chains 40, loops 1 (4 pts), ternaries 1 (2 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KeyedArrayComparator.isContainedBy (cognitive 110) · ×1
  • KeyedArrayComparator.isContainedBy (cognitive 110) src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:30 — KeyedArrayComparator.isContainedBy has cognitive complexity 110 (threshold 15). Drivers by points: if/else 24 (67 pts), boolean chains 35, loops 3 (5 pts), ternaries 1 (3 pts) (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 · ClassTemplateParamCollector.collect (cognitive 109) · ×1
  • ClassTemplateParamCollector.collect (cognitive 109) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ClassTemplateParamCollector.php:37 — ClassTemplateParamCollector.collect has cognitive complexity 109 (threshold 15). Drivers by points: if/else 24 (67 pts), loops 8 (20 pts), boolean chains 15, ternaries 2 (7 pts) (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 · ArgumentsAnalyzer.analyzeArguments (cognitive 107) · ×1
  • ArgumentsAnalyzer.analyzeArguments (cognitive 107) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:150 — ArgumentsAnalyzer.analyzeArguments has cognitive complexity 107 (threshold 15). Drivers by points: boolean chains 49, if/else 24 (48 pts), ternaries 4 (9 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CallAnalyzer.collectSpecialInformation (cognitive 107) · ×1
  • CallAnalyzer.collectSpecialInformation (cognitive 107) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:86 — CallAnalyzer.collectSpecialInformation has cognitive complexity 107 (threshold 15). Drivers by points: if/else 23 (76 pts), loops 5 (17 pts), boolean chains 11, ternaries 1 (3 pts) (nesting depth added 67). 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 · Functions.getCallMapFunctionCapabilities (cognitive 107) · ×1
  • Functions.getCallMapFunctionCapabilities (cognitive 107) src/Psalm/Internal/Codebase/Functions.php:458 — Functions.getCallMapFunctionCapabilities has cognitive complexity 107 (threshold 15). Drivers by points: boolean chains 40, if/else 24 (37 pts), ternaries 7 (17 pts), loops 3 (8 pts), error handling 1 (5 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 · TypeCombiner.combine (cognitive 107) · ×1
  • TypeCombiner.combine (cognitive 107) src/Psalm/Internal/Type/TypeCombiner.php:103 — TypeCombiner.combine has cognitive complexity 107 (threshold 15). Drivers by points: if/else 37 (60 pts), boolean chains 33, loops 8 (14 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayFunctionArgumentsAnalyzer.handleByRefArrayAdjustment (cognitive 105) · ×1
  • ArrayFunctionArgumentsAnalyzer.handleByRefArrayAdjustment (cognitive 105) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:653 — ArrayFunctionArgumentsAnalyzer.handleByRefArrayAdjustment has cognitive complexity 105 (threshold 15). Drivers by points: if/else 21 (72 pts), ternaries 2 (12 pts), boolean chains 11, loops 2 (10 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 · NewAnalyzer.getNewType (cognitive 105) · ×1
  • NewAnalyzer.getNewType (cognitive 105) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1544 — NewAnalyzer.getNewType has cognitive complexity 105 (threshold 15). Drivers by points: if/else 23 (79 pts), boolean chains 11, ternaries 2 (8 pts), loops 2 (7 pts) (nesting depth added 67). 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 · Populator.populateOverriddenMethods (cognitive 105) · ×1
  • Populator.populateOverriddenMethods (cognitive 105) src/Psalm/Internal/Codebase/Populator.php:776 — Populator.populateOverriddenMethods has cognitive complexity 105 (threshold 15). Drivers by points: if/else 21 (73 pts), boolean chains 14, loops 8 (14 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 60). 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 · Analyzer.loadCachedResults (cognitive 104) · ×1
  • Analyzer.loadCachedResults (cognitive 104) src/Psalm/Internal/Codebase/Analyzer.php:419 — Analyzer.loadCachedResults has cognitive complexity 104 (threshold 15). Drivers by points: if/else 15 (49 pts), loops 24 (44 pts), error handling 1 (7 pts), boolean chains 4 (nesting depth added 60). 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 · FunctionDocblockManipulator.getDocblock (cognitive 102) · ×1
  • FunctionDocblockManipulator.getDocblock (cognitive 102) src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:344 — FunctionDocblockManipulator.getDocblock has cognitive complexity 102 (threshold 15). Drivers by points: if/else 29 (73 pts), loops 7 (14 pts), ternaries 4 (9 pts), boolean chains 6 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeTokenizer.tokenize (cognitive 102) · ×1
  • TypeTokenizer.tokenize (cognitive 102) src/Psalm/Internal/Type/TypeTokenizer.php:142 — TypeTokenizer.tokenize has cognitive complexity 102 (threshold 15). Drivers by points: if/else 27 (61 pts), boolean chains 40, loops 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionReconciler.refine (cognitive 101) · ×1
  • AssertionReconciler.refine (cognitive 101) src/Psalm/Internal/Type/AssertionReconciler.php:648 — AssertionReconciler.refine has cognitive complexity 101 (threshold 15). Drivers by points: if/else 28 (64 pts), boolean chains 25, loops 4 (8 pts), ternaries 2 (4 pts) (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 · Methods.getMethodParams (cognitive 100) · ×1
  • Methods.getMethodParams (cognitive 100) src/Psalm/Internal/Codebase/Methods.php:282 — Methods.getMethodParams has cognitive complexity 100 (threshold 15). Drivers by points: if/else 19 (54 pts), loops 7 (23 pts), boolean chains 13, ternaries 4 (10 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionLikeDocblockParser.parseTaintTags (cognitive 100) · ×1
  • FunctionLikeDocblockParser.parseTaintTags (cognitive 100) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:476 — FunctionLikeDocblockParser.parseTaintTags has cognitive complexity 100 (threshold 15). Drivers by points: if/else 31 (80 pts), loops 7 (14 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 59). 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 · GenericTypeComparator.isContainedBy (cognitive 99) · ×1
  • GenericTypeComparator.isContainedBy (cognitive 99) src/Psalm/Internal/Type/Comparator/GenericTypeComparator.php:26 — GenericTypeComparator.isContainedBy has cognitive complexity 99 (threshold 15). Drivers by points: if/else 26 (65 pts), boolean chains 28, loops 2 (6 pts) (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 · MethodComparator.compareMethodParams (cognitive 98) · ×1
  • MethodComparator.compareMethodParams (cognitive 98) src/Psalm/Internal/Analyzer/MethodComparator.php:700 — MethodComparator.compareMethodParams has cognitive complexity 98 (threshold 15). Drivers by points: if/else 18 (48 pts), boolean chains 29, ternaries 6 (21 pts) (nesting depth added 45). 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 · CallAnalyzer.checkTemplateResult (cognitive 98) · ×1
  • CallAnalyzer.checkTemplateResult (cognitive 98) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:1266 — CallAnalyzer.checkTemplateResult has cognitive complexity 98 (threshold 15). Drivers by points: if/else 17 (67 pts), loops 7 (26 pts), boolean chains 5 (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 · CallableTypeComparator.getCallableMethodIdFromTKeyedArray (cognitive 97) · ×1
  • CallableTypeComparator.getCallableMethodIdFromTKeyedArray (cognitive 97) src/Psalm/Internal/Type/Comparator/CallableTypeComparator.php:897 — CallableTypeComparator.getCallableMethodIdFromTKeyedArray has cognitive complexity 97 (threshold 15). Drivers by points: if/else 19 (58 pts), ternaries 3 (15 pts), boolean chains 14, loops 3 (10 pts) (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 · InstancePropertyFetchAnalyzer.analyze (cognitive 96) · ×1
  • InstancePropertyFetchAnalyzer.analyze (cognitive 96) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:69 — InstancePropertyFetchAnalyzer.analyze has cognitive complexity 96 (threshold 15). Drivers by points: if/else 32 (47 pts), boolean chains 35, ternaries 3 (10 pts), loops 2 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Populator.populateClassLikeStorage (cognitive 96) · ×1
  • Populator.populateClassLikeStorage (cognitive 96) src/Psalm/Internal/Codebase/Populator.php:529 — Populator.populateClassLikeStorage has cognitive complexity 96 (threshold 15). Drivers by points: if/else 24 (49 pts), loops 19 (34 pts), boolean chains 13 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionLikeDocblockScanner.improveParamsFromDocblock (cognitive 96) · ×1
  • FunctionLikeDocblockScanner.improveParamsFromDocblock (cognitive 96) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:972 — FunctionLikeDocblockScanner.improveParamsFromDocblock has cognitive complexity 96 (threshold 15). Drivers by points: if/else 23 (59 pts), boolean chains 19, loops 5 (12 pts), ternaries 3 (4 pts), error handling 1 (2 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TemplateInferredTypeReplacer.replace (cognitive 96) · ×1
  • TemplateInferredTypeReplacer.replace (cognitive 96) src/Psalm/Internal/Type/TemplateInferredTypeReplacer.php:58 — TemplateInferredTypeReplacer.replace has cognitive complexity 96 (threshold 15). Drivers by points: if/else 19 (56 pts), loops 6 (19 pts), boolean chains 11, ternaries 3 (10 pts) (nesting depth added 57). 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 · ClassLikes.consolidateAnalyzedData (cognitive 95) · ×1
  • ClassLikes.consolidateAnalyzedData (cognitive 95) src/Psalm/Internal/Codebase/ClassLikes.php:864 — ClassLikes.consolidateAnalyzedData has cognitive complexity 95 (threshold 15). Drivers by points: if/else 15 (52 pts), loops 7 (21 pts), boolean chains 17, error handling 2 (3 pts), ternaries 2 (nesting depth added 52). 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 · ClassAnalyzer.checkImplementedInterfaces (cognitive 94) · ×1
  • ClassAnalyzer.checkImplementedInterfaces (cognitive 94) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:2375 — ClassAnalyzer.checkImplementedInterfaces has cognitive complexity 94 (threshold 15). Drivers by points: if/else 19 (62 pts), boolean chains 20, error handling 2 (4 pts), loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassLikes.checkPropertyReferences (cognitive 94) · ×1
  • ClassLikes.checkPropertyReferences (cognitive 94) src/Psalm/Internal/Codebase/ClassLikes.php:2847 — ClassLikes.checkPropertyReferences has cognitive complexity 94 (threshold 15). Drivers by points: if/else 15 (50 pts), ternaries 4 (18 pts), boolean chains 17, loops 3 (9 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 · TemplateStandinTypeReplacer.handleAtomicStandin (cognitive 94) · ×1
  • TemplateStandinTypeReplacer.handleAtomicStandin (cognitive 94) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:222 — TemplateStandinTypeReplacer.handleAtomicStandin has cognitive complexity 94 (threshold 15). Drivers by points: if/else 29 (63 pts), boolean chains 16, loops 4 (15 pts) (nesting depth added 45). 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 · FunctionCallReturnTypeFetcher.fetch (cognitive 93) · ×1
  • FunctionCallReturnTypeFetcher.fetch (cognitive 93) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:84 — FunctionCallReturnTypeFetcher.fetch has cognitive complexity 93 (threshold 15). Drivers by points: if/else 27 (65 pts), loops 4 (14 pts), boolean chains 11, error handling 1 (3 pts) (nesting depth added 50). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AssignmentAnalyzer.analyzeAssignmentRef (cognitive 92) · ×1
  • AssignmentAnalyzer.analyzeAssignmentRef (cognitive 92) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1343 — AssignmentAnalyzer.analyzeAssignmentRef has cognitive complexity 92 (threshold 15). Drivers by points: if/else 27 (48 pts), boolean chains 27, ternaries 4 (7 pts), loops 3 (6 pts), error handling 2 (4 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.processCustomAssertion (cognitive 91) · ×1
  • AssertionFinder.processCustomAssertion (cognitive 91) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1116 — AssertionFinder.processCustomAssertion has cognitive complexity 91 (threshold 15). Drivers by points: if/else 25 (74 pts), boolean chains 12, loops 2 (4 pts), ternaries 1 (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 · YieldAnalyzer.analyze (cognitive 91) · ×1
  • YieldAnalyzer.analyze (cognitive 91) src/Psalm/Internal/Analyzer/Statements/Expression/YieldAnalyzer.php:37 — YieldAnalyzer.analyze has cognitive complexity 91 (threshold 15). Drivers by points: if/else 27 (62 pts), boolean chains 10, loops 4 (10 pts), ternaries 3 (7 pts), error handling 1 (2 pts) (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 · ElseIfAnalyzer.analyze (cognitive 90) · ×1
  • ElseIfAnalyzer.analyze (cognitive 90) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:128 — ElseIfAnalyzer.analyze has cognitive complexity 90 (threshold 15). Drivers by points: if/else 26 (47 pts), loops 9 (18 pts), boolean chains 14, ternaries 4 (8 pts), error handling 3 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionLikeDocblockScanner.handleAssertions (cognitive 90) · ×1
  • FunctionLikeDocblockScanner.handleAssertions (cognitive 90) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:1649 — FunctionLikeDocblockScanner.handleAssertions has cognitive complexity 90 (threshold 15). Drivers by points: if/else 18 (54 pts), ternaries 6 (18 pts), loops 6 (15 pts), boolean chains 3 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Algebra.getTruthsFromFormula (cognitive 89) · ×1
  • Algebra.getTruthsFromFormula (cognitive 89) src/Psalm/Internal/Algebra.php:342 — Algebra.getTruthsFromFormula has cognitive complexity 89 (threshold 15). Drivers by points: if/else 22 (67 pts), loops 7 (14 pts), boolean chains 8 (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 · ClassLikeAnalyzer.checkTemplateParams (cognitive 89) · ×1
  • ClassLikeAnalyzer.checkTemplateParams (cognitive 89) src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:951 — ClassLikeAnalyzer.checkTemplateParams has cognitive complexity 89 (threshold 15). Drivers by points: if/else 15 (44 pts), loops 6 (20 pts), boolean chains 18, ternaries 3 (7 pts) (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 · CastAnalyzer.analyze (cognitive 89) · ×1
  • CastAnalyzer.analyze (cognitive 89) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:89 — CastAnalyzer.analyze has cognitive complexity 89 (threshold 15). Drivers by points: if/else 39 (75 pts), ternaries 2 (6 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaticPropertyFetchAnalyzer.analyze (cognitive 89) · ×1
  • StaticPropertyFetchAnalyzer.analyze (cognitive 89) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/StaticPropertyFetchAnalyzer.php:49 — StaticPropertyFetchAnalyzer.analyze has cognitive complexity 89 (threshold 15). Drivers by points: if/else 42 (64 pts), boolean chains 17, ternaries 4 (8 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 · ArrayFunctionArgumentsAnalyzer.handleSplice (cognitive 88) · ×1
  • ArrayFunctionArgumentsAnalyzer.handleSplice (cognitive 88) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:368 — ArrayFunctionArgumentsAnalyzer.handleSplice has cognitive complexity 88 (threshold 15). Drivers by points: if/else 34 (60 pts), boolean chains 24, loops 1 (4 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstancePropertyAssignmentAnalyzer.analyze (cognitive 87) · ×1
  • InstancePropertyAssignmentAnalyzer.analyze (cognitive 87) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:106 — InstancePropertyAssignmentAnalyzer.analyze has cognitive complexity 87 (threshold 15). Drivers by points: if/else 30 (62 pts), boolean chains 17, loops 4 (6 pts), error handling 1 (2 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CallableTypeComparator.isContainedBy (cognitive 87) · ×1
  • CallableTypeComparator.isContainedBy (cognitive 87) src/Psalm/Internal/Type/Comparator/CallableTypeComparator.php:58 — CallableTypeComparator.isContainedBy has cognitive complexity 87 (threshold 15). Drivers by points: if/else 25 (58 pts), boolean chains 19, ternaries 2 (6 pts), loops 2 (4 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForeachAnalyzer.checkIteratorType (cognitive 86) · ×1
  • ForeachAnalyzer.checkIteratorType (cognitive 86) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1216 — ForeachAnalyzer.checkIteratorType has cognitive complexity 86 (threshold 15). Drivers by points: if/else 28 (60 pts), boolean chains 12, ternaries 3 (10 pts), loops 2 (4 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.scrapeAssertions (cognitive 86) · ×1
  • AssertionFinder.scrapeAssertions (cognitive 86) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:154 — AssertionFinder.scrapeAssertions has cognitive complexity 86 (threshold 15). Drivers by points: if/else 30 (48 pts), boolean chains 18, ternaries 7 (14 pts), loops 2 (6 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayAssignmentAnalyzer.taintArrayAssignment (cognitive 86) · ×1
  • ArrayAssignmentAnalyzer.taintArrayAssignment (cognitive 86) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:685 — ArrayAssignmentAnalyzer.taintArrayAssignment has cognitive complexity 86 (threshold 15). Drivers by points: if/else 12 (31 pts), ternaries 9 (22 pts), loops 7 (21 pts), boolean chains 12 (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 · ArithmeticOpAnalyzer.analyze (cognitive 86) · ×1
  • ArithmeticOpAnalyzer.analyze (cognitive 86) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:84 — ArithmeticOpAnalyzer.analyze has cognitive complexity 86 (threshold 15). Drivers by points: if/else 29 (66 pts), boolean chains 14, loops 2 (5 pts), ternaries 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AtomicStaticCallAnalyzer.analyze (cognitive 86) · ×1
  • AtomicStaticCallAnalyzer.analyze (cognitive 86) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/AtomicStaticCallAnalyzer.php:79 — AtomicStaticCallAnalyzer.analyze has cognitive complexity 86 (threshold 15). Drivers by points: if/else 22 (47 pts), boolean chains 21, ternaries 4 (13 pts), loops 2 (5 pts) (nesting depth added 37). 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 · ArrayMapReturnTypeProvider.getFunctionReturnType (cognitive 86) · ×1
  • ArrayMapReturnTypeProvider.getFunctionReturnType (cognitive 86) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMapReturnTypeProvider.php:78 — ArrayMapReturnTypeProvider.getFunctionReturnType has cognitive complexity 86 (threshold 15). Drivers by points: if/else 21 (46 pts), boolean chains 18, ternaries 6 (14 pts), loops 3 (8 pts) (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CallableTypeComparator.getCallableFromAtomic (cognitive 86) · ×1
  • CallableTypeComparator.getCallableFromAtomic (cognitive 86) src/Psalm/Internal/Type/Comparator/CallableTypeComparator.php:554 — CallableTypeComparator.getCallableFromAtomic has cognitive complexity 86 (threshold 15). Drivers by points: if/else 19 (55 pts), loops 4 (17 pts), boolean chains 7, ternaries 2 (5 pts), error handling 1 (2 pts) (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MinMaxReturnTypeProvider.getFunctionReturnType (cognitive 85) · ×1
  • MinMaxReturnTypeProvider.getFunctionReturnType (cognitive 85) src/Psalm/Internal/Provider/ReturnTypeProvider/MinMaxReturnTypeProvider.php:43 — MinMaxReturnTypeProvider.getFunctionReturnType has cognitive complexity 85 (threshold 15). Drivers by points: if/else 24 (51 pts), ternaries 6 (18 pts), loops 4 (9 pts), boolean chains 7 (nesting depth added 44). 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 · IfAnalyzer.analyze (cognitive 83) · ×1
  • IfAnalyzer.analyze (cognitive 83) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/IfAnalyzer.php:60 — IfAnalyzer.analyze has cognitive complexity 83 (threshold 15). Drivers by points: if/else 22 (43 pts), boolean chains 16, loops 6 (16 pts), ternaries 4 (8 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeTokenizer.getFullyQualifiedTokens (cognitive 83) · ×1
  • TypeTokenizer.getFullyQualifiedTokens (cognitive 83) src/Psalm/Internal/Type/TypeTokenizer.php:441 — TypeTokenizer.getFullyQualifiedTokens has cognitive complexity 83 (threshold 15). Drivers by points: if/else 24 (48 pts), boolean chains 32, ternaries 1 (2 pts), loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionReconciler.handleIsA (cognitive 82) · ×1
  • AssertionReconciler.handleIsA (cognitive 82) src/Psalm/Internal/Type/AssertionReconciler.php:2276 — AssertionReconciler.handleIsA has cognitive complexity 82 (threshold 15). Drivers by points: if/else 21 (59 pts), boolean chains 10, loops 3 (10 pts), ternaries 1 (3 pts) (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 · Algebra.groupImpossibilities (cognitive 81) · ×1
  • Algebra.groupImpossibilities (cognitive 81) src/Psalm/Internal/Algebra.php:467 — Algebra.groupImpossibilities has cognitive complexity 81 (threshold 15). Drivers by points: if/else 11 (43 pts), loops 12 (36 pts), boolean chains 2 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Psalter.run (cognitive 81) · ×1
  • Psalter.run (cognitive 81) src/Psalm/Internal/Cli/Psalter.php:99 — Psalter.run has cognitive complexity 81 (threshold 15). Drivers by points: if/else 34 (46 pts), boolean chains 15, loops 6 (14 pts), ternaries 2 (4 pts), error handling 1 (2 pts) (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 · TypeVariableTracker.reconcileLowerBoundsWithUpperBounds (cognitive 81) · ×1
  • TypeVariableTracker.reconcileLowerBoundsWithUpperBounds (cognitive 81) src/Psalm/Internal/Type/TypeVariableTracker.php:246 — TypeVariableTracker.reconcileLowerBoundsWithUpperBounds has cognitive complexity 81 (threshold 15). Drivers by points: if/else 19 (53 pts), loops 8 (16 pts), boolean chains 7, ternaries 2 (5 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayFetchAnalyzer.handleArrayAccessOnTArray (cognitive 80) · ×1
  • ArrayFetchAnalyzer.handleArrayAccessOnTArray (cognitive 80) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1672 — ArrayFetchAnalyzer.handleArrayAccessOnTArray has cognitive complexity 80 (threshold 15). Drivers by points: if/else 24 (53 pts), boolean chains 15, ternaries 3 (7 pts), loops 2 (5 pts) (nesting depth added 36). 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 · IncludeAnalyzer.analyze (cognitive 80) · ×1
  • IncludeAnalyzer.analyze (cognitive 80) src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php:60 — IncludeAnalyzer.analyze has cognitive complexity 80 (threshold 15). Drivers by points: if/else 23 (44 pts), boolean chains 17, loops 4 (11 pts), ternaries 2 (5 pts), error handling 1 (3 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassLikes.findPossibleMethodParamTypes (cognitive 80) · ×1
  • ClassLikes.findPossibleMethodParamTypes (cognitive 80) src/Psalm/Internal/Codebase/ClassLikes.php:2629 — ClassLikes.findPossibleMethodParamTypes has cognitive complexity 80 (threshold 15). Drivers by points: if/else 17 (65 pts), boolean chains 6, loops 2 (6 pts), error handling 1 (3 pts) (nesting depth added 54). 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 · InternalCallMapHandler.getMatchingCallableFromCallMapOptions (cognitive 80) · ×1
  • InternalCallMapHandler.getMatchingCallableFromCallMapOptions (cognitive 80) src/Psalm/Internal/Codebase/InternalCallMapHandler.php:134 — InternalCallMapHandler.getMatchingCallableFromCallMapOptions has cognitive complexity 80 (threshold 15). Drivers by points: if/else 22 (60 pts), boolean chains 9, loops 4 (9 pts), ternaries 1 (2 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ObjectComparator.isIntersectionShallowlyContainedBy (cognitive 80) · ×1
  • ObjectComparator.isIntersectionShallowlyContainedBy (cognitive 80) src/Psalm/Internal/Type/Comparator/ObjectComparator.php:179 — ObjectComparator.isIntersectionShallowlyContainedBy has cognitive complexity 80 (threshold 15). Drivers by points: if/else 27 (51 pts), boolean chains 25, loops 1 (4 pts) (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 · TemplateInferredTypeReplacer.replaceTemplateParam (cognitive 80) · ×1
  • TemplateInferredTypeReplacer.replaceTemplateParam (cognitive 80) src/Psalm/Internal/Type/TemplateInferredTypeReplacer.php:270 — TemplateInferredTypeReplacer.replaceTemplateParam has cognitive complexity 80 (threshold 15). Drivers by points: if/else 15 (55 pts), loops 5 (16 pts), boolean chains 5, error handling 1 (4 pts) (nesting depth added 54). 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 · MethodCallPurityAnalyzer.analyze (cognitive 79) · ×1
  • MethodCallPurityAnalyzer.analyze (cognitive 79) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php:356 — MethodCallPurityAnalyzer.analyze has cognitive complexity 79 (threshold 15). Drivers by points: boolean chains 33, if/else 18 (33 pts), ternaries 7 (11 pts), loops 1 (2 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 · MatchAnalyzer.analyze (cognitive 79) · ×1
  • MatchAnalyzer.analyze (cognitive 79) src/Psalm/Internal/Analyzer/Statements/Expression/MatchAnalyzer.php:55 — MatchAnalyzer.analyze has cognitive complexity 79 (threshold 15). Drivers by points: if/else 26 (46 pts), boolean chains 17, loops 5 (9 pts), ternaries 3 (7 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayFunctionArgumentsAnalyzer.handleAddition (cognitive 78) · ×1
  • ArrayFunctionArgumentsAnalyzer.handleAddition (cognitive 78) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:149 — ArrayFunctionArgumentsAnalyzer.handleAddition has cognitive complexity 78 (threshold 15). Drivers by points: if/else 21 (57 pts), loops 5 (11 pts), boolean chains 10 (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 · SimpleAssertionReconciler.reconcileTruthyOrNonEmpty (cognitive 78) · ×1
  • SimpleAssertionReconciler.reconcileTruthyOrNonEmpty (cognitive 78) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:3051 — SimpleAssertionReconciler.reconcileTruthyOrNonEmpty has cognitive complexity 78 (threshold 15). Drivers by points: if/else 28 (55 pts), boolean chains 18, loops 3 (5 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProjectAnalyzer.interpretRefactors (cognitive 77) · ×1
  • ProjectAnalyzer.interpretRefactors (cognitive 77) src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:591 — ProjectAnalyzer.interpretRefactors has cognitive complexity 77 (threshold 15). Drivers by points: if/else 26 (67 pts), boolean chains 5, loops 3 (5 pts) (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 · ClassLikes.getPotentialDynamicMethodCalls (cognitive 77) · ×1
  • ClassLikes.getPotentialDynamicMethodCalls (cognitive 77) src/Psalm/Internal/Codebase/ClassLikes.php:2162 — ClassLikes.getPotentialDynamicMethodCalls has cognitive complexity 77 (threshold 15). Drivers by points: if/else 12 (41 pts), error handling 3 (12 pts), loops 5 (10 pts), boolean chains 7, ternaries 2 (7 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Reconciler.adjustTKeyedArrayType (cognitive 77) · ×1
  • Reconciler.adjustTKeyedArrayType (cognitive 77) src/Psalm/Type/Reconciler.php:2021 — Reconciler.adjustTKeyedArrayType has cognitive complexity 77 (threshold 15). Drivers by points: if/else 15 (46 pts), loops 4 (14 pts), boolean chains 11, ternaries 1 (6 pts) (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 · ElseAnalyzer.analyze (cognitive 76) · ×1
  • ElseAnalyzer.analyze (cognitive 76) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php:40 — ElseAnalyzer.analyze has cognitive complexity 76 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 16, loops 5 (12 pts), ternaries 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssignmentAnalyzer.assignByRefParam (cognitive 76) · ×1
  • AssignmentAnalyzer.assignByRefParam (cognitive 76) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1995 — AssignmentAnalyzer.assignByRefParam has cognitive complexity 76 (threshold 15). Drivers by points: if/else 24 (55 pts), boolean chains 16, loops 2 (5 pts) (nesting depth added 34). 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 · EncapsulatedStringAnalyzer.analyze (cognitive 76) · ×1
  • EncapsulatedStringAnalyzer.analyze (cognitive 76) src/Psalm/Internal/Analyzer/Statements/Expression/EncapsulatedStringAnalyzer.php:37 — EncapsulatedStringAnalyzer.analyze has cognitive complexity 76 (threshold 15). Drivers by points: if/else 19 (45 pts), boolean chains 13, ternaries 3 (10 pts), loops 3 (8 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 · FunctionDocblockManipulator.__construct (cognitive 76) · ×1
  • FunctionDocblockManipulator.__construct (cognitive 76) src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:125 — FunctionDocblockManipulator.__construct has cognitive complexity 76 (threshold 15). Drivers by points: if/else 19 (50 pts), boolean chains 14, loops 4 (7 pts), ternaries 3, match/switch 1 (2 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TemplateStandinTypeReplacer.getMappedGenericTypeParams (cognitive 76) · ×1
  • TemplateStandinTypeReplacer.getMappedGenericTypeParams (cognitive 76) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:1506 — TemplateStandinTypeReplacer.getMappedGenericTypeParams has cognitive complexity 76 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 5 (19 pts), ternaries 6 (17 pts), boolean chains 8 (nesting depth added 45). 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 · ExpressionIdentifier.getExtendedVarId (cognitive 75) · ×1
  • ExpressionIdentifier.getExtendedVarId (cognitive 75) src/Psalm/Internal/Analyzer/Statements/Expression/ExpressionIdentifier.php:160 — ExpressionIdentifier.getExtendedVarId has cognitive complexity 75 (threshold 15). Drivers by points: if/else 18 (41 pts), boolean chains 22, ternaries 3 (12 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Refactor.run (cognitive 75) · ×1
  • Refactor.run (cognitive 75) src/Psalm/Internal/Cli/Refactor.php:69 — Refactor.run has cognitive complexity 75 (threshold 15). Drivers by points: if/else 34 (60 pts), boolean chains 9, loops 3 (6 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Type.intersectUnionTypes (cognitive 75) · ×1
  • Type.intersectUnionTypes (cognitive 75) src/Psalm/Type.php:789 — Type.intersectUnionTypes has cognitive complexity 75 (threshold 15). Drivers by points: if/else 24 (51 pts), boolean chains 12, loops 3 (12 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleNegatedAssertionReconciler.reconcile (cognitive 74) · ×1
  • SimpleNegatedAssertionReconciler.reconcile (cognitive 74) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:85 — SimpleNegatedAssertionReconciler.reconcile has cognitive complexity 74 (threshold 15). Drivers by points: if/else 31 (42 pts), boolean chains 29, ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Type.intersectAtomicTypes (cognitive 74) · ×1
  • Type.intersectAtomicTypes (cognitive 74) src/Psalm/Type.php:1037 — Type.intersectAtomicTypes has cognitive complexity 74 (threshold 15). Drivers by points: boolean chains 34, if/else 15 (29 pts), error handling 2 (5 pts), ternaries 1 (4 pts), loops 1 (2 pts) (nesting depth added 21). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AssignmentAnalyzer.analyzeAssignmentToVariable (cognitive 73) · ×1
  • AssignmentAnalyzer.analyzeAssignmentToVariable (cognitive 73) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:2926 — AssignmentAnalyzer.analyzeAssignmentToVariable has cognitive complexity 73 (threshold 15). Drivers by points: if/else 15 (43 pts), boolean chains 15, loops 2 (8 pts), error handling 1 (4 pts), ternaries 1 (3 pts) (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AssertionReconciler.filterAtomicWithAnother (cognitive 73) · ×1
  • AssertionReconciler.filterAtomicWithAnother (cognitive 73) src/Psalm/Internal/Type/AssertionReconciler.php:1154 — AssertionReconciler.filterAtomicWithAnother has cognitive complexity 73 (threshold 15). Drivers by points: boolean chains 34, if/else 23 (33 pts), loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CastAnalyzer.castFloatAttempt (cognitive 71) · ×1
  • CastAnalyzer.castFloatAttempt (cognitive 71) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:549 — CastAnalyzer.castFloatAttempt has cognitive complexity 71 (threshold 15). Drivers by points: if/else 22 (48 pts), boolean chains 12, loops 4 (11 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilterUtils.getOptionsArgValueOrError (cognitive 71) · ×1
  • FilterUtils.getOptionsArgValueOrError (cognitive 71) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:161 — FilterUtils.getOptionsArgValueOrError has cognitive complexity 71 (threshold 15). Drivers by points: if/else 23 (62 pts), loops 2 (6 pts), ternaries 1 (3 pts) (nesting depth added 45). 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 · CommentAnalyzer.splitDocLine (cognitive 70) · ×1
  • CommentAnalyzer.splitDocLine (cognitive 70) src/Psalm/Internal/Analyzer/CommentAnalyzer.php:299 — CommentAnalyzer.splitDocLine has cognitive complexity 70 (threshold 15). Drivers by points: if/else 14 (37 pts), boolean chains 24, ternaries 3 (8 pts), loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayAnalyzer.handleUnpackedArray (cognitive 70) · ×1
  • ArrayAnalyzer.handleUnpackedArray (cognitive 70) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:717 — ArrayAnalyzer.handleUnpackedArray has cognitive complexity 70 (threshold 15). Drivers by points: if/else 19 (57 pts), loops 3 (6 pts), ternaries 1 (6 pts), boolean chains 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 · CastAnalyzer.castIntAttempt (cognitive 70) · ×1
  • CastAnalyzer.castIntAttempt (cognitive 70) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:354 — CastAnalyzer.castIntAttempt has cognitive complexity 70 (threshold 15). Drivers by points: if/else 23 (50 pts), boolean chains 9, loops 3 (8 pts), ternaries 1 (3 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeParser.getTypeFromKeyedArrayTree (cognitive 70) · ×1
  • TypeParser.getTypeFromKeyedArrayTree (cognitive 70) src/Psalm/Internal/Type/TypeParser.php:2416 — TypeParser.getTypeFromKeyedArrayTree has cognitive complexity 70 (threshold 15). Drivers by points: if/else 26 (47 pts), boolean chains 15, ternaries 4 (5 pts), loops 2 (3 pts) (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 · MethodComparator.compareMethodSignatureParams (cognitive 69) · ×1
  • MethodComparator.compareMethodSignatureParams (cognitive 69) src/Psalm/Internal/Analyzer/MethodComparator.php:963 — MethodComparator.compareMethodSignatureParams has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 11 (22 pts), if/else 10 (20 pts), boolean chains 18, loops 3 (9 pts) (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 · CastAnalyzer.castStringAttempt (cognitive 69) · ×1
  • CastAnalyzer.castStringAttempt (cognitive 69) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:740 — CastAnalyzer.castStringAttempt has cognitive complexity 69 (threshold 15). Drivers by points: if/else 20 (49 pts), boolean chains 8, ternaries 2 (8 pts), loops 2 (4 pts) (nesting depth added 37). 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 · ArrayTypeComparator.isContainedBy (cognitive 69) · ×1
  • ArrayTypeComparator.isContainedBy (cognitive 69) src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php:29 — ArrayTypeComparator.isContainedBy has cognitive complexity 69 (threshold 15). Drivers by points: if/else 22 (41 pts), boolean chains 25, loops 2 (3 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 · AssertionFinder.getTrueInequalityAssertions (cognitive 68) · ×1
  • AssertionFinder.getTrueInequalityAssertions (cognitive 68) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2570 — AssertionFinder.getTrueInequalityAssertions has cognitive complexity 68 (threshold 15). Drivers by points: if/else 22 (48 pts), boolean chains 10, loops 2 (5 pts), ternaries 2 (5 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · StaticPropertyAssignmentAnalyzer.analyze (cognitive 68) · ×1
  • StaticPropertyAssignmentAnalyzer.analyze (cognitive 68) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/StaticPropertyAssignmentAnalyzer.php:46 — StaticPropertyAssignmentAnalyzer.analyze has cognitive complexity 68 (threshold 15). Drivers by points: if/else 26 (57 pts), boolean chains 5, ternaries 1 (4 pts), loops 2 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.getFalseEqualityAssertions (cognitive 67) · ×1
  • AssertionFinder.getFalseEqualityAssertions (cognitive 67) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3333 — AssertionFinder.getFalseEqualityAssertions has cognitive complexity 67 (threshold 15). Drivers by points: if/else 22 (48 pts), boolean chains 9, loops 2 (5 pts), ternaries 2 (5 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AtomicTypeComparator.canBeIdentical (cognitive 67) · ×1
  • AtomicTypeComparator.canBeIdentical (cognitive 67) src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php:1083 — AtomicTypeComparator.canBeIdentical has cognitive complexity 67 (threshold 15). Drivers by points: boolean chains 38, if/else 16 (23 pts), loops 3 (5 pts), ternaries 1 (nesting depth added 9). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ClassLikeAnalyzer.checkFullyQualifiedClassLikeName (cognitive 66) · ×1
  • ClassLikeAnalyzer.checkFullyQualifiedClassLikeName (cognitive 66) src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:335 — ClassLikeAnalyzer.checkFullyQualifiedClassLikeName has cognitive complexity 66 (threshold 15). Drivers by points: if/else 23 (43 pts), boolean chains 16, ternaries 4 (5 pts), error handling 1, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoopAnalyzer.setLoopVars (cognitive 66) · ×1
  • LoopAnalyzer.setLoopVars (cognitive 66) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:1284 — LoopAnalyzer.setLoopVars has cognitive complexity 66 (threshold 15). Drivers by points: if/else 16 (47 pts), boolean chains 14, loops 3 (5 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 · FileStatementsDiffer.diff (cognitive 66) · ×1
  • FileStatementsDiffer.diff (cognitive 66) src/Psalm/Internal/Diff/FileStatementsDiffer.php:31 — FileStatementsDiffer.diff has cognitive complexity 66 (threshold 15). Drivers by points: if/else 16 (38 pts), boolean chains 19, loops 3 (9 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArgumentAnalyzer.coerceValueAfterGatekeeperArgument (cognitive 65) · ×1
  • ArgumentAnalyzer.coerceValueAfterGatekeeperArgument (cognitive 65) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:1933 — ArgumentAnalyzer.coerceValueAfterGatekeeperArgument has cognitive complexity 65 (threshold 15). Drivers by points: if/else 20 (42 pts), loops 3 (12 pts), boolean chains 11 (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 · ArrayFetchAnalyzer.taintArrayFetch (cognitive 65) · ×1
  • ArrayFetchAnalyzer.taintArrayFetch (cognitive 65) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:615 — ArrayFetchAnalyzer.taintArrayFetch has cognitive complexity 65 (threshold 15). Drivers by points: if/else 13 (31 pts), ternaries 7 (16 pts), boolean chains 13, loops 2 (5 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Scanner.scanFile (cognitive 65) · ×1
  • Scanner.scanFile (cognitive 65) src/Psalm/Internal/Codebase/Scanner.php:693 — Scanner.scanFile has cognitive complexity 65 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 9 (22 pts), boolean chains 9 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleAssertionReconciler.reconcileAssertion (cognitive 65) · ×1
  • SimpleAssertionReconciler.reconcileAssertion (cognitive 65) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:158 — SimpleAssertionReconciler.reconcileAssertion has cognitive complexity 65 (threshold 15). Drivers by points: if/else 37 (44 pts), boolean chains 19, loops 1 (2 pts) (nesting depth added 8). 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 · TemplateStandinTypeReplacer.handleTemplateParamClassStandin (cognitive 65) · ×1
  • TemplateStandinTypeReplacer.handleTemplateParamClassStandin (cognitive 65) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:1141 — TemplateStandinTypeReplacer.handleTemplateParamClassStandin has cognitive complexity 65 (threshold 15). Drivers by points: if/else 19 (38 pts), loops 5 (15 pts), ternaries 2 (8 pts), boolean chains 4 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NamedFunctionCallHandler.handleExtract (cognitive 64) · ×1
  • NamedFunctionCallHandler.handleExtract (cognitive 64) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:562 — NamedFunctionCallHandler.handleExtract has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (39 pts), boolean chains 18, loops 3 (7 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 · SimpleTypeInferer.handleArrayItem (cognitive 64) · ×1
  • SimpleTypeInferer.handleArrayItem (cognitive 64) src/Psalm/Internal/Analyzer/Statements/Expression/SimpleTypeInferer.php:633 — SimpleTypeInferer.handleArrayItem has cognitive complexity 64 (threshold 15). Drivers by points: if/else 23 (50 pts), boolean chains 10, ternaries 1 (4 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · StatementsAnalyzer.checkUnreferencedVars (cognitive 64) · ×1
  • StatementsAnalyzer.checkUnreferencedVars (cognitive 64) src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:1045 — StatementsAnalyzer.checkUnreferencedVars has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (38 pts), boolean chains 18, loops 2 (5 pts), ternaries 2 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Algebra.combineOredClauses (cognitive 63) · ×1
  • Algebra.combineOredClauses (cognitive 63) src/Psalm/Internal/Algebra.php:594 — Algebra.combineOredClauses has cognitive complexity 63 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 7 (15 pts), boolean chains 13, ternaries 1 (3 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MethodComparator.compare (cognitive 63) · ×1
  • MethodComparator.compare (cognitive 63) src/Psalm/Internal/Analyzer/MethodComparator.php:65 — MethodComparator.compare has cognitive complexity 63 (threshold 15). Drivers by points: boolean chains 31, if/else 14 (27 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 14). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SwitchAnalyzer.analyze (cognitive 63) · ×1
  • SwitchAnalyzer.analyze (cognitive 63) src/Psalm/Internal/Analyzer/Statements/Block/SwitchAnalyzer.php:29 — SwitchAnalyzer.analyze has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 13, loops 6 (11 pts), ternaries 1 (2 pts) (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 · AssertionFinder.getIsaAssertions (cognitive 63) · ×1
  • AssertionFinder.getIsaAssertions (cognitive 63) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3909 — AssertionFinder.getIsaAssertions has cognitive complexity 63 (threshold 15). Drivers by points: if/else 15 (42 pts), boolean chains 13, loops 1 (4 pts), ternaries 2 (4 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CliUtils.getPathsToCheck (cognitive 63) · ×1
  • CliUtils.getPathsToCheck (cognitive 63) src/Psalm/Internal/CliUtils.php:462 — CliUtils.getPathsToCheck has cognitive complexity 63 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 12, loops 4 (8 pts), ternaries 2 (4 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 · ArrayFilterParamsProvider.getFunctionParams (cognitive 63) · ×1
  • ArrayFilterParamsProvider.getFunctionParams (cognitive 63) src/Psalm/Internal/Provider/ParamsProvider/ArrayFilterParamsProvider.php:50 — ArrayFilterParamsProvider.getFunctionParams has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (47 pts), boolean chains 9, ternaries 2 (4 pts), loops 1 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeCombiner.scrapeIntProperties (cognitive 63) · ×1
  • TypeCombiner.scrapeIntProperties (cognitive 63) src/Psalm/Internal/Type/TypeCombiner.php:1606 — TypeCombiner.scrapeIntProperties has cognitive complexity 63 (threshold 15). Drivers by points: if/else 17 (46 pts), loops 2 (9 pts), boolean chains 4, ternaries 1 (4 pts) (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TypeExpander.expandNamedObject (cognitive 63) · ×1
  • TypeExpander.expandNamedObject (cognitive 63) src/Psalm/Internal/Type/TypeExpander.php:834 — TypeExpander.expandNamedObject has cognitive complexity 63 (threshold 15). Drivers by points: boolean chains 33, if/else 13 (28 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · MethodCallReturnTypeFetcher.fetch (cognitive 62) · ×1
  • MethodCallReturnTypeFetcher.fetch (cognitive 62) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php:60 — MethodCallReturnTypeFetcher.fetch has cognitive complexity 62 (threshold 15). Drivers by points: if/else 20 (36 pts), boolean chains 19, ternaries 3 (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 · LanguageServer.run (cognitive 62) · ×1
  • LanguageServer.run (cognitive 62) src/Psalm/Internal/Cli/LanguageServer.php:65 — LanguageServer.run has cognitive complexity 62 (threshold 15). Drivers by points: if/else 28 (31 pts), boolean chains 28, ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ClassLikeNodeScanner.visitClassConstDeclaration (cognitive 62) · ×1
  • ClassLikeNodeScanner.visitClassConstDeclaration (cognitive 62) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1640 — ClassLikeNodeScanner.visitClassConstDeclaration has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 16, loops 3 (6 pts), ternaries 3 (6 pts), error handling 2 (4 pts) (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 · SimpleAssertionReconciler.reconcileNonEmptyCountable (cognitive 62) · ×1
  • SimpleAssertionReconciler.reconcileNonEmptyCountable (cognitive 62) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:683 — SimpleAssertionReconciler.reconcileNonEmptyCountable has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (34 pts), ternaries 2 (11 pts), loops 2 (10 pts), boolean chains 7 (nesting depth added 36). 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 · MethodCallReturnTypeFetcher.taintMethodCallResult (cognitive 61) · ×1
  • MethodCallReturnTypeFetcher.taintMethodCallResult (cognitive 61) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php:455 — MethodCallReturnTypeFetcher.taintMethodCallResult has cognitive complexity 61 (threshold 15). Drivers by points: if/else 16 (31 pts), ternaries 8 (14 pts), boolean chains 8, loops 3 (8 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 · NewAnalyzer.analyze (cognitive 61) · ×1
  • NewAnalyzer.analyze (cognitive 61) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:145 — NewAnalyzer.analyze has cognitive complexity 61 (threshold 15). Drivers by points: if/else 20 (40 pts), boolean chains 9, ternaries 3 (9 pts), match/switch 1 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpressionAnalyzer.handleExpression (cognitive 61) · ×1
  • ExpressionAnalyzer.handleExpression (cognitive 61) src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php:241 — ExpressionAnalyzer.handleExpression has cognitive complexity 61 (threshold 15). Drivers by points: if/else 49 (53 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 · AssignmentAnalyzer.getReferencedPropertyType (cognitive 60) · ×1
  • AssignmentAnalyzer.getReferencedPropertyType (cognitive 60) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1690 — AssignmentAnalyzer.getReferencedPropertyType has cognitive complexity 60 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 11, ternaries 4 (11 pts), loops 2 (4 pts) (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 · ArrayFunctionArgumentsAnalyzer.checkClosureTypeArgs (cognitive 60) · ×1
  • ArrayFunctionArgumentsAnalyzer.checkClosureTypeArgs (cognitive 60) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:956 — ArrayFunctionArgumentsAnalyzer.checkClosureTypeArgs has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 13, ternaries 5 (10 pts), loops 4 (6 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 · TernaryAnalyzer.analyze (cognitive 60) · ×1
  • TernaryAnalyzer.analyze (cognitive 60) src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php:48 — TernaryAnalyzer.analyze has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (26 pts), ternaries 9 (12 pts), boolean chains 10, loops 7 (10 pts), error handling 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 · TypeCombiner.handleKeyedArrayEntries (cognitive 60) · ×1
  • TypeCombiner.handleKeyedArrayEntries (cognitive 60) src/Psalm/Internal/Type/TypeCombiner.php:1778 — TypeCombiner.handleKeyedArrayEntries has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 14, loops 3 (8 pts), ternaries 2 (8 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 · Type.combineUnionTypes (cognitive 60) · ×1
  • Type.combineUnionTypes (cognitive 60) src/Psalm/Type.php:649 — Type.combineUnionTypes has cognitive complexity 60 (threshold 15). Drivers by points: if/else 27 (44 pts), boolean chains 16 (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 · ConcatAnalyzer.analyzeOperand (cognitive 59) · ×1
  • ConcatAnalyzer.analyzeOperand (cognitive 59) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:525 — ConcatAnalyzer.analyzeOperand has cognitive complexity 59 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 13, ternaries 3 (13 pts), error handling 1 (5 pts), loops 2 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AtomicMethodCallAnalyzer.handleInvalidClass (cognitive 59) · ×1
  • AtomicMethodCallAnalyzer.handleInvalidClass (cognitive 59) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php:722 — AtomicMethodCallAnalyzer.handleInvalidClass has cognitive complexity 59 (threshold 15). Drivers by points: if/else 12 (34 pts), boolean chains 11, ternaries 2 (8 pts), loops 1 (5 pts), match/switch 1 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PartialApplicationAnalyzer.bind (cognitive 59) · ×1
  • PartialApplicationAnalyzer.bind (cognitive 59) src/Psalm/Internal/Analyzer/Statements/Expression/Call/PartialApplicationAnalyzer.php:294 — PartialApplicationAnalyzer.bind has cognitive complexity 59 (threshold 15). Drivers by points: if/else 21 (47 pts), boolean chains 6, loops 3 (4 pts), ternaries 2 (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 · ReflectorVisitor.leaveNode (cognitive 59) · ×1
  • ReflectorVisitor.leaveNode (cognitive 59) src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:779 — ReflectorVisitor.leaveNode has cognitive complexity 59 (threshold 15). Drivers by points: if/else 16 (38 pts), boolean chains 10, loops 2 (6 pts), ternaries 1 (5 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TemplateInferredTypeReplacer.replaceConditional (cognitive 59) · ×1
  • TemplateInferredTypeReplacer.replaceConditional (cognitive 59) src/Psalm/Internal/Type/TemplateInferredTypeReplacer.php:453 — TemplateInferredTypeReplacer.replaceConditional has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 16, ternaries 4 (7 pts), loops 2 (4 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · IncludeAnalyzer.getPathTo (cognitive 58) · ×1
  • IncludeAnalyzer.getPathTo (cognitive 58) src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php:347 — IncludeAnalyzer.getPathTo has cognitive complexity 58 (threshold 15). Drivers by points: if/else 21 (49 pts), boolean chains 8, ternaries 1 (nesting depth added 28). 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 · FunctionLikeDocblockScanner.handleReturn (cognitive 58) · ×1
  • FunctionLikeDocblockScanner.handleReturn (cognitive 58) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:1222 — FunctionLikeDocblockScanner.handleReturn has cognitive complexity 58 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 22, loops 2 (4 pts), ternaries 2 (4 pts), error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GetObjectVarsReturnTypeProvider.getGetObjectVarsReturnType (cognitive 58) · ×1
  • GetObjectVarsReturnTypeProvider.getGetObjectVarsReturnType (cognitive 58) src/Psalm/Internal/Provider/ReturnTypeProvider/GetObjectVarsReturnTypeProvider.php:49 — GetObjectVarsReturnTypeProvider.getGetObjectVarsReturnType has cognitive complexity 58 (threshold 15). Drivers by points: if/else 15 (45 pts), ternaries 2 (8 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Config.removeCacheDirectory (cognitive 57) · ×1
  • Config.removeCacheDirectory (cognitive 57) src/Psalm/Config.php:3332 — Config.removeCacheDirectory has cognitive complexity 57 (threshold 15). Drivers by points: if/else 13 (42 pts), error handling 2 (7 pts), loops 2 (6 pts), boolean chains 2 (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 · IfAnalyzer.updateIfScope (cognitive 57) · ×1
  • IfAnalyzer.updateIfScope (cognitive 57) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/IfAnalyzer.php:490 — IfAnalyzer.updateIfScope has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 15, loops 6 (9 pts), ternaries 3 (6 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 · FunctionCallAnalyzer.checkFunctionCallPurity (cognitive 57) · ×1
  • FunctionCallAnalyzer.checkFunctionCallPurity (cognitive 57) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1928 — FunctionCallAnalyzer.checkFunctionCallPurity has cognitive complexity 57 (threshold 15). Drivers by points: boolean chains 23, if/else 8 (19 pts), ternaries 6 (15 pts) (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 · ArrayFetchAnalyzer.handleArrayAccessOnNamedObject (cognitive 57) · ×1
  • ArrayFetchAnalyzer.handleArrayAccessOnNamedObject (cognitive 57) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2299 — ArrayFetchAnalyzer.handleArrayAccessOnNamedObject has cognitive complexity 57 (threshold 15). Drivers by points: if/else 21 (46 pts), boolean chains 8, ternaries 1 (3 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 · TypeHintResolver.resolve (cognitive 57) · ×1
  • TypeHintResolver.resolve (cognitive 57) src/Psalm/Internal/PhpVisitor/Reflector/TypeHintResolver.php:78 — TypeHintResolver.resolve has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (36 pts), loops 4 (10 pts), ternaries 2 (8 pts), boolean chains 3 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleNegatedAssertionReconciler.reconcileFalsyOrEmpty (cognitive 57) · ×1
  • SimpleNegatedAssertionReconciler.reconcileFalsyOrEmpty (cognitive 57) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:938 — SimpleNegatedAssertionReconciler.reconcileFalsyOrEmpty has cognitive complexity 57 (threshold 15). Drivers by points: if/else 26 (43 pts), boolean chains 9, loops 3 (5 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 · FileAnalyzer.analyze (cognitive 56) · ×1
  • FileAnalyzer.analyze (cognitive 56) src/Psalm/Internal/Analyzer/FileAnalyzer.php:119 — FileAnalyzer.analyze has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (38 pts), loops 9 (15 pts), boolean chains 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 · UnusedAssignmentRemover.findAssignStmt (cognitive 56) · ×1
  • UnusedAssignmentRemover.findAssignStmt (cognitive 56) src/Psalm/Internal/Analyzer/Statements/UnusedAssignmentRemover.php:243 — UnusedAssignmentRemover.findAssignStmt has cognitive complexity 56 (threshold 15). Drivers by points: if/else 11 (35 pts), boolean chains 10, loops 3 (7 pts), ternaries 1 (4 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NamespaceStatementsDiffer.diff (cognitive 56) · ×1
  • NamespaceStatementsDiffer.diff (cognitive 56) src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php:31 — NamespaceStatementsDiffer.diff has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 15, loops 3 (9 pts), ternaries 1 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssignmentMapVisitor.enterNode (cognitive 56) · ×1
  • AssignmentMapVisitor.enterNode (cognitive 56) src/Psalm/Internal/PhpVisitor/AssignmentMapVisitor.php:45 — AssignmentMapVisitor.enterNode has cognitive complexity 56 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 9 (21 pts), boolean chains 6 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommentAnalyzer.arrayToDocblocks (cognitive 55) · ×1
  • CommentAnalyzer.arrayToDocblocks (cognitive 55) src/Psalm/Internal/Analyzer/CommentAnalyzer.php:88 — CommentAnalyzer.arrayToDocblocks has cognitive complexity 55 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 14, error handling 2 (7 pts), ternaries 2 (6 pts), loops 1 (2 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 · AssertionFinder.hasGetClassCheck (cognitive 55) · ×1
  • AssertionFinder.hasGetClassCheck (cognitive 55) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1632 — AssertionFinder.hasGetClassCheck has cognitive complexity 55 (threshold 15). Drivers by points: boolean chains 32, if/else 9 (17 pts), loops 2 (6 pts) (nesting depth added 12). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Populator.inheritPropertyTypes (cognitive 55) · ×1
  • Populator.inheritPropertyTypes (cognitive 55) src/Psalm/Internal/Codebase/Populator.php:1909 — Populator.inheritPropertyTypes has cognitive complexity 55 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 11, loops 4 (11 pts), ternaries 3 (5 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TemplateStandinTypeReplacer.findMatchingAtomicTypesForTemplate (cognitive 55) · ×1
  • TemplateStandinTypeReplacer.findMatchingAtomicTypesForTemplate (cognitive 55) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:588 — TemplateStandinTypeReplacer.findMatchingAtomicTypesForTemplate has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (41 pts), boolean chains 10, error handling 1 (3 pts), loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeCombiner.getArrayTypeFromGenericParams (cognitive 54) · ×1
  • TypeCombiner.getArrayTypeFromGenericParams (cognitive 54) src/Psalm/Internal/Type/TypeCombiner.php:1897 — TypeCombiner.getArrayTypeFromGenericParams has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 12, loops 3 (10 pts), ternaries 2 (7 pts) (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 · ReturnTypeCollector.getReturnTypes (cognitive 53) · ×1
  • ReturnTypeCollector.getReturnTypes (cognitive 53) src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeCollector.php:38 — ReturnTypeCollector.getReturnTypes has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 4 (10 pts), boolean chains 7 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InterfaceAnalyzer.analyze (cognitive 53) · ×1
  • InterfaceAnalyzer.analyze (cognitive 53) src/Psalm/Internal/Analyzer/InterfaceAnalyzer.php:44 — InterfaceAnalyzer.analyze has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 5 (11 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.scrapeEqualityAssertions (cognitive 53) · ×1
  • AssertionFinder.scrapeEqualityAssertions (cognitive 53) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:408 — AssertionFinder.scrapeEqualityAssertions has cognitive complexity 53 (threshold 15). Drivers by points: if/else 23 (39 pts), boolean chains 8, ternaries 2 (6 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 · AssertionFinder.getGreaterAssertions (cognitive 53) · ×1
  • AssertionFinder.getGreaterAssertions (cognitive 53) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4389 — AssertionFinder.getGreaterAssertions has cognitive complexity 53 (threshold 15). Drivers by points: if/else 22 (42 pts), ternaries 5 (10 pts), boolean chains 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 · ArithmeticOpAnalyzer.analyzeMulBetweenIntRange (cognitive 53) · ×1
  • ArithmeticOpAnalyzer.analyzeMulBetweenIntRange (cognitive 53) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1570 — ArithmeticOpAnalyzer.analyzeMulBetweenIntRange has cognitive complexity 53 (threshold 15). Drivers by points: if/else 12 (22 pts), ternaries 8 (16 pts), boolean chains 15 (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 · MethodVisibilityAnalyzer.analyze (cognitive 53) · ×1
  • MethodVisibilityAnalyzer.analyze (cognitive 53) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodVisibilityAnalyzer.php:31 — MethodVisibilityAnalyzer.analyze has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 10, ternaries 2 (6 pts), loops 1, match/switch 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AtomicPropertyFetchAnalyzer.handleNonExistentClass (cognitive 53) · ×1
  • AtomicPropertyFetchAnalyzer.handleNonExistentClass (cognitive 53) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:1367 — AtomicPropertyFetchAnalyzer.handleNonExistentClass has cognitive complexity 53 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 17, loops 2 (5 pts), ternaries 2 (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 · UnsetAnalyzer.removeOffset (cognitive 53) · ×1
  • UnsetAnalyzer.removeOffset (cognitive 53) src/Psalm/Internal/Analyzer/Statements/UnsetAnalyzer.php:194 — UnsetAnalyzer.removeOffset has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (40 pts), loops 2 (5 pts), ternaries 1 (5 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 · TaintFlowGraph.linkGeneratorSends (cognitive 53) · ×1
  • TaintFlowGraph.linkGeneratorSends (cognitive 53) src/Psalm/Internal/Codebase/TaintFlowGraph.php:1140 — TaintFlowGraph.linkGeneratorSends has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (37 pts), loops 5 (12 pts), boolean chains 4 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionLikeDocblockScanner.handleTaintFlow (cognitive 53) · ×1
  • FunctionLikeDocblockScanner.handleTaintFlow (cognitive 53) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:1402 — FunctionLikeDocblockScanner.handleTaintFlow has cognitive complexity 53 (threshold 15). Drivers by points: if/else 8 (31 pts), loops 6 (20 pts), boolean chains 2 (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 · OrAnalyzer.analyze (cognitive 52) · ×1
  • OrAnalyzer.analyze (cognitive 52) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/OrAnalyzer.php:44 — OrAnalyzer.analyze has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (30 pts), loops 5 (10 pts), boolean chains 7, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArgumentsAnalyzer.evaluateArbitraryParam (cognitive 52) · ×1
  • ArgumentsAnalyzer.evaluateArbitraryParam (cognitive 52) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:2056 — ArgumentsAnalyzer.evaluateArbitraryParam has cognitive complexity 52 (threshold 15). Drivers by points: boolean chains 24, if/else 11 (22 pts), loops 1 (4 pts), ternaries 1 (2 pts) (nesting depth added 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · FunctionLikeDocblockScanner.getConditionalSanitizedTypeTokens (cognitive 52) · ×1
  • FunctionLikeDocblockScanner.getConditionalSanitizedTypeTokens (cognitive 52) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:705 — FunctionLikeDocblockScanner.getConditionalSanitizedTypeTokens has cognitive complexity 52 (threshold 15). Drivers by points: if/else 9 (29 pts), ternaries 3 (14 pts), boolean chains 5, loops 2 (4 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 · ClassLikeAnalyzer.checkPropertyVisibility (cognitive 51) · ×1
  • ClassLikeAnalyzer.checkPropertyVisibility (cognitive 51) src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:698 — ClassLikeAnalyzer.checkPropertyVisibility has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (26 pts), ternaries 8 (16 pts), boolean chains 6, loops 1 (2 pts), match/switch 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayAssignmentAnalyzer.analyzeNestedArrayAssignment (cognitive 51) · ×1
  • ArrayAssignmentAnalyzer.analyzeNestedArrayAssignment (cognitive 51) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:1238 — ArrayAssignmentAnalyzer.analyzeNestedArrayAssignment has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 10, ternaries 1 (2 pts), loops 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 · NamedFunctionCallHandler.handleDependentTypeFunction (cognitive 51) · ×1
  • NamedFunctionCallHandler.handleDependentTypeFunction (cognitive 51) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:685 — NamedFunctionCallHandler.handleDependentTypeFunction has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (37 pts), ternaries 1 (6 pts), boolean chains 5, loops 1 (3 pts) (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 · GlobalAnalyzer.analyze (cognitive 51) · ×1
  • GlobalAnalyzer.analyze (cognitive 51) src/Psalm/Internal/Analyzer/Statements/GlobalAnalyzer.php:50 — GlobalAnalyzer.analyze has cognitive complexity 51 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 8, ternaries 3 (7 pts), loops 2 (4 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 · ClassLikes.rebuildStructuralEdges (cognitive 51) · ×1
  • ClassLikes.rebuildStructuralEdges (cognitive 51) src/Psalm/Internal/Codebase/ClassLikes.php:1053 — ClassLikes.rebuildStructuralEdges has cognitive complexity 51 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 6 (12 pts), error handling 3 (9 pts), boolean chains 5 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Populator.inheritMethodsFromParent (cognitive 51) · ×1
  • Populator.inheritMethodsFromParent (cognitive 51) src/Psalm/Internal/Codebase/Populator.php:1707 — Populator.inheritMethodsFromParent has cognitive complexity 51 (threshold 15). Drivers by points: if/else 13 (36 pts), boolean chains 6, loops 4 (6 pts), ternaries 1 (3 pts) (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 · TaintFlowResolution.buildTrace (cognitive 51) · ×1
  • TaintFlowResolution.buildTrace (cognitive 51) src/Psalm/Internal/Codebase/TaintFlowResolution.php:4017 — TaintFlowResolution.buildTrace has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 10, ternaries 3 (9 pts), loops 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleAssertionReconciler.reconcileList (cognitive 51) · ×1
  • SimpleAssertionReconciler.reconcileList (cognitive 51) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2615 — SimpleAssertionReconciler.reconcileList has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 14, ternaries 2 (5 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.getSmallerAssertions (cognitive 50) · ×1
  • AssertionFinder.getSmallerAssertions (cognitive 50) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4668 — AssertionFinder.getSmallerAssertions has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (37 pts), ternaries 6 (12 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstancePropertyAssignmentAnalyzer.analyzeRegularAssignment (cognitive 50) · ×1
  • InstancePropertyAssignmentAnalyzer.analyzeRegularAssignment (cognitive 50) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:995 — InstancePropertyAssignmentAnalyzer.analyzeRegularAssignment has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 11, ternaries 3 (7 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArgumentAnalyzer.processTaintedness (cognitive 50) · ×1
  • ArgumentAnalyzer.processTaintedness (cognitive 50) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:2068 — ArgumentAnalyzer.processTaintedness has cognitive complexity 50 (threshold 15). Drivers by points: boolean chains 16, if/else 10 (14 pts), ternaries 12 (14 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · TaintFlowResolution.addEntryCaller (cognitive 50) · ×1
  • TaintFlowResolution.addEntryCaller (cognitive 50) src/Psalm/Internal/Codebase/TaintFlowResolution.php:2667 — TaintFlowResolution.addEntryCaller has cognitive complexity 50 (threshold 15). Drivers by points: loops 14 (29 pts), if/else 12 (20 pts), boolean chains 1 (nesting depth added 23). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · SimpleNegatedAssertionReconciler.reconcileNotNonEmptyCountable (cognitive 50) · ×1
  • SimpleNegatedAssertionReconciler.reconcileNotNonEmptyCountable (cognitive 50) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:587 — SimpleNegatedAssertionReconciler.reconcileNotNonEmptyCountable has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (37 pts), boolean chains 7, loops 1 (6 pts) (nesting depth added 28). 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 · Codebase.getCompletionItemsForPartialSymbol (cognitive 49) · ×1
  • Codebase.getCompletionItemsForPartialSymbol (cognitive 49) src/Psalm/Codebase.php:2591 — Codebase.getCompletionItemsForPartialSymbol has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 7, loops 5 (7 pts), error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArgumentAnalyzer.getDispatchNode (cognitive 49) · ×1
  • ArgumentAnalyzer.getDispatchNode (cognitive 49) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:2422 — ArgumentAnalyzer.getDispatchNode has cognitive complexity 49 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 4 (13 pts), boolean chains 9, loops 4 (7 pts) (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 · FunctionCallReturnTypeFetcher.taintReturnType (cognitive 49) · ×1
  • FunctionCallReturnTypeFetcher.taintReturnType (cognitive 49) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:1562 — FunctionCallReturnTypeFetcher.taintReturnType has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 12, ternaries 3 (5 pts), loops 1 (3 pts) (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 · Methods.methodExists (cognitive 49) · ×1
  • Methods.methodExists (cognitive 49) src/Psalm/Internal/Codebase/Methods.php:95 — Methods.methodExists has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 12, loops 4 (9 pts), ternaries 2, error handling 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 · AssertionFinder.getInarrayAssertions (cognitive 48) · ×1
  • AssertionFinder.getInarrayAssertions (cognitive 48) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4120 — AssertionFinder.getInarrayAssertions has cognitive complexity 48 (threshold 15). Drivers by points: if/else 9 (29 pts), boolean chains 11, loops 2 (7 pts), ternaries 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · NonComparisonOpAnalyzer.analyze (cognitive 48) · ×1
  • NonComparisonOpAnalyzer.analyze (cognitive 48) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/NonComparisonOpAnalyzer.php:23 — NonComparisonOpAnalyzer.analyze has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 21, if/else 10 (15 pts), ternaries 4 (12 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 · ArgumentsAnalyzer.handleByRefFunctionArg (cognitive 48) · ×1
  • ArgumentsAnalyzer.handleByRefFunctionArg (cognitive 48) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:2223 — ArgumentsAnalyzer.handleByRefFunctionArg has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 18, loops 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TaintFlowResolution.getNextOpenAssignments (cognitive 48) · ×1
  • TaintFlowResolution.getNextOpenAssignments (cognitive 48) src/Psalm/Internal/Codebase/TaintFlowResolution.php:1380 — TaintFlowResolution.getNextOpenAssignments has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 11 (23 pts), boolean chains 16, if/else 7 (9 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 · ArrayMapReturnTypeProvider.getReturnTypeFromMappingIds (cognitive 48) · ×1
  • ArrayMapReturnTypeProvider.getReturnTypeFromMappingIds (cognitive 48) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMapReturnTypeProvider.php:627 — ArrayMapReturnTypeProvider.getReturnTypeFromMappingIds has cognitive complexity 48 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 4 (12 pts), ternaries 1 (5 pts), boolean chains 2 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AssertionReconciler.reconcile (cognitive 48) · ×1
  • AssertionReconciler.reconcile (cognitive 48) src/Psalm/Internal/Type/AssertionReconciler.php:113 — AssertionReconciler.reconcile has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 11, loops 4 (7 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayAssignmentAnalyzer.updateArrayType (cognitive 47) · ×1
  • ArrayAssignmentAnalyzer.updateArrayType (cognitive 47) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:127 — ArrayAssignmentAnalyzer.updateArrayType has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 11, loops 3 (7 pts), ternaries 2 (3 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 · ArgumentAnalyzer.checkArgumentMatches (cognitive 47) · ×1
  • ArgumentAnalyzer.checkArgumentMatches (cognitive 47) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:155 — ArgumentAnalyzer.checkArgumentMatches has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 15, loops 1 (3 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CloneAnalyzer.analyzeClonedType (cognitive 47) · ×1
  • CloneAnalyzer.analyzeClonedType (cognitive 47) src/Psalm/Internal/Analyzer/Statements/Expression/CloneAnalyzer.php:233 — CloneAnalyzer.analyzeClonedType has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (35 pts), boolean chains 6, ternaries 1 (5 pts), loops 1 (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 · DestructorAnalyzer.getHeldType (cognitive 47) · ×1
  • DestructorAnalyzer.getHeldType (cognitive 47) src/Psalm/Internal/Analyzer/Statements/Expression/DestructorAnalyzer.php:123 — DestructorAnalyzer.getHeldType has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 9, ternaries 4 (8 pts), loops 2 (4 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 · Analyzer.doAnalysis (cognitive 47) · ×1
  • Analyzer.doAnalysis (cognitive 47) src/Psalm/Internal/Codebase/Analyzer.php:309 — Analyzer.doAnalysis has cognitive complexity 47 (threshold 15). Drivers by points: loops 8 (24 pts), if/else 9 (21 pts), boolean chains 2 (nesting depth added 28). 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 · Populator.extendTemplateParams (cognitive 47) · ×1
  • Populator.extendTemplateParams (cognitive 47) src/Psalm/Internal/Codebase/Populator.php:1317 — Populator.extendTemplateParams has cognitive complexity 47 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 6 (21 pts), ternaries 1 (2 pts), boolean chains 1 (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 · SimpleAssertionReconciler.reconcileExactlyCountable (cognitive 47) · ×1
  • SimpleAssertionReconciler.reconcileExactlyCountable (cognitive 47) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:818 — SimpleAssertionReconciler.reconcileExactlyCountable has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 2 (10 pts), boolean chains 6, ternaries 1 (6 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 · MutableUnion.substitute (cognitive 47) · ×1
  • MutableUnion.substitute (cognitive 47) src/Psalm/Type/MutableUnion.php:356 — MutableUnion.substitute has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 14, loops 2 (3 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 · NewAnalyzer.analyzeNamedConstructor (cognitive 46) · ×1
  • NewAnalyzer.analyzeNamedConstructor (cognitive 46) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:629 — NewAnalyzer.analyzeNamedConstructor has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 7, ternaries 2 (5 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 · Functions.getMatchingFunctionNames (cognitive 46) · ×1
  • Functions.getMatchingFunctionNames (cognitive 46) src/Psalm/Internal/Codebase/Functions.php:330 — Functions.getMatchingFunctionNames has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 5 (9 pts), error handling 1 (4 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 · FilterInputReturnTypeProvider.getFunctionReturnType (cognitive 46) · ×1
  • FilterInputReturnTypeProvider.getFunctionReturnType (cognitive 46) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php:51 — FilterInputReturnTypeProvider.getFunctionReturnType has cognitive complexity 46 (threshold 15). Drivers by points: if/else 29 (39 pts), boolean chains 6, 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 · AssertionReconciler.handleLiteralEqualityWithString (cognitive 46) · ×1
  • AssertionReconciler.handleLiteralEqualityWithString (cognitive 46) src/Psalm/Internal/Type/AssertionReconciler.php:1872 — AssertionReconciler.handleLiteralEqualityWithString has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 11, loops 2 (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 · Reconciler.reconcileAbsentArrayValue (cognitive 46) · ×1
  • Reconciler.reconcileAbsentArrayValue (cognitive 46) src/Psalm/Type/Reconciler.php:1818 — Reconciler.reconcileAbsentArrayValue has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 15, loops 4 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SwitchCaseAnalyzer.handleNonReturningCase (cognitive 45) · ×1
  • SwitchCaseAnalyzer.handleNonReturningCase (cognitive 45) src/Psalm/Internal/Analyzer/Statements/Block/SwitchCaseAnalyzer.php:604 — SwitchCaseAnalyzer.handleNonReturningCase has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (30 pts), loops 3 (9 pts), boolean chains 6 (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 · ArrayAnalyzer.analyze (cognitive 45) · ×1
  • ArrayAnalyzer.analyze (cognitive 45) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:63 — ArrayAnalyzer.analyze has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (25 pts), ternaries 4 (9 pts), boolean chains 8, loops 2 (3 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 · AssertionFinder.getNativeSymbolGuardAssertion (cognitive 45) · ×1
  • AssertionFinder.getNativeSymbolGuardAssertion (cognitive 45) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:932 — AssertionFinder.getNativeSymbolGuardAssertion has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 10, loops 2 (5 pts), ternaries 3 (5 pts), error handling 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 · StatementsAnalyzer.hoistFunctions (cognitive 45) · ×1
  • StatementsAnalyzer.hoistFunctions (cognitive 45) src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:341 — StatementsAnalyzer.hoistFunctions has cognitive complexity 45 (threshold 15). Drivers by points: if/else 7 (28 pts), loops 3 (11 pts), boolean chains 3, error handling 1 (3 pts) (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 · SimpleNameResolver.enterNode (cognitive 45) · ×1
  • SimpleNameResolver.enterNode (cognitive 45) src/Psalm/Internal/PhpVisitor/SimpleNameResolver.php:60 — SimpleNameResolver.enterNode has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 7 (16 pts), boolean chains 8 (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 · StatementsProvider.getStatementsForFile (cognitive 45) · ×1
  • StatementsProvider.getStatementsForFile (cognitive 45) src/Psalm/Internal/Provider/StatementsProvider.php:113 — StatementsProvider.getStatementsForFile has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 12, ternaries 2 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionReconciler.handleLiteralEqualityWithInt (cognitive 45) · ×1
  • AssertionReconciler.handleLiteralEqualityWithInt (cognitive 45) src/Psalm/Internal/Type/AssertionReconciler.php:1700 — AssertionReconciler.handleLiteralEqualityWithInt has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 11, loops 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionReconciler.handleLiteralEqualityWithFloat (cognitive 45) · ×1
  • AssertionReconciler.handleLiteralEqualityWithFloat (cognitive 45) src/Psalm/Internal/Type/AssertionReconciler.php:2030 — AssertionReconciler.handleLiteralEqualityWithFloat has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 10, loops 2 (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 · TypeParser.getTypeFromTree (cognitive 45) · ×1
  • TypeParser.getTypeFromTree (cognitive 45) src/Psalm/Internal/Type/TypeParser.php:394 — TypeParser.getTypeFromTree has cognitive complexity 45 (threshold 15). Drivers by points: if/else 27 (35 pts), boolean chains 6, ternaries 2 (4 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 · ClosureAnalyzer.analyzeClosureUses (cognitive 44) · ×1
  • ClosureAnalyzer.analyzeClosureUses (cognitive 44) src/Psalm/Internal/Analyzer/ClosureAnalyzer.php:637 — ClosureAnalyzer.analyzeClosureUses has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (35 pts), ternaries 1 (4 pts), boolean chains 3, loops 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Scanner.queueFilesOfInheritedMethods (cognitive 44) · ×1
  • Scanner.queueFilesOfInheritedMethods (cognitive 44) src/Psalm/Internal/Codebase/Scanner.php:413 — Scanner.queueFilesOfInheritedMethods has cognitive complexity 44 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 4 (11 pts), boolean chains 9 (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 · ProjectAnalyzer.migrateCode (cognitive 43) · ×1
  • ProjectAnalyzer.migrateCode (cognitive 43) src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:813 — ProjectAnalyzer.migrateCode has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (23 pts), ternaries 3 (12 pts), loops 3 (7 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 · AssertionFinder.getGetclassEqualityAssertions (cognitive 43) · ×1
  • AssertionFinder.getGetclassEqualityAssertions (cognitive 43) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3688 — AssertionFinder.getGetclassEqualityAssertions has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 13, ternaries 2 (6 pts), loops 1 (3 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 · ArgumentAnalyzer.verifyCallableInContext (cognitive 43) · ×1
  • ArgumentAnalyzer.verifyCallableInContext (cognitive 43) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:1652 — ArgumentAnalyzer.verifyCallableInContext has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 16, if/else 7 (16 pts), ternaries 3 (9 pts), error handling 1 (2 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ClassConstAnalyzer.getOverriddenConstant (cognitive 43) · ×1
  • ClassConstAnalyzer.getOverriddenConstant (cognitive 43) src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:986 — ClassConstAnalyzer.getOverriddenConstant has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 9, loops 4 (6 pts), ternaries 1 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CodeUseGraph.reach (cognitive 43) · ×1
  • CodeUseGraph.reach (cognitive 43) src/Psalm/Internal/Codebase/CodeUseGraph.php:720 — CodeUseGraph.reach has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 5 (10 pts), boolean chains 7 (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 · TaintStore.getKnownStart (cognitive 43) · ×1
  • TaintStore.getKnownStart (cognitive 43) src/Psalm/Internal/Codebase/TaintStore.php:466 — TaintStore.getKnownStart has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 10, ternaries 2 (6 pts), loops 2 (4 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 · TypeExpander.expandPropertiesOf (cognitive 43) · ×1
  • TypeExpander.expandPropertiesOf (cognitive 43) src/Psalm/Internal/Type/TypeExpander.php:1277 — TypeExpander.expandPropertiesOf has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 5 (9 pts), ternaries 3 (6 pts), boolean chains 4 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Transpiler.emitClass (cognitive 42) · ×1
  • Transpiler.emitClass (cognitive 42) bin/hack-conformance/Transpiler.php:1126 — Transpiler.emitClass has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 4 (9 pts), loops 5 (7 pts), boolean chains 3, match/switch 1 (2 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 · Codebase.getMarkupContentForSymbolByReference (cognitive 42) · ×1
  • Codebase.getMarkupContentForSymbolByReference (cognitive 42) src/Psalm/Codebase.php:1704 — Codebase.getMarkupContentForSymbolByReference has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (40 pts), error handling 1, ternaries 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 · ClassAnalyzer.analyzeTraitUse (cognitive 42) · ×1
  • ClassAnalyzer.analyzeTraitUse (cognitive 42) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:1610 — ClassAnalyzer.analyzeTraitUse has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 3 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContinueAnalyzer.analyze (cognitive 42) · ×1
  • ContinueAnalyzer.analyze (cognitive 42) src/Psalm/Internal/Analyzer/Statements/ContinueAnalyzer.php:24 — ContinueAnalyzer.analyze has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 4 (9 pts), boolean chains 5, ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayAssignmentAnalyzer.updateTypeWithKeyValues (cognitive 42) · ×1
  • ArrayAssignmentAnalyzer.updateTypeWithKeyValues (cognitive 42) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:424 — ArrayAssignmentAnalyzer.updateTypeWithKeyValues has cognitive complexity 42 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 4 (9 pts), boolean chains 5, ternaries 1 (2 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 · FunctionCallAnalyzer.handleNamedFunction (cognitive 42) · ×1
  • FunctionCallAnalyzer.handleNamedFunction (cognitive 42) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:788 — FunctionCallAnalyzer.handleNamedFunction has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 13, ternaries 3 (4 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCallReturnTypeFetcher.simpleExclusion (cognitive 42) · ×1
  • FunctionCallReturnTypeFetcher.simpleExclusion (cognitive 42) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:2039 — FunctionCallReturnTypeFetcher.simpleExclusion has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 22, if/else 8 (19 pts), loops 1 (nesting depth added 11). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ImplodeReturnTypeProvider.getFunctionReturnType (cognitive 42) · ×1
  • ImplodeReturnTypeProvider.getFunctionReturnType (cognitive 42) src/Psalm/Internal/Provider/ReturnTypeProvider/ImplodeReturnTypeProvider.php:50 — ImplodeReturnTypeProvider.getFunctionReturnType has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 16, if/else 9 (16 pts), loops 4 (5 pts), ternaries 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 · IteratorToArrayReturnTypeProvider.getFunctionReturnType (cognitive 42) · ×1
  • IteratorToArrayReturnTypeProvider.getFunctionReturnType (cognitive 42) src/Psalm/Internal/Provider/ReturnTypeProvider/IteratorToArrayReturnTypeProvider.php:43 — IteratorToArrayReturnTypeProvider.getFunctionReturnType has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 8, ternaries 2 (6 pts), loops 1 (2 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DocblockParser.resolveTags (cognitive 42) · ×1
  • DocblockParser.resolveTags (cognitive 42) src/Psalm/Internal/Scanner/DocblockParser.php:171 — DocblockParser.resolveTags has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 26, if/else 14 (16 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Config.visitStubFiles (cognitive 41) · ×1
  • Config.visitStubFiles (cognitive 41) src/Psalm/Config.php:2855 — Config.visitStubFiles has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 6 (10 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DoAnalyzer.hasExitToTheLoop (cognitive 41) · ×1
  • DoAnalyzer.hasExitToTheLoop (cognitive 41) src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php:564 — DoAnalyzer.hasExitToTheLoop has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 3 (7 pts), boolean chains 5, ternaries 2 (5 pts) (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 · MissingMethodCallHandler.overloadAcceptsArgs (cognitive 41) · ×1
  • MissingMethodCallHandler.overloadAcceptsArgs (cognitive 41) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MissingMethodCallHandler.php:666 — MissingMethodCallHandler.overloadAcceptsArgs has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (29 pts), boolean chains 6, loops 3 (6 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 · CallAnalyzer.getTemplateTypesForCall (cognitive 41) · ×1
  • CallAnalyzer.getTemplateTypesForCall (cognitive 41) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:435 — CallAnalyzer.getTemplateTypesForCall has cognitive complexity 41 (threshold 15). Drivers by points: loops 7 (23 pts), if/else 5 (16 pts), boolean chains 2 (nesting depth added 27). 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 · AtomicPropertyFetchAnalyzer.localizePropertyType (cognitive 41) · ×1
  • AtomicPropertyFetchAnalyzer.localizePropertyType (cognitive 41) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:883 — AtomicPropertyFetchAnalyzer.localizePropertyType has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (26 pts), loops 4 (13 pts), boolean chains 1, ternaries 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionReconciler.restoreTemplateKeyOrValueOf (cognitive 41) · ×1
  • AssertionReconciler.restoreTemplateKeyOrValueOf (cognitive 41) src/Psalm/Internal/Type/AssertionReconciler.php:370 — AssertionReconciler.restoreTemplateKeyOrValueOf has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 6 (11 pts), ternaries 3 (6 pts), boolean chains 3 (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 · Codebase.getCompletionDataAtPosition (cognitive 40) · ×1
  • Codebase.getCompletionDataAtPosition (cognitive 40) src/Psalm/Codebase.php:2225 — Codebase.getCompletionDataAtPosition has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 4, loops 2, ternaries 1 (2 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 · FileFilter.allows (cognitive 40) · ×1
  • FileFilter.allows (cognitive 40) src/Psalm/Config/FileFilter.php:526 — FileFilter.allows has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (37 pts), loops 2 (3 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 · AlgebraAnalyzer.checkForParadox (cognitive 40) · ×1
  • AlgebraAnalyzer.checkForParadox (cognitive 40) src/Psalm/Internal/Analyzer/AlgebraAnalyzer.php:307 — AlgebraAnalyzer.checkForParadox has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 8 (12 pts), boolean chains 8, error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.getGetclassInequalityAssertions (cognitive 40) · ×1
  • AssertionFinder.getGetclassInequalityAssertions (cognitive 40) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2932 — AssertionFinder.getGetclassInequalityAssertions has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 12, ternaries 3 (8 pts), loops 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.getTrueEqualityAssertions (cognitive 40) · ×1
  • AssertionFinder.getTrueEqualityAssertions (cognitive 40) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3203 — AssertionFinder.getTrueEqualityAssertions has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 10 (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 · AssignmentAnalyzer.analyzePropertyAssignment (cognitive 40) · ×1
  • AssignmentAnalyzer.analyzePropertyAssignment (cognitive 40) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:2827 — AssignmentAnalyzer.analyzePropertyAssignment has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 4 (9 pts), boolean chains 6, loops 1 (4 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 · HighOrderFunctionArgHandler.getCallableArgInfo (cognitive 40) · ×1
  • HighOrderFunctionArgHandler.getCallableArgInfo (cognitive 40) src/Psalm/Internal/Analyzer/Statements/Expression/Call/HighOrderFunctionArgHandler.php:175 — HighOrderFunctionArgHandler.getCallableArgInfo has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 11 (14 pts), boolean chains 9, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleTypeInferer.handleUnpackedArray (cognitive 40) · ×1
  • SimpleTypeInferer.handleUnpackedArray (cognitive 40) src/Psalm/Internal/Analyzer/Statements/Expression/SimpleTypeInferer.php:782 — SimpleTypeInferer.handleUnpackedArray has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (36 pts), loops 2 (4 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 · ArrayUniqueReturnTypeProvider.getFunctionReturnType (cognitive 40) · ×1
  • ArrayUniqueReturnTypeProvider.getFunctionReturnType (cognitive 40) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayUniqueReturnTypeProvider.php:55 — ArrayUniqueReturnTypeProvider.getFunctionReturnType has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 5 (8 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocblockParser.parse (cognitive 40) · ×1
  • DocblockParser.parse (cognitive 40) src/Psalm/Internal/Scanner/DocblockParser.php:45 — DocblockParser.parse has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 4 (5 pts), boolean chains 2, ternaries 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 · MethodComparator.compareMethodDocblockParams (cognitive 39) · ×1
  • MethodComparator.compareMethodDocblockParams (cognitive 39) src/Psalm/Internal/Analyzer/MethodComparator.php:1126 — MethodComparator.compareMethodDocblockParams has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 7 (19 pts), if/else 9 (15 pts), boolean chains 5 (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 · SourceAnalyzer.signalMutationOnlyInferred (cognitive 39) · ×1
  • SourceAnalyzer.signalMutationOnlyInferred (cognitive 39) src/Psalm/Internal/Analyzer/SourceAnalyzer.php:246 — SourceAnalyzer.signalMutationOnlyInferred has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 12, ternaries 2 (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 · AssertionFinder.processFunctionCall (cognitive 39) · ×1
  • AssertionFinder.processFunctionCall (cognitive 39) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:798 — AssertionFinder.processFunctionCall has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 14, ternaries 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 · InstancePropertyAssignmentAnalyzer.taintProperty (cognitive 39) · ×1
  • InstancePropertyAssignmentAnalyzer.taintProperty (cognitive 39) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:635 — InstancePropertyAssignmentAnalyzer.taintProperty has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (9 pts), ternaries 2 (6 pts), boolean chains 1 (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 · AndAnalyzer.analyze (cognitive 39) · ×1
  • AndAnalyzer.analyze (cognitive 39) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/AndAnalyzer.php:41 — AndAnalyzer.analyze has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 9, loops 4 (6 pts), ternaries 3 (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 · ThrowAnalyzer.analyze (cognitive 39) · ×1
  • ThrowAnalyzer.analyze (cognitive 39) src/Psalm/Internal/Analyzer/Statements/Expression/ThrowAnalyzer.php:29 — ThrowAnalyzer.analyze has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 4 (10 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 · ReceiverPropertyTaints.taintCall (cognitive 39) · ×1
  • ReceiverPropertyTaints.taintCall (cognitive 39) src/Psalm/Internal/Codebase/ReceiverPropertyTaints.php:173 — ReceiverPropertyTaints.taintCall has cognitive complexity 39 (threshold 15). Drivers by points: loops 7 (17 pts), if/else 9 (12 pts), boolean chains 5, ternaries 1 (5 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 · CustomTraverser.traverseNode (cognitive 39) · ×1
  • CustomTraverser.traverseNode (cognitive 39) src/Psalm/Internal/PhpTraverser/CustomTraverser.php:31 — CustomTraverser.traverseNode has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 3 (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 · CustomTraverser.traverseArray (cognitive 39) · ×1
  • CustomTraverser.traverseArray (cognitive 39) src/Psalm/Internal/PhpTraverser/CustomTraverser.php:98 — CustomTraverser.traverseArray has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 4 (9 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpressionResolver.enterConditional (cognitive 39) · ×1
  • ExpressionResolver.enterConditional (cognitive 39) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:369 — ExpressionResolver.enterConditional has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 16, if/else 9 (14 pts), ternaries 3 (6 pts), error handling 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 · StringStartScanner.scan (cognitive 39) · ×1
  • StringStartScanner.scan (cognitive 39) src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:91 — StringStartScanner.scan has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 8 (12 pts), boolean chains 3, ternaries 1 (3 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 · AtomicTypeComparator.getTraversableHalf (cognitive 39) · ×1
  • AtomicTypeComparator.getTraversableHalf (cognitive 39) src/Psalm/Internal/Type/Comparator/AtomicTypeComparator.php:1005 — AtomicTypeComparator.getTraversableHalf has cognitive complexity 39 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 15, loops 2 (7 pts), ternaries 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 · ParseTreeCreator.create (cognitive 39) · ×1
  • ParseTreeCreator.create (cognitive 39) src/Psalm/Internal/Type/ParseTreeCreator.php:72 — ParseTreeCreator.create has cognitive complexity 39 (threshold 15). Drivers by points: if/else 6 (19 pts), boolean chains 10, loops 3 (8 pts), match/switch 1 (2 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 · SimpleAssertionReconciler.reconcileHasMethod (cognitive 39) · ×1
  • SimpleAssertionReconciler.reconcileHasMethod (cognitive 39) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:938 — SimpleAssertionReconciler.reconcileHasMethod has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (28 pts), boolean chains 6, loops 2 (5 pts) (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TypeExpander.expandConditional (cognitive 39) · ×1
  • TypeExpander.expandConditional (cognitive 39) src/Psalm/Internal/Type/TypeExpander.php:1048 — TypeExpander.expandConditional has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 3 (7 pts), boolean chains 4 (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 · IfConditionalAnalyzer.analyze (cognitive 38) · ×1
  • IfConditionalAnalyzer.analyze (cognitive 38) src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php:46 — IfConditionalAnalyzer.analyze has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 8, ternaries 2 (5 pts), loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.getAndCheckInstanceofAssertions (cognitive 38) · ×1
  • AssertionFinder.getAndCheckInstanceofAssertions (cognitive 38) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4771 — AssertionFinder.getAndCheckInstanceofAssertions has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (28 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (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 · UnaryPlusMinusAnalyzer.analyze (cognitive 38) · ×1
  • UnaryPlusMinusAnalyzer.analyze (cognitive 38) src/Psalm/Internal/Analyzer/Statements/Expression/UnaryPlusMinusAnalyzer.php:35 — UnaryPlusMinusAnalyzer.analyze has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (29 pts), ternaries 2 (6 pts), loops 1 (2 pts), boolean chains 1 (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 · UnsetAnalyzer.replaceElement (cognitive 38) · ×1
  • UnsetAnalyzer.replaceElement (cognitive 38) src/Psalm/Internal/Analyzer/Statements/UnsetAnalyzer.php:345 — UnsetAnalyzer.replaceElement has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (17 pts), ternaries 4 (9 pts), boolean chains 6, loops 3 (6 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 · Psalm.run (cognitive 38) · ×1
  • Psalm.run (cognitive 38) src/Psalm/Internal/Cli/Psalm.php:194 — Psalm.run has cognitive complexity 38 (threshold 15). Drivers by points: if/else 24 (26 pts), boolean chains 8, loops 2, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ClassLikes.handleClassLikeReferenceInMigration (cognitive 38) · ×1
  • ClassLikes.handleClassLikeReferenceInMigration (cognitive 38) src/Psalm/Internal/Codebase/ClassLikes.php:1668 — ClassLikes.handleClassLikeReferenceInMigration has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 8, ternaries 3 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassLikeNodeScanner.handleTraitUse (cognitive 38) · ×1
  • ClassLikeNodeScanner.handleTraitUse (cognitive 38) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1238 — ClassLikeNodeScanner.handleTraitUse has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 4 (8 pts), match/switch 1 (4 pts), boolean chains 3 (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 · StubsGenerator.getAll (cognitive 38) · ×1
  • StubsGenerator.getAll (cognitive 38) src/Psalm/Internal/Stubs/Generator/StubsGenerator.php:61 — StubsGenerator.getAll has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 7 (9 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnionTypeComparator.mergeAlternativeBounds (cognitive 38) · ×1
  • UnionTypeComparator.mergeAlternativeBounds (cognitive 38) src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php:713 — UnionTypeComparator.mergeAlternativeBounds has cognitive complexity 38 (threshold 15). Drivers by points: loops 11 (26 pts), if/else 5 (9 pts), boolean chains 3 (nesting depth added 19). 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 · ParseTreeCreator.handleValue (cognitive 38) · ×1
  • ParseTreeCreator.handleValue (cognitive 38) src/Psalm/Internal/Type/ParseTreeCreator.php:1012 — ParseTreeCreator.handleValue has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 11, ternaries 4 (6 pts), match/switch 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 · Atomic.createInner (cognitive 38) · ×1
  • Atomic.createInner (cognitive 38) src/Psalm/Type/Atomic.php:185 — Atomic.createInner has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 9, ternaries 3 (6 pts), 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 · AlgebraAnalyzer.findImplication (cognitive 37) · ×1
  • AlgebraAnalyzer.findImplication (cognitive 37) src/Psalm/Internal/Analyzer/AlgebraAnalyzer.php:489 — AlgebraAnalyzer.findImplication has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 4 (10 pts), boolean chains 5, ternaries 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MethodComparator.compareMethodDocblockReturnTypes (cognitive 37) · ×1
  • MethodComparator.compareMethodDocblockReturnTypes (cognitive 37) src/Psalm/Internal/Analyzer/MethodComparator.php:1440 — MethodComparator.compareMethodDocblockReturnTypes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 7 (14 pts), boolean chains 8 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.getInstanceOfAssertions (cognitive 37) · ×1
  • AssertionFinder.getInstanceOfAssertions (cognitive 37) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1398 — AssertionFinder.getInstanceOfAssertions has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (21 pts), ternaries 2 (10 pts), boolean chains 3, loops 1 (3 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 · ArrayAssignmentAnalyzer.updateParentTypes (cognitive 37) · ×1
  • ArrayAssignmentAnalyzer.updateParentTypes (cognitive 37) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:1449 — ArrayAssignmentAnalyzer.updateParentTypes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 4, ternaries 1 (4 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Populator.populateFileStorage (cognitive 37) · ×1
  • Populator.populateFileStorage (cognitive 37) src/Psalm/Internal/Codebase/Populator.php:1484 — Populator.populateFileStorage has cognitive complexity 37 (threshold 15). Drivers by points: error handling 9 (20 pts), if/else 5 (9 pts), loops 7 (8 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 · ReflectorVisitor.recordExternalEffects (cognitive 37) · ×1
  • ReflectorVisitor.recordExternalEffects (cognitive 37) src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:521 — ReflectorVisitor.recordExternalEffects has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 29, if/else 6, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · FilterUtils.getOptions (cognitive 37) · ×1
  • FilterUtils.getOptions (cognitive 37) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:513 — FilterUtils.getOptions has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 8, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ObjectComparator.isShallowlyContainedBy (cognitive 37) · ×1
  • ObjectComparator.isShallowlyContainedBy (cognitive 37) src/Psalm/Internal/Type/Comparator/ObjectComparator.php:35 — ObjectComparator.isShallowlyContainedBy has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 13, 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 · PurityWildcardPaths.collectEdits (cognitive 37) · ×1
  • PurityWildcardPaths.collectEdits (cognitive 37) src/Psalm/Internal/Type/PurityWildcardPaths.php:134 — PurityWildcardPaths.collectEdits has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, ternaries 3 (7 pts), loops 3 (6 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 · Reconciler.triggerIssueForImpossible (cognitive 37) · ×1
  • Reconciler.triggerIssueForImpossible (cognitive 37) src/Psalm/Type/Reconciler.php:1676 — Reconciler.triggerIssueForImpossible has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 4 (13 pts), boolean chains 5 (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 · ReturnTypeAnalyzer.checkReturnType (cognitive 36) · ×1
  • ReturnTypeAnalyzer.checkReturnType (cognitive 36) src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:911 — ReturnTypeAnalyzer.checkReturnType has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 9, ternaries 2 (3 pts), loops 1 (2 pts), error handling 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 · AssertionFinder.getTypedValueEqualityAssertions (cognitive 36) · ×1
  • AssertionFinder.getTypedValueEqualityAssertions (cognitive 36) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3793 — AssertionFinder.getTypedValueEqualityAssertions has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 18, if/else 9 (13 pts), loops 2 (4 pts), ternaries 1 (nesting depth added 6). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · StatementsAnalyzer.getUncaughtThrows (cognitive 36) · ×1
  • StatementsAnalyzer.getUncaughtThrows (cognitive 36) src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:1385 — StatementsAnalyzer.getUncaughtThrows has cognitive complexity 36 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (7 pts), ternaries 2 (6 pts), error handling 1 (5 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TaintFlowResolution.applyPathType (cognitive 36) · ×1
  • TaintFlowResolution.applyPathType (cognitive 36) src/Psalm/Internal/Codebase/TaintFlowResolution.php:1509 — TaintFlowResolution.applyPathType has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 13, ternaries 1 (2 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ArrayReverseReturnTypeProvider.getFunctionReturnType (cognitive 36) · ×1
  • ArrayReverseReturnTypeProvider.getFunctionReturnType (cognitive 36) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReverseReturnTypeProvider.php:37 — ArrayReverseReturnTypeProvider.getFunctionReturnType has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (10 pts), boolean chains 8, ternaries 2 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionLikeAnalyzer.detectUnusedParameters (cognitive 35) · ×1
  • FunctionLikeAnalyzer.detectUnusedParameters (cognitive 35) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:3215 — FunctionLikeAnalyzer.detectUnusedParameters has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 4, loops 2 (3 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 · ArithmeticOpAnalyzer.analyzeModBetweenIntRange (cognitive 35) · ×1
  • ArithmeticOpAnalyzer.analyzeModBetweenIntRange (cognitive 35) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1826 — ArithmeticOpAnalyzer.analyzeModBetweenIntRange has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MethodCallReturnTypeFetcher.getReturnDispatchNode (cognitive 35) · ×1
  • MethodCallReturnTypeFetcher.getReturnDispatchNode (cognitive 35) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php:866 — MethodCallReturnTypeFetcher.getReturnDispatchNode has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (9 pts), boolean chains 8, ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MissingMethodCallHandler.handleMissingOrMagicMethod (cognitive 35) · ×1
  • MissingMethodCallHandler.handleMissingOrMagicMethod (cognitive 35) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MissingMethodCallHandler.php:376 — MissingMethodCallHandler.handleMissingOrMagicMethod has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 3 (9 pts), boolean chains 5 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NewAnalyzer.getUnconstrainableTemplates (cognitive 35) · ×1
  • NewAnalyzer.getUnconstrainableTemplates (cognitive 35) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1987 — NewAnalyzer.getUnconstrainableTemplates has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 8 (15 pts), boolean chains 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 · AtomicPropertyFetchAnalyzer.propertyFetchCanBeAnalyzed (cognitive 35) · ×1
  • AtomicPropertyFetchAnalyzer.propertyFetchCanBeAnalyzed (cognitive 35) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:706 — AtomicPropertyFetchAnalyzer.propertyFetchCanBeAnalyzed has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 4 (8 pts), boolean chains 6 (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 · InternalCallMapHandler.getCallablesFromCallMap (cognitive 35) · ×1
  • InternalCallMapHandler.getCallablesFromCallMap (cognitive 35) src/Psalm/Internal/Codebase/InternalCallMapHandler.php:281 — InternalCallMapHandler.getCallablesFromCallMap has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 3 (4 pts), boolean chains 2 (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 · ScalarTypeComparator.isContainedByDecimalIntString (cognitive 35) · ×1
  • ScalarTypeComparator.isContainedByDecimalIntString (cognitive 35) src/Psalm/Internal/Type/Comparator/ScalarTypeComparator.php:677 — ScalarTypeComparator.isContainedByDecimalIntString has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 10 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeChecker.checkGenericParams (cognitive 35) · ×1
  • TypeChecker.checkGenericParams (cognitive 35) src/Psalm/Internal/TypeVisitor/TypeChecker.php:342 — TypeChecker.checkGenericParams has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 6 (10 pts), boolean chains 6, ternaries 2 (3 pts), error handling 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 · Transpiler.resolveContext (cognitive 34) · ×1
  • Transpiler.resolveContext (cognitive 34) bin/hack-conformance/Transpiler.php:916 — Transpiler.resolveContext has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (18 pts), ternaries 3 (9 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.getFalseInequalityAssertions (cognitive 34) · ×1
  • AssertionFinder.getFalseInequalityAssertions (cognitive 34) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2448 — AssertionFinder.getFalseInequalityAssertions has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 11 (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 · BitwiseNotAnalyzer.analyze (cognitive 34) · ×1
  • BitwiseNotAnalyzer.analyze (cognitive 34) src/Psalm/Internal/Analyzer/Statements/Expression/BitwiseNotAnalyzer.php:34 — BitwiseNotAnalyzer.analyze has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 2 (8 pts), boolean chains 3, loops 1 (2 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 · ArgumentAnalyzer.getDispatchRoutes (cognitive 34) · ×1
  • ArgumentAnalyzer.getDispatchRoutes (cognitive 34) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:2337 — ArgumentAnalyzer.getDispatchRoutes has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (9 pts), boolean chains 4, ternaries 3 (4 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ExpressionIdentifier.getVarId (cognitive 34) · ×1
  • ExpressionIdentifier.getVarId (cognitive 34) src/Psalm/Internal/Analyzer/Statements/Expression/ExpressionIdentifier.php:50 — ExpressionIdentifier.getVarId has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 15, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FreshObjectFinder.walk (cognitive 34) · ×1
  • FreshObjectFinder.walk (cognitive 34) src/Psalm/Internal/Analyzer/Statements/FreshObjectFinder.php:65 — FreshObjectFinder.walk has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (8 pts), boolean chains 4, ternaries 1 (3 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 · ClassLikeNodeScanner.visitEnumDeclaration (cognitive 34) · ×1
  • ClassLikeNodeScanner.visitEnumDeclaration (cognitive 34) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1838 — ClassLikeNodeScanner.visitEnumDeclaration has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 8, error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionLikeDocblockScanner.getAssertionParts (cognitive 34) · ×1
  • FunctionLikeDocblockScanner.getAssertionParts (cognitive 34) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:835 — FunctionLikeDocblockScanner.getAssertionParts has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 5 (9 pts), boolean chains 4, error handling 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 · ArrayFillReturnTypeProvider.getFunctionReturnType (cognitive 34) · ×1
  • ArrayFillReturnTypeProvider.getFunctionReturnType (cognitive 34) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFillReturnTypeProvider.php:36 — ArrayFillReturnTypeProvider.getFunctionReturnType has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 11, ternaries 4, 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 · BasenameReturnTypeProvider.getFunctionReturnType (cognitive 34) · ×1
  • BasenameReturnTypeProvider.getFunctionReturnType (cognitive 34) src/Psalm/Internal/Provider/ReturnTypeProvider/BasenameReturnTypeProvider.php:33 — BasenameReturnTypeProvider.getFunctionReturnType has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 1 (3 pts), boolean chains 1 (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 · TypeParser.intersectAtomicTypes (cognitive 34) · ×1
  • TypeParser.intersectAtomicTypes (cognitive 34) src/Psalm/Internal/Type/TypeParser.php:1825 — TypeParser.intersectAtomicTypes has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 16, if/else 14 (16 pts), error handling 1 (2 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TypeParser.unescapeStringLiteral (cognitive 34) · ×1
  • TypeParser.unescapeStringLiteral (cognitive 34) src/Psalm/Internal/Type/TypeParser.php:2834 — TypeParser.unescapeStringLiteral has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 4 (16 pts), if/else 7 (14 pts), boolean chains 3, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeLocation.calculateRealLocation (cognitive 33) · ×1
  • CodeLocation.calculateRealLocation (cognitive 33) src/Psalm/CodeLocation.php:248 — CodeLocation.calculateRealLocation has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (22 pts), ternaries 3 (4 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (2 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 · ArrayAssignmentAnalyzer.getElementCopySource (cognitive 33) · ×1
  • ArrayAssignmentAnalyzer.getElementCopySource (cognitive 33) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:578 — ArrayAssignmentAnalyzer.getElementCopySource has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 17, if/else 6 (8 pts), ternaries 4 (6 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ArithmeticOpAnalyzer.isChangeableByLoop (cognitive 33) · ×1
  • ArithmeticOpAnalyzer.isChangeableByLoop (cognitive 33) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1260 — ArithmeticOpAnalyzer.isChangeableByLoop has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 9, loops 3 (6 pts), ternaries 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArithmeticOpAnalyzer.analyzePowBetweenIntRange (cognitive 33) · ×1
  • ArithmeticOpAnalyzer.analyzePowBetweenIntRange (cognitive 33) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1750 — ArithmeticOpAnalyzer.analyzePowBetweenIntRange has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 6 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CoalesceAnalyzer.analyze (cognitive 33) · ×1
  • CoalesceAnalyzer.analyze (cognitive 33) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/CoalesceAnalyzer.php:79 — CoalesceAnalyzer.analyze has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 17, if/else 8 (12 pts), loops 2 (4 pts) (nesting depth added 6). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ExistingAtomicMethodCallAnalyzer.getMagicGetterOrSetterProperty (cognitive 33) · ×1
  • ExistingAtomicMethodCallAnalyzer.getMagicGetterOrSetterProperty (cognitive 33) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:651 — ExistingAtomicMethodCallAnalyzer.getMagicGetterOrSetterProperty has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 4, ternaries 1 (2 pts), match/switch 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 · PartialApplicationAnalyzer.analyze (cognitive 33) · ×1
  • PartialApplicationAnalyzer.analyze (cognitive 33) src/Psalm/Internal/Analyzer/Statements/Expression/Call/PartialApplicationAnalyzer.php:63 — PartialApplicationAnalyzer.analyze has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 12, ternaries 3 (6 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReturnAnalyzer.collectGeneratorReturnTypes (cognitive 33) · ×1
  • ReturnAnalyzer.collectGeneratorReturnTypes (cognitive 33) src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php:882 — ReturnAnalyzer.collectGeneratorReturnTypes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 9, loops 3 (7 pts), ternaries 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 · Analyzer.removeExistingDataForFile (cognitive 33) · ×1
  • Analyzer.removeExistingDataForFile (cognitive 33) src/Psalm/Internal/Codebase/Analyzer.php:1283 — Analyzer.removeExistingDataForFile has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 4 (8 pts), boolean chains 5 (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 · ClassLikes.handleDocblockTypeInMigration (cognitive 33) · ×1
  • ClassLikes.handleDocblockTypeInMigration (cognitive 33) src/Psalm/Internal/Codebase/ClassLikes.php:1853 — ClassLikes.handleDocblockTypeInMigration has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 9, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionDocblockManipulator.getManipulationsForFile (cognitive 33) · ×1
  • FunctionDocblockManipulator.getManipulationsForFile (cognitive 33) src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:543 — FunctionDocblockManipulator.getManipulationsForFile has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 10, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpressionResolver.functionEvaluatesToTrue (cognitive 33) · ×1
  • ExpressionResolver.functionEvaluatesToTrue (cognitive 33) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:446 — ExpressionResolver.functionEvaluatesToTrue has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 17, if/else 11 (16 pts) (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ExpressionScanner.scanGlobalWrites (cognitive 33) · ×1
  • ExpressionScanner.scanGlobalWrites (cognitive 33) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionScanner.php:114 — ExpressionScanner.scanGlobalWrites has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 17, if/else 4 (8 pts), loops 2 (4 pts), match/switch 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ClassLikeStubGenerator.getMethodNodes (cognitive 33) · ×1
  • ClassLikeStubGenerator.getMethodNodes (cognitive 33) src/Psalm/Internal/Stubs/Generator/ClassLikeStubGenerator.php:215 — ClassLikeStubGenerator.getMethodNodes has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 3 (7 pts), loops 4 (7 pts), boolean chains 3, match/switch 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 · IssetGuardedProperties.walk (cognitive 32) · ×1
  • IssetGuardedProperties.walk (cognitive 32) src/Psalm/Internal/Analyzer/IssetGuardedProperties.php:68 — IssetGuardedProperties.walk has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (21 pts), loops 4 (8 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 · StaticCallAnalyzer.taintReturnType (cognitive 32) · ×1
  • StaticCallAnalyzer.taintReturnType (cognitive 32) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php:477 — StaticCallAnalyzer.taintReturnType has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 12, ternaries 4 (6 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ArrayFetchAnalyzer.handleArrayAccessOnString (cognitive 32) · ×1
  • ArrayFetchAnalyzer.handleArrayAccessOnString (cognitive 32) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2549 — ArrayFetchAnalyzer.handleArrayAccessOnString has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 9, 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 · TaintFlowResolution.reach (cognitive 32) · ×1
  • TaintFlowResolution.reach (cognitive 32) src/Psalm/Internal/Codebase/TaintFlowResolution.php:1946 — TaintFlowResolution.reach has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 9 (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 · IntegerRangeComparator.reduceRangeIncrementally (cognitive 32) · ×1
  • IntegerRangeComparator.reduceRangeIncrementally (cognitive 32) src/Psalm/Internal/Type/Comparator/IntegerRangeComparator.php:98 — IntegerRangeComparator.reduceRangeIncrementally has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (26 pts), boolean chains 5, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreeCreator.handleQuestionMark (cognitive 32) · ×1
  • ParseTreeCreator.handleQuestionMark (cognitive 32) src/Psalm/Internal/Type/ParseTreeCreator.php:769 — ParseTreeCreator.handleQuestionMark has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (13 pts), ternaries 2 (4 pts), 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 · Reconciler.breakUpPathIntoParts (cognitive 32) · ×1
  • Reconciler.breakUpPathIntoParts (cognitive 32) src/Psalm/Type/Reconciler.php:1072 — Reconciler.breakUpPathIntoParts has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 7, match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Transpiler.docType (cognitive 31) · ×1
  • Transpiler.docType (cognitive 31) bin/hack-conformance/Transpiler.php:729 — Transpiler.docType has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 9 (20 pts), if/else 3 (6 pts), loops 1 (2 pts), match/switch 2, 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 · Context.findReferenceRebinding (cognitive 31) · ×1
  • Context.findReferenceRebinding (cognitive 31) src/Psalm/Context.php:832 — Context.findReferenceRebinding has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 19, if/else 5 (11 pts), loops 1 (nesting depth added 6). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Context.filterClauses (cognitive 31) · ×1
  • Context.filterClauses (cognitive 31) src/Psalm/Context.php:1125 — Context.filterClauses has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (16 pts), boolean chains 8, loops 3 (6 pts), ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassAnalyzer.analyzeClassMethod (cognitive 31) · ×1
  • ClassAnalyzer.analyzeClassMethod (cognitive 31) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:2031 — ClassAnalyzer.analyzeClassMethod has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 11, error handling 1, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CommentAnalyzer.isHashNotation (cognitive 31) · ×1
  • CommentAnalyzer.isHashNotation (cognitive 31) src/Psalm/Internal/Analyzer/CommentAnalyzer.php:497 — CommentAnalyzer.isHashNotation has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 8, loops 2 (4 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 · FunctionLikeAnalyzer.alterParams (cognitive 31) · ×1
  • FunctionLikeAnalyzer.alterParams (cognitive 31) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2165 — FunctionLikeAnalyzer.alterParams has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 11, 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 · FunctionLikeAnalyzer.getParamTypeStrings (cognitive 31) · ×1
  • FunctionLikeAnalyzer.getParamTypeStrings (cognitive 31) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2507 — FunctionLikeAnalyzer.getParamTypeStrings has cognitive complexity 31 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (9 pts), boolean chains 6, error handling 1 (5 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 · PurityWildcardInference.markReceiverTemplates (cognitive 31) · ×1
  • PurityWildcardInference.markReceiverTemplates (cognitive 31) src/Psalm/Internal/Analyzer/PurityWildcardInference.php:100 — PurityWildcardInference.markReceiverTemplates has cognitive complexity 31 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 4 (9 pts), ternaries 2 (5 pts), boolean chains 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 · ArrayAnalyzer.castArrayKeyType (cognitive 31) · ×1
  • ArrayAnalyzer.castArrayKeyType (cognitive 31) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:249 — ArrayAnalyzer.castArrayKeyType has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 5, loops 4 (5 pts), ternaries 2 (4 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 · GuardedClasses.whenResult (cognitive 31) · ×1
  • GuardedClasses.whenResult (cognitive 31) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/GuardedClasses.php:67 — GuardedClasses.whenResult has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 16, if/else 7 (11 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · MethodCallPurityAnalyzer.getUnaffectedPropertyGetters (cognitive 31) · ×1
  • MethodCallPurityAnalyzer.getUnaffectedPropertyGetters (cognitive 31) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php:884 — MethodCallPurityAnalyzer.getUnaffectedPropertyGetters has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 7, loops 4 (6 pts), ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayFetchAnalyzer.handleArrayAccessOnArray (cognitive 31) · ×1
  • ArrayFetchAnalyzer.handleArrayAccessOnArray (cognitive 31) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1538 — ArrayFetchAnalyzer.handleArrayAccessOnArray has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 3 (12 pts), boolean chains 10, if/else 6 (9 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AtomicPropertyFetchAnalyzer.processTaints (cognitive 31) · ×1
  • AtomicPropertyFetchAnalyzer.processTaints (cognitive 31) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:955 — AtomicPropertyFetchAnalyzer.processTaints has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 2 (6 pts), loops 1 (4 pts), boolean chains 2 (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 · FreshObjectFinder.use (cognitive 31) · ×1
  • FreshObjectFinder.use (cognitive 31) src/Psalm/Internal/Analyzer/Statements/FreshObjectFinder.php:127 — FreshObjectFinder.use has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 25, if/else 5 (6 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · StatementsAnalyzer.analyzeCheckedTypes (cognitive 31) · ×1
  • StatementsAnalyzer.analyzeCheckedTypes (cognitive 31) src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:446 — StatementsAnalyzer.analyzeCheckedTypes has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 2 (8 pts), boolean chains 4, error handling 1 (4 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 · CliUtils.parseOptions (cognitive 31) · ×1
  • CliUtils.parseOptions (cognitive 31) src/Psalm/Internal/CliUtils.php:288 — CliUtils.parseOptions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), ternaries 1 (4 pts), boolean chains 3, loops 2 (3 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 · TaintFlowResolution.walk (cognitive 31) · ×1
  • TaintFlowResolution.walk (cognitive 31) src/Psalm/Internal/Codebase/TaintFlowResolution.php:2063 — TaintFlowResolution.walk has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 12, loops 1 (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 · FunctionLikeDocblockScanner.handleTemplates (cognitive 31) · ×1
  • FunctionLikeDocblockScanner.handleTemplates (cognitive 31) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockScanner.php:2082 — FunctionLikeDocblockScanner.handleTemplates has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 4 (10 pts), error handling 2 (8 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayCombineReturnTypeProvider.getFunctionReturnType (cognitive 31) · ×1
  • ArrayCombineReturnTypeProvider.getFunctionReturnType (cognitive 31) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayCombineReturnTypeProvider.php:37 — ArrayCombineReturnTypeProvider.getFunctionReturnType has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 6, loops 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Transpiler.emit (cognitive 30) · ×1
  • Transpiler.emit (cognitive 30) bin/hack-conformance/Transpiler.php:1443 — Transpiler.emit has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 3 (6 pts), boolean chains 2, loops 1 (2 pts), match/switch 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 · Config.getParentIssueType (cognitive 30) · ×1
  • Config.getParentIssueType (cognitive 30) src/Psalm/Config.php:2425 — Config.getParentIssueType has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26 (27 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Config.visitPreloadedStubFiles (cognitive 30) · ×1
  • Config.visitPreloadedStubFiles (cognitive 30) src/Psalm/Config.php:2751 — Config.visitPreloadedStubFiles has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 5, 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 · Context.update (cognitive 30) · ×1
  • Context.update (cognitive 30) src/Psalm/Context.php:586 — Context.update has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (19 pts), boolean chains 7, ternaries 1 (3 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Context.removeMutableObjectVars (cognitive 30) · ×1
  • Context.removeMutableObjectVars (cognitive 30) src/Psalm/Context.php:1628 — Context.removeMutableObjectVars has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 16, if/else 5 (9 pts), loops 4 (5 pts) (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AttributesAnalyzer.analyze (cognitive 30) · ×1
  • AttributesAnalyzer.analyze (cognitive 30) src/Psalm/Internal/Analyzer/AttributesAnalyzer.php:58 — AttributesAnalyzer.analyze has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 10, ternaries 2 (5 pts), 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 · MethodComparator.compareMethodSignatureReturnTypes (cognitive 30) · ×1
  • MethodComparator.compareMethodSignatureReturnTypes (cognitive 30) src/Psalm/Internal/Analyzer/MethodComparator.php:1323 — MethodComparator.compareMethodSignatureReturnTypes has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 12, ternaries 7 (11 pts), if/else 5 (7 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 · LoopAnalyzer.widenArrayValueIntRanges (cognitive 30) · ×1
  • LoopAnalyzer.widenArrayValueIntRanges (cognitive 30) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:1899 — LoopAnalyzer.widenArrayValueIntRanges has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (19 pts), ternaries 2 (5 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayAssignmentAnalyzer.getArrayAssignmentOffsetType (cognitive 30) · ×1
  • ArrayAssignmentAnalyzer.getArrayAssignmentOffsetType (cognitive 30) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:1776 — ArrayAssignmentAnalyzer.getArrayAssignmentOffsetType has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 10 (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 · ArgumentAnalyzer.resolveTypeVariablesInCallables (cognitive 30) · ×1
  • ArgumentAnalyzer.resolveTypeVariablesInCallables (cognitive 30) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:2566 — ArgumentAnalyzer.resolveTypeVariablesInCallables has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 5, loops 2 (5 pts), ternaries 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 · ArgumentMapPopulator.recordArgumentPositions (cognitive 30) · ×1
  • ArgumentMapPopulator.recordArgumentPositions (cognitive 30) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentMapPopulator.php:31 — ArgumentMapPopulator.recordArgumentPositions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 5 (10 pts), loops 5 (7 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 · InstanceofAnalyzer.analyze (cognitive 30) · ×1
  • InstanceofAnalyzer.analyze (cognitive 30) src/Psalm/Internal/Analyzer/Statements/Expression/InstanceofAnalyzer.php:27 — InstanceofAnalyzer.analyze has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (19 pts), ternaries 2 (8 pts), boolean chains 3 (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 · NullsafeAnalyzer.analyze (cognitive 30) · ×1
  • NullsafeAnalyzer.analyze (cognitive 30) src/Psalm/Internal/Analyzer/Statements/Expression/NullsafeAnalyzer.php:66 — NullsafeAnalyzer.analyze has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 14, if/else 10 (11 pts), ternaries 4 (5 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Cache.consolidate (cognitive 30) · ×1
  • Cache.consolidate (cognitive 30) src/Psalm/Internal/Cache.php:196 — Cache.consolidate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 6, ternaries 3 (5 pts), 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 · CliUtils.requireAutoloaders (cognitive 30) · ×1
  • CliUtils.requireAutoloaders (cognitive 30) src/Psalm/Internal/CliUtils.php:79 — CliUtils.requireAutoloaders has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 5, loops 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 · DataFlowGraph.shouldIgnoreFetch (cognitive 30) · ×1
  • DataFlowGraph.shouldIgnoreFetch (cognitive 30) src/Psalm/Internal/Codebase/DataFlowGraph.php:96 — DataFlowGraph.shouldIgnoreFetch has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 3, loops 1 (2 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 · MutationLevelResolver.resolveLevels (cognitive 30) · ×1
  • MutationLevelResolver.resolveLevels (cognitive 30) src/Psalm/Internal/Codebase/MutationLevelResolver.php:69 — MutationLevelResolver.resolveLevels has cognitive complexity 30 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 4 (10 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 17). 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 · TaintFlowResolution.takeEdge (cognitive 30) · ×1
  • TaintFlowResolution.takeEdge (cognitive 30) src/Psalm/Internal/Codebase/TaintFlowResolution.php:2240 — TaintFlowResolution.takeEdge has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 11 (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 · UnshippedCode.fromContents (cognitive 30) · ×1
  • UnshippedCode.fromContents (cognitive 30) src/Psalm/Internal/Codebase/UnshippedCode.php:74 — UnshippedCode.fromContents has cognitive complexity 30 (threshold 15). Drivers by points: loops 7 (12 pts), if/else 4 (9 pts), boolean chains 6, ternaries 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 · ProtocolStreamReader.readMessages (cognitive 30) · ×1
  • ProtocolStreamReader.readMessages (cognitive 30) src/Psalm/Internal/LanguageServer/ProtocolStreamReader.php:75 — ProtocolStreamReader.readMessages has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (23 pts), error handling 1 (4 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionLikeNodeScanner.getTrivialConstructorCapabilities (cognitive 30) · ×1
  • FunctionLikeNodeScanner.getTrivialConstructorCapabilities (cognitive 30) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:788 — FunctionLikeNodeScanner.getTrivialConstructorCapabilities has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 16, if/else 5 (9 pts), ternaries 2 (3 pts), loops 2 (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · FunctionLikeNodeScanner.inferPropertyTypeFromConstructor (cognitive 30) · ×1
  • FunctionLikeNodeScanner.inferPropertyTypeFromConstructor (cognitive 30) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:937 — FunctionLikeNodeScanner.inferPropertyTypeFromConstructor has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (12 pts), ternaries 1 (3 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionLikeNodeScanner.addParams (cognitive 30) · ×1
  • FunctionLikeNodeScanner.addParams (cognitive 30) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:1454 — FunctionLikeNodeScanner.addParams has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 5 (12 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClosureReturnTypeProvider.getMethodReturnType (cognitive 30) · ×1
  • ClosureReturnTypeProvider.getMethodReturnType (cognitive 30) src/Psalm/Internal/Provider/ReturnTypeProvider/ClosureReturnTypeProvider.php:37 — ClosureReturnTypeProvider.getMethodReturnType has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 3 (6 pts), loops 2 (5 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 · DirnameReturnTypeProvider.getFunctionReturnType (cognitive 30) · ×1
  • DirnameReturnTypeProvider.getFunctionReturnType (cognitive 30) src/Psalm/Internal/Provider/ReturnTypeProvider/DirnameReturnTypeProvider.php:35 — DirnameReturnTypeProvider.getFunctionReturnType has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleAssertionReconciler.reconcileIsGreaterThan (cognitive 30) · ×1
  • SimpleAssertionReconciler.reconcileIsGreaterThan (cognitive 30) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2080 — SimpleAssertionReconciler.reconcileIsGreaterThan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 9, loops 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleAssertionReconciler.reconcileArray (cognitive 30) · ×1
  • SimpleAssertionReconciler.reconcileArray (cognitive 30) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2407 — SimpleAssertionReconciler.reconcileArray has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 5, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleNegatedAssertionReconciler.reconcileArray (cognitive 30) · ×1
  • SimpleNegatedAssertionReconciler.reconcileArray (cognitive 30) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1719 — SimpleNegatedAssertionReconciler.reconcileArray has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 5, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TemplateStandinTypeReplacer.replace (cognitive 30) · ×1
  • TemplateStandinTypeReplacer.replace (cognitive 30) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:107 — TemplateStandinTypeReplacer.replace has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionLikeAnalyzer.findAssignments (cognitive 29) · ×1
  • FunctionLikeAnalyzer.findAssignments (cognitive 29) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2550 — FunctionLikeAnalyzer.findAssignments has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 11, 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 · LoopAnalyzer.addAlwaysWrittenVarIds (cognitive 29) · ×1
  • LoopAnalyzer.addAlwaysWrittenVarIds (cognitive 29) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:1091 — LoopAnalyzer.addAlwaysWrittenVarIds has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 16, if/else 5 (11 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AssertionFinder.scrapeInequalityAssertions (cognitive 29) · ×1
  • AssertionFinder.scrapeInequalityAssertions (cognitive 29) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:631 — AssertionFinder.scrapeInequalityAssertions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryOpAnalyzer.checkForImpureEqualityComparison (cognitive 29) · ×1
  • BinaryOpAnalyzer.checkForImpureEqualityComparison (cognitive 29) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php:555 — BinaryOpAnalyzer.checkForImpureEqualityComparison has cognitive complexity 29 (threshold 15). Drivers by points: error handling 2 (8 pts), ternaries 2 (8 pts), if/else 3 (7 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MissingMethodCallHandler.handleMagicMethod (cognitive 29) · ×1
  • MissingMethodCallHandler.handleMagicMethod (cognitive 29) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MissingMethodCallHandler.php:51 — MissingMethodCallHandler.handleMagicMethod has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 3 (7 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 · UnsetAnalyzer.analyze (cognitive 29) · ×1
  • UnsetAnalyzer.analyze (cognitive 29) src/Psalm/Internal/Analyzer/Statements/UnsetAnalyzer.php:79 — UnsetAnalyzer.analyze has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 7, ternaries 2 (6 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Reflection.registerClass (cognitive 29) · ×1
  • Reflection.registerClass (cognitive 29) src/Psalm/Internal/Codebase/Reflection.php:72 — Reflection.registerClass has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 5, boolean chains 2, error handling 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TaintFlowResolution.composeOpenAssignments (cognitive 29) · ×1
  • TaintFlowResolution.composeOpenAssignments (cognitive 29) src/Psalm/Internal/Codebase/TaintFlowResolution.php:1741 — TaintFlowResolution.composeOpenAssignments has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 6 (9 pts), boolean chains 7, 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 · ParamReplacementVisitor.enterNode (cognitive 29) · ×1
  • ParamReplacementVisitor.enterNode (cognitive 29) src/Psalm/Internal/PhpVisitor/ParamReplacementVisitor.php:39 — ParamReplacementVisitor.enterNode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (5 pts), boolean chains 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 · ClassLikeNodeScanner.getTypeAliasesFromCommentLines (cognitive 29) · ×1
  • ClassLikeNodeScanner.getTypeAliasesFromCommentLines (cognitive 29) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:2529 — ClassLikeNodeScanner.getTypeAliasesFromCommentLines has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (8 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MbInternalEncodingReturnTypeProvider.getFunctionReturnType (cognitive 29) · ×1
  • MbInternalEncodingReturnTypeProvider.getFunctionReturnType (cognitive 29) src/Psalm/Internal/Provider/ReturnTypeProvider/MbInternalEncodingReturnTypeProvider.php:38 — MbInternalEncodingReturnTypeProvider.getFunctionReturnType has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (24 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 · StubsGenerator.getExpressionFromType (cognitive 29) · ×1
  • StubsGenerator.getExpressionFromType (cognitive 29) src/Psalm/Internal/Stubs/Generator/StubsGenerator.php:376 — StubsGenerator.getExpressionFromType has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 2 (4 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 · SimpleAssertionReconciler.reconcileIsLessThan (cognitive 29) · ×1
  • SimpleAssertionReconciler.reconcileIsLessThan (cognitive 29) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2210 — SimpleAssertionReconciler.reconcileIsLessThan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 8, loops 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleAssertionReconciler.reconcileCallable (cognitive 29) · ×1
  • SimpleAssertionReconciler.reconcileCallable (cognitive 29) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2877 — SimpleAssertionReconciler.reconcileCallable has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 11, 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 · CallableTrait.toNamespacedString (cognitive 29) · ×1
  • CallableTrait.toNamespacedString (cognitive 29) src/Psalm/Type/Atomic/CallableTrait.php:184 — CallableTrait.toNamespacedString has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 7 (19 pts), if/else 5 (7 pts), loops 1 (2 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 · UnionTrait.equals (cognitive 29) · ×1
  • UnionTrait.equals (cognitive 29) src/Psalm/Type/UnionTrait.php:1617 — UnionTrait.equals has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 10, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Config.getLibraryStubs (cognitive 28) · ×1
  • Config.getLibraryStubs (cognitive 28) src/Psalm/Config.php:3036 — Config.getLibraryStubs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (9 pts), ternaries 3 (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 · ForeachAnalyzer.getKeysWrittenToTheItem (cognitive 28) · ×1
  • ForeachAnalyzer.getKeysWrittenToTheItem (cognitive 28) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:681 — ForeachAnalyzer.getKeysWrittenToTheItem has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 6, loops 2 (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 · LoopAnalyzer.widenIntRanges (cognitive 28) · ×1
  • LoopAnalyzer.widenIntRanges (cognitive 28) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:1839 — LoopAnalyzer.widenIntRanges has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (10 pts), ternaries 5 (7 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassLikes.checkMethodParamReferences (cognitive 28) · ×1
  • ClassLikes.checkMethodParamReferences (cognitive 28) src/Psalm/Internal/Codebase/ClassLikes.php:2565 — ClassLikes.checkMethodParamReferences has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 4, loops 2 (4 pts), error handling 1 (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 · ReceiverPropertyTaints.taintWrites (cognitive 28) · ×1
  • ReceiverPropertyTaints.taintWrites (cognitive 28) src/Psalm/Internal/Codebase/ReceiverPropertyTaints.php:359 — ReceiverPropertyTaints.taintWrites has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 5 (8 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TaintFlowResolution.passesFetch (cognitive 28) · ×1
  • TaintFlowResolution.passesFetch (cognitive 28) src/Psalm/Internal/Codebase/TaintFlowResolution.php:3092 — TaintFlowResolution.passesFetch has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 13, if/else 10 (13 pts), ternaries 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.
D2 · Cognitive Complexity · TaintFlowResolution.reportFlow (cognitive 28) · ×1
  • TaintFlowResolution.reportFlow (cognitive 28) src/Psalm/Internal/Codebase/TaintFlowResolution.php:3921 — TaintFlowResolution.reportFlow has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 3 (9 pts), 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 · StringStartScanner.getCallArguments (cognitive 28) · ×1
  • StringStartScanner.getCallArguments (cognitive 28) src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:430 — StringStartScanner.getCallArguments has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 5 (6 pts), ternaries 2 (6 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleNegatedAssertionReconciler.reconcileBool (cognitive 28) · ×1
  • SimpleNegatedAssertionReconciler.reconcileBool (cognitive 28) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:501 — SimpleNegatedAssertionReconciler.reconcileBool has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 6, 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 · TypeParser.intersectScalarTypes (cognitive 28) · ×1
  • TypeParser.intersectScalarTypes (cognitive 28) src/Psalm/Internal/Type/TypeParser.php:2013 — TypeParser.intersectScalarTypes has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 10, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Atomic.isTruthy (cognitive 28) · ×1
  • Atomic.isTruthy (cognitive 28) src/Psalm/Type/Atomic.php:872 — Atomic.isTruthy has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18, boolean chains 10. 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 · FileAnalyzer.populateCheckers (cognitive 27) · ×1
  • FileAnalyzer.populateCheckers (cognitive 27) src/Psalm/Internal/Analyzer/FileAnalyzer.php:315 — FileAnalyzer.populateCheckers has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DoAnalyzer.getUnsureBounds (cognitive 27) · ×1
  • DoAnalyzer.getUnsureBounds (cognitive 27) src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php:338 — DoAnalyzer.getUnsureBounds has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 2 (6 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForeachAnalyzer.getIterationCapabilities (cognitive 27) · ×1
  • ForeachAnalyzer.getIterationCapabilities (cognitive 27) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1986 — ForeachAnalyzer.getIterationCapabilities has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.getNullInequalityAssertions (cognitive 27) · ×1
  • AssertionFinder.getNullInequalityAssertions (cognitive 27) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2349 — AssertionFinder.getNullInequalityAssertions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartialApplicationAnalyzer.captureReference (cognitive 27) · ×1
  • PartialApplicationAnalyzer.captureReference (cognitive 27) src/Psalm/Internal/Analyzer/Statements/Expression/Call/PartialApplicationAnalyzer.php:528 — PartialApplicationAnalyzer.captureReference has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 7, loops 3 (5 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 · ExistingAtomicStaticCallAnalyzer.collectClassTemplateParams (cognitive 27) · ×1
  • ExistingAtomicStaticCallAnalyzer.collectClassTemplateParams (cognitive 27) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php:857 — ExistingAtomicStaticCallAnalyzer.collectClassTemplateParams has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (9 pts), boolean chains 7 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MixinLookup.find (cognitive 27) · ×1
  • MixinLookup.find (cognitive 27) src/Psalm/Internal/Codebase/MixinLookup.php:122 — MixinLookup.find has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 4 (5 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Populator.registerMixinDependencies (cognitive 27) · ×1
  • Populator.registerMixinDependencies (cognitive 27) src/Psalm/Internal/Codebase/Populator.php:1223 — Populator.registerMixinDependencies has cognitive complexity 27 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 4 (10 pts), error handling 1 (5 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 · Properties.getPropertyType (cognitive 27) · ×1
  • Properties.getPropertyType (cognitive 27) src/Psalm/Internal/Codebase/Properties.php:224 — Properties.getPropertyType has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (24 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 · TaintFlowResolution.prepareGraph (cognitive 27) · ×1
  • TaintFlowResolution.prepareGraph (cognitive 27) src/Psalm/Internal/Codebase/TaintFlowResolution.php:895 — TaintFlowResolution.prepareGraph has cognitive complexity 27 (threshold 15). Drivers by points: loops 11 (15 pts), if/else 4 (11 pts), boolean chains 1 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ArrayFillKeysReturnTypeProvider.getFunctionReturnType (cognitive 27) · ×1
  • ArrayFillKeysReturnTypeProvider.getFunctionReturnType (cognitive 27) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFillKeysReturnTypeProvider.php:37 — ArrayFillKeysReturnTypeProvider.getFunctionReturnType has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 6, loops 1 (2 pts), ternaries 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 · AssertionReconciler.handleLiteralEquality (cognitive 27) · ×1
  • AssertionReconciler.handleLiteralEquality (cognitive 27) src/Psalm/Internal/Type/AssertionReconciler.php:1562 — AssertionReconciler.handleLiteralEquality has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleNegatedAssertionReconciler.reconcileIsLessThanOrEqualTo (cognitive 27) · ×1
  • SimpleNegatedAssertionReconciler.reconcileIsLessThanOrEqualTo (cognitive 27) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1888 — SimpleNegatedAssertionReconciler.reconcileIsLessThanOrEqualTo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 7, 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. This shape REPEATS in the file: one other method here (SimpleNegatedAssertionReconciler.reconcileIsGreaterThanOrEqualTo) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · SimpleNegatedAssertionReconciler.reconcileIsGreaterThanOrEqualTo (cognitive 27) · ×1
  • SimpleNegatedAssertionReconciler.reconcileIsGreaterThanOrEqualTo (cognitive 27) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:2011 — SimpleNegatedAssertionReconciler.reconcileIsGreaterThanOrEqualTo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 7, 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. This shape REPEATS in the file: one other method here (SimpleNegatedAssertionReconciler.reconcileIsLessThanOrEqualTo) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · TypeLocalizer.enterNode (cognitive 27) · ×1
  • TypeLocalizer.enterNode (cognitive 27) src/Psalm/Internal/TypeVisitor/TypeLocalizer.php:36 — TypeLocalizer.enterNode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TKeyedArray.getId (cognitive 27) · ×1
  • TKeyedArray.getId (cognitive 27) src/Psalm/Type/Atomic/TKeyedArray.php:211 — TKeyedArray.getId has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 6 (11 pts), 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 · Transpiler.nativeType (cognitive 26) · ×1
  • Transpiler.nativeType (cognitive 26) bin/hack-conformance/Transpiler.php:832 — Transpiler.nativeType has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (5 pts), ternaries 4 (5 pts), boolean chains 2, match/switch 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 · gen_callmap_utils.normalizeParameters (cognitive 26) · ×1
  • gen_callmap_utils.normalizeParameters (cognitive 26) bin/stubs/gen_callmap_utils.php:42 — gen_callmap_utils.normalizeParameters has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (3 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 · ForeachAnalyzer.mayPassByReference (cognitive 26) · ×1
  • ForeachAnalyzer.mayPassByReference (cognitive 26) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:926 — ForeachAnalyzer.mayPassByReference has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, loops 3 (5 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCallReturnTypeFetcher.getTaintsRemovedBySprintfFormats (cognitive 26) · ×1
  • FunctionCallReturnTypeFetcher.getTaintsRemovedBySprintfFormats (cognitive 26) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:1763 — FunctionCallReturnTypeFetcher.getTaintsRemovedBySprintfFormats has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 2 (5 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 · CallAnalyzer.resolveStaticPropertyAssertionClasses (cognitive 26) · ×1
  • CallAnalyzer.resolveStaticPropertyAssertionClasses (cognitive 26) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:876 — CallAnalyzer.resolveStaticPropertyAssertionClasses has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), ternaries 2 (5 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayFetchAnalyzer.castInvalidOffsetTypes (cognitive 26) · ×1
  • ArrayFetchAnalyzer.castInvalidOffsetTypes (cognitive 26) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2705 — ArrayFetchAnalyzer.castInvalidOffsetTypes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (8 pts), loops 2 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TaintStore.taintCall (cognitive 26) · ×1
  • TaintStore.taintCall (cognitive 26) src/Psalm/Internal/Codebase/TaintStore.php:168 — TaintStore.taintCall has cognitive complexity 26 (threshold 15). Drivers by points: loops 8 (17 pts), if/else 4 (7 pts), boolean chains 2 (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · FileDiffer.getDiff (cognitive 26) · ×1
  • FileDiffer.getDiff (cognitive 26) src/Psalm/Internal/Diff/FileDiffer.php:125 — FileDiffer.getDiff has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StringStartScanner.getReturnStart (cognitive 26) · ×1
  • StringStartScanner.getReturnStart (cognitive 26) src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:364 — StringStartScanner.getReturnStart has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, loops 3 (5 pts), ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassLikeStringComparator.isContainedBy (cognitive 26) · ×1
  • ClassLikeStringComparator.isContainedBy (cognitive 26) src/Psalm/Internal/Type/Comparator/ClassLikeStringComparator.php:109 — ClassLikeStringComparator.isContainedBy has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (9 pts), ternaries 4 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ParseTreeCreator.handleIsOrAs (cognitive 26) · ×1
  • ParseTreeCreator.handleIsOrAs (cognitive 26) src/Psalm/Internal/Type/ParseTreeCreator.php:953 — ParseTreeCreator.handleIsOrAs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 8, ternaries 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 · SimpleAssertionReconciler.reconcileInt (cognitive 26) · ×1
  • SimpleAssertionReconciler.reconcileInt (cognitive 26) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1144 — SimpleAssertionReconciler.reconcileInt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 6, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleAssertionReconciler.getListOfSealedShape (cognitive 26) · ×1
  • SimpleAssertionReconciler.getListOfSealedShape (cognitive 26) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2527 — SimpleAssertionReconciler.getListOfSealedShape has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3, boolean chains 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleNegatedAssertionReconciler.reconcileNumeric (cognitive 26) · ×1
  • SimpleNegatedAssertionReconciler.reconcileNumeric (cognitive 26) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1326 — SimpleNegatedAssertionReconciler.reconcileNumeric has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 5, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeCombiner.combineDecimalIntString (cognitive 26) · ×1
  • TypeCombiner.combineDecimalIntString (cognitive 26) src/Psalm/Internal/Type/TypeCombiner.php:1553 — TypeCombiner.combineDecimalIntString has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, ternaries 2 (5 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 · Atomic.visitMutable (cognitive 26) · ×1
  • Atomic.visitMutable (cognitive 26) src/Psalm/Type/Atomic.php:712 — Atomic.visitMutable has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (8 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 · Context.resetMutatedStaticProperties (cognitive 25) · ×1
  • Context.resetMutatedStaticProperties (cognitive 25) src/Psalm/Context.php:1446 — Context.resetMutatedStaticProperties has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (6 pts), loops 4 (5 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 · FunctionAnalyzer.analyzeStatement (cognitive 25) · ×1
  • FunctionAnalyzer.analyzeStatement (cognitive 25) src/Psalm/Internal/Analyzer/FunctionAnalyzer.php:62 — FunctionAnalyzer.analyzeStatement has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (4 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 · MethodComparator.comparePseudoMethod (cognitive 25) · ×1
  • MethodComparator.comparePseudoMethod (cognitive 25) src/Psalm/Internal/Analyzer/MethodComparator.php:379 — MethodComparator.comparePseudoMethod has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 4 (7 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NamespaceAnalyzer.collectAnalyzableInformation (cognitive 25) · ×1
  • NamespaceAnalyzer.collectAnalyzableInformation (cognitive 25) src/Psalm/Internal/Analyzer/NamespaceAnalyzer.php:55 — NamespaceAnalyzer.collectAnalyzableInformation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (5 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 · PurityWildcardInference.findParamPath (cognitive 25) · ×1
  • PurityWildcardInference.findParamPath (cognitive 25) src/Psalm/Internal/Analyzer/PurityWildcardInference.php:295 — PurityWildcardInference.findParamPath has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 6 (9 pts), boolean chains 4, 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 · ForeachAnalyzer.mayWriteTheArrayOtherwise (cognitive 25) · ×1
  • ForeachAnalyzer.mayWriteTheArrayOtherwise (cognitive 25) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:798 — ForeachAnalyzer.mayWriteTheArrayOtherwise has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 14, if/else 6 (9 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · LoopAnalyzer.applyPreConditionToLoopContext (cognitive 25) · ×1
  • LoopAnalyzer.applyPreConditionToLoopContext (cognitive 25) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:1585 — LoopAnalyzer.applyPreConditionToLoopContext has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCallReturnTypeFetcher.taintCallableParamCall (cognitive 25) · ×1
  • FunctionCallReturnTypeFetcher.taintCallableParamCall (cognitive 25) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:822 — FunctionCallReturnTypeFetcher.taintCallableParamCall has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, loops 3 (6 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 · FunctionCallReturnTypeFetcher.taintCallablePassedToParam (cognitive 25) · ×1
  • FunctionCallReturnTypeFetcher.taintCallablePassedToParam (cognitive 25) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:907 — FunctionCallReturnTypeFetcher.taintCallablePassedToParam has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaticCallAnalyzer.analyzeParentPropertyHookCall (cognitive 25) · ×1
  • StaticCallAnalyzer.analyzeParentPropertyHookCall (cognitive 25) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticCallAnalyzer.php:390 — StaticCallAnalyzer.analyzeParentPropertyHookCall has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (9 pts), ternaries 4, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · CallAnalyzer.getFunctionIdsFromCallableArg (cognitive 25) · ×1
  • CallAnalyzer.getFunctionIdsFromCallableArg (cognitive 25) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:545 — CallAnalyzer.getFunctionIdsFromCallableArg has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 12 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ClassConstAnalyzer.analyze (cognitive 25) · ×1
  • ClassConstAnalyzer.analyze (cognitive 25) src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:890 — ClassConstAnalyzer.analyze has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MagicConstAnalyzer.analyze (cognitive 25) · ×1
  • MagicConstAnalyzer.analyze (cognitive 25) src/Psalm/Internal/Analyzer/Statements/Expression/MagicConstAnalyzer.php:31 — MagicConstAnalyzer.analyze has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3, ternaries 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 · Psalm.restart (cognitive 25) · ×1
  • Psalm.restart (cognitive 25) src/Psalm/Internal/Cli/Psalm.php:1027 — Psalm.restart has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, loops 1 (3 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassLikeNodeScanner.nodesUseProperty (cognitive 25) · ×1
  • ClassLikeNodeScanner.nodesUseProperty (cognitive 25) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:2351 — ClassLikeNodeScanner.nodesUseProperty has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 8, loops 2 (3 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 · ExpressionResolver.fileDeclaresKind (cognitive 25) · ×1
  • ExpressionResolver.fileDeclaresKind (cognitive 25) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:590 — ExpressionResolver.fileDeclaresKind has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 8, ternaries 3 (4 pts), 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 · StringStartScanner.getStart (cognitive 25) · ×1
  • StringStartScanner.getStart (cognitive 25) src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:624 — StringStartScanner.getStart has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7, ternaries 2 (5 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileReferenceProvider.loadReferenceCache (cognitive 25) · ×1
  • FileReferenceProvider.loadReferenceCache (cognitive 25) src/Psalm/Internal/Provider/FileReferenceProvider.php:278 — FileReferenceProvider.loadReferenceCache has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionReconciler.canBeIntersected (cognitive 25) · ×1
  • AssertionReconciler.canBeIntersected (cognitive 25) src/Psalm/Internal/Type/AssertionReconciler.php:2463 — AssertionReconciler.canBeIntersected has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 8, 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 · SimpleNegatedAssertionReconciler.reconcileInt (cognitive 25) · ×1
  • SimpleNegatedAssertionReconciler.reconcileInt (cognitive 25) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1420 — SimpleNegatedAssertionReconciler.reconcileInt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleNegatedAssertionReconciler.reconcileFloat (cognitive 25) · ×1
  • SimpleNegatedAssertionReconciler.reconcileFloat (cognitive 25) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1520 — SimpleNegatedAssertionReconciler.reconcileFloat has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LongProgress.taskDone (cognitive 25) · ×1
  • LongProgress.taskDone (cognitive 25) src/Psalm/Progress/LongProgress.php:121 — LongProgress.taskDone has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5, ternaries 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 · TKeyedArray.toNamespacedString (cognitive 25) · ×1
  • TKeyedArray.toNamespacedString (cognitive 25) src/Psalm/Type/Atomic/TKeyedArray.php:270 — TKeyedArray.toNamespacedString has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 4 (7 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnionTrait.getNonDefaultProperties (cognitive 25) · ×1
  • UnionTrait.getNonDefaultProperties (cognitive 25) src/Psalm/Type/UnionTrait.php:135 — UnionTrait.getNonDefaultProperties has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25. 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 · FileFilter.loadFromXMLElement (cognitive 24) · ×1
  • FileFilter.loadFromXMLElement (cognitive 24) src/Psalm/Config/FileFilter.php:390 — FileFilter.loadFromXMLElement has cognitive complexity 24 (threshold 15). Drivers by points: loops 8 (16 pts), if/else 8 (nesting depth added 8). 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 · FunctionCallReturnTypeFetcher.taintCallableParams (cognitive 24) · ×1
  • FunctionCallReturnTypeFetcher.taintCallableParams (cognitive 24) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:1015 — FunctionCallReturnTypeFetcher.taintCallableParams has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MethodCallPurityAnalyzer.resetWrittenProperties (cognitive 24) · ×1
  • MethodCallPurityAnalyzer.resetWrittenProperties (cognitive 24) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php:671 — MethodCallPurityAnalyzer.resetWrittenProperties has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 7, loops 2 (4 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 · NewAnalyzer.taintNewObject (cognitive 24) · ×1
  • NewAnalyzer.taintNewObject (cognitive 24) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:939 — NewAnalyzer.taintNewObject has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 9, if/else 8, ternaries 5 (7 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ConstFetchAnalyzer.getConstType (cognitive 24) · ×1
  • ConstFetchAnalyzer.getConstType (cognitive 24) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ConstFetchAnalyzer.php:315 — ConstFetchAnalyzer.getConstType has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, loops 3 (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 · Clause.__toString (cognitive 24) · ×1
  • Clause.__toString (cognitive 24) src/Psalm/Internal/Clause.php:195 — Clause.__toString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Review.run (cognitive 24) · ×1
  • Review.run (cognitive 24) src/Psalm/Internal/Cli/Review.php:68 — Review.run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 4 (5 pts), boolean chains 3, loops 2, match/switch 1 (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 · ClassLikes.getFinalInsertionPosition (cognitive 24) · ×1
  • ClassLikes.getFinalInsertionPosition (cognitive 24) src/Psalm/Internal/Codebase/ClassLikes.php:1410 — ClassLikes.getFinalInsertionPosition has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 7, ternaries 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeUseGraph.loadCacheData (cognitive 24) · ×1
  • CodeUseGraph.loadCacheData (cognitive 24) src/Psalm/Internal/Codebase/CodeUseGraph.php:1163 — CodeUseGraph.loadCacheData has cognitive complexity 24 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 5 (9 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Scanner.convertClassesToFilePaths (cognitive 24) · ×1
  • Scanner.convertClassesToFilePaths (cognitive 24) src/Psalm/Internal/Codebase/Scanner.php:632 — Scanner.convertClassesToFilePaths has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (22 pts), boolean chains 1, loops 1 (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 · TaintFlowAnnotation.parse (cognitive 24) · ×1
  • TaintFlowAnnotation.parse (cognitive 24) src/Psalm/Internal/Codebase/TaintFlowAnnotation.php:115 — TaintFlowAnnotation.parse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 8 (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 · FunctionLikeDocblockParser.extractParams (cognitive 24) · ×1
  • FunctionLikeDocblockParser.extractParams (cognitive 24) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:636 — FunctionLikeDocblockParser.extractParams has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 7, 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 · ReflectorVisitor.recordThisPropertyMutation (cognitive 24) · ×1
  • ReflectorVisitor.recordThisPropertyMutation (cognitive 24) src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:583 — ReflectorVisitor.recordThisPropertyMutation has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (10 pts), loops 2 (3 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ArrayReplaceRecursiveReturnTypeProvider.replaceArray (cognitive 24) · ×1
  • ArrayReplaceRecursiveReturnTypeProvider.replaceArray (cognitive 24) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReplaceRecursiveReturnTypeProvider.php:179 — ArrayReplaceRecursiveReturnTypeProvider.replaceArray has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3 (5 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleAssertionReconciler.reconcileString (cognitive 24) · ×1
  • SimpleAssertionReconciler.reconcileString (cognitive 24) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1049 — SimpleAssertionReconciler.reconcileString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 7, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleAssertionReconciler.reconcileObject (cognitive 24) · ×1
  • SimpleAssertionReconciler.reconcileObject (cognitive 24) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1665 — SimpleAssertionReconciler.reconcileObject has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 8, 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 · SimpleNegatedAssertionReconciler.reconcileScalar (cognitive 24) · ×1
  • SimpleNegatedAssertionReconciler.reconcileScalar (cognitive 24) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1141 — SimpleNegatedAssertionReconciler.reconcileScalar has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 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 · SimpleNegatedAssertionReconciler.reconcileObject (cognitive 24) · ×1
  • SimpleNegatedAssertionReconciler.reconcileObject (cognitive 24) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1227 — SimpleNegatedAssertionReconciler.reconcileObject has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 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 · SimpleNegatedAssertionReconciler.reconcileString (cognitive 24) · ×1
  • SimpleNegatedAssertionReconciler.reconcileString (cognitive 24) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1615 — SimpleNegatedAssertionReconciler.reconcileString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 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 · TypeExpander.expandKeyOfValueOf (cognitive 24) · ×1
  • TypeExpander.expandKeyOfValueOf (cognitive 24) src/Psalm/Internal/Type/TypeExpander.php:1386 — TypeExpander.expandKeyOfValueOf has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IssueBuffer.add (cognitive 24) · ×1
  • IssueBuffer.add (cognitive 24) src/Psalm/IssueBuffer.php:365 — IssueBuffer.add has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, ternaries 3 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gen_callmap_utils.assertEntryParameters (cognitive 23) · ×1
  • gen_callmap_utils.assertEntryParameters (cognitive 23) bin/stubs/gen_callmap_utils.php:115 — gen_callmap_utils.assertEntryParameters has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Codebase.getSignatureInformation (cognitive 23) · ×1
  • Codebase.getSignatureInformation (cognitive 23) src/Psalm/Codebase.php:2143 — Codebase.getSignatureInformation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 1 (2 pts), ternaries 1 (2 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 · Config.reportIssueInFile (cognitive 23) · ×1
  • Config.reportIssueInFile (cognitive 23) src/Psalm/Config.php:2167 — Config.reportIssueInFile has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 7 (8 pts), error handling 1 (2 pts), loops 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · CommentAnalyzer.decorateVarDocblockComment (cognitive 23) · ×1
  • CommentAnalyzer.decorateVarDocblockComment (cognitive 23) src/Psalm/Internal/Analyzer/CommentAnalyzer.php:233 — CommentAnalyzer.decorateVarDocblockComment has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (7 pts), boolean chains 3, error handling 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 · LoopAnalyzer.setVarsAssignedInCondition (cognitive 23) · ×1
  • LoopAnalyzer.setVarsAssignedInCondition (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:1172 — LoopAnalyzer.setVarsAssignedInCondition has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 11 (nesting depth added 7). 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 · AssertionFinder.getTypedValueInequalityAssertions (cognitive 23) · ×1
  • AssertionFinder.getTypedValueInequalityAssertions (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3031 — AssertionFinder.getTypedValueInequalityAssertions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, loops 1 (3 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.getComparedVarId (cognitive 23) · ×1
  • AssertionFinder.getComparedVarId (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4027 — AssertionFinder.getComparedVarId has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 5 (7 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstancePropertyAssignmentAnalyzer.trackPropertyImpurity (cognitive 23) · ×1
  • InstancePropertyAssignmentAnalyzer.trackPropertyImpurity (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:429 — InstancePropertyAssignmentAnalyzer.trackPropertyImpurity has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (8 pts), if/else 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssignmentAnalyzer.assignTypeFromVarDocblock (cognitive 23) · ×1
  • AssignmentAnalyzer.assignTypeFromVarDocblock (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1070 — AssignmentAnalyzer.assignTypeFromVarDocblock has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (9 pts), error handling 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · BinaryOpAnalyzer.addDataFlow (cognitive 23) · ×1
  • BinaryOpAnalyzer.addDataFlow (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php:472 — BinaryOpAnalyzer.addDataFlow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, loops 3 (6 pts), ternaries 1 (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.
D2 · Cognitive Complexity · ArgumentsAnalyzer.getProvisionalTemplateResultForFunctionLike (cognitive 23) · ×1
  • ArgumentsAnalyzer.getProvisionalTemplateResultForFunctionLike (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:2438 — ArgumentsAnalyzer.getProvisionalTemplateResultForFunctionLike has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), boolean chains 3, ternaries 2 (3 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 · ArrayFunctionArgumentsAnalyzer.checkArgumentsMatch (cognitive 23) · ×1
  • ArrayFunctionArgumentsAnalyzer.checkArgumentsMatch (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:70 — ArrayFunctionArgumentsAnalyzer.checkArgumentsMatch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (6 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CallPurityResolver.resolveMethodTemplateType (cognitive 23) · ×1
  • CallPurityResolver.resolveMethodTemplateType (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Expression/Call/CallPurityResolver.php:365 — CallPurityResolver.resolveMethodTemplateType has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (10 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 · NewAnalyzer.childConstructorsAcceptArgs (cognitive 23) · ×1
  • NewAnalyzer.childConstructorsAcceptArgs (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:448 — NewAnalyzer.childConstructorsAcceptArgs has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (8 pts), boolean chains 6, if/else 3 (6 pts), loops 2 (3 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 · NewAnalyzer.taintUsingConstructorFlows (cognitive 23) · ×1
  • NewAnalyzer.taintUsingConstructorFlows (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1067 — NewAnalyzer.taintUsingConstructorFlows has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CastAnalyzer.castScalarToString (cognitive 23) · ×1
  • CastAnalyzer.castScalarToString (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:945 — CastAnalyzer.castScalarToString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7, loops 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CloneAnalyzer.analyzeFuncCall (cognitive 23) · ×1
  • CloneAnalyzer.analyzeFuncCall (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Expression/CloneAnalyzer.php:97 — CloneAnalyzer.analyzeFuncCall has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, loops 2, ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncDecExpressionAnalyzer.analyze (cognitive 23) · ×1
  • IncDecExpressionAnalyzer.analyze (cognitive 23) src/Psalm/Internal/Analyzer/Statements/Expression/IncDecExpressionAnalyzer.php:31 — IncDecExpressionAnalyzer.analyze has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Psalm.generateConfig (cognitive 23) · ×1
  • Psalm.generateConfig (cognitive 23) src/Psalm/Internal/Cli/Psalm.php:563 — Psalm.generateConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 9, error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnifiedDiffRenderer.colorize (cognitive 23) · ×1
  • UnifiedDiffRenderer.colorize (cognitive 23) src/Psalm/Internal/FileManipulation/UnifiedDiffRenderer.php:122 — UnifiedDiffRenderer.colorize has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 2 (5 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 13). 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 · LanguageServer.emitVersionedIssues (cognitive 23) · ×1
  • LanguageServer.emitVersionedIssues (cognitive 23) src/Psalm/Internal/LanguageServer/LanguageServer.php:713 — LanguageServer.emitVersionedIssues has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CheckTrivialExprVisitor.checkNonTrivialExpr (cognitive 23) · ×1
  • CheckTrivialExprVisitor.checkNonTrivialExpr (cognitive 23) src/Psalm/Internal/PhpVisitor/CheckTrivialExprVisitor.php:17 — CheckTrivialExprVisitor.checkNonTrivialExpr has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 18, if/else 3 (5 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · PregReplaceCallbackParamsProvider.getFunctionParams (cognitive 23) · ×1
  • PregReplaceCallbackParamsProvider.getFunctionParams (cognitive 23) src/Psalm/Internal/Provider/ParamsProvider/PregReplaceCallbackParamsProvider.php:51 — PregReplaceCallbackParamsProvider.getFunctionParams has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 4 (5 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayFirstLastReturnTypeProvider.getElementType (cognitive 23) · ×1
  • ArrayFirstLastReturnTypeProvider.getElementType (cognitive 23) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFirstLastReturnTypeProvider.php:101 — ArrayFirstLastReturnTypeProvider.getElementType has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 9, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayMapReturnTypeProvider.getElementMarker (cognitive 23) · ×1
  • ArrayMapReturnTypeProvider.getElementMarker (cognitive 23) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMapReturnTypeProvider.php:334 — ArrayMapReturnTypeProvider.getElementMarker has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 15, if/else 5 (6 pts), loops 1, ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · PowReturnTypeProvider.getFunctionReturnType (cognitive 23) · ×1
  • PowReturnTypeProvider.getFunctionReturnType (cognitive 23) src/Psalm/Internal/Provider/ReturnTypeProvider/PowReturnTypeProvider.php:35 — PowReturnTypeProvider.getFunctionReturnType has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 7 (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 · ParsedDocblock.render (cognitive 23) · ×1
  • ParsedDocblock.render (cognitive 23) src/Psalm/Internal/Scanner/ParsedDocblock.php:31 — ParsedDocblock.render has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (7 pts), ternaries 2 (7 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreeCreator.handleColon (cognitive 23) · ×1
  • ParseTreeCreator.handleColon (cognitive 23) src/Psalm/Internal/Type/ParseTreeCreator.php:647 — ParseTreeCreator.handleColon has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SimpleAssertionReconciler.reconcileIsset (cognitive 23) · ×1
  • SimpleAssertionReconciler.reconcileIsset (cognitive 23) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:601 — SimpleAssertionReconciler.reconcileIsset has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 10, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeParser.intersectStringTypes (cognitive 23) · ×1
  • TypeParser.intersectStringTypes (cognitive 23) src/Psalm/Internal/Type/TypeParser.php:2129 — TypeParser.intersectStringTypes has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 3 (9 pts), boolean chains 8, if/else 4 (6 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 · JunitReport.create (cognitive 23) · ×1
  • JunitReport.create (cognitive 23) src/Psalm/Report/JunitReport.php:32 — JunitReport.create has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · TValueOf.getValueType (cognitive 23) · ×1
  • TValueOf.getValueType (cognitive 23) src/Psalm/Type/Atomic/TValueOf.php:126 — TValueOf.getValueType has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, 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 · Transpiler.emitParameters (cognitive 22) · ×1
  • Transpiler.emitParameters (cognitive 22) bin/hack-conformance/Transpiler.php:1349 — Transpiler.emitParameters has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 3 (8 pts), 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 · ClassLikeAnalyzer.checkMixins (cognitive 22) · ×1
  • ClassLikeAnalyzer.checkMixins (cognitive 22) src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:877 — ClassLikeAnalyzer.checkMixins has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 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 · FunctionLikeAnalyzer.examineParamTypes (cognitive 22) · ×1
  • FunctionLikeAnalyzer.examineParamTypes (cognitive 22) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2394 — FunctionLikeAnalyzer.examineParamTypes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (9 pts), ternaries 2 (8 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · DoAnalyzer.analyze (cognitive 22) · ×1
  • DoAnalyzer.analyze (cognitive 22) src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php:41 — DoAnalyzer.analyze has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 3 (4 pts), error handling 1 (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 · AssertionFinder.getNullEqualityAssertions (cognitive 22) · ×1
  • AssertionFinder.getNullEqualityAssertions (cognitive 22) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3114 — AssertionFinder.getNullEqualityAssertions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ArithmeticOpAnalyzer.arithmeticOperation (cognitive 22) · ×1
  • ArithmeticOpAnalyzer.arithmeticOperation (cognitive 22) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1132 — ArithmeticOpAnalyzer.arithmeticOperation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCallAnalyzer.processAssertFunctionEffects (cognitive 22) · ×1
  • FunctionCallAnalyzer.processAssertFunctionEffects (cognitive 22) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1832 — FunctionCallAnalyzer.processAssertFunctionEffects has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 6, loops 1 (2 pts), ternaries 1 (2 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 · FunctionCallReturnTypeFetcher.taintArrayColumn (cognitive 22) · ×1
  • FunctionCallReturnTypeFetcher.taintArrayColumn (cognitive 22) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:1400 — FunctionCallReturnTypeFetcher.taintArrayColumn has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3, boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayFetchAnalyzer.checkLiteralStringArrayOffset (cognitive 22) · ×1
  • ArrayFetchAnalyzer.checkLiteralStringArrayOffset (cognitive 22) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1358 — ArrayFetchAnalyzer.checkLiteralStringArrayOffset has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, ternaries 1 (3 pts), 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 · ArrayFetchAnalyzer.handleArrayAccessOnClassStringMap (cognitive 22) · ×1
  • ArrayFetchAnalyzer.handleArrayAccessOnClassStringMap (cognitive 22) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1865 — ArrayFetchAnalyzer.handleArrayAccessOnClassStringMap has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 3 (12 pts), if/else 4 (9 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaticAnalyzer.analyze (cognitive 22) · ×1
  • StaticAnalyzer.analyze (cognitive 22) src/Psalm/Internal/Analyzer/Statements/StaticAnalyzer.php:30 — StaticAnalyzer.analyze has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConditionalTaintSinks.getParamBounds (cognitive 22) · ×1
  • ConditionalTaintSinks.getParamBounds (cognitive 22) src/Psalm/Internal/Codebase/ConditionalTaintSinks.php:108 — ConditionalTaintSinks.getParamBounds has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts), ternaries 1 (4 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 · Functions.getStorage (cognitive 22) · ×1
  • Functions.getStorage (cognitive 22) src/Psalm/Internal/Codebase/Functions.php:77 — Functions.getStorage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NosqlEqualityOperand.markArgument (cognitive 22) · ×1
  • NosqlEqualityOperand.markArgument (cognitive 22) src/Psalm/Internal/Codebase/NosqlEqualityOperand.php:49 — NosqlEqualityOperand.markArgument has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 2 (5 pts), ternaries 1 (4 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TaintStore.getKeyNames (cognitive 22) · ×1
  • TaintStore.getKeyNames (cognitive 22) src/Psalm/Internal/Codebase/TaintStore.php:606 — TaintStore.getKeyNames has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (6 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PropertyDocblockManipulator.getManipulationsForFile (cognitive 22) · ×1
  • PropertyDocblockManipulator.getManipulationsForFile (cognitive 22) src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php:199 — PropertyDocblockManipulator.getManipulationsForFile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, ternaries 2 (6 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 · ClassLikeDocblockParser.addMagicPropertyToInfo (cognitive 22) · ×1
  • ClassLikeDocblockParser.addMagicPropertyToInfo (cognitive 22) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:663 — ClassLikeDocblockParser.addMagicPropertyToInfo has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 5, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TemplateTagParser.parseTags (cognitive 22) · ×1
  • TemplateTagParser.parseTags (cognitive 22) src/Psalm/Internal/PhpVisitor/Reflector/TemplateTagParser.php:55 — TemplateTagParser.parseTags has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 6 (9 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TemplateTagParser.findDefaultSeparator (cognitive 22) · ×1
  • TemplateTagParser.findDefaultSeparator (cognitive 22) src/Psalm/Internal/PhpVisitor/Reflector/TemplateTagParser.php:171 — TemplateTagParser.findDefaultSeparator has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 2 (5 pts), error handling 1 (3 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TypeHintResolver.getDuplicateKeysOfAUnionMember (cognitive 22) · ×1
  • TypeHintResolver.getDuplicateKeysOfAUnionMember (cognitive 22) src/Psalm/Internal/PhpVisitor/Reflector/TypeHintResolver.php:40 — TypeHintResolver.getDuplicateKeysOfAUnionMember has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (11 pts), boolean chains 5, if/else 3 (5 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 · FileReferenceProvider.calculateFilesReferencingFile (cognitive 22) · ×1
  • FileReferenceProvider.calculateFilesReferencingFile (cognitive 22) src/Psalm/Internal/Provider/FileReferenceProvider.php:152 — FileReferenceProvider.calculateFilesReferencingFile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), error handling 1 (4 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 · ArrayIntersectKeyReturnTypeProvider.getFunctionReturnType (cognitive 22) · ×1
  • ArrayIntersectKeyReturnTypeProvider.getFunctionReturnType (cognitive 22) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayIntersectKeyReturnTypeProvider.php:36 — ArrayIntersectKeyReturnTypeProvider.getFunctionReturnType has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayMapReturnTypeProvider.isPlainValue (cognitive 22) · ×1
  • ArrayMapReturnTypeProvider.isPlainValue (cognitive 22) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMapReturnTypeProvider.php:448 — ArrayMapReturnTypeProvider.isPlainValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseUrlReturnTypeProvider.getFunctionReturnType (cognitive 22) · ×1
  • ParseUrlReturnTypeProvider.getFunctionReturnType (cognitive 22) src/Psalm/Internal/Provider/ReturnTypeProvider/ParseUrlReturnTypeProvider.php:55 — ParseUrlReturnTypeProvider.getFunctionReturnType has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (22 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 · RoundReturnTypeProvider.getFunctionReturnType (cognitive 22) · ×1
  • RoundReturnTypeProvider.getFunctionReturnType (cognitive 22) src/Psalm/Internal/Provider/ReturnTypeProvider/RoundReturnTypeProvider.php:35 — RoundReturnTypeProvider.getFunctionReturnType has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 6 (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 · AssertionReconciler.inferTemplateParamsFromParent (cognitive 22) · ×1
  • AssertionReconciler.inferTemplateParamsFromParent (cognitive 22) src/Psalm/Internal/Type/AssertionReconciler.php:1022 — AssertionReconciler.inferTemplateParamsFromParent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 9, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CallableTypeComparator.isNotExplicitlyCallableTypeCallable (cognitive 22) · ×1
  • CallableTypeComparator.isNotExplicitlyCallableTypeCallable (cognitive 22) src/Psalm/Internal/Type/Comparator/CallableTypeComparator.php:254 — CallableTypeComparator.isNotExplicitlyCallableTypeCallable has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CallableTypeComparator.getCallableFromMethodId (cognitive 22) · ×1
  • CallableTypeComparator.getCallableFromMethodId (cognitive 22) src/Psalm/Internal/Type/Comparator/CallableTypeComparator.php:326 — CallableTypeComparator.getCallableFromMethodId has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, error handling 1, 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 · KeyedArrayComparator.coerceToObjectWithProperties (cognitive 22) · ×1
  • KeyedArrayComparator.coerceToObjectWithProperties (cognitive 22) src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:351 — KeyedArrayComparator.coerceToObjectWithProperties has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 4 (6 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ParseTreeCreator.parseCallableParam (cognitive 22) · ×1
  • ParseTreeCreator.parseCallableParam (cognitive 22) src/Psalm/Internal/Type/ParseTreeCreator.php:283 — ParseTreeCreator.parseCallableParam has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 6 (7 pts), boolean chains 6 (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 · SimpleAssertionReconciler.reconcileNumeric (cognitive 22) · ×1
  • SimpleAssertionReconciler.reconcileNumeric (cognitive 22) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1562 — SimpleAssertionReconciler.reconcileNumeric has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, ternaries 2 (4 pts), 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 · SimpleAssertionReconciler.reconcileStringArrayAccess (cognitive 22) · ×1
  • SimpleAssertionReconciler.reconcileStringArrayAccess (cognitive 22) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2735 — SimpleAssertionReconciler.reconcileStringArrayAccess has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TemplateStandinTypeReplacer.replaceMatchingAtomicTypes (cognitive 22) · ×1
  • TemplateStandinTypeReplacer.replaceMatchingAtomicTypes (cognitive 22) src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php:511 — TemplateStandinTypeReplacer.replaceMatchingAtomicTypes has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (9 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeParser.extractKeyedIntersectionTypes (cognitive 22) · ×1
  • TypeParser.extractKeyedIntersectionTypes (cognitive 22) src/Psalm/Internal/Type/TypeParser.php:2628 — TypeParser.extractKeyedIntersectionTypes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, 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 · GenericTrait.toNamespacedString (cognitive 22) · ×1
  • GenericTrait.toNamespacedString (cognitive 22) src/Psalm/Type/Atomic/GenericTrait.php:127 — GenericTrait.toNamespacedString has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 9, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · lib.hc_parse_trees (cognitive 21) · ×1
  • lib.hc_parse_trees (cognitive 21) bin/hack-conformance/lib.php:217 — lib.hc_parse_trees has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (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 · Codebase.getSymbolLocationByReference (cognitive 21) · ×1
  • Codebase.getSymbolLocationByReference (cognitive 21) src/Psalm/Codebase.php:1918 — Codebase.getSymbolLocationByReference has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), error handling 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Creator.getPsr4Or0Paths (cognitive 21) · ×1
  • Creator.getPsr4Or0Paths (cognitive 21) src/Psalm/Config/Creator.php:242 — Creator.getPsr4Or0Paths has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassAnalyzer.analyzeClassMethodReturnType (cognitive 21) · ×1
  • ClassAnalyzer.analyzeClassMethodReturnType (cognitive 21) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:2240 — ClassAnalyzer.analyzeClassMethodReturnType has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 4 (8 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 · ClassAnalyzer.checkParentClass (cognitive 21) · ×1
  • ClassAnalyzer.checkParentClass (cognitive 21) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:2683 — ClassAnalyzer.checkParentClass has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, ternaries 3 (5 pts), boolean chains 4, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MethodComparator.checkForObviousMethodMismatches (cognitive 21) · ×1
  • MethodComparator.checkForObviousMethodMismatches (cognitive 21) src/Psalm/Internal/Analyzer/MethodComparator.php:490 — MethodComparator.checkForObviousMethodMismatches has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (7 pts), ternaries 1 (2 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · MethodComparator.getBoundCapabilities (cognitive 21) · ×1
  • MethodComparator.getBoundCapabilities (cognitive 21) src/Psalm/Internal/Analyzer/MethodComparator.php:646 — MethodComparator.getBoundCapabilities has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 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 · IfElseAnalyzer.removeMixedAssignmentsOfNarrowedVars (cognitive 21) · ×1
  • IfElseAnalyzer.removeMixedAssignmentsOfNarrowedVars (cognitive 21) src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:639 — IfElseAnalyzer.removeMixedAssignmentsOfNarrowedVars has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 7, ternaries 1 (4 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 · AssertionFinder.getEmptyInequalityAssertions (cognitive 21) · ×1
  • AssertionFinder.getEmptyInequalityAssertions (cognitive 21) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2726 — AssertionFinder.getEmptyInequalityAssertions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayAssignmentAnalyzer.removeAliasedOffsets (cognitive 21) · ×1
  • ArrayAssignmentAnalyzer.removeAliasedOffsets (cognitive 21) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:1618 — ArrayAssignmentAnalyzer.removeAliasedOffsets has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExitAnalyzer.analyze (cognitive 21) · ×1
  • ExitAnalyzer.analyze (cognitive 21) src/Psalm/Internal/Analyzer/Statements/Expression/ExitAnalyzer.php:31 — ExitAnalyzer.analyze has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (5 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 · ArrayFetchAnalyzer.taintSuperGlobalFetch (cognitive 21) · ×1
  • ArrayFetchAnalyzer.taintSuperGlobalFetch (cognitive 21) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:522 — ArrayFetchAnalyzer.taintSuperGlobalFetch has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (5 pts), ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ConstFetchAnalyzer.findGlobalConstTypesByWildcard (cognitive 21) · ×1
  • ConstFetchAnalyzer.findGlobalConstTypesByWildcard (cognitive 21) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ConstFetchAnalyzer.php:277 — ConstFetchAnalyzer.findGlobalConstTypesByWildcard has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (7 pts), loops 4 (5 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 · ReturnAnalyzer.getTemplateParamEqualToLiteral (cognitive 21) · ×1
  • ReturnAnalyzer.getTemplateParamEqualToLiteral (cognitive 21) src/Psalm/Internal/Analyzer/Statements/ReturnAnalyzer.php:78 — ReturnAnalyzer.getTemplateParamEqualToLiteral has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnusedAssignmentRemover.findUnusedAssignment (cognitive 21) · ×1
  • UnusedAssignmentRemover.findUnusedAssignment (cognitive 21) src/Psalm/Internal/Analyzer/Statements/UnusedAssignmentRemover.php:38 — UnusedAssignmentRemover.findUnusedAssignment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Clause.calculateNegation (cognitive 21) · ×1
  • Clause.calculateNegation (cognitive 21) src/Psalm/Internal/Clause.php:292 — Clause.calculateNegation has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (7 pts), loops 2 (3 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Psalm.initBaseline (cognitive 21) · ×1
  • Psalm.initBaseline (cognitive 21) src/Psalm/Internal/Cli/Psalm.php:1234 — Psalm.initBaseline has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Populator.inheritPropertiesFromParent (cognitive 21) · ×1
  • Populator.inheritPropertiesFromParent (cognitive 21) src/Psalm/Internal/Codebase/Populator.php:1854 — Populator.inheritPropertiesFromParent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 3, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReferenceMapGenerator.getReferenceMap (cognitive 21) · ×1
  • ReferenceMapGenerator.getReferenceMap (cognitive 21) src/Psalm/Internal/Codebase/ReferenceMapGenerator.php:19 — ReferenceMapGenerator.getReferenceMap has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Reflection.extractReflectionMethodInfo (cognitive 21) · ×1
  • Reflection.extractReflectionMethodInfo (cognitive 21) src/Psalm/Internal/Codebase/Reflection.php:258 — Reflection.extractReflectionMethodInfo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (5 pts), boolean chains 3, ternaries 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 · TaintStore.getKnownStartOfMember (cognitive 21) · ×1
  • TaintStore.getKnownStartOfMember (cognitive 21) src/Psalm/Internal/Codebase/TaintStore.php:733 — TaintStore.getKnownStartOfMember has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, ternaries 3 (5 pts), if/else 4 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · VariableUseGraph.getChildNodes (cognitive 21) · ×1
  • VariableUseGraph.getChildNodes (cognitive 21) src/Psalm/Internal/Codebase/VariableUseGraph.php:192 — VariableUseGraph.getChildNodes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 9, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PurityTemplateParser.parse (cognitive 21) · ×1
  • PurityTemplateParser.parse (cognitive 21) src/Psalm/Internal/PhpVisitor/Reflector/PurityTemplateParser.php:39 — PurityTemplateParser.parse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArrayFindReturnTypeProvider.getFunctionReturnType (cognitive 21) · ×1
  • ArrayFindReturnTypeProvider.getFunctionReturnType (cognitive 21) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFindReturnTypeProvider.php:33 — ArrayFindReturnTypeProvider.getFunctionReturnType has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (7 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilterVarReturnTypeProvider.getFunctionReturnType (cognitive 21) · ×1
  • FilterVarReturnTypeProvider.getFunctionReturnType (cognitive 21) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterVarReturnTypeProvider.php:40 — FilterVarReturnTypeProvider.getFunctionReturnType has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 1, loops 1 (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 · StubsGenerator.getParserTypeFromPsalmType (cognitive 21) · ×1
  • StubsGenerator.getParserTypeFromPsalmType (cognitive 21) src/Psalm/Internal/Stubs/Generator/StubsGenerator.php:317 — StubsGenerator.getParserTypeFromPsalmType has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionReconciler.getCompatibleStringType (cognitive 21) · ×1
  • AssertionReconciler.getCompatibleStringType (cognitive 21) src/Psalm/Internal/Type/AssertionReconciler.php:2200 — AssertionReconciler.getCompatibleStringType has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 15, if/else 2 (5 pts), loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · UnionTypeComparator.canBeContainedBy (cognitive 21) · ×1
  • UnionTypeComparator.canBeContainedBy (cognitive 21) src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php:630 — UnionTypeComparator.canBeContainedBy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, 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 · ParseTreeCreator.handleOpenRoundBracket (cognitive 21) · ×1
  • ParseTreeCreator.handleOpenRoundBracket (cognitive 21) src/Psalm/Internal/Type/ParseTreeCreator.php:440 — ParseTreeCreator.handleOpenRoundBracket has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, loops 1 (3 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseTreeCreator.handleEllipsisOrEquals (cognitive 21) · ×1
  • ParseTreeCreator.handleEllipsisOrEquals (cognitive 21) src/Psalm/Internal/Type/ParseTreeCreator.php:587 — ParseTreeCreator.handleEllipsisOrEquals has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TypeParser.parseTokens (cognitive 21) · ×1
  • TypeParser.parseTokens (cognitive 21) src/Psalm/Internal/Type/TypeParser.php:150 — TypeParser.parseTokens has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeVariableTracker.doResolveTypeVariables (cognitive 21) · ×1
  • TypeVariableTracker.doResolveTypeVariables (cognitive 21) src/Psalm/Internal/Type/TypeVariableTracker.php:139 — TypeVariableTracker.doResolveTypeVariables has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeChecker.checkNamedObject (cognitive 21) · ×1
  • TypeChecker.checkNamedObject (cognitive 21) src/Psalm/Internal/TypeVisitor/TypeChecker.php:248 — TypeChecker.checkNamedObject has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7 (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 · SarifReport.create (cognitive 21) · ×1
  • SarifReport.create (cognitive 21) src/Psalm/Report/SarifReport.php:60 — SarifReport.create has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 4 (7 pts), loops 3 (5 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 · CallableTrait.replaceCallableTemplateTypesWithStandins (cognitive 21) · ×1
  • CallableTrait.replaceCallableTemplateTypesWithStandins (cognitive 21) src/Psalm/Type/Atomic/CallableTrait.php:282 — CallableTrait.replaceCallableTemplateTypesWithStandins has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Reconciler.getPathType (cognitive 21) · ×1
  • Reconciler.getPathType (cognitive 21) src/Psalm/Type/Reconciler.php:989 — Reconciler.getPathType has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, ternaries 2 (3 pts), 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 · Transpiler.parseType (cognitive 20) · ×1
  • Transpiler.parseType (cognitive 20) bin/hack-conformance/Transpiler.php:627 — Transpiler.parseType has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 11). 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 · Transpiler.contextTags (cognitive 20) · ×1
  • Transpiler.contextTags (cognitive 20) bin/hack-conformance/Transpiler.php:1033 — Transpiler.contextTags has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 5 (7 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Context.detachReferencesReboundIn (cognitive 20) · ×1
  • Context.detachReferencesReboundIn (cognitive 20) src/Psalm/Context.php:725 — Context.detachReferencesReboundIn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CanAlias.visitUse (cognitive 20) · ×1
  • CanAlias.visitUse (cognitive 20) src/Psalm/Internal/Analyzer/CanAlias.php:52 — CanAlias.visitUse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (10 pts), ternaries 2 (7 pts), match/switch 1 (2 pts), loops 1 (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 · ClassAnalyzer.checkEnum (cognitive 20) · ×1
  • ClassAnalyzer.checkEnum (cognitive 20) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:2858 — ClassAnalyzer.checkEnum has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, ternaries 1 (3 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 · ClosureAnalyzer.widenLiteralsOfByRefCapture (cognitive 20) · ×1
  • ClosureAnalyzer.widenLiteralsOfByRefCapture (cognitive 20) src/Psalm/Internal/Analyzer/ClosureAnalyzer.php:218 — ClosureAnalyzer.widenLiteralsOfByRefCapture has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InheritedMethodTaints.getBodySuffix (cognitive 20) · ×1
  • InheritedMethodTaints.getBodySuffix (cognitive 20) src/Psalm/Internal/Analyzer/InheritedMethodTaints.php:45 — InheritedMethodTaints.getBodySuffix has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 15, if/else 4, error handling 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · MethodAnalyzer.checkStatic (cognitive 20) · ×1
  • MethodAnalyzer.checkStatic (cognitive 20) src/Psalm/Internal/Analyzer/MethodAnalyzer.php:102 — MethodAnalyzer.checkStatic has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 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 · ForeachAnalyzer.addItemsWrittenByRef (cognitive 20) · ×1
  • ForeachAnalyzer.addItemsWrittenByRef (cognitive 20) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:523 — ForeachAnalyzer.addItemsWrittenByRef has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, loops 3 (5 pts), ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IfConditionalAnalyzer.getAssignmentStates (cognitive 20) · ×1
  • IfConditionalAnalyzer.getAssignmentStates (cognitive 20) src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php:625 — IfConditionalAnalyzer.getAssignmentStates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstancePropertyAssignmentAnalyzer.checkReadonlyPropertyWrite (cognitive 20) · ×1
  • InstancePropertyAssignmentAnalyzer.checkReadonlyPropertyWrite (cognitive 20) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:539 — InstancePropertyAssignmentAnalyzer.checkReadonlyPropertyWrite has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 17, if/else 2 (3 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · NewAnalyzer.analyzeConstructorExpression (cognitive 20) · ×1
  • NewAnalyzer.analyzeConstructorExpression (cognitive 20) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1336 — NewAnalyzer.analyzeConstructorExpression has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (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 · VariableFetchAnalyzer.addDataFlowToVariable (cognitive 20) · ×1
  • VariableFetchAnalyzer.addDataFlowToVariable (cognitive 20) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php:555 — VariableFetchAnalyzer.addDataFlowToVariable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Psalter.loadCodeowners (cognitive 20) · ×1
  • Psalter.loadCodeowners (cognitive 20) src/Psalm/Internal/Cli/Psalter.php:535 — Psalter.loadCodeowners has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassLikes.moveProperties (cognitive 20) · ×1
  • ClassLikes.moveProperties (cognitive 20) src/Psalm/Internal/Codebase/ClassLikes.php:1494 — ClassLikes.moveProperties has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, error handling 1 (2 pts), 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 · Populator.bindIterationPurity (cognitive 20) · ×1
  • Populator.bindIterationPurity (cognitive 20) src/Psalm/Internal/Codebase/Populator.php:273 — Populator.bindIterationPurity has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (6 pts), boolean chains 5 (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 · PropertyBagTaints.taintAssignment (cognitive 20) · ×1
  • PropertyBagTaints.taintAssignment (cognitive 20) src/Psalm/Internal/Codebase/PropertyBagTaints.php:75 — PropertyBagTaints.taintAssignment has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (6 pts), boolean chains 5, loops 4 (5 pts), if/else 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TaintStore.addFlow (cognitive 20) · ×1
  • TaintStore.addFlow (cognitive 20) src/Psalm/Internal/Codebase/TaintStore.php:83 — TaintStore.addFlow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnshippedCode.globToRegex (cognitive 20) · ×1
  • UnshippedCode.globToRegex (cognitive 20) src/Psalm/Internal/Codebase/UnshippedCode.php:246 — UnshippedCode.globToRegex has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, ternaries 1 (3 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 · EventDispatcher.registerClass (cognitive 20) · ×1
  • EventDispatcher.registerClass (cognitive 20) src/Psalm/Internal/EventDispatcher.php:208 — EventDispatcher.registerClass has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. 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 · ClassLikeNodeScanner.finish (cognitive 20) · ×1
  • ClassLikeNodeScanner.finish (cognitive 20) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1163 — ClassLikeNodeScanner.finish has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 2 (4 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeParser.getTypeFromCallableTree (cognitive 20) · ×1
  • TypeParser.getTypeFromCallableTree (cognitive 20) src/Psalm/Internal/Type/TypeParser.php:2218 — TypeParser.getTypeFromCallableTree has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TKeyedArray.replaceTemplateTypesWithStandins (cognitive 20) · ×1
  • TKeyedArray.replaceTemplateTypesWithStandins (cognitive 20) src/Psalm/Type/Atomic/TKeyedArray.php:574 — TKeyedArray.replaceTemplateTypesWithStandins has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (9 pts), loops 2 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TKeyedArray.escapeAndQuote (cognitive 20) · ×1
  • TKeyedArray.escapeAndQuote (cognitive 20) src/Psalm/Type/Atomic/TKeyedArray.php:797 — TKeyedArray.escapeAndQuote has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 1 (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 · MutableUnion.addType (cognitive 20) · ×1
  • MutableUnion.addType (cognitive 20) src/Psalm/Type/MutableUnion.php:241 — MutableUnion.addType has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (6 pts), boolean chains 5 (nesting depth added 8). 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 · MutableUnion.removeType (cognitive 20) · ×1
  • MutableUnion.removeType (cognitive 20) src/Psalm/Type/MutableUnion.php:286 — MutableUnion.removeType has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 5 (8 pts), boolean chains 2 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · Transpiler.emitLambda (cognitive 19) · ×1
  • Transpiler.emitLambda (cognitive 19) bin/hack-conformance/Transpiler.php:1708 — Transpiler.emitLambda has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4 (5 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lib.hc_fixtures (cognitive 19) · ×1
  • lib.hc_fixtures (cognitive 19) bin/hack-conformance/lib.php:41 — lib.hc_fixtures has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build_docker.pieInstalls (cognitive 19) · ×1
  • build_docker.pieInstalls (cognitive 19) bin/stubs/build_docker.php:344 — build_docker.pieInstalls has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassAnalyzer.analyzeProperty (cognitive 19) · ×1
  • ClassAnalyzer.analyzeProperty (cognitive 19) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:1791 — ClassAnalyzer.analyzeProperty has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · FunctionLikeAnalyzer.checkParamReferences (cognitive 19) · ×1
  • FunctionLikeAnalyzer.checkParamReferences (cognitive 19) src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:1377 — FunctionLikeAnalyzer.checkParamReferences has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MethodAnalyzer.isMethodVisible (cognitive 19) · ×1
  • MethodAnalyzer.isMethodVisible (cognitive 19) src/Psalm/Internal/Analyzer/MethodAnalyzer.php:298 — MethodAnalyzer.isMethodVisible has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProjectAnalyzer.check (cognitive 19) · ×1
  • ProjectAnalyzer.check (cognitive 19) src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:474 — ProjectAnalyzer.check has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForeachAnalyzer.getExtendedType (cognitive 19) · ×1
  • ForeachAnalyzer.getExtendedType (cognitive 19) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:2316 — ForeachAnalyzer.getExtendedType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (2 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 · LoopAnalyzer.analyzeForOrWhile (cognitive 19) · ×1
  • LoopAnalyzer.analyzeForOrWhile (cognitive 19) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:869 — LoopAnalyzer.analyzeForOrWhile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (2 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 · LoopAnalyzer.updateLoopScopeContexts (cognitive 19) · ×1
  • LoopAnalyzer.updateLoopScopeContexts (cognitive 19) src/Psalm/Internal/Analyzer/Statements/Block/LoopAnalyzer.php:1502 — LoopAnalyzer.updateLoopScopeContexts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (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 · AssertionFinder.getNullsafePropertyType (cognitive 19) · ×1
  • AssertionFinder.getNullsafePropertyType (cognitive 19) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2271 — AssertionFinder.getNullsafePropertyType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (5 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssignmentAnalyzer.analyzeAssignmentOperation (cognitive 19) · ×1
  • AssignmentAnalyzer.analyzeAssignmentOperation (cognitive 19) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1246 — AssignmentAnalyzer.analyzeAssignmentOperation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, loops 2 (4 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AssignmentAnalyzer.makeReferencedArrayNonNull (cognitive 19) · ×1
  • AssignmentAnalyzer.makeReferencedArrayNonNull (cognitive 19) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:1932 — AssignmentAnalyzer.makeReferencedArrayNonNull has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, loops 2 (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 · ClassTemplateParamCollector.resolveTemplateParam (cognitive 19) · ×1
  • ClassTemplateParamCollector.resolveTemplateParam (cognitive 19) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ClassTemplateParamCollector.php:270 — ClassTemplateParamCollector.resolveTemplateParam has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MethodCallReturnTypeFetcher.getFirstClassCallableType (cognitive 19) · ×1
  • MethodCallReturnTypeFetcher.getFirstClassCallableType (cognitive 19) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php:1058 — MethodCallReturnTypeFetcher.getFirstClassCallableType has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), ternaries 1 (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 · NativeClassTaintAnalyzer.getPropertyIds (cognitive 19) · ×1
  • NativeClassTaintAnalyzer.getPropertyIds (cognitive 19) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/NativeClassTaintAnalyzer.php:263 — NativeClassTaintAnalyzer.getPropertyIds has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CallAnalyzer.checkMethodArgs (cognitive 19) · ×1
  • CallAnalyzer.checkMethodArgs (cognitive 19) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:314 — CallAnalyzer.checkMethodArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · YieldFromAnalyzer.analyze (cognitive 19) · ×1
  • YieldFromAnalyzer.analyze (cognitive 19) src/Psalm/Internal/Analyzer/Statements/Expression/YieldFromAnalyzer.php:24 — YieldFromAnalyzer.analyze has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExpressionAnalyzer.analyze (cognitive 19) · ×1
  • ExpressionAnalyzer.analyze (cognitive 19) src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php:81 — ExpressionAnalyzer.analyze has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), loops 1 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StatementsAnalyzer.analyze (cognitive 19) · ×1
  • StatementsAnalyzer.analyze (cognitive 19) src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:277 — StatementsAnalyzer.analyze has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts), loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeUseGraph.addGraph (cognitive 19) · ×1
  • CodeUseGraph.addGraph (cognitive 19) src/Psalm/Internal/Codebase/CodeUseGraph.php:540 — CodeUseGraph.addGraph has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 3 (9 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 · MutationLevelResolver.resolve (cognitive 19) · ×1
  • MutationLevelResolver.resolve (cognitive 19) src/Psalm/Internal/Codebase/MutationLevelResolver.php:200 — MutationLevelResolver.resolve has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TaintStore.getKnownStartOfImplode (cognitive 19) · ×1
  • TaintStore.getKnownStartOfImplode (cognitive 19) src/Psalm/Internal/Codebase/TaintStore.php:867 — TaintStore.getKnownStartOfImplode has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 5, if/else 3 (5 pts), 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 · FileDiffer.calculateTrace (cognitive 19) · ×1
  • FileDiffer.calculateTrace (cognitive 19) src/Psalm/Internal/Diff/FileDiffer.php:35 — FileDiffer.calculateTrace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 6, loops 3 (6 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 · PsalmRestarter.requiresRestart (cognitive 19) · ×1
  • PsalmRestarter.requiresRestart (cognitive 19) src/Psalm/Internal/Fork/PsalmRestarter.php:93 — PsalmRestarter.requiresRestart has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (6 pts), boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EmitterTrait.emit (cognitive 19) · ×1
  • EmitterTrait.emit (cognitive 19) src/Psalm/Internal/LanguageServer/EmitterTrait.php:84 — EmitterTrait.emit 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 · StringStartScanner.resolve (cognitive 19) · ×1
  • StringStartScanner.resolve (cognitive 19) src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php:728 — StringStartScanner.resolve has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, ternaries 1 (2 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 · JsonEncodeTainter.removeTaints (cognitive 19) · ×1
  • JsonEncodeTainter.removeTaints (cognitive 19) src/Psalm/Internal/Provider/AddRemoveTaints/JsonEncodeTainter.php:39 — JsonEncodeTainter.removeTaints has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (7 pts), ternaries 2 (3 pts), 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 · ClassLikeStorageProvider.addMore (cognitive 19) · ×1
  • ClassLikeStorageProvider.addMore (cognitive 19) src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:118 — ClassLikeStorageProvider.addMore has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 5, ternaries 1 (4 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 · StatementsProvider.parseStatements (cognitive 19) · ×1
  • StatementsProvider.parseStatements (cognitive 19) src/Psalm/Internal/Provider/StatementsProvider.php:416 — StatementsProvider.parseStatements has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 3 (6 pts), error handling 2 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassLikeStubGenerator.getClassLikeNode (cognitive 19) · ×1
  • ClassLikeStubGenerator.getClassLikeNode (cognitive 19) src/Psalm/Internal/Stubs/Generator/ClassLikeStubGenerator.php:36 — ClassLikeStubGenerator.getClassLikeNode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (7 pts), ternaries 3 (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 · ParseTreeCreator.createMethodParam (cognitive 19) · ×1
  • ParseTreeCreator.createMethodParam (cognitive 19) src/Psalm/Internal/Type/ParseTreeCreator.php:215 — ParseTreeCreator.createMethodParam has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (4 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 · SimpleAssertionReconciler.reconcileFalse (cognitive 19) · ×1
  • SimpleAssertionReconciler.reconcileFalse (cognitive 19) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1317 — SimpleAssertionReconciler.reconcileFalse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (SimpleAssertionReconciler.reconcileTrue) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · SimpleAssertionReconciler.reconcileTrue (cognitive 19) · ×1
  • SimpleAssertionReconciler.reconcileTrue (cognitive 19) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1402 — SimpleAssertionReconciler.reconcileTrue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (SimpleAssertionReconciler.reconcileFalse) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · TypeParser.getTypeFromUnionTree (cognitive 19) · ×1
  • TypeParser.getTypeFromUnionTree (cognitive 19) src/Psalm/Internal/Type/TypeParser.php:1447 — TypeParser.getTypeFromUnionTree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Atomic.isFalsy (cognitive 19) · ×1
  • Atomic.isFalsy (cognitive 19) src/Psalm/Type/Atomic.php:957 — Atomic.isFalsy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, boolean chains 8. 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 · UnionTrait.toPhpString (cognitive 19) · ×1
  • UnionTrait.toPhpString (cognitive 19) src/Psalm/Type/UnionTrait.php:425 — UnionTrait.toPhpString has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Config.reportStubDocblockIssues (cognitive 18) · ×1
  • Config.reportStubDocblockIssues (cognitive 18) src/Psalm/Config.php:3092 — Config.reportStubDocblockIssues has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 3 (8 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 · AttributesAnalyzer.getAttributeClassFlags (cognitive 18) · ×1
  • AttributesAnalyzer.getAttributeClassFlags (cognitive 18) src/Psalm/Internal/Analyzer/AttributesAnalyzer.php:316 — AttributesAnalyzer.getAttributeClassFlags has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (4 pts), 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 · ArrayAnalyzer.getArrayType (cognitive 18) · ×1
  • ArrayAnalyzer.getArrayType (cognitive 18) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:660 — ArrayAnalyzer.getArrayType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 2 (6 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.isPropertyImmutableOnArgument (cognitive 18) · ×1
  • AssertionFinder.isPropertyImmutableOnArgument (cognitive 18) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:5025 — AssertionFinder.isPropertyImmutableOnArgument 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 · ArrayAssignmentAnalyzer.getKeyAt (cognitive 18) · ×1
  • ArrayAssignmentAnalyzer.getKeyAt (cognitive 18) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:1663 — ArrayAssignmentAnalyzer.getKeyAt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 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 · ArrayAssignmentAnalyzer.getDimKeyValues (cognitive 18) · ×1
  • ArrayAssignmentAnalyzer.getDimKeyValues (cognitive 18) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:1732 — ArrayAssignmentAnalyzer.getDimKeyValues has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (8 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 · ArgumentsAnalyzer.applyParamClosureThisHint (cognitive 18) · ×1
  • ArgumentsAnalyzer.applyParamClosureThisHint (cognitive 18) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:958 — ArgumentsAnalyzer.applyParamClosureThisHint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArgumentsAnalyzer.addCurlOptionArraySinks (cognitive 18) · ×1
  • ArgumentsAnalyzer.addCurlOptionArraySinks (cognitive 18) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:2871 — ArgumentsAnalyzer.addCurlOptionArraySinks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TernaryAnalyzer.mergeRedefinedVars (cognitive 18) · ×1
  • TernaryAnalyzer.mergeRedefinedVars (cognitive 18) src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php:402 — TernaryAnalyzer.mergeRedefinedVars has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Cache.__construct (cognitive 18) · ×1
  • Cache.__construct (cognitive 18) src/Psalm/Internal/Cache.php:120 — Cache.__construct has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 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 · Populator.extendType (cognitive 18) · ×1
  • Populator.extendType (cognitive 18) src/Psalm/Internal/Codebase/Populator.php:1029 — Populator.extendType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (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 · ReceiverPropertyTaints.getElementCopySource (cognitive 18) · ×1
  • ReceiverPropertyTaints.getElementCopySource (cognitive 18) src/Psalm/Internal/Codebase/ReceiverPropertyTaints.php:551 — ReceiverPropertyTaints.getElementCopySource has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (5 pts), loops 1, ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AstDiffer.calculateTrace (cognitive 18) · ×1
  • AstDiffer.calculateTrace (cognitive 18) src/Psalm/Internal/Diff/AstDiffer.php:37 — AstDiffer.calculateTrace has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (6 pts), boolean chains 5 (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 · AstDiffer.extractDiff (cognitive 18) · ×1
  • AstDiffer.extractDiff (cognitive 18) src/Psalm/Internal/Diff/AstDiffer.php:89 — AstDiffer.extractDiff has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (7 pts), if/else 3 (5 pts), boolean chains 3, ternaries 1 (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 · FileDiffer.coalesceReplacements (cognitive 18) · ×1
  • FileDiffer.coalesceReplacements (cognitive 18) src/Psalm/Internal/Diff/FileDiffer.php:273 — FileDiffer.coalesceReplacements has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (5 pts), boolean chains 2 (nesting depth added 8). 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 · ExpressionScanner.scan (cognitive 18) · ×1
  • ExpressionScanner.scan (cognitive 18) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionScanner.php:46 — ExpressionScanner.scan has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (8 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · FunctionLikeDocblockParser.extractReturnType (cognitive 18) · ×1
  • FunctionLikeDocblockParser.extractReturnType (cognitive 18) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:779 — FunctionLikeDocblockParser.extractReturnType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (3 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 · HtmlFunctionTainter.addTaints (cognitive 18) · ×1
  • HtmlFunctionTainter.addTaints (cognitive 18) src/Psalm/Internal/Provider/AddRemoveTaints/HtmlFunctionTainter.php:29 — HtmlFunctionTainter.addTaints has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 7 (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. This shape REPEATS in the file: one other method here (HtmlFunctionTainter.removeTaints) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · HtmlFunctionTainter.removeTaints (cognitive 18) · ×1
  • HtmlFunctionTainter.removeTaints (cognitive 18) src/Psalm/Internal/Provider/AddRemoveTaints/HtmlFunctionTainter.php:80 — HtmlFunctionTainter.removeTaints has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 7 (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. This shape REPEATS in the file: one other method here (HtmlFunctionTainter.addTaints) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ArrayReplaceRecursiveReturnTypeProvider.replaceValue (cognitive 18) · ×1
  • ArrayReplaceRecursiveReturnTypeProvider.replaceValue (cognitive 18) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReplaceRecursiveReturnTypeProvider.php:289 — ArrayReplaceRecursiveReturnTypeProvider.replaceValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilterUtils.checkRedundantFlags (cognitive 18) · ×1
  • FilterUtils.checkRedundantFlags (cognitive 18) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.php:411 — FilterUtils.checkRedundantFlags has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SerializedProperties.findSpecialKeys (cognitive 18) · ×1
  • SerializedProperties.findSpecialKeys (cognitive 18) src/Psalm/Internal/SerializedProperties.php:38 — SerializedProperties.findSpecialKeys has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 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 · ParseTreeCreator.handleComma (cognitive 18) · ×1
  • ParseTreeCreator.handleComma (cognitive 18) src/Psalm/Internal/Type/ParseTreeCreator.php:534 — ParseTreeCreator.handleComma has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 6, loops 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ParseTreeCreator.handleAmpersand (cognitive 18) · ×1
  • ParseTreeCreator.handleAmpersand (cognitive 18) src/Psalm/Internal/Type/ParseTreeCreator.php:877 — ParseTreeCreator.handleAmpersand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, loops 1 (2 pts), ternaries 2 (nesting depth added 2). 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 · SimpleAssertionReconciler.reconcileValueOf (cognitive 18) · ×1
  • SimpleAssertionReconciler.reconcileValueOf (cognitive 18) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:3292 — SimpleAssertionReconciler.reconcileValueOf has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 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 · SimpleNegatedAssertionReconciler.reconcileFalse (cognitive 18) · ×1
  • SimpleNegatedAssertionReconciler.reconcileFalse (cognitive 18) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:777 — SimpleNegatedAssertionReconciler.reconcileFalse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (SimpleNegatedAssertionReconciler.reconcileTrue) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · SimpleNegatedAssertionReconciler.reconcileTrue (cognitive 18) · ×1
  • SimpleNegatedAssertionReconciler.reconcileTrue (cognitive 18) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:857 — SimpleNegatedAssertionReconciler.reconcileTrue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (SimpleNegatedAssertionReconciler.reconcileFalse) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · TypeChecker.checkTemplateParam (cognitive 18) · ×1
  • TypeChecker.checkTemplateParam (cognitive 18) src/Psalm/Internal/TypeVisitor/TypeChecker.php:640 — TypeChecker.checkTemplateParam has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, ternaries 2 (5 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TClassStringMap.replaceTemplateTypesWithStandins (cognitive 18) · ×1
  • TClassStringMap.replaceTemplateTypesWithStandins (cognitive 18) src/Psalm/Type/Atomic/TClassStringMap.php:124 — TClassStringMap.replaceTemplateTypesWithStandins has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 5, 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 · TKeyedArray.make (cognitive 18) · ×1
  • TKeyedArray.make (cognitive 18) src/Psalm/Type/Atomic/TKeyedArray.php:82 — TKeyedArray.make has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Codebase.getReferenceAtPositionAsReference (cognitive 17) · ×1
  • Codebase.getReferenceAtPositionAsReference (cognitive 17) src/Psalm/Codebase.php:2033 — Codebase.getReferenceAtPositionAsReference has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Config.loadCustomTaints (cognitive 17) · ×1
  • Config.loadCustomTaints (cognitive 17) src/Psalm/Config.php:1781 — Config.loadCustomTaints has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (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 · CiCreator.detectPsalmVersion (cognitive 17) · ×1
  • CiCreator.detectPsalmVersion (cognitive 17) src/Psalm/Config/CiCreator.php:49 — CiCreator.detectPsalmVersion has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, ternaries 2, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MethodComparator.transformTemplates (cognitive 17) · ×1
  • MethodComparator.transformTemplates (cognitive 17) src/Psalm/Internal/Analyzer/MethodComparator.php:1675 — MethodComparator.transformTemplates has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 3 (8 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · DoAnalyzer.reportIssues (cognitive 17) · ×1
  • DoAnalyzer.reportIssues (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php:285 — DoAnalyzer.reportIssues has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForeachAnalyzer.taintItemsWrittenByRef (cognitive 17) · ×1
  • ForeachAnalyzer.taintItemsWrittenByRef (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:1015 — ForeachAnalyzer.taintItemsWrittenByRef has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, loops 3 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AssertionFinder.getGettypeInequalityAssertions (cognitive 17) · ×1
  • AssertionFinder.getGettypeInequalityAssertions (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2803 — AssertionFinder.getGettypeInequalityAssertions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AssertionFinder.getEmptyArrayEqualityAssertions (cognitive 17) · ×1
  • AssertionFinder.getEmptyArrayEqualityAssertions (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3488 — AssertionFinder.getEmptyArrayEqualityAssertions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstancePropertyAssignmentAnalyzer.taintUnspecializedProperty (cognitive 17) · ×1
  • InstancePropertyAssignmentAnalyzer.taintUnspecializedProperty (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:764 — InstancePropertyAssignmentAnalyzer.taintUnspecializedProperty has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 5, loops 1 (2 pts), ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ArithmeticOpAnalyzer.getBitwiseResultOfNonNegativeRanges (cognitive 17) · ×1
  • ArithmeticOpAnalyzer.getBitwiseResultOfNonNegativeRanges (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1400 — ArithmeticOpAnalyzer.getBitwiseResultOfNonNegativeRanges has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, ternaries 3 (5 pts), 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 · ArithmeticOpAnalyzer.analyzeOperandsBetweenIntRange (cognitive 17) · ×1
  • ArithmeticOpAnalyzer.analyzeOperandsBetweenIntRange (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1449 — ArithmeticOpAnalyzer.analyzeOperandsBetweenIntRange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 5, ternaries 2. 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 · PipeAnalyzer.getDirectCall (cognitive 17) · ×1
  • PipeAnalyzer.getDirectCall (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/PipeAnalyzer.php:103 — PipeAnalyzer.getDirectCall has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCallAnalyzer.callUsesByReferenceArguments (cognitive 17) · ×1
  • FunctionCallAnalyzer.callUsesByReferenceArguments (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:2126 — FunctionCallAnalyzer.callUsesByReferenceArguments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HighOrderFunctionArgHandler.remapLowerBounds (cognitive 17) · ×1
  • HighOrderFunctionArgHandler.remapLowerBounds (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/Call/HighOrderFunctionArgHandler.php:62 — HighOrderFunctionArgHandler.remapLowerBounds has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExistingAtomicStaticCallAnalyzer.getMethodReturnType (cognitive 17) · ×1
  • ExistingAtomicStaticCallAnalyzer.getMethodReturnType (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php:673 — ExistingAtomicStaticCallAnalyzer.getMethodReturnType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (3 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 · CallAnalyzer.checkFunctionExists (cognitive 17) · ×1
  • CallAnalyzer.checkFunctionExists (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:708 — CallAnalyzer.checkFunctionExists has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (6 pts), error handling 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ArrayFetchAnalyzer.handleMixedArrayAccess (cognitive 17) · ×1
  • ArrayFetchAnalyzer.handleMixedArrayAccess (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1455 — ArrayFetchAnalyzer.handleMixedArrayAccess has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, loops 1 (3 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 · ArrayFetchAnalyzer.splitInvalidOffsetTypes (cognitive 17) · ×1
  • ArrayFetchAnalyzer.splitInvalidOffsetTypes (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2774 — ArrayFetchAnalyzer.splitInvalidOffsetTypes has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (6 pts), ternaries 1 (4 pts), 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 · AtomicPropertyFetchAnalyzer.processUnspecialTaints (cognitive 17) · ×1
  • AtomicPropertyFetchAnalyzer.processUnspecialTaints (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:1070 — AtomicPropertyFetchAnalyzer.processUnspecialTaints has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 2 (5 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstancePropertyFetchAnalyzer.isUndeclaredInterfacePropertyOf (cognitive 17) · ×1
  • InstancePropertyFetchAnalyzer.isUndeclaredInterfacePropertyOf (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:459 — InstancePropertyFetchAnalyzer.isUndeclaredInterfacePropertyOf has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StaticPropertyFetchAnalyzer.analyzeVariableStaticPropertyFetch (cognitive 17) · ×1
  • StaticPropertyFetchAnalyzer.analyzeVariableStaticPropertyFetch (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/StaticPropertyFetchAnalyzer.php:494 — StaticPropertyFetchAnalyzer.analyzeVariableStaticPropertyFetch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GlobalStateAnalyzer.propagate (cognitive 17) · ×1
  • GlobalStateAnalyzer.propagate (cognitive 17) src/Psalm/Internal/Analyzer/Statements/Expression/GlobalStateAnalyzer.php:39 — GlobalStateAnalyzer.propagate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6 (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 · Analyzer.updateFile (cognitive 17) · ×1
  • Analyzer.updateFile (cognitive 17) src/Psalm/Internal/Codebase/Analyzer.php:1176 — Analyzer.updateFile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 3 (6 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassLikes.moveMethods (cognitive 17) · ×1
  • ClassLikes.moveMethods (cognitive 17) src/Psalm/Internal/Codebase/ClassLikes.php:1326 — ClassLikes.moveMethods has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, error handling 2 (4 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CliOutput.markPrintedArgs (cognitive 17) · ×1
  • CliOutput.markPrintedArgs (cognitive 17) src/Psalm/Internal/Codebase/CliOutput.php:248 — CliOutput.markPrintedArgs has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (7 pts), loops 2 (3 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 · Scanner.queueClassLikeForScanning (cognitive 17) · ×1
  • Scanner.queueClassLikeForScanning (cognitive 17) src/Psalm/Internal/Codebase/Scanner.php:308 — Scanner.queueClassLikeForScanning has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TaintFlowResolution.computeTaintAddingReachable (cognitive 17) · ×1
  • TaintFlowResolution.computeTaintAddingReachable (cognitive 17) src/Psalm/Internal/Codebase/TaintFlowResolution.php:1165 — TaintFlowResolution.computeTaintAddingReachable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 5 (8 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 · TaintStore.getStores (cognitive 17) · ×1
  • TaintStore.getStores (cognitive 17) src/Psalm/Internal/Codebase/TaintStore.php:264 — TaintStore.getStores has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TaintStore.getArgsByParam (cognitive 17) · ×1
  • TaintStore.getArgsByParam (cognitive 17) src/Psalm/Internal/Codebase/TaintStore.php:556 — TaintStore.getArgsByParam has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IncludeCollector.getFilteredIncludedFiles (cognitive 17) · ×1
  • IncludeCollector.getFilteredIncludedFiles (cognitive 17) src/Psalm/Internal/IncludeCollector.php:90 — IncludeCollector.getFilteredIncludedFiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassLikeDocblockParser.keepTemplatesInParamTypes (cognitive 17) · ×1
  • ClassLikeDocblockParser.keepTemplatesInParamTypes (cognitive 17) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:633 — ClassLikeDocblockParser.keepTemplatesInParamTypes has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 11, if/else 2 (5 pts), loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · FunctionLikeNodeScanner.isConstantValue (cognitive 17) · ×1
  • FunctionLikeNodeScanner.isConstantValue (cognitive 17) src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:855 — FunctionLikeNodeScanner.isConstantValue has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (6 pts), loops 1 (2 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · FfiMemcmpParamsProvider.getMethodParams (cognitive 17) · ×1
  • FfiMemcmpParamsProvider.getMethodParams (cognitive 17) src/Psalm/Internal/Provider/ParamsProvider/FfiMemcmpParamsProvider.php:42 — FfiMemcmpParamsProvider.getMethodParams has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (6 pts), loops 2 (3 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ArrayReplaceRecursiveReturnTypeProvider.replaceWithUnpackedArray (cognitive 17) · ×1
  • ArrayReplaceRecursiveReturnTypeProvider.replaceWithUnpackedArray (cognitive 17) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReplaceRecursiveReturnTypeProvider.php:106 — ArrayReplaceRecursiveReturnTypeProvider.replaceWithUnpackedArray has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 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 · StrReplaceReturnTypeProvider.getFunctionReturnType (cognitive 17) · ×1
  • StrReplaceReturnTypeProvider.getFunctionReturnType (cognitive 17) src/Psalm/Internal/Provider/ReturnTypeProvider/StrReplaceReturnTypeProvider.php:39 — StrReplaceReturnTypeProvider.getFunctionReturnType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, 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 · AtomicParts.split (cognitive 17) · ×1
  • AtomicParts.split (cognitive 17) src/Psalm/Internal/Type/AtomicParts.php:53 — AtomicParts.split has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 4 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClosedInheritanceToUnion.map (cognitive 17) · ×1
  • ClosedInheritanceToUnion.map (cognitive 17) src/Psalm/Internal/Type/ClosedInheritanceToUnion.php:21 — ClosedInheritanceToUnion.map has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UnionTypeComparator.getTypeParts (cognitive 17) · ×1
  • UnionTypeComparator.getTypeParts (cognitive 17) src/Psalm/Internal/Type/Comparator/UnionTypeComparator.php:884 — UnionTypeComparator.getTypeParts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeCombiner.getSharedTypes (cognitive 17) · ×1
  • TypeCombiner.getSharedTypes (cognitive 17) src/Psalm/Internal/Type/TypeCombiner.php:1710 — TypeCombiner.getSharedTypes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Atomic.visit (cognitive 17) · ×1
  • Atomic.visit (cognitive 17) src/Psalm/Type/Atomic.php:683 — Atomic.visit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 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 · GenericTrait.replaceTypeParamsTemplateTypesWithStandins (cognitive 17) · ×1
  • GenericTrait.replaceTypeParamsTemplateTypesWithStandins (cognitive 17) src/Psalm/Type/Atomic/GenericTrait.php:213 — GenericTrait.replaceTypeParamsTemplateTypesWithStandins has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, ternaries 2 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TKeyedArray.setProperties (cognitive 17) · ×1
  • TKeyedArray.setProperties (cognitive 17) src/Psalm/Type/Atomic/TKeyedArray.php:147 — TKeyedArray.setProperties has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Codebase.getGuardedPhpVersionId (cognitive 16) · ×1
  • Codebase.getGuardedPhpVersionId (cognitive 16) src/Psalm/Codebase.php:3425 — Codebase.getGuardedPhpVersionId has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Config.getReportingLevelForIssue (cognitive 16) · ×1
  • Config.getReportingLevelForIssue (cognitive 16) src/Psalm/Config.php:2359 — Config.getReportingLevelForIssue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ClassLikeAnalyzer.getTraitUseMethodMutations (cognitive 16) · ×1
  • ClassLikeAnalyzer.getTraitUseMethodMutations (cognitive 16) src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:233 — ClassLikeAnalyzer.getTraitUseMethodMutations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProjectAnalyzer.checkPaths (cognitive 16) · ×1
  • ProjectAnalyzer.checkPaths (cognitive 16) src/Psalm/Internal/Analyzer/ProjectAnalyzer.php:1057 — ProjectAnalyzer.checkPaths has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ForeachAnalyzer.withoutKeysOfNarrowing (cognitive 16) · ×1
  • ForeachAnalyzer.withoutKeysOfNarrowing (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:629 — ForeachAnalyzer.withoutKeysOfNarrowing has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, loops 2, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IfConditionalAnalyzer.getDefinitelyEvaluatedExpressionAfterIf (cognitive 16) · ×1
  • IfConditionalAnalyzer.getDefinitelyEvaluatedExpressionAfterIf (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php:416 — IfConditionalAnalyzer.getDefinitelyEvaluatedExpressionAfterIf has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5 (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. This shape REPEATS in the file: one other method here (IfConditionalAnalyzer.getDefinitelyEvaluatedExpressionInsideIf) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · IfConditionalAnalyzer.getDefinitelyEvaluatedExpressionInsideIf (cognitive 16) · ×1
  • IfConditionalAnalyzer.getDefinitelyEvaluatedExpressionInsideIf (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Block/IfConditionalAnalyzer.php:460 — IfConditionalAnalyzer.getDefinitelyEvaluatedExpressionInsideIf has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5 (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. This shape REPEATS in the file: one other method here (IfConditionalAnalyzer.getDefinitelyEvaluatedExpressionAfterIf) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · AssertionFinder.hasTypedValueComparison (cognitive 16) · ×1
  • AssertionFinder.hasTypedValueComparison (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:1974 — AssertionFinder.hasTypedValueComparison has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 13, if/else 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ArgumentAnalyzer.saysNothingAbout (cognitive 16) · ×1
  • ArgumentAnalyzer.saysNothingAbout (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:806 — ArgumentAnalyzer.saysNothingAbout has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, loops 3 (4 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 · CallPurityResolver.getOuterPurityTemplates (cognitive 16) · ×1
  • CallPurityResolver.getOuterPurityTemplates (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Expression/Call/CallPurityResolver.php:137 — CallPurityResolver.getOuterPurityTemplates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCallAnalyzer.getMethodCallableSignatures (cognitive 16) · ×1
  • FunctionCallAnalyzer.getMethodCallableSignatures (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1082 — FunctionCallAnalyzer.getMethodCallableSignatures has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FunctionCallReturnTypeFetcher.taintCallableReturnType (cognitive 16) · ×1
  • FunctionCallReturnTypeFetcher.taintCallableReturnType (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:643 — FunctionCallReturnTypeFetcher.taintCallableReturnType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (6 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MethodCallPurityAnalyzer.getDeclaredPlainPropertyType (cognitive 16) · ×1
  • MethodCallPurityAnalyzer.getDeclaredPlainPropertyType (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php:1008 — MethodCallPurityAnalyzer.getDeclaredPlainPropertyType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CastAnalyzer.getStringConversionParentNodes (cognitive 16) · ×1
  • CastAnalyzer.getStringConversionParentNodes (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:1067 — CastAnalyzer.getStringConversionParentNodes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 1 (3 pts), boolean chains 1, 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 · ArrayFetchAnalyzer.checkArrayOffsetType (cognitive 16) · ×1
  • ArrayFetchAnalyzer.checkArrayOffsetType (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2640 — ArrayFetchAnalyzer.checkArrayOffsetType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, 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 · InstancePropertyFetchAnalyzer.isLeftUninitialized (cognitive 16) · ×1
  • InstancePropertyFetchAnalyzer.isLeftUninitialized (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:389 — InstancePropertyFetchAnalyzer.isLeftUninitialized has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, loops 2 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IntMaskComparisonAnalyzer.analyzeBinaryOp (cognitive 16) · ×1
  • IntMaskComparisonAnalyzer.analyzeBinaryOp (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Expression/IntMaskComparisonAnalyzer.php:43 — IntMaskComparisonAnalyzer.analyzeBinaryOp has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 3 (4 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · IntMaskComparisonAnalyzer.analyzeSearch (cognitive 16) · ×1
  • IntMaskComparisonAnalyzer.analyzeSearch (cognitive 16) src/Psalm/Internal/Analyzer/Statements/Expression/IntMaskComparisonAnalyzer.php:93 — IntMaskComparisonAnalyzer.analyzeSearch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 3, loops 2 (3 pts), ternaries 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 · ExpressionAnalyzer.checkRiskyTruthyFalsyComparison (cognitive 16) · ×1
  • ExpressionAnalyzer.checkRiskyTruthyFalsyComparison (cognitive 16) src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php:164 — ExpressionAnalyzer.checkRiskyTruthyFalsyComparison has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CliOutput.isInCliOnlyCode (cognitive 16) · ×1
  • CliOutput.isInCliOnlyCode (cognitive 16) src/Psalm/Internal/Codebase/CliOutput.php:95 — CliOutput.isInCliOnlyCode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Reflection.createFunctionStorage (cognitive 16) · ×1
  • Reflection.createFunctionStorage (cognitive 16) src/Psalm/Internal/Codebase/Reflection.php:410 — Reflection.createFunctionStorage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 3, loops 2 (3 pts), ternaries 2 (3 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 · TaintFlowGraph.addGraph (cognitive 16) · ×1
  • TaintFlowGraph.addGraph (cognitive 16) src/Psalm/Internal/Codebase/TaintFlowGraph.php:921 — TaintFlowGraph.addGraph has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 5 (6 pts), boolean chains 3 (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 · TaintFlowResolution.getObservedDepths (cognitive 16) · ×1
  • TaintFlowResolution.getObservedDepths (cognitive 16) src/Psalm/Internal/Codebase/TaintFlowResolution.php:1095 — TaintFlowResolution.getObservedDepths has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 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 · TaintFlowResolution.getPathTypeEffects (cognitive 16) · ×1
  • TaintFlowResolution.getPathTypeEffects (cognitive 16) src/Psalm/Internal/Codebase/TaintFlowResolution.php:1232 — TaintFlowResolution.getPathTypeEffects has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3, boolean chains 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 · TaintFlowResolution.getAssignmentClass (cognitive 16) · ×1
  • TaintFlowResolution.getAssignmentClass (cognitive 16) src/Psalm/Internal/Codebase/TaintFlowResolution.php:3187 — TaintFlowResolution.getAssignmentClass has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, boolean chains 5, ternaries 3 (5 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · TaintFlowResolution.addEntrySink (cognitive 16) · ×1
  • TaintFlowResolution.addEntrySink (cognitive 16) src/Psalm/Internal/Codebase/TaintFlowResolution.php:3627 — TaintFlowResolution.addEntrySink has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (5 pts), boolean chains 4, ternaries 2 (4 pts), loops 2 (3 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 · NodeTable.encode (cognitive 16) · ×1
  • NodeTable.encode (cognitive 16) src/Psalm/Internal/DataFlow/NodeTable.php:141 — NodeTable.encode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6 (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 · ExpressionScanner.visitInclude (cognitive 16) · ×1
  • ExpressionScanner.visitInclude (cognitive 16) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionScanner.php:416 — ExpressionScanner.visitInclude has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReflectorVisitor.recordStaticPropertyMutation (cognitive 16) · ×1
  • ReflectorVisitor.recordStaticPropertyMutation (cognitive 16) src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:647 — ReflectorVisitor.recordStaticPropertyMutation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, loops 2 (3 pts), ternaries 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 · ArrayReplaceRecursiveReturnTypeProvider.getMergedValueType (cognitive 16) · ×1
  • ArrayReplaceRecursiveReturnTypeProvider.getMergedValueType (cognitive 16) src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReplaceRecursiveReturnTypeProvider.php:333 — ArrayReplaceRecursiveReturnTypeProvider.getMergedValueType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrimReturnTypeProvider.getFunctionReturnType (cognitive 16) · ×1
  • TrimReturnTypeProvider.getFunctionReturnType (cognitive 16) src/Psalm/Internal/Provider/ReturnTypeProvider/TrimReturnTypeProvider.php:44 — TrimReturnTypeProvider.getFunctionReturnType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, loops 1, match/switch 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 · KeyedArrayComparator.isContainedByObjectWithProperties (cognitive 16) · ×1
  • KeyedArrayComparator.isContainedByObjectWithProperties (cognitive 16) src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:285 — KeyedArrayComparator.isContainedByObjectWithProperties has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 4, 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 · SimpleAssertionReconciler.reconcileBool (cognitive 16) · ×1
  • SimpleAssertionReconciler.reconcileBool (cognitive 16) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1238 — SimpleAssertionReconciler.reconcileBool has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleAssertionReconciler.reconcileScalar (cognitive 16) · ×1
  • SimpleAssertionReconciler.reconcileScalar (cognitive 16) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1487 — SimpleAssertionReconciler.reconcileScalar has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleAssertionReconciler.reconcileIterable (cognitive 16) · ×1
  • SimpleAssertionReconciler.reconcileIterable (cognitive 16) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1911 — SimpleAssertionReconciler.reconcileIterable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeCombination.fallbackKeyAlwaysContains (cognitive 16) · ×1
  • TypeCombination.fallbackKeyAlwaysContains (cognitive 16) src/Psalm/Internal/Type/TypeCombination.php:162 — TypeCombination.fallbackKeyAlwaysContains has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 6, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeExpander.expandUnion (cognitive 16) · ×1
  • TypeExpander.expandUnion (cognitive 16) src/Psalm/Internal/Type/TypeExpander.php:73 — TypeExpander.expandUnion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 4, loops 2 (3 pts), ternaries 2 (3 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 · TypeParser.getGenericParamClass (cognitive 16) · ×1
  • TypeParser.getGenericParamClass (cognitive 16) src/Psalm/Internal/Type/TypeParser.php:635 — TypeParser.getGenericParamClass has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 1 (3 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 · TypeParser.intersectObjectTypes (cognitive 16) · ×1
  • TypeParser.intersectObjectTypes (cognitive 16) src/Psalm/Internal/Type/TypeParser.php:1607 — TypeParser.intersectObjectTypes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TypeChecker.enterNode (cognitive 16) · ×1
  • TypeChecker.enterNode (cognitive 16) src/Psalm/Internal/TypeVisitor/TypeChecker.php:121 — TypeChecker.enterNode has cognitive complexity 16 (threshold 15). Drivers by points: loops 2 (6 pts), boolean chains 5, if/else 4 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Possibilities.getUntemplatedCopy (cognitive 16) · ×1
  • Possibilities.getUntemplatedCopy (cognitive 16) src/Psalm/Storage/Possibilities.php:43 — Possibilities.getUntemplatedCopy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Type.getStringFromFQCLN (cognitive 16) · ×1
  • Type.getStringFromFQCLN (cognitive 16) src/Psalm/Type.php:143 — Type.getStringFromFQCLN has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TKeyedArray.getGenericArrayType (cognitive 16) · ×1
  • TKeyedArray.getGenericArrayType (cognitive 16) src/Psalm/Type/Atomic/TKeyedArray.php:433 — TKeyedArray.getGenericArrayType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change coupling clique · ×1
  • Change coupling clique: ClassLikeStorageCacheProvider.php, FileStorageCacheProvider.php, ParserCacheProvider.php, ProjectCacheProvider.php src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php — 4 files — `src/Psalm/Internal/Provider/ClassLikeStorageCacheProvider.php`, `src/Psalm/Internal/Provider/FileStorageCacheProvider.php`, `src/Psalm/Internal/Provider/ParserCacheProvider.php`, `src/Psalm/Internal/Provider/ProjectCacheProvider.php` — all change together with no explicit dependency: a fully-connected co-change clique, not 6 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D4 · Code Duplication · Near-duplicate member family (4 members, 58 shared lines) · ×1
  • Near-duplicate member family (4 members, 58 shared lines) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2090 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2090-2204 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2221-2331 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1898-2005 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:2021-2126 — These 4 members are variants of one another: a block of 58 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them 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 · Near-duplicate member pair (66 shared lines) · ×1
  • Near-duplicate member pair (66 shared lines) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php:53 — src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php:53-264 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterVarReturnTypeProvider.php:42-169 — These two members are variants of one another: 66 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 (16 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (16 members, 50+ identical tokens) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1007 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1007-1214 | src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:350-882 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:429-1111 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:246-489 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:176-293 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:322-755 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:904-1624 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1839-1925 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php:82-634 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php:733-845 | src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:962-1237 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:874-1305 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1466-1528 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2562-2634 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:76-380 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:507-741 — These 16 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 16 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 16 times.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1151 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1151-1220 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1237-1319 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1336-1413 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1430-1513 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1530-1608 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1625-1712 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1729-1812 — These 7 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 7 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 7 times.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2809 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2809-2865 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2878-2925 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2938-3024 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3566-3615 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3628-3681 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3694-3786 — These 6 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 6 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 6 times.
D4 · Code Duplication · Edited copy of a member (183 corresponding lines) · ×1
  • Edited copy of a member (183 corresponding lines) src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:360 — src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:360-546 | src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:555-737 — These two members are one piece of code written twice and then edited apart: 183 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 (112 corresponding lines) · ×1
  • Edited copy of a member (112 corresponding lines) src/Psalm/Internal/Diff/FileStatementsDiffer.php:33 — src/Psalm/Internal/Diff/FileStatementsDiffer.php:33-176 | src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php:33-144 — These two members are one piece of code written twice and then edited apart: 112 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 (93 corresponding lines) · ×1
  • Edited copy of a member (93 corresponding lines) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4394 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4394-4489 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4673-4765 — These two members are one piece of code written twice and then edited apart: 93 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 (105 corresponding lines) · ×1
  • Edited copy of a member (105 corresponding lines) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:692 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:692-812 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:827-931 — These two members are one piece of code written twice and then edited apart: 105 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, 77+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 77+ corresponding lines) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1333 — src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1333-1409 | src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1417-1495 | src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1503-1581 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 77 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 copies of one member (3 members, 123+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 123+ corresponding lines) src/Psalm/Internal/Type/AssertionReconciler.php:1712 — src/Psalm/Internal/Type/AssertionReconciler.php:1712-1834 | src/Psalm/Internal/Type/AssertionReconciler.php:1884-2023 | src/Psalm/Internal/Type/AssertionReconciler.php:2042-2165 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 123 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 copies of one member (3 members, 72+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 72+ corresponding lines) src/Psalm/Internal/Codebase/ClassLikes.php:1328 — src/Psalm/Internal/Codebase/ClassLikes.php:1328-1404 | src/Psalm/Internal/Codebase/ClassLikes.php:1496-1589 | src/Psalm/Internal/Codebase/ClassLikes.php:1594-1665 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 72 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 copies of one member (4 members, 69+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 69+ corresponding lines) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1059 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1059-1137 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1153-1231 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1327-1395 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1412-1480 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 69 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (52 corresponding lines) · ×1
  • Edited copy of a member (52 corresponding lines) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:669 — src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeDocblockParser.php:669-720 | src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeDocblockParser.php:643-708 — These two members are one piece of code written twice and then edited apart: 52 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 (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) src/Psalm/Internal/Diff/AstDiffer.php:91 — src/Psalm/Internal/Diff/AstDiffer.php:91-130 | src/Psalm/Internal/Diff/FileDiffer.php:79-118 — These two members are one piece of code written twice and then edited apart: 40 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 (59 corresponding lines) · ×1
  • Edited copy of a member (59 corresponding lines) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1248 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1248-1310 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1497-1555 — These two members are one piece of code written twice and then edited apart: 59 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, 52+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 52+ corresponding lines) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1852 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1852-1904 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1922-1985 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2349-2400 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 52 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 (45 corresponding lines) · ×1
  • Edited copy of a member (45 corresponding lines) src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:1120 — src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:1120-1165 | src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:2321-2365 — These two members are one piece of code written twice and then edited apart: 45 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, 31+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 31+ corresponding lines) src/Psalm/Report/ByIssueLevelAndTypeReport.php:64 — src/Psalm/Report/ByIssueLevelAndTypeReport.php:64-104 | src/Psalm/Report/ConsoleReport.php:40-78 | src/Psalm/Report/PhpStormReport.php:40-70 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 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 (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) src/Psalm/Type/MutableUnion.php:202 — src/Psalm/Type/MutableUnion.php:202-235 | src/Psalm/Type/UnionTrait.php:86-122 — These two members are one piece of code written twice and then edited apart: 34 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 (44 corresponding lines) · ×1
  • Edited copy of a member (44 corresponding lines) src/Psalm/Codebase.php:2037 — src/Psalm/Codebase.php:2037-2086 | src/Psalm/Codebase.php:2094-2137 — These two members are one piece of code written twice and then edited apart: 44 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 (89 corresponding lines) · ×1
  • Edited copy of a member (89 corresponding lines) src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php:57 — src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php:57-145 | src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php:150-264 — These two members are one piece of code written twice and then edited apart: 89 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, 27+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 27+ corresponding lines) src/Psalm/Report/ByIssueLevelAndTypeReport.php:115 — src/Psalm/Report/ByIssueLevelAndTypeReport.php:115-141 | src/Psalm/Report/ConsoleReport.php:87-113 | src/Psalm/Report/PhpStormReport.php:79-108 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 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 copies of one member (3 members, 38+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 38+ corresponding lines) src/Psalm/Internal/LanguageServer/Server/TextDocument.php:165 — src/Psalm/Internal/LanguageServer/Server/TextDocument.php:165-204 | src/Psalm/Internal/LanguageServer/Server/TextDocument.php:216-253 | src/Psalm/Internal/LanguageServer/Server/TextDocument.php:333-374 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 38 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 copies of one member (3 members, 32+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 32+ corresponding lines) src/Psalm/Internal/Codebase/ClassLikes.php:372 — src/Psalm/Internal/Codebase/ClassLikes.php:372-403 | src/Psalm/Internal/Codebase/ClassLikes.php:414-445 | src/Psalm/Internal/Codebase/ClassLikes.php:456-487 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 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/Psalm/Type/UnionTrait.php:256 — src/Psalm/Type/UnionTrait.php:256-287 | src/Psalm/Type/UnionTrait.php:295-329 — 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 (23 corresponding lines) · ×1
  • Edited copy of a member (23 corresponding lines) src/Psalm/Internal/Provider/FileProvider.php:49 — src/Psalm/Internal/Provider/FileProvider.php:49-72 | src/Psalm/Internal/Provider/FileProvider.php:80-102 — These two members are one piece of code written twice and then edited apart: 23 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 (28 corresponding lines) · ×1
  • Edited copy of a member (28 corresponding lines) src/Psalm/Internal/LanguageServer/Client/Progress/Progress.php:36 — src/Psalm/Internal/LanguageServer/Client/Progress/Progress.php:36-63 | src/Psalm/Internal/LanguageServer/Client/Progress/Progress.php:96-125 — These two members are one piece of code written twice and then edited apart: 28 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, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) src/Psalm/Type/Atomic.php:600 — src/Psalm/Type/Atomic.php:600-618 | src/Psalm/Type/Atomic.php:623-641 | src/Psalm/Type/Atomic.php:661-679 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 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 copies of one member (4 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 19+ corresponding lines) src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php:607 — src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php:607-627 | src/Psalm/Internal/Analyzer/Statements/ExpressionAnalyzer.php:635-655 | src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:943-961 | src/Psalm/Internal/Analyzer/StatementsAnalyzer.php:969-987 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 12+ corresponding lines) src/Psalm/Internal/Codebase/ClassLikes.php:230 — src/Psalm/Internal/Codebase/ClassLikes.php:230-241 | src/Psalm/Internal/Codebase/ClassLikes.php:249-260 | src/Psalm/Internal/Codebase/ClassLikes.php:268-279 | src/Psalm/Internal/Codebase/ClassLikes.php:287-298 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×1
  • Edited copy of a member (12 corresponding lines) src/Psalm/Internal/LanguageServer/Server/TextDocument.php:65 — src/Psalm/Internal/LanguageServer/Server/TextDocument.php:65-76 | src/Psalm/Internal/LanguageServer/Server/TextDocument.php:88-99 — These two members are one piece of code written twice and then edited apart: 12 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/Psalm/Internal/Provider/FileReferenceProvider.php:606 — src/Psalm/Internal/Provider/FileReferenceProvider.php:606-616 | src/Psalm/IssueBuffer.php:1314-1322 — 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 copies of one member (4 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 15+ corresponding lines) src/Psalm/Internal/Provider/MethodExistenceProvider.php:71 — src/Psalm/Internal/Provider/MethodExistenceProvider.php:71-85 | src/Psalm/Internal/Provider/MethodParamsProvider.php:86-102 | src/Psalm/Internal/Provider/MethodVisibilityProvider.php:76-91 | src/Psalm/Internal/Provider/PropertyTypeProvider.php:77-96 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×1
  • Edited copy of a member (10 corresponding lines) src/Psalm/Internal/Codebase/TaintFlowGraph.php:1348 — src/Psalm/Internal/Codebase/TaintFlowGraph.php:1348-1357 | src/Psalm/Internal/Codebase/TaintFlowResolution.php:986-995 — These two members are one piece of code written twice and then edited apart: 10 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/Psalm/Internal/Type/IterationPurity.php:115 — src/Psalm/Internal/Type/IterationPurity.php:115-129 | src/Psalm/Type/UnionTrait.php:1597-1611 — 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 copies of one member (4 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 4+ corresponding lines) src/Psalm/Storage/Assertion/IsIdentical.php:65 — src/Psalm/Storage/Assertion/IsIdentical.php:65-68 | src/Psalm/Storage/Assertion/IsLooselyEqual.php:65-68 | src/Psalm/Storage/Assertion/IsNotIdentical.php:74-77 | src/Psalm/Storage/Assertion/IsNotLooselyEqual.php:74-77 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:547 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/ArrayAssignmentAnalyzer.php:547-558 | src/Psalm/Type/Atomic/TKeyOf.php:69-79 | src/Psalm/Type/Atomic/TValueOf.php:112-123 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 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 copies of one member (6 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 7+ corresponding lines) src/Psalm/Internal/Provider/MethodCapabilitiesProvider.php:40 — src/Psalm/Internal/Provider/MethodCapabilitiesProvider.php:40-46 | src/Psalm/Internal/Provider/MethodParamsProvider.php:48-54 | src/Psalm/Internal/Provider/MethodReturnTypeProvider.php:53-59 | src/Psalm/Internal/Provider/MethodVisibilityProvider.php:43-49 | src/Psalm/Internal/Provider/PropertyExistenceProvider.php:43-49 | src/Psalm/Internal/Provider/PropertyTypeProvider.php:43-49 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 7 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×1
  • Edited copy of a member (16 corresponding lines) src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:1184 — src/Psalm/Internal/Analyzer/FunctionLike/ReturnTypeAnalyzer.php:1184-1200 | src/Psalm/Type/UnionTrait.php:1502-1517 — These two members are one piece of code written twice and then edited apart: 16 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 (6 corresponding lines) · ×1
  • Edited copy of a member (6 corresponding lines) src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:1971 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentsAnalyzer.php:1971-1976 | src/Psalm/Internal/Codebase/InternalTaintSourceMap.php:39-44 — These two members are one piece of code written twice and then edited apart: 6 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, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) src/Psalm/Internal/GzipSerializer.php:34 — src/Psalm/Internal/GzipSerializer.php:34-41 | src/Psalm/Internal/Lz4Serializer.php:28-35 | src/Psalm/Internal/ZstdSerializer.php:63-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 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 (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) src/Psalm/Internal/Provider/MethodExistenceProvider.php:41 — src/Psalm/Internal/Provider/MethodExistenceProvider.php:41-45 | src/Psalm/Internal/Provider/PropertyVisibilityProvider.php:42-46 — These two members are one piece of code written twice and then edited apart: 5 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 (53–95 lines × 2) · ×1
  • Duplicated block (53–95 lines × 2) src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php:93 — src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php:93-145 | src/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php:170-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/Psalm/Internal/Provider/ReturnTypeProvider/PdoStatementReturnTypeProvider.php:93` 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 (73–76 lines × 2) · ×1
  • Duplicated block (73–76 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2609 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2609-2681 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3372-3447 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2609` 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 (48 lines × 2) · ×1
  • Duplicated block (48 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:331 — src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:331-378 | src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:684-731 — 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/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:331` 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/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:330` calls `getFirst` and `src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:683` 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 (47 lines × 4) · ×1
  • Duplicated block (47 lines × 4) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2158 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2158-2204 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2285-2331 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1959-2005 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:2080-2126 — before extracting anything, compare `src/Psalm/Internal/Type/SimpleAssertionReconciler.php` and `src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 139 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:2158` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (46–47 lines × 2) · ×1
  • Duplicated block (46–47 lines × 2) src/Psalm/Internal/Cli/Psalter.php:274 — src/Psalm/Internal/Cli/Psalter.php:274-320 | src/Psalm/Internal/Cli/Refactor.php:314-359 — before extracting anything, compare `src/Psalm/Internal/Cli/Psalter.php` and `src/Psalm/Internal/Cli/Refactor.php` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 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/Psalm/Internal/Cli/Psalter.php:274` 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/Psalm/Internal/Cli/Psalter.php:321` calls `elseif`, `streamIsInteractive`, `LongProgress` and `src/Psalm/Internal/Cli/Refactor.php:360` 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 (43–45 lines × 2) · ×1
  • Duplicated block (43–45 lines × 2) src/Psalm/Internal/Diff/FileStatementsDiffer.php:46 — src/Psalm/Internal/Diff/FileStatementsDiffer.php:46-88 | src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php:45-89 — before extracting anything, compare `src/Psalm/Internal/Diff/FileStatementsDiffer.php` and `src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 114 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/Psalm/Internal/Diff/FileStatementsDiffer.php:46` 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 (37–39 lines × 2) · ×1
  • Duplicated block (37–39 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:753 — src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:753-791 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:1574-1610 — 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/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php:1574` 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 (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) src/Psalm/Internal/Codebase/ClassLikes.php:1368 — src/Psalm/Internal/Codebase/ClassLikes.php:1368-1404 | src/Psalm/Internal/Codebase/ClassLikes.php:1553-1589 — 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/Psalm/Internal/Codebase/ClassLikes.php:1368` 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 (36 lines × 3) · ×1
  • Duplicated block (36 lines × 3) src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1333 — src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1333-1368 | src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1417-1452 | src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1503-1538 — 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/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php:1333` 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 (35–36 lines × 2) · ×1
  • Duplicated block (35–36 lines × 2) src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php:107 — src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php:107-142 | src/Psalm/Internal/Provider/ReturnTypeProvider/FilterVarReturnTypeProvider.php:86-120 — before extracting anything, compare `src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php` and `src/Psalm/Internal/Provider/ReturnTypeProvider/FilterVarReturnTypeProvider.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 67 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/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php:107` 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 (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:807 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:807-839 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:887-919 — 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:807` 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 (31–32 lines × 2) · ×1
  • Duplicated block (31–32 lines × 2) src/Psalm/Internal/Algebra/FormulaGenerator.php:73 — src/Psalm/Internal/Algebra/FormulaGenerator.php:73-103 | src/Psalm/Internal/Algebra/FormulaGenerator.php:128-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/Psalm/Internal/Algebra/FormulaGenerator.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.
D4 · Code Duplication · Duplicated block (31 lines × 4) · ×1
  • Duplicated block (31 lines × 4) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:740 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:740-770 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:820-850 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:900-930 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1852-1882 — 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:740` 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 (29–30 lines × 2) · ×1
  • Duplicated block (29–30 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:91 — src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:91-120 | src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:161-189 — 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/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:91` 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/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:159` calls `spl_object_id` and `src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:89` 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 (28 lines × 5) · ×1
  • Duplicated block (28 lines × 5) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1193 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1193-1220 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1292-1319 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1386-1413 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1486-1513 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1581-1608 — all 5 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1193` 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 (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1596 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1596-1623 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1661-1687 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1596` 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 (26 lines × 4) · ×1
  • Duplicated block (26 lines × 4) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1110 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1110-1135 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1283-1308 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1528-1553 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1631-1656 — 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:1110` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1107` calls `elseif` and `src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1281` 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 (25 lines × 7) · ×1
  • Duplicated block (25 lines × 7) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1369 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1369-1393 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1454-1478 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1752-1776 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1808-1832 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1878-1902 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1959-1983 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2374-2398 — all 7 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:1369` 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 (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:715 — src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:715-739 | src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:748-772 — 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/Psalm/Internal/PhpVisitor/ReflectorVisitor.php:715` 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 (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:165 — src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:165-188 | src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:306-330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (24 lines × 5) · ×1
  • Duplicated block (24 lines × 5) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1516 — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1516-1539 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1604-1627 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1638-1661 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1676-1699 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1714-1737 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (24 lines × 4) · ×1
  • Duplicated block (24 lines × 4) src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php:156 — src/Psalm/Internal/Type/Comparator/ArrayTypeComparator.php:156-179 | src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:175-198 | src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:209-232 | src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php:253-276 — 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/Psalm/Internal/Type/Comparator/ArrayTypeComparator.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.
D4 · Code Duplication · Duplicated block (21–24 lines × 2) · ×1
  • Duplicated block (21–24 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:201 — src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:201-224 | src/Psalm/Internal/Analyzer/Statements/Block/IfElseAnalyzer.php:211-231 — 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/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:201` 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 (22–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:293 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:293-314 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallReturnTypeFetcher.php:665-688 — 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 (22 lines × 4) · ×1
  • Duplicated block (22 lines × 4) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2483 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2483-2504 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2614-2635 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3247-3268 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3377-3398 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:2483` 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 (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:444 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:444-463 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:478-499 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/NamedFunctionCallHandler.php:444` 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 (21 lines × 12) · ×1
  • Duplicated block (21 lines × 12) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1022 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1022-1042 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1117-1137 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1290-1310 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1375-1395 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1460-1480 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1535-1555 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1638-1658 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1758-1778 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1814-1834 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1884-1904 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1965-1985 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2380-2400 — all 12 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:1022` 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 (21 lines × 8) · ×1
  • Duplicated block (21 lines × 8) src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1369 — src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1369-1389 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1454-1474 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1752-1772 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1808-1828 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1878-1898 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1959-1979 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2374-2394 | src/Psalm/Internal/Type/SimpleAssertionReconciler.php:2982-3002 — all 8 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/Psalm/Internal/Type/SimpleAssertionReconciler.php:1369` 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 (20–21 lines × 3) · ×1
  • Duplicated block (20–21 lines × 3) src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:147 — src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:147-166 | src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:199-219 | src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:233-253 — 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/Psalm/Internal/Scanner/PhpStormMetaScanner.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. 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–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:620 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:620-640 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.php:594-613 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.php:620` 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 (20 lines × 5) · ×1
  • Duplicated block (20 lines × 5) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:556 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:556-575 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:745-764 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:825-844 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:905-924 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1857-1876 — all 5 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:556` 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:743` calls `unset` and `src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:554` 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 (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3853 — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3853-3871 | src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3875-3890 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3853` 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 (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) src/Psalm/Internal/Codebase/ClassLikes.php:2937 — src/Psalm/Internal/Codebase/ClassLikes.php:2937-2954 | src/Psalm/Internal/Codebase/ClassLikes.php:2969-2987 — 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/Psalm/Internal/Codebase/ClassLikes.php:2937` 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 (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1395 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1395-1412 | src/Psalm/Internal/Analyzer/Statements/Expression/EvalAnalyzer.php:58-75 | src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php:138-155 — before extracting anything, compare `src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php` and `src/Psalm/Internal/Analyzer/Statements/Expression/EvalAnalyzer.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1395` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Psalm/Internal/Analyzer/Statements/Expression/EvalAnalyzer.php:54` calls `getCodebase` and `src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1390` 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 (16–17 lines × 3) · ×1
  • Duplicated block (16–17 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:875 — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:875-891 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1044-1060 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1071-1086 — 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/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:875` 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–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) src/Psalm/Internal/ExecutionEnvironment/BuildInfoCollector.php:91 — src/Psalm/Internal/ExecutionEnvironment/BuildInfoCollector.php:91-104 | src/Psalm/Internal/ExecutionEnvironment/BuildInfoCollector.php:172-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) src/Psalm/Internal/Analyzer/MethodComparator.php:1069 — src/Psalm/Internal/Analyzer/MethodComparator.php:1069-1083 | src/Psalm/Internal/Analyzer/MethodComparator.php:1087-1102 | src/Psalm/Internal/Analyzer/MethodComparator.php:1106-1119 — 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/Psalm/Internal/Analyzer/MethodComparator.php:1069` 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×1
  • Duplicated block (13–16 lines × 2) src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:306 — src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:306-321 | src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php:205-217 — 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/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php:306` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) src/Psalm/Internal/Analyzer/MethodComparator.php:763 — src/Psalm/Internal/Analyzer/MethodComparator.php:763-776 | src/Psalm/Internal/Analyzer/MethodComparator.php:780-794 — 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/Psalm/Internal/Analyzer/MethodComparator.php:763` 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. 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 (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:307 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:307-321 | src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/StaticPropertyAssignmentAnalyzer.php:282-293 — 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/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:307` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:574 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:574-586 | src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:419-432 | src/Psalm/Internal/Analyzer/Statements/Expression/ClassConstAnalyzer.php:759-772 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:574` 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–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) src/Psalm/Internal/Analyzer/ClassAnalyzer.php:347 — src/Psalm/Internal/Analyzer/ClassAnalyzer.php:347-359 | src/Psalm/Internal/Analyzer/InterfaceAnalyzer.php:130-143 — 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/Psalm/Internal/Analyzer/ClassAnalyzer.php:347` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:1129 — src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:1129-1140 | src/Psalm/Internal/TypeVisitor/TypeChecker.php:440-453 — 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/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:1129` 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. 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–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:2124 — src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:2124-2137 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/PartialApplicationAnalyzer.php:643-653 — 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/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:2124` 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 (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) src/Psalm/Type/Atomic/TArray.php:87 — src/Psalm/Type/Atomic/TArray.php:87-99 | src/Psalm/Type/Atomic/TGenericObject.php:133-144 | src/Psalm/Type/Atomic/TIterable.php:176-187 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/Psalm/Type/Atomic/TArray.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.
D4 · Code Duplication · Duplicated block (10–13 lines × 3) · ×1
  • Duplicated block (10–13 lines × 3) src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php:446 — src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php:446-458 | src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php:467-479 | src/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php:488-497 — 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/Psalm/Internal/Analyzer/Statements/Expression/TernaryAnalyzer.php:446` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1745 — src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1745-1756 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1392-1403 | src/Psalm/Internal/Analyzer/Statements/Expression/EvalAnalyzer.php:55-66 | src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php:135-146 — 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/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1745` 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/Psalm/Internal/Analyzer/Statements/Expression/EvalAnalyzer.php:54` calls `getCodebase` and `src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1743` 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 (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:297 — src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:297-308 | src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:346-357 | src/Psalm/Internal/Scanner/PhpStormMetaScanner.php:376-387 — 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/Psalm/Internal/Scanner/PhpStormMetaScanner.php:297` 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) · ×1
  • Duplicated block (15 lines × 3) src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:476 — src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:476-490 | src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:494-508 | src/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:512-526 — 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/Psalm/Internal/PhpVisitor/Reflector/ExpressionResolver.php:476` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (7–11 lines × 2) · ×1
  • Duplicated block (7–11 lines × 2) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1042 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1042-1052 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1216-1222 — 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/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1042` 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–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) src/Psalm/Internal/Provider/ReturnTypeProvider/RoundReturnTypeProvider.php:48 — src/Psalm/Internal/Provider/ReturnTypeProvider/RoundReturnTypeProvider.php:48-57 | src/Psalm/Internal/Provider/ReturnTypeProvider/RoundReturnTypeProvider.php:60-70 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Psalm/Internal/Provider/ReturnTypeProvider/RoundReturnTypeProvider.php:60` calls `count`, `getType` and `src/Psalm/Internal/Provider/ReturnTypeProvider/RoundReturnTypeProvider.php:72` 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–10 lines × 6) · ×1
  • Duplicated block (8–10 lines × 6) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1077 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1077-1084 | src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:743-752 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:1053-1060 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1136-1143 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1237-1244 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:513-520 — there are 6 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 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/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1077` 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. 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 × 2) · ×1
  • Duplicated block (9–10 lines × 2) src/Psalm/Internal/Type/ParseTreeCreator.php:223 — src/Psalm/Internal/Type/ParseTreeCreator.php:223-231 | src/Psalm/Internal/Type/ParseTreeCreator.php:314-323 — 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/Psalm/Internal/Type/ParseTreeCreator.php:223` 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 × 12) · ×1
  • Duplicated block (9 lines × 12) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1047 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1047-1055 | src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:694-702 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:560-568 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:256-264 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:184-192 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:490-498 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:952-960 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php:756-764 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1217-1225 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1466-1474 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2564-2572 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:168-176 — there are 12 copies across 8 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 12 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/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:266` calls `hasMixed`, `CodeLocation`, `getSource` and `src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:962` 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 (9 lines × 10) · ×1
  • Duplicated block (9 lines × 10) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1076 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1076-1084 | src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php:742-750 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:644-652 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:329-337 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:1052-1060 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php:180-188 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1135-1143 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1236-1244 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2582-2590 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:512-520 — there are 10 copies across 8 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.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) src/Psalm/Internal/Diff/FileStatementsDiffer.php:135 — src/Psalm/Internal/Diff/FileStatementsDiffer.php:135-143 | src/Psalm/Internal/Diff/FileStatementsDiffer.php:163-172 | src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php:116-125 | src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php:131-140 — before extracting anything, compare `src/Psalm/Internal/Diff/FileStatementsDiffer.php` and `src/Psalm/Internal/Diff/NamespaceStatementsDiffer.php` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 114 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/Psalm/Internal/Diff/FileStatementsDiffer.php:135` 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/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1760 — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1760-1767 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1779-1786 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1810-1818 — 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/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php:1760` 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 × 3) · ×1
  • Duplicated block (9 lines × 3) src/Psalm/Internal/PluginManager/Command/DisableCommand.php:52 — src/Psalm/Internal/PluginManager/Command/DisableCommand.php:52-61 | src/Psalm/Internal/PluginManager/Command/EnableCommand.php:52-61 | src/Psalm/Internal/PluginManager/Command/ShowCommand.php:47-55 — before extracting anything, compare `src/Psalm/Internal/PluginManager/Command/DisableCommand.php` and `src/Psalm/Internal/PluginManager/Command/EnableCommand.php` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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 (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:357 — src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:357-365 | src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:406-413 — 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/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:357` 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/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:367` calls `count`, `implode`, `array_slice` and `src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:414` 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 × 6) · ×1
  • Duplicated block (8 lines × 6) src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:534 — src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:534-541 | src/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:582-589 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1745-1752 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/NewAnalyzer.php:1392-1399 | src/Psalm/Internal/Analyzer/Statements/Expression/EvalAnalyzer.php:55-62 | src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php:135-142 — there are 6 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 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/Psalm/Internal/Analyzer/Statements/Expression/ArrayAnalyzer.php:534` 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/Psalm/Internal/Analyzer/Statements/Expression/EvalAnalyzer.php:54` calls `getCodebase` and `src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1743` 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 (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:511 — src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:511-518 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1151-1158 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1237-1244 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1430-1437 | src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:1530-1537 — all 5 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/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php:511` 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–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) src/Psalm/Internal/FileManipulation/ClassDocblockManipulator.php:106 — src/Psalm/Internal/FileManipulation/ClassDocblockManipulator.php:106-113 | src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:472-478 — 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/Psalm/Internal/FileManipulation/ClassDocblockManipulator.php:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/Psalm/Internal/FileManipulation/FunctionDocblockManipulator.php:468` calls `isset`, `reset` and `src/Psalm/Internal/FileManipulation/ClassDocblockManipulator.php:104` 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 (7 lines × 9) · ×1
  • Duplicated block (7 lines × 9) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1047 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1047-1053 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:256-262 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:490-496 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:952-958 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1889-1896 | src/Psalm/Internal/Analyzer/Statements/Expression/CallAnalyzer.php:1213-1220 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1217-1223 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:2564-2570 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:168-174 — there are 9 copies across 7 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 9 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/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1047` 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 × 6) · ×1
  • Duplicated block (7 lines × 6) src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1076 — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1076-1082 | src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ConcatAnalyzer.php:329-335 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php:1052-1058 | src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/AtomicMethodCallAnalyzer.php:180-186 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1135-1141 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/InstancePropertyFetchAnalyzer.php:207-213 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:1076` 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 × 5) · ×1
  • Duplicated block (7 lines × 5) src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php:651 — src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php:651-657 | src/Psalm/Internal/Analyzer/Statements/Expression/EncapsulatedStringAnalyzer.php:126-132 | src/Psalm/Internal/Analyzer/Statements/Expression/EvalAnalyzer.php:54-60 | src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:648-654 | src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php:134-140 — before extracting anything, compare `src/Psalm/Internal/Analyzer/Statements/Expression/EvalAnalyzer.php` and `src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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 (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) src/Psalm/Internal/Codebase/TaintFlowResolution.php:2936 — src/Psalm/Internal/Codebase/TaintFlowResolution.php:2936-2940 | src/Psalm/Internal/Codebase/TaintFlowResolution.php:3110-3114 | src/Psalm/Internal/Codebase/TaintFlowResolution.php:3199-3203 — 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/Psalm/Internal/Codebase/TaintFlowResolution.php:2936` 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 (43 lines × 4) · ×1
  • Duplicated block (43 lines × 4) src/Psalm/Plugin/EventHandler/Event/AfterExpressionAnalysisEvent.php:40 — src/Psalm/Plugin/EventHandler/Event/AfterExpressionAnalysisEvent.php:40-82 | src/Psalm/Plugin/EventHandler/Event/AfterFunctionCallAnalysisEvent.php:42-101 | src/Psalm/Plugin/EventHandler/Event/AfterMethodCallAnalysisEvent.php:46-128 | src/Psalm/Plugin/EventHandler/Event/BeforeExpressionAnalysisEvent.php:40-82 — before extracting anything, compare `src/Psalm/Plugin/EventHandler/Event/AfterExpressionAnalysisEvent.php` and `src/Psalm/Plugin/EventHandler/Event/AfterFunctionCallAnalysisEvent.php` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/Psalm/Plugin/EventHandler/Event/AfterExpressionAnalysisEvent.php:40` 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 (51 lines × 2) · ×1
  • Duplicated block (51 lines × 2) src/Psalm/Plugin/EventHandler/Event/MethodCapabilitiesProviderEvent.php:36 — src/Psalm/Plugin/EventHandler/Event/MethodCapabilitiesProviderEvent.php:36-86 | src/Psalm/Plugin/EventHandler/Event/MethodReturnTypeProviderEvent.php:45-105 — 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/Psalm/Plugin/EventHandler/Event/MethodCapabilitiesProviderEvent.php:36` 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 (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) examples/plugins/TaintModelFields.php:29 — examples/plugins/TaintModelFields.php:29-41 | examples/plugins/TaintPageComponents.php:32-46 — 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 `examples/plugins/TaintModelFields.php:29` 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.
P3 · Security & performance tooling · SAST runs, but gates no merge · ×1
  • SAST runs, but gates no merge — `announce-release.yml`, `apply-queued-changes.yml`, `auto-release.yml`, `build-docker.yml` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.
X29 · Per-element action decided by a fixed element · Per-element action decided by a fixed element · ×1
  • Per-element action decided by a fixed element src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php:917 — This loop runs once per element of `$context.vars_in_scope`, and the statement it guards acts on the element it is on — `$var_id`. The test deciding whether that statement runs does not: `$getter_receiver_id === $receiver_id || str_starts_with($getter_receiver_id, ...` reads `$context.vars_in_scope[$getter_receiver_id]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 920, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
Minor — 87 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:2286 — `!$atomic_type instanceof TNamedObject || !$codebase` appears character-identically in 4 files — src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php, src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php, src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php, src/Psalm/Internal/Analyzer/Statements/Expression/ThrowAnalyzer.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/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php:202 — `!$callmap_callables || $callmap_callables[0]` appears character-identically in 2 files — src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallReturnTypeFetcher.php, src/Psalm/Internal/Codebase/Methods.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/Psalm/Internal/Provider/FakeFileProvider.php:44 — `!$go_to_source && isset($this->temp_files[$file_path])` appears character-identically in 2 files — src/Psalm/Internal/Provider/FakeFileProvider.php, src/Psalm/Internal/Provider/FileProvider.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/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php:266 — `!$has_continue_statement && !$has_break_statement` appears character-identically in 3 files — src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseAnalyzer.php, src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php, src/Psalm/Internal/Analyzer/Statements/Block/IfElse/IfAnalyzer.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/Psalm/Internal/Type/SimpleAssertionReconciler.php:2175 — `!$inside_loop && $redundant && $var_id && $code_location` appears character-identically in 2 files — src/Psalm/Internal/Type/SimpleAssertionReconciler.php, src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.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/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php:62 — `!$statements_source instanceof StatementsAnalyzer || !$call_args` appears character-identically in 6 files — src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php, src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMergeReturnTypeProvider.php, src/Psalm/Internal/Provider/ReturnTypeProvider/FirstArgStringReturnTypeProvider.php, src/Psalm/Internal/Provider/ReturnTypeProvider/GetClassMethodsReturnTypeProvider.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/Psalm/Internal/Provider/ReturnTypeProvider/ArrayColumnReturnTypeProvider.php:62 — `!$statements_source instanceof StatementsAnalyzer || count($call_args) < 2` appears character-identically in 2 files — src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayColumnReturnTypeProvider.php, src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayCombineReturnTypeProvider.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/Psalm/Codebase.php:3175 — `!$storage instanceof MethodStorage || !$storage` appears character-identically in 3 files — src/Psalm/Codebase.php, src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php, src/Psalm/Internal/PhpVisitor/ReflectorVisitor.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/Psalm/Internal/TypeVisitor/FromDocblockSetter.php:33 — `!$type instanceof Atomic && !$type instanceof Union && !$type instanceof MutableUnion` appears character-identically in 2 files — src/Psalm/Internal/TypeVisitor/FromDocblockSetter.php, src/Psalm/Internal/TypeVisitor/TypeChecker.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/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php:171 — `!$type instanceof TNamedObject || !$codebase` appears character-identically in 2 files — src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/MethodCallPurityAnalyzer.php, src/Psalm/Internal/Type/SimpleAssertionReconciler.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/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php:1020 — `!$type instanceof TTemplateParam || $type` appears character-identically in 2 files — src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/ArrayFetchAnalyzer.php, src/Psalm/Internal/TypeVisitor/TemplateBoundNarrower.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/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php:318 — `!$type_match_found && !$union_comparison_results` appears character-identically in 4 files — src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php, src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/StaticPropertyAssignmentAnalyzer.php, src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentAnalyzer.php, src/Psalm/Internal/Analyzer/Statements/Expression/Call/Method/ExistingAtomicMethodCallAnalyzer.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/Psalm/Internal/Provider/ParamsProvider/ArrayFilterParamsProvider.php:53 — `!isset($call_args[0]) || !isset($call_args[1])` appears character-identically in 4 files — src/Psalm/Internal/Provider/ParamsProvider/ArrayFilterParamsProvider.php, src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReduceReturnTypeProvider.php, src/Psalm/Internal/Provider/ReturnTypeProvider/InArrayReturnTypeProvider.php, src/Psalm/Internal/Provider/ReturnTypeProvider/PropertyExistsReturnTypeProvider.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/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php:1314 — `!str_starts_with($var, '$this->') && $var !== '$this'` appears character-identically in 2 files — src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php, src/Psalm/Internal/Analyzer/Statements/Expression/Call/StaticMethod/ExistingAtomicStaticCallAnalyzer.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/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php:749 — `$array_atomic_type instanceof TKeyedArray && $array_atomic_type` appears character-identically in 2 files — src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArrayFunctionArgumentsAnalyzer.php, src/Psalm/Internal/Type/SimpleAssertionReconciler.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/Psalm/Internal/Type/TemplateInferredTypeReplacer.php:165 — `$array_template_type instanceof TKeyedArray && ($offset_template_type instanceof TLiteralString || $offset_template_type instanceof TLiteral…` appears character-identically in 2 files — src/Psalm/Internal/Type/TemplateInferredTypeReplacer.php, src/Psalm/Internal/Type/TemplateStandinTypeReplacer.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/Psalm/Internal/Type/AssertionReconciler.php:612 — `$assertion instanceof IsIsset || $assertion instanceof IsEqualIsset` appears character-identically in 2 files — src/Psalm/Internal/Type/AssertionReconciler.php, src/Psalm/Internal/Type/SimpleAssertionReconciler.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/Psalm/Internal/Type/NegatedAssertionReconciler.php:232 — `$assertion_type instanceof TNamedObject && $assertion_type` appears character-identically in 2 files — src/Psalm/Internal/Type/NegatedAssertionReconciler.php, src/Psalm/Internal/Type/SimpleAssertionReconciler.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/Psalm/Internal/Analyzer/Statements/Expression/NullsafeAnalyzer.php:45 — `$atomic instanceof TArray || $atomic instanceof TKeyedArray` appears character-identically in 2 files — src/Psalm/Internal/Analyzer/Statements/Expression/NullsafeAnalyzer.php, src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReplaceRecursiveReturnTypeProvider.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/Psalm/Internal/Analyzer/Statements/Expression/Call/CallPurityResolver.php:226 — `$atomic instanceof TClosure || $atomic instanceof TCallable` appears character-identically in 2 files — src/Psalm/Internal/Analyzer/Statements/Expression/Call/CallPurityResolver.php, src/Psalm/Storage/Capabilities.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/Psalm/Internal/Analyzer/PurityWildcardInference.php:240 — `$atomic instanceof TTemplateParam && $atomic` appears character-identically in 2 files — src/Psalm/Internal/Analyzer/PurityWildcardInference.php, src/Psalm/Internal/Type/PurityWildcard.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/Psalm/Internal/Type/Comparator/ClassLikeStringComparator.php:183 — `$atomic_comparison_result && $atomic_comparison_result` appears character-identically in 2 files — src/Psalm/Internal/Type/Comparator/ClassLikeStringComparator.php, src/Psalm/Internal/Type/Comparator/GenericTypeComparator.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/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php:608 — `$atomic_type instanceof TArray && !$atomic_type` appears character-identically in 2 files — src/Psalm/Internal/Analyzer/Statements/Block/ForeachAnalyzer.php, src/Psalm/Internal/Analyzer/Statements/UnsetAnalyzer.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/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:4134 — `$atomic_type instanceof TArray || $atomic_type instanceof TKeyedArray` appears character-identically in 3 files — src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php, src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php, src/Psalm/Internal/Analyzer/Statements/Expression/YieldFromAnalyzer.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/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php:947 — `$atomic_type instanceof TFloat || $atomic_type instanceof TInt || $atomic_type instanceof TNumeric` appears character-identically in 2 files — src/Psalm/Internal/Analyzer/Statements/Expression/CastAnalyzer.php, src/Psalm/Internal/Provider/ReturnTypeProvider/FilterUtils.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.
  • + 15 more in this group — see findings.md.
D34 · Knowledge Freshness · Orphaned file · ×27
  • Orphaned file src/Psalm/Internal/Provider/ReturnTypeProvider/SprintfReturnTypeProvider.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/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.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/Psalm/Internal/LanguageServer/LanguageClient.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/Psalm/Type/Atomic/TValueOf.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/Psalm/Internal/LanguageServer/Server/Workspace.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/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentMapPopulator.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/Psalm/PluginFileExtensionsSocket.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/Psalm/Internal/Analyzer/Statements/DeclareAnalyzer.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/Psalm/Report/PhpStormReport.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/Psalm/Internal/LanguageServer/Client/Progress/Progress.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/Psalm/Internal/PluginManager/ComposerLock.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/Psalm/Internal/Provider/DynamicFunctionStorageProvider.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/Psalm/Internal/Provider/ReturnTypeProvider/DirnameReturnTypeProvider.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/Psalm/Internal/PluginManager/PluginList.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/Psalm/Internal/Provider/ReturnTypeProvider/PowReturnTypeProvider.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/Psalm/Type/Atomic/TKeyOf.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/Psalm/Internal/Json/Json.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/Psalm/Internal/VersionUtils.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/Psalm/Report/CodeClimateReport.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/Psalm/Internal/ErrorHandler.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/Psalm/Internal/Provider/ReturnTypeProvider/BasenameReturnTypeProvider.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/Psalm/Internal/PluginManager/Command/ShowCommand.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/Psalm/Internal/Provider/ReturnTypeProvider/RoundReturnTypeProvider.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/Psalm/Internal/Analyzer/Statements/Expression/EmptyAnalyzer.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/Psalm/Internal/Provider/ReturnTypeProvider/InArrayReturnTypeProvider.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.
  • + 2 more in this group — see findings.md.
D16 · Bus Factor · Off-boarding risk · ×3
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 37 significant file(s) lose their only recent owner: src/Psalm/Internal/Codebase/TaintFlowResolution.php, src/Psalm/Internal/Codebase/TaintStore.php, src/Psalm/Internal/PhpVisitor/Reflector/StringStartScanner.php, src/Psalm/Internal/Type/TypeVariableTracker.php, src/Psalm/Internal/Analyzer/Statements/Expression/Call/CallPurityResolver.php, src/Psalm/Internal/Analyzer/Statements/Expression/YieldAnalyzer.php, src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayReplaceRecursiveReturnTypeProvider.php, src/Psalm/Internal/Codebase/TaintFlowAnnotation.php (+29 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 15 significant file(s) lose their only recent owner: src/Psalm/Internal/Type/Comparator/KeyedArrayComparator.php, src/Psalm/Internal/LanguageServer/Server/TextDocument.php, src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayMergeReturnTypeProvider.php, src/Psalm/Internal/Diff/ClassStatementsDiffer.php, src/Psalm/Type/Atomic/TObjectWithProperties.php, src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/CoalesceAnalyzer.php, src/Psalm/Config/IssueHandler.php, src/Psalm/Internal/Analyzer/Statements/Expression/ThrowAnalyzer.php (+7 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 10 significant file(s) lose their only recent owner: src/Psalm/Internal/Provider/ParamsProvider/ArrayMultisortParamsProvider.php, src/Psalm/Internal/FileManipulation/FileManipulationBuffer.php, src/Psalm/Type/Atomic/TClassString.php, src/Psalm/Internal/Provider/FileStorageProvider.php, src/Psalm/Internal/IncludeCollector.php, src/Psalm/Config/CiCreator.php, src/Psalm/Internal/Type/TemplateResult.php, src/Psalm/Plugin/EventHandler/Event/MethodReturnTypeProviderEvent.php (+2 more). Pair on, review, or document these before any departure.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×3
  • Silent fallback default on parse failure src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php:1185 — `getClassesForFile` returns `[]` when `InvalidArgumentException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
  • Silent fallback default on parse failure src/Psalm/Internal/Analyzer/Statements/Expression/Call/FunctionCallAnalyzer.php:1023 — `getFunctionCallableSignatures` returns `[]` when `UnexpectedValueException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
  • Silent fallback default on parse failure src/Psalm/Internal/Type/TypeCombiner.php:1752 — `getClassLikes` returns `[]` when `InvalidArgumentException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
AX6 · Interface segregation · Fat interface · ×1
  • Fat interface: StatementsSource (20 methods) src/Psalm/StatementsSource.php:17 — `StatementsSource` declares 20 methods: `getNamespace`, `getAliasedClassesFlipped`, `getAliasedClassesFlippedReplaceable`, `getFQCLN`, `getClassName`, `getParentFQCLN`, `getTemplateTypeMap`, `setRootFilePath`, `hasParentFilePath`, `hasAlreadyRequiredFilePath`, `getRequireNesting`, `isStatic`, `getSource`, `getCodebase`, `getSuppressedIssues`, `addSuppressedIssues`, `removeSuppressedIssues`, `getNodeTypeProvider`, `signalMutationOnlyInferred`, `signalMutation`. Counted over its public instance methods, once per name; constants and static methods are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (63 single-owned of 412 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 412 of the 1318 production source files in this repository met that bar). They are anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: src/Psalm/Report/JunitReport.php.
D19 · Documentation Quality · Documentation · ×1
  • Documentation: no build, run or usage example assets/psalm-phar/README.md:1 — `psalm-phar` is a command-line package (`bin` in `composer.json`) and neither `assets/psalm-phar/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 27 of 412 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 412 of the 1318 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: src/Psalm/Internal/Provider/ReturnTypeProvider/SprintfReturnTypeProvider.php, src/Psalm/Internal/Provider/ReturnTypeProvider/FilterInputReturnTypeProvider.php, src/Psalm/Internal/LanguageServer/LanguageClient.php, src/Psalm/Type/Atomic/TValueOf.php, src/Psalm/Internal/LanguageServer/Server/Workspace.php, src/Psalm/Internal/Analyzer/Statements/Expression/Call/ArgumentMapPopulator.php, src/Psalm/PluginFileExtensionsSocket.php, src/Psalm/Internal/Analyzer/Statements/DeclareAnalyzer.php (and 19 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · ADRs not easily discoverable · ×1
  • ADRs not easily discoverable — 1 ADR-shaped document(s) detected by content — `.agents/skills/purity-capabilities/SKILL.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
P3 · Security & performance tooling · Dependabot does not watch composer/gitsubmodule · ×1
  • Dependabot does not watch composer/gitsubmodule REDACTED:2 — `REDACTED` schedules updates, but no `package-ecosystem` entry covers `composer`, `gitsubmodule`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entries to the `updates:` list.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
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.)
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×1
  • Diagnostic log message is built whether or not it is wanted src/Psalm/Internal/LanguageServer/LanguageServer.php:715 — `logDebug` at line 715 is called with an argument built by `array_keys($files)` (line 716), whose cost grows with the collection it walks. PHP evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because logDebug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isHandling` test, no debug flag, and no placeholder context array that lets the logger build the text only when the level is on.
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/CoalesceAnalyzer.php:56 — `printOperand` swallows every exception into `return 'left operand of ??'` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the docblock, and the row stops firing.
Minor — 46 finding(s)
D10 · Test Quality · Skipped (documented) · ×41
  • Skipped (documented): testArrayFirstLastUserDefinedBeforePhp85 tests/ArrayFunctionCallTest.php:48 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testFailedWriteKeepsThePreviousEntry tests/Cache/CacheTest.php:342 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testShortWriteIsReportedAndLeavesNoTemporaryFile tests/Cache/CacheTest.php:380 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testDeclaredLengthIsNotAllocatedBeforeItIsKnownToBeInTheFile tests/Cache/CacheTest.php:522 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testReadingWhileAnotherProcessRewritesTheEntry tests/Cache/CacheTest.php:605 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testConcurrentWritersLeaveAValidEntry tests/Cache/CacheTest.php:668 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testIgnoreSymlinkedProjectDirectory tests/Config/ConfigTest.php:203 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testAutoOrUnavailableCompressorIsResolvedLikeAnAbsentAttribute tests/Config/ConfigTest.php:3325 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testInvalidCode tests/DocumentationTest.php:273 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testSucceedsWithEmptyFile tests/EndToEnd/DestructiveAutoloaderTest.php:17 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testSucceedsWithEmptyFile tests/EndToEnd/SuicidalAutoloaderTest.php:17 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testClassesAreUndefinedWhenExtensionIsDisabled tests/ExtImagickStubTest.php:32 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testCode tests/FileDiffTest.php:26 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testPartialAstDiff tests/FileDiffTest.php:83 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testValidCode tests/FileManipulation/ClassConstantMoveTest.php:25 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testValidCode tests/FileManipulation/ClassMoveTest.php:25 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testValidCode tests/FileManipulation/FileManipulationTestCase.php:26 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testValidCode tests/FileManipulation/MethodMoveTest.php:25 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testValidCode tests/FileManipulation/NamespaceMoveTest.php:25 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testValidCode tests/FileManipulation/PropertyMoveTest.php:25 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testReferenceLocations tests/FileReferenceTest.php:42 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testReferencedMethods tests/FileReferenceTest.php:164 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testValidInclude tests/FileUpdates/AnalyzedMethodTest.php:58 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testValidInclude tests/FileUpdates/CachedStorageTest.php:64 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • Skipped (documented): testTranspiledSuiteIsUpToDate tests/HackConformanceTest.php:88 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by markTestSkipped()
  • + 16 more in this group — see findings.md.
D10 · Test Quality · No assertions (declared) · ×5
  • No assertions (declared): testClassExistsGuardDoesNotRunTheAutoloader tests/ClassLikeStringTest.php:57 — This test performs no assertions and its author said so, with the test framework's own declaration for exactly that (PHPUnit `#[DoesNotPerformAssertions]`, which switches off PHPUnit's "This test did not perform any assertions" warning). It is reported for visibility and is NOT counted against this dimension's score: D10 looks for tests that verify nothing unintentionally. Worth a read anyway — such a test passes as long as the code under it does not throw, so if it was meant to check something, the declaration is now hiding that it does not.
  • No assertions (declared): testAllowBuiltinClassStringStandInForNewClass tests/ClassLikeStringTest.php:166 — This test performs no assertions and its author said so, with the test framework's own declaration for exactly that (PHPUnit `#[DoesNotPerformAssertions]`, which switches off PHPUnit's "This test did not perform any assertions" warning). It is reported for visibility and is NOT counted against this dimension's score: D10 looks for tests that verify nothing unintentionally. Worth a read anyway — such a test passes as long as the code under it does not throw, so if it was meant to check something, the declaration is now hiding that it does not.
  • No assertions (declared): testAllowBuiltinClassStringStandInForStaticPropertyFetch tests/ClassLikeStringTest.php:191 — This test performs no assertions and its author said so, with the test framework's own declaration for exactly that (PHPUnit `#[DoesNotPerformAssertions]`, which switches off PHPUnit's "This test did not perform any assertions" warning). It is reported for visibility and is NOT counted against this dimension's score: D10 looks for tests that verify nothing unintentionally. Worth a read anyway — such a test passes as long as the code under it does not throw, so if it was meant to check something, the declaration is now hiding that it does not.
  • No assertions (declared): testLegitimateCodeInEitherMode tests/ClassStringLiteralConfigTest.php:76 — This test performs no assertions and its author said so, with the test framework's own declaration for exactly that (PHPUnit `#[DoesNotPerformAssertions]`, which switches off PHPUnit's "This test did not perform any assertions" warning). It is reported for visibility and is NOT counted against this dimension's score: D10 looks for tests that verify nothing unintentionally. Worth a read anyway — such a test passes as long as the code under it does not throw, so if it was meant to check something, the declaration is now hiding that it does not.
  • No assertions (declared): testEnabledAcceptsCallableClassName tests/ClassStringLiteralConfigTest.php:161 — This test performs no assertions and its author said so, with the test framework's own declaration for exactly that (PHPUnit `#[DoesNotPerformAssertions]`, which switches off PHPUnit's "This test did not perform any assertions" warning). It is reported for visibility and is NOT counted against this dimension's score: D10 looks for tests that verify nothing unintentionally. Worth a read anyway — such a test passes as long as the code under it does not throw, so if it was meant to check something, the declaration is now hiding that it does not.

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 --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-90393d235a26420fad613a8b3c3665c9/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-90393d235a26420fad613a8b3c3665c9/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=3200" --report-format json --report-path /tmp/watchdog-gitleaks-90393d235a26420fad613a8b3c3665c9/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=4200 --max-count=12800" --report-format json --report-path /tmp/watchdog-gitleaks-90393d235a26420fad613a8b3c3665c9/history-3.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=17000 --max-count=6069" --report-format json --report-path /tmp/watchdog-gitleaks-90393d235a26420fad613a8b3c3665c9/history-4.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-4.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-90393d235a26420fad613a8b3c3665c9/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 .3artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm . /tmp/codehealth-osv-sbom-356e864d39a24c40a228bc75bc76cdd90artifacts/raw/osv-scanner.json
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. semgrep could not parse 218 file(s) — `bin/ci/announce-release.php`, `bin/hack-conformance/Transpiler.php`, `bin/hack-conformance/transpile.php`, `bin/perf/lib/compare.php`, `bin/perf/lib/report.php`, … (+213 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.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 Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm . /tmp/codehealth-osv-sbom-356e864d39a24c40a228bc75bc76cdd90artifacts/raw/osv-scanner.json

Run 01a1e9ef-91a4-7adf-bc63-805303cbc4d3 · 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