Repository Analysis

nikic/PHP-Parser

A PHP parser written in PHP

2.5 Likely human-written View on GitHub

Analysis Overview

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).

2.5
Adjusted Score
2.5
Raw Score
100%
Time Factor
2026-07-11
Last Push
17.4K
Stars
PHP
Language
35.8K
Lines of Code
354
Files
88
Pattern Hits
2026-07-14
Scan Date
0.00
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

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.

Severity Breakdown

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.

CRITICAL 0HIGH 0MEDIUM 0LOW 88

Directory Score Breakdown

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.

Pattern Findings

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.

Hyper-Verbose Identifiers86 hits · 89 pts
SeverityFileLineSnippetContext
LOWtest/PhpParser/BuilderFactoryTest.php252 public function testInvalidIdentifierOrExpr(): void {CODE
LOWtest/PhpParser/BuilderHelpersTest.php39 public function testNormalizeStmtInvalidType(): void {CODE
LOWtest/PhpParser/BuilderHelpersTest.php55 public function testNormalizeIdentifierOrExpr(): void {CODE
LOWtest/PhpParser/BuilderHelpersTest.php86 public function testNormalizeNameInvalidType(): void {CODE
LOWtest/PhpParser/BuilderHelpersTest.php113 public function testNormalizeNameOrExpInvalidType(): void {CODE
LOWtest/PhpParser/BuilderHelpersTest.php160 public function testNormalizeTypeNullableVoid(): void {CODE
LOWtest/PhpParser/BuilderHelpersTest.php166 public function testNormalizeTypeNullableMixed(): void {CODE
LOWtest/PhpParser/BuilderHelpersTest.php172 public function testNormalizeTypeNullableNever(): void {CODE
LOWtest/PhpParser/NodeTraverserTest.php215 public function testDontTraverseCurrentAndChildren(): void {CODE
LOWtest/PhpParser/ConstExprEvaluatorTest.php84 public function testEvaluateFallbackMagicConst(): void {CODE
LOWtest/PhpParser/ConstExprEvaluatorTest.php98 public function testEvaluateFallbackPipeOperator(): void {CODE
LOWtest/PhpParser/ConstExprEvaluatorTest.php132 public static function provideTestEvaluateSilently() {CODE
LOWtest/PhpParser/ParserTestAbstract.php14 public function testParserThrowsSyntaxError(): void {CODE
LOWtest/PhpParser/ParserTestAbstract.php21 public function testParserThrowsSpecialError(): void {CODE
LOWtest/PhpParser/ParserTestAbstract.php28 public function testParserThrowsLexerError(): void {CODE
LOWtest/PhpParser/ParserTestAbstract.php131 public static function provideTestExtraAttributes() {CODE
LOWtest/PhpParser/PrettyPrinterTest.php55 public static function provideTestPrettyPrintFile() {CODE
LOWtest/PhpParser/PrettyPrinterTest.php73 public function testCommentBeforeInlineHTML(): void {CODE
LOWtest/PhpParser/PrettyPrinterTest.php99 public static function provideTestKindAttributes() {CODE
LOWtest/PhpParser/PrettyPrinterTest.php155 public static function provideTestUnnaturalLiterals() {CODE
LOWtest/PhpParser/PrettyPrinterTest.php175 public static function provideTestCustomRawValue() {CODE
LOWtest/PhpParser/PrettyPrinterTest.php200 public function testPrettyPrintWithErrorInClassConstFetch(): void {CODE
LOWtest/PhpParser/PrettyPrinterTest.php213 public function testFormatPreservingPrint($name, $code, $modification, $expected, $modeLine): void {CODE
LOWtest/PhpParser/PrettyPrinterTest.php239 public static function provideTestFormatPreservingPrint() {CODE
LOWtest/PhpParser/PrettyPrinterTest.php270 public static function provideTestRoundTripPrint() {CODE
LOWtest/PhpParser/NameContextTest.php35 public static function provideTestGetPossibleNames() {CODE
LOW…st/PhpParser/NodeVisitor/NodeConnectingVisitorTest.php13 public function testConnectsNodeToItsParentNodeAndItsSiblingNodes(): void {CODE
LOW…/PhpParser/NodeVisitor/ParentConnectingVisitorTest.php11 public function testConnectsChildNodeToParentNode(): void {CODE
LOWtest/PhpParser/NodeVisitor/NameResolverTest.php378 public function testAddDeclarationNamespacedName(): void {CODE
LOWtest/PhpParser/NodeVisitor/NameResolverTest.php413 public function testAddRuntimeResolvedNamespacedName(): void {CODE
LOWtest/PhpParser/NodeVisitor/NameResolverTest.php490 public function testClassNameIsCaseInsensitive(): void {CODE
LOWtest/PhpParser/NodeVisitor/NameResolverTest.php511 public function testSpecialClassNamesAreCaseInsensitive(): void {CODE
LOWtest/PhpParser/Lexer/EmulativeTest.php35 public function testReplaceKeywordsUppercase(string $keyword, int $expectedToken): void {CODE
LOWtest/PhpParser/Lexer/EmulativeTest.php49 public function testNoReplaceKeywordsAfterObjectOperator(string $keyword): void {CODE
LOWtest/PhpParser/Lexer/EmulativeTest.php64 public function testNoReplaceKeywordsAfterObjectOperatorWithSpaces(string $keyword): void {CODE
LOWtest/PhpParser/Lexer/EmulativeTest.php77 public function testNoReplaceKeywordsAfterObjectOperatorWithComment(): void {CODE
LOWtest/PhpParser/Lexer/EmulativeTest.php96 public function testNoReplaceKeywordsAfterNullsafeObjectOperator(string $keyword): void {CODE
LOWtest/PhpParser/Lexer/EmulativeTest.php108 public static function provideTestReplaceKeywords() {CODE
LOWtest/PhpParser/Lexer/EmulativeTest.php159 public function testLeaveStuffAloneInStrings(string $code): void {CODE
LOWtest/PhpParser/Lexer/EmulativeTest.php195 public static function provideTestLexNewFeatures() {CODE
LOWtest/PhpParser/Internal/DifferTest.php60 public static function provideTestDiffWithReplacements() {CODE
LOWtest/PhpParser/Node/ParamTest.php55 public function testPromotedPropertyWithoutVisibilityModifier(): void {CODE
LOWtest/PhpParser/Node/ParamTest.php64 public function testNonPromotedPropertyIsNotPublic(): void {CODE
LOWtest/PhpParser/Node/PropertyHookTest.php54 public function testGetStmtsSetHookFromParser(): void {CODE
LOWtest/PhpParser/Node/PropertyHookTest.php82 public function testGetStmtsSetHookWithoutPropertyName(): void {CODE
LOWtest/PhpParser/Node/NameTest.php77 public function testSliceLengthTooLargeWithOffset(): void {CODE
LOWtest/PhpParser/Node/NameTest.php155 public static function provideTestIsSpecialClassName() {CODE
LOWtest/PhpParser/Node/IdentifierTest.php25 public static function provideTestIsSpecialClassName() {CODE
LOWtest/PhpParser/Node/Stmt/PropertyTest.php33 public function testStaticImplicitlyPublic(): void {CODE
LOWtest/PhpParser/Node/Expr/CallableLikeTest.php29 public static function provideTestIsFirstClassCallable() {CODE
LOWtest/PhpParser/Node/Scalar/StringTest.php45 public static function provideTestParseEscapeSequences() {CODE
LOWtest/PhpParser/Builder/FunctionTest.php115 public function testInvalidNullableVoidType(): void {CODE
LOWtest/PhpParser/Builder/MethodTest.php156 public function testAddStmtToAbstractMethodError(): void {CODE
LOWtest/PhpParser/Builder/MethodTest.php165 public function testMakeMethodWithStmtsAbstractError(): void {CODE
LOWtest/PhpParser/Builder/TraitUseTest.php44 public function testInvalidAdaptationNode(): void {CODE
LOWtest/PhpParser/Builder/TraitUseAdaptationTest.php11 protected function createTraitUseAdaptationBuilder($trait, $method) {CODE
LOWtest/PhpParser/Builder/TraitUseAdaptationTest.php64 public function testInsteadofOnNotPrecedence(): void {CODE
LOWtest/PhpParser/Builder/TraitUseAdaptationTest.php73 public function testInsteadofWithoutTrait(): void {CODE
LOWlib/PhpParser/BuilderHelpers.php87 public static function normalizeIdentifierOrExpr($name) {CODE
LOWlib/PhpParser/compatibility_tokens.php6 function defineCompatibilityTokens(): void {CODE
26 more matches not shown…
Over-Commented Block2 hits · 2 pts
SeverityFileLineSnippetContext
LOWlib/PhpParser/Comment.php121 $text = str_replace("\r\n", "\n", $this->text);COMMENT
LOWlib/PhpParser/Comment.php141 // /*COMMENT