A PHP parser written in PHP
This report presents the forensic synthetic code analysis of nikic/PHP-Parser, a PHP project with 17,450 GitHub stars. SynthScan v2.0 examined 35,771 lines of code across 354 source files, recording 88 pattern matches distributed across 2 syntactic categories. The overall adjusted score of 2.5 places this repository in the Likely human-written band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 88 distinct pattern matches across 2 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/PhpParser/BuilderFactoryTest.php | 252 | public function testInvalidIdentifierOrExpr(): void { | CODE |
| LOW | test/PhpParser/BuilderHelpersTest.php | 39 | public function testNormalizeStmtInvalidType(): void { | CODE |
| LOW | test/PhpParser/BuilderHelpersTest.php | 55 | public function testNormalizeIdentifierOrExpr(): void { | CODE |
| LOW | test/PhpParser/BuilderHelpersTest.php | 86 | public function testNormalizeNameInvalidType(): void { | CODE |
| LOW | test/PhpParser/BuilderHelpersTest.php | 113 | public function testNormalizeNameOrExpInvalidType(): void { | CODE |
| LOW⚡ | test/PhpParser/BuilderHelpersTest.php | 160 | public function testNormalizeTypeNullableVoid(): void { | CODE |
| LOW⚡ | test/PhpParser/BuilderHelpersTest.php | 166 | public function testNormalizeTypeNullableMixed(): void { | CODE |
| LOW⚡ | test/PhpParser/BuilderHelpersTest.php | 172 | public function testNormalizeTypeNullableNever(): void { | CODE |
| LOW | test/PhpParser/NodeTraverserTest.php | 215 | public function testDontTraverseCurrentAndChildren(): void { | CODE |
| LOW | test/PhpParser/ConstExprEvaluatorTest.php | 84 | public function testEvaluateFallbackMagicConst(): void { | CODE |
| LOW | test/PhpParser/ConstExprEvaluatorTest.php | 98 | public function testEvaluateFallbackPipeOperator(): void { | CODE |
| LOW | test/PhpParser/ConstExprEvaluatorTest.php | 132 | public static function provideTestEvaluateSilently() { | CODE |
| LOW⚡ | test/PhpParser/ParserTestAbstract.php | 14 | public function testParserThrowsSyntaxError(): void { | CODE |
| LOW⚡ | test/PhpParser/ParserTestAbstract.php | 21 | public function testParserThrowsSpecialError(): void { | CODE |
| LOW⚡ | test/PhpParser/ParserTestAbstract.php | 28 | public function testParserThrowsLexerError(): void { | CODE |
| LOW | test/PhpParser/ParserTestAbstract.php | 131 | public static function provideTestExtraAttributes() { | CODE |
| LOW | test/PhpParser/PrettyPrinterTest.php | 55 | public static function provideTestPrettyPrintFile() { | CODE |
| LOW | test/PhpParser/PrettyPrinterTest.php | 73 | public function testCommentBeforeInlineHTML(): void { | CODE |
| LOW | test/PhpParser/PrettyPrinterTest.php | 99 | public static function provideTestKindAttributes() { | CODE |
| LOW | test/PhpParser/PrettyPrinterTest.php | 155 | public static function provideTestUnnaturalLiterals() { | CODE |
| LOW | test/PhpParser/PrettyPrinterTest.php | 175 | public static function provideTestCustomRawValue() { | CODE |
| LOW | test/PhpParser/PrettyPrinterTest.php | 200 | public function testPrettyPrintWithErrorInClassConstFetch(): void { | CODE |
| LOW | test/PhpParser/PrettyPrinterTest.php | 213 | public function testFormatPreservingPrint($name, $code, $modification, $expected, $modeLine): void { | CODE |
| LOW | test/PhpParser/PrettyPrinterTest.php | 239 | public static function provideTestFormatPreservingPrint() { | CODE |
| LOW | test/PhpParser/PrettyPrinterTest.php | 270 | public static function provideTestRoundTripPrint() { | CODE |
| LOW | test/PhpParser/NameContextTest.php | 35 | public static function provideTestGetPossibleNames() { | CODE |
| LOW | …st/PhpParser/NodeVisitor/NodeConnectingVisitorTest.php | 13 | public function testConnectsNodeToItsParentNodeAndItsSiblingNodes(): void { | CODE |
| LOW | …/PhpParser/NodeVisitor/ParentConnectingVisitorTest.php | 11 | public function testConnectsChildNodeToParentNode(): void { | CODE |
| LOW | test/PhpParser/NodeVisitor/NameResolverTest.php | 378 | public function testAddDeclarationNamespacedName(): void { | CODE |
| LOW | test/PhpParser/NodeVisitor/NameResolverTest.php | 413 | public function testAddRuntimeResolvedNamespacedName(): void { | CODE |
| LOW | test/PhpParser/NodeVisitor/NameResolverTest.php | 490 | public function testClassNameIsCaseInsensitive(): void { | CODE |
| LOW | test/PhpParser/NodeVisitor/NameResolverTest.php | 511 | public function testSpecialClassNamesAreCaseInsensitive(): void { | CODE |
| LOW | test/PhpParser/Lexer/EmulativeTest.php | 35 | public function testReplaceKeywordsUppercase(string $keyword, int $expectedToken): void { | CODE |
| LOW | test/PhpParser/Lexer/EmulativeTest.php | 49 | public function testNoReplaceKeywordsAfterObjectOperator(string $keyword): void { | CODE |
| LOW | test/PhpParser/Lexer/EmulativeTest.php | 64 | public function testNoReplaceKeywordsAfterObjectOperatorWithSpaces(string $keyword): void { | CODE |
| LOW | test/PhpParser/Lexer/EmulativeTest.php | 77 | public function testNoReplaceKeywordsAfterObjectOperatorWithComment(): void { | CODE |
| LOW | test/PhpParser/Lexer/EmulativeTest.php | 96 | public function testNoReplaceKeywordsAfterNullsafeObjectOperator(string $keyword): void { | CODE |
| LOW | test/PhpParser/Lexer/EmulativeTest.php | 108 | public static function provideTestReplaceKeywords() { | CODE |
| LOW | test/PhpParser/Lexer/EmulativeTest.php | 159 | public function testLeaveStuffAloneInStrings(string $code): void { | CODE |
| LOW | test/PhpParser/Lexer/EmulativeTest.php | 195 | public static function provideTestLexNewFeatures() { | CODE |
| LOW | test/PhpParser/Internal/DifferTest.php | 60 | public static function provideTestDiffWithReplacements() { | CODE |
| LOW | test/PhpParser/Node/ParamTest.php | 55 | public function testPromotedPropertyWithoutVisibilityModifier(): void { | CODE |
| LOW | test/PhpParser/Node/ParamTest.php | 64 | public function testNonPromotedPropertyIsNotPublic(): void { | CODE |
| LOW | test/PhpParser/Node/PropertyHookTest.php | 54 | public function testGetStmtsSetHookFromParser(): void { | CODE |
| LOW | test/PhpParser/Node/PropertyHookTest.php | 82 | public function testGetStmtsSetHookWithoutPropertyName(): void { | CODE |
| LOW | test/PhpParser/Node/NameTest.php | 77 | public function testSliceLengthTooLargeWithOffset(): void { | CODE |
| LOW | test/PhpParser/Node/NameTest.php | 155 | public static function provideTestIsSpecialClassName() { | CODE |
| LOW | test/PhpParser/Node/IdentifierTest.php | 25 | public static function provideTestIsSpecialClassName() { | CODE |
| LOW | test/PhpParser/Node/Stmt/PropertyTest.php | 33 | public function testStaticImplicitlyPublic(): void { | CODE |
| LOW | test/PhpParser/Node/Expr/CallableLikeTest.php | 29 | public static function provideTestIsFirstClassCallable() { | CODE |
| LOW | test/PhpParser/Node/Scalar/StringTest.php | 45 | public static function provideTestParseEscapeSequences() { | CODE |
| LOW | test/PhpParser/Builder/FunctionTest.php | 115 | public function testInvalidNullableVoidType(): void { | CODE |
| LOW | test/PhpParser/Builder/MethodTest.php | 156 | public function testAddStmtToAbstractMethodError(): void { | CODE |
| LOW | test/PhpParser/Builder/MethodTest.php | 165 | public function testMakeMethodWithStmtsAbstractError(): void { | CODE |
| LOW | test/PhpParser/Builder/TraitUseTest.php | 44 | public function testInvalidAdaptationNode(): void { | CODE |
| LOW | test/PhpParser/Builder/TraitUseAdaptationTest.php | 11 | protected function createTraitUseAdaptationBuilder($trait, $method) { | CODE |
| LOW | test/PhpParser/Builder/TraitUseAdaptationTest.php | 64 | public function testInsteadofOnNotPrecedence(): void { | CODE |
| LOW | test/PhpParser/Builder/TraitUseAdaptationTest.php | 73 | public function testInsteadofWithoutTrait(): void { | CODE |
| LOW | lib/PhpParser/BuilderHelpers.php | 87 | public static function normalizeIdentifierOrExpr($name) { | CODE |
| LOW | lib/PhpParser/compatibility_tokens.php | 6 | function defineCompatibilityTokens(): void { | CODE |
| 26 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | lib/PhpParser/Comment.php | 121 | $text = str_replace("\r\n", "\n", $this->text); | COMMENT |
| LOW | lib/PhpParser/Comment.php | 141 | // /* | COMMENT |