Instant Upgrades and Automated Refactoring of any PHP 5.3+ code
This report summarizes scanner evidence for rectorphp/rector, a PHP project with 10,437 GitHub stars. SynthScan examined 124,248 lines of code across 1396 source files, recording 663 pattern matches distributed across 2 syntactic categories. The legacy adjusted pattern signal is 5.4 (Moderate pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 663 finding(s).
Are imports declared and package/API names verified? 0 finding(s).
Are wrappers, guards, and repeated structures necessary? 660 finding(s).
Which changes need focused human review? 663 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 663 distinct pattern matches across 2 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | bin/rector.php | 34 | public function includeDependencyOrRepositoryVendorAutoloadIfExists(): void | CODE |
| LOW | bin/rector.php | 47 | public function autoloadProjectAutoloaderFile(): void | CODE |
| LOW | bin/rector.php | 54 | public function autoloadRectorInstalledAsGlobalDependency(): void | CODE |
| LOW | bin/rector.php | 83 | public function loadIfExistsAndNotLoadedYet(string $filePath): void | CODE |
| LOW | …r/Assign/ReplaceEachAssignmentWithKeyCurrentRector.php | 106 | private function createDimFetchAssignWithFuncCall(Expr $assignVariable, Expr $eachedVariable, $dimValue, string $fun | CODE |
| LOW | rules/Php72/NodeFactory/AnonymousFunctionFactory.php | 94 | public function createAnonymousFunctionFromExpr(Expr $expr): ?Closure | CODE |
| LOW | rules/Php72/NodeFactory/AnonymousFunctionFactory.php | 139 | private function createUseVariablesFromParams(array $nodes, array $params): array | CODE |
| LOW | …or/Class_/ConstructorReadonlyAssignToDefaultRector.php | 102 | private function isDefaultableReadonlyProperty(Property $property): bool | CODE |
| LOW | rules/Php81/Rector/Property/ReadOnlyPropertyRector.php | 270 | private function isPropertyChangedInByRefForeach(Class_ $class, string $propertyName): bool | CODE |
| LOW | rules/Php81/Rector/Property/ReadOnlyPropertyRector.php | 285 | private function isPromotedPropertyAssigned(Class_ $class, Param $param): bool | CODE |
| LOW | …Rector/New_/MyCLabsConstructorCallToEnumFromRector.php | 69 | private function refactorConstructorCallToStaticFromCall(New_ $new): ?StaticCall | CODE |
| LOW | …hp81/Rector/Array_/ArrayToFirstClassCallableRector.php | 161 | private function isReferenceToNonPublicMethodOutsideOwningScope(MethodCall $methodCall, string $methodName): bool | CODE |
| LOW | …r/MethodCall/SpatieEnumMethodCallToEnumConstRector.php | 85 | private function refactorGetterToMethodCall(MethodCall $methodCall, string $property): ?PropertyFetch | CODE |
| LOW | …ctor/MethodCall/MyCLabsMethodCallToEnumConstRector.php | 118 | private function refactorGetValueMethodCall(MethodCall $methodCall): ?PropertyFetch | CODE |
| LOW | …ctor/MethodCall/MyCLabsMethodCallToEnumConstRector.php | 217 | private function getPropertyFetchOrVariable($expr) | CODE |
| LOW | rules/Php81/NodeFactory/EnumFactory.php | 116 | private function createEnumCaseFromDocComment(PhpDocTagNode $phpDocTagNode, Class_ $class, array $mapping = [], bool | CODE |
| LOW | rules/Php81/NodeFactory/EnumFactory.php | 174 | private function getIdentifierTypeFromMappings(array $mapping): string | CODE |
| LOW | …p81/NodeManipulator/NullToStrictStringIntConverter.php | 147 | private function isPropertyFetchOnClassWithMagicGet(Expr $expr): bool | CODE |
| LOW | …p81/NodeManipulator/NullToStrictStringIntConverter.php | 214 | private function isPossibleArrayVariableName(Type $passedType, Type $reflectionParamType, Expr $expr): bool | CODE |
| LOW | …p81/NodeManipulator/NullToStrictStringIntConverter.php | 230 | private function isStringCastedTernaryOfMixedTypes(Expr $expr, Scope $scope): bool | CODE |
| LOW | …74/Rector/FuncCall/MoneyFormatToNumberFormatRector.php | 81 | private function warpInNumberFormatFuncCall(FuncCall $funcCall, Expr $expr): FuncCall | CODE |
| LOW | …es/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php | 74 | private function shouldSkipForUseVariableUsedByCompact(Closure $closure): bool | CODE |
| LOW | …es/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php | 98 | private function shouldSkipMoreSpecificTypeWithVarDoc(Return_ $return): bool | CODE |
| LOW | …es/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php | 107 | private function shouldSkipForUsedReferencedValue(Closure $closure): bool | CODE |
| LOW | …es/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php | 140 | private function resolveReferencedUseVariablesFromClosure(Closure $closure): array | CODE |
| LOW | …80/ValueObject/DoctrineTagAndAnnotationToAttribute.php | 22 | public function getDoctrineAnnotationTagValueNode(): DoctrineAnnotationTagValueNode | CODE |
| LOW | rules/Php80/ValueObject/NestedAnnotationToAttribute.php | 46 | public function getAnnotationPropertiesToAttributeClasses(): array | CODE |
| LOW | rules/Php80/ValueObject/PropertyPromotionCandidate.php | 58 | public function getConstructorAssignStmtPosition(): int | CODE |
| LOW | rules/Php80/ValueObject/AnnotationToAttribute.php | 61 | public function getUseValueAsAttributeArgument(): bool | CODE |
| LOW | …ueObject/NestedDoctrineTagAndAnnotationToAttribute.php | 22 | public function getDoctrineAnnotationTagValueNode(): DoctrineAnnotationTagValueNode | CODE |
| LOW | …ueObject/NestedDoctrineTagAndAnnotationToAttribute.php | 26 | public function getNestedAnnotationToAttribute(): \Rector\Php80\ValueObject\NestedAnnotationToAttribute | CODE |
| LOW | …p80/Rector/Ternary/TernaryToNullsafeCoalesceRector.php | 162 | private function shouldSkipCoalesceFallback(Expr $callExpr): bool | CODE |
| LOW | rules/Php80/Rector/Ternary/GetDebugTypeRector.php | 108 | private function shouldSkipClassConstFetch(ClassConstFetch $classConstFetch): bool | CODE |
| LOW | …ClassMethod/AddParamBasedOnParentClassMethodRector.php | 173 | private function processAddNullDefaultParam(array $currentClassMethodParams, array $parentClassMethodParams): bool | CODE |
| LOW | …ClassMethod/AddParamBasedOnParentClassMethodRector.php | 196 | private function processReplaceClassMethodParams(ClassMethod $classMethod, array $currentClassMethodParams, array $p | CODE |
| LOW | …/Rector/Property/NestedAnnotationToAttributeRector.php | 139 | private function transformDoctrineAnnotationClassesToAttributeGroups(PhpDocInfo $phpDocInfo, array $uses): array | CODE |
| LOW | …/Rector/Property/NestedAnnotationToAttributeRector.php | 162 | private function matchAnnotationToAttribute(DoctrineAnnotationTagValueNode $doctrineAnnotationTagValueNode): ?\Recto | CODE |
| LOW | rules/Php80/Rector/Identical/StrEndsWithRector.php | 180 | private function isUnaryMinusStrlenFuncCallArgValue(Expr $substrOffset, Expr $needle): bool | CODE |
| LOW | rules/Php80/Rector/Identical/StrEndsWithRector.php | 200 | private function isHardCodedLNumberAndString(Expr $substrOffset, Expr $needle): bool | CODE |
| LOW | …es/Php80/Rector/Class_/AnnotationToAttributeRector.php | 193 | private function resolveWithChangedAttributesClass(array $configuration): array | CODE |
| LOW | …es/Php80/Rector/Class_/AnnotationToAttributeRector.php | 248 | private function processDoctrineAnnotationClasses(PhpDocInfo $phpDocInfo, array $uses): array | CODE |
| LOW | …es/Php80/Rector/Class_/AnnotationToAttributeRector.php | 348 | private function matchAnnotationToAttribute(DoctrineAnnotationTagValueNode $doctrineAnnotationTagValueNode): ?\Recto | CODE |
| LOW | …s_/ClassPropertyAssignToConstructorPromotionRector.php | 316 | private function shouldSkipUntypedParentProperty(ClassReflection $classReflection, string $propertyName): bool | CODE |
| LOW | …s_/ClassPropertyAssignToConstructorPromotionRector.php | 360 | private function shouldSkipPropertyOrParam(Property $property, Param $param): bool | CODE |
| LOW | …s_/ClassPropertyAssignToConstructorPromotionRector.php | 377 | private function shouldSkipNarrowingVarDoc(Property $property, Param $param, PhpDocInfo $constructorPhpDocInfo, stri | CODE |
| LOW | …s_/ClassPropertyAssignToConstructorPromotionRector.php | 403 | private function shouldRemoveNullFromForPromotedParamType(Property $property, Param $param): bool | CODE |
| LOW | …s_/ClassPropertyAssignToConstructorPromotionRector.php | 420 | private function shouldUsePropertyTypeForPromotedParam(Property $property, Param $param): bool | CODE |
| LOW | …s_/ClassPropertyAssignToConstructorPromotionRector.php | 443 | private function shouldSkipPropertyAssignedNull(Class_ $class, string $propertyName): bool | CODE |
| LOW | …p80/NodeAnalyzer/PromotedPropertyCandidateResolver.php | 97 | private function matchPropertyPromotionCandidate(Property $property, ClassMethod $constructClassMethod, int $propert | CODE |
| LOW | …p80/NodeAnalyzer/PromotedPropertyCandidateResolver.php | 161 | private function matchClassMethodParamByAssignedVariable(ClassMethod $classMethod, Variable $variable): ?Param | CODE |
| LOW | …p80/NodeAnalyzer/PromotedPropertyCandidateResolver.php | 188 | private function isParamReadAfterPropertyMutation(ClassMethod $constructClassMethod, int $assignStmtPosition, string | CODE |
| LOW | rules/Php80/NodeAnalyzer/MatchSwitchAnalyzer.php | 89 | public function haveCondAndExprsMatchPotential(array $condAndExprs): bool | CODE |
| LOW | rules/Php80/NodeAnalyzer/MatchSwitchAnalyzer.php | 113 | public function hasCondsAndExprDefaultValue(array $condAndExprs): bool | CODE |
| LOW | rules/Php80/NodeAnalyzer/MatchSwitchAnalyzer.php | 140 | private function resolveUniqueKindsWithoutThrows(array $condAndExprs): array | CODE |
| LOW | rules/Php80/NodeAnalyzer/PhpAttributeAnalyzer.php | 76 | private function hasArgWithRemoveArrayValue(array $args): bool | CODE |
| LOW | …les/Php80/DocBlock/PropertyPromotionDocBlockMerger.php | 55 | public function mergePropertyAndParamDocBlocks(Property $property, Param $param, ?ParamTagValueNode $paramTagValueNo | CODE |
| LOW | …les/Php80/DocBlock/PropertyPromotionDocBlockMerger.php | 72 | public function decorateParamWithPropertyPhpDocInfo(ClassMethod $classMethod, Property $property, Param $param, stri | CODE |
| LOW | …rStartsWithMatchAndRefactor/SubstrMatchAndRefactor.php | 95 | private function isHardcodedStringWithLNumberLength(StrStartsWith $strStartsWith): bool | CODE |
| LOW | …StartsWithMatchAndRefactor/StrncmpMatchAndRefactor.php | 98 | private function isHardcodedStringWithLNumberLength(StrStartsWith $strStartsWith): bool | CODE |
| LOW | rules/Php73/Rector/FuncCall/ArrayKeyFirstLastRector.php | 184 | private function hasInternalPointerChangeNext(Node $stmtsAware, int $nextKey, int $totalKeys, FuncCall $funcCall): b | CODE |
| 600 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …nalyzer/ReturnTypeAnalyzer/StrictReturnNewAnalyzer.php | 58 | // in case of more returns, we need to check if they all return the same variable | COMMENT |
| LOW | rules/Arguments/ArgumentDefaultValueReplacer.php | 123 | // before any named argument, we need to check if it is in the list of named arguments | COMMENT |
| LOW | …ents/Rector/MethodCall/RemoveMethodCallParamRector.php | 92 | // before any named argument, we need to check if it is in the list of named arguments | COMMENT |