Diff implementation
This report presents the forensic synthetic code analysis of sebastianbergmann/diff, a PHP project with 7,656 GitHub stars. SynthScan v2.0 examined 6,324 lines of code across 44 source files, recording 60 pattern matches distributed across 1 syntactic category. The overall adjusted score of 9.5 places this repository in the Low AI signal 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).
Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.
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 60 distinct pattern matches across 1 syntactic category. 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 | README.md | 119 | [content:SebastianBergmann\Diff\Line:private] => public function tes | CODE |
| LOW | README.md | 125 | [content:SebastianBergmann\Diff\Line:private] => public function tes | CODE |
| LOW | tests/MyersDiffTest.php | 64 | public function testCompletelyDistinctSequences(): void | CODE |
| LOW | tests/MyersDiffTest.php | 81 | public function testSingleSubstitutionInMiddle(): void | CODE |
| LOW | tests/MyersDiffTest.php | 145 | public function testReversedSequenceProducesOptimalEditDistance(): void | CODE |
| LOW | tests/DiffTest.php | 22 | public function testGettersAfterConstructionWithDefault(): void | CODE |
| LOW | tests/DiffTest.php | 33 | public function testGettersAfterConstructionWithChunks(): void | CODE |
| LOW | tests/DiffTest.php | 46 | public function testSetChunksAfterConstruction(): void | CODE |
| LOW | tests/ParserTest.php | 81 | public function testParseWithMultipleChunks(): void | CODE |
| LOW | tests/ParserTest.php | 106 | public function testParseWithSpacesInFileNames(): void | CODE |
| LOW | tests/ParserTest.php | 128 | public function testParseWithSpacesInFileNamesAndTimestamp(): void | CODE |
| LOW | tests/ParserTest.php | 149 | public function testParseWithRemovedLines(): void | CODE |
| LOW | tests/ParserTest.php | 189 | public function testParseDiffForMultipleFiles(): void | CODE |
| LOW | tests/DifferTest.php | 275 | public static function provideSplitStringByLinesCases(): array | CODE |
| LOW | tests/DifferTest.php | 359 | public function testArrayRepresentationOfDiffCanBeRendered(array $expected, array|string $from, array|string $to): v | CODE |
| LOW | tests/DifferTest.php | 365 | public function testTextRepresentationOfDiffCanBeRendered(string $expected, string $from, string $to): void | CODE |
| LOW | tests/Output/DiffOnlyOutputBuilderTest.php | 34 | public static function textForNoNonDiffLinesProvider(): array | CODE |
| LOW | tests/Output/DiffOnlyOutputBuilderTest.php | 73 | public function testDiffDoNotShowNonDiffLines(string $expected, string $from, string $to, string $header = ''): void | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 38 | public static function provideOutputBuildingCases(): array | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 54 | public static function provideBasicDiffGeneration(): array | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 72 | public static function provideConfiguredDiffGeneration(): array | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 222 | public static function provideInvalidConfiguration(): array | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 283 | public static function provideCommonLineThresholdCases(): array | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 331 | public static function provideContextLineConfigurationCases(): array | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 596 | public function testConfiguredDiffGeneration(string $expected, string $from, string $to, array $config = []): void | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 646 | public function testCustomHeaderCanBeProvided(): void | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 658 | public function testCustomHeaderTakesPrecedenceOverFromFileAndToFile(): void | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 674 | public function testCustomHeaderWithoutTrailingNewlineGetsOneAppended(): void | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 686 | public function testLineNumbersCanBeOmittedFromHunkHeader(): void | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 700 | public function testNoLineEndEofWarningCanBeSuppressed(): void | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 714 | public function testDiffLineEndWarningIsEmittedWhenEnabled(): void | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 729 | public function testDiffLineEndWarningIsSuppressedByDefault(): void | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 742 | public function testInvalidAddLineNumbersOptionIsRejected(): void | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 754 | public function testInvalidEmitNoLineEndEofWarningOptionIsRejected(): void | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 766 | public function testInvalidEmitDiffLineEndWarningOptionIsRejected(): void | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 778 | public function testInvalidHeaderOptionIsRejected(): void | CODE |
| LOW | tests/Output/StrictUnifiedDiffOutputBuilderTest.php | 813 | public function testContextLineConfiguration(string $expected, string $from, string $to, int $contextLines, int $com | CODE |
| LOW | …/Output/StrictUnifiedDiffOutputBuilderDataProvider.php | 30 | public static function provideOutputBuildingCases(): array | CODE |
| LOW | …/Output/StrictUnifiedDiffOutputBuilderDataProvider.php | 138 | public static function provideBasicDiffGeneration(): array | CODE |
| LOW | …tion/StrictUnifiedDiffOutputBuilderIntegrationTest.php | 52 | public static function provideOutputBuildingCases(): array | CODE |
| LOW | …tion/StrictUnifiedDiffOutputBuilderIntegrationTest.php | 68 | public static function provideBasicDiffGeneration(): array | CODE |
| LOW | …tion/StrictUnifiedDiffOutputBuilderIntegrationTest.php | 129 | public function testIntegrationUsingPHPFileInVendorGitApply(string $fileFrom, string $fileTo): void | CODE |
| LOW | …tion/StrictUnifiedDiffOutputBuilderIntegrationTest.php | 147 | public function testIntegrationUsingPHPFileInVendorPatch(string $fileFrom, string $fileTo): void | CODE |
| LOW | …tion/StrictUnifiedDiffOutputBuilderIntegrationTest.php | 170 | public function testIntegrationOfUnitTestCasesGitApply(string $expected, string $from, string $to, ?array $options = | CODE |
| LOW | …tion/StrictUnifiedDiffOutputBuilderIntegrationTest.php | 181 | public function testIntegrationOfUnitTestCasesPatch(string $expected, string $from, string $to, ?array $options = nu | CODE |
| LOW | …tion/StrictUnifiedDiffOutputBuilderIntegrationTest.php | 187 | public function testIntegrationDiffOutputBuilderVersusDiffCommand(string $diff, string $from, string $to): void | CODE |
| LOW | …tion/StrictUnifiedDiffOutputBuilderIntegrationTest.php | 214 | private function doIntegrationTestGitApply(string $diff, string $from): void | CODE |
| LOW | tests/Utils/UnifiedDiffAssertTraitTest.php | 69 | public function testInvalidStartWithoutHeader(): void | CODE |
| LOW | tests/Utils/UnifiedDiffAssertTraitTest.php | 302 | public function testUnexpectedDuplicateNoNewLineEOF(): void | CODE |
| LOW | tests/Utils/UnifiedDiffAssertTraitTest.php | 388 | public function testUnexpectedEOFFromMissingLines(): void | CODE |
| LOW | tests/Utils/UnifiedDiffAssertTraitTest.php | 404 | public function testUnexpectedEOFToMissingLines(): void | CODE |
| LOW | tests/Utils/UnifiedDiffAssertTraitTest.php | 420 | public function testUnexpectedEOFBothFromAndToMissingLines(): void | CODE |
| LOW | tests/Utils/UnifiedDiffAssertTrait.php | 30 | public function assertValidUnifiedDiffFormat(string $diff): void | CODE |
| LOW | tests/Utils/UnifiedDiffAssertTrait.php | 189 | private function unifiedDiffAssertLinePrefix(string $line, string $message): string | CODE |
| LOW | tests/Utils/UnifiedDiffAssertTrait.php | 205 | private function unifiedDiffAssertStrLength(string $line, int $min, string $message): void | CODE |
| LOW | tests/Utils/UnifiedDiffAssertTrait.php | 221 | private function unifiedDiffAssertHeaderLine(string $line, string $start, string $message): void | CODE |
| LOW | tests/Utils/UnifiedDiffAssertTrait.php | 245 | private function unifiedDiffAssertHeaderDate(string $date, string $message): void | CODE |
| LOW | tests/Utils/UnifiedDiffAssertTrait.php | 264 | private function unifiedDiffAssertHunkHeader(string $line, string $message): array | CODE |
| LOW | tests/Exception/ConfigurationExceptionTest.php | 22 | public function testConstructWithDefaults(): void | CODE |
| LOW | src/Differ.php | 110 | private function detectUnmatchedLineEndings(array $diff): bool | CODE |