Yii 2: The Fast, Secure and Professional PHP Framework
This report presents the forensic synthetic code analysis of yiisoft/yii2, a PHP project with 14,300 GitHub stars. SynthScan v2.0 examined 427,301 lines of code across 1933 source files, recording 1280 pattern matches distributed across 4 syntactic categories. The overall adjusted score of 3.1 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 1280 distinct pattern matches across 4 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 | framework/UPGRADE.md | 1165 | `public static function findIdentityByAccessToken($token, $type = null)`. The new `$type` parameter | CODE |
| LOW | framework/filters/PageCache.php | 283 | private function insertResponseCookieCollectionIntoData(Response $response, array &$data) | CODE |
| LOW | framework/filters/PageCache.php | 307 | private function insertResponseHeaderCollectionIntoData(Response $response, array &$data) | CODE |
| LOW | framework/rbac/DbManager.php | 579 | protected function getDirectPermissionsByUser($userId) | CODE |
| LOW | framework/rbac/DbManager.php | 603 | protected function getInheritedPermissionsByUser($userId) | CODE |
| LOW | framework/rbac/PhpManager.php | 491 | protected function getDirectPermissionsByUser($userId) | CODE |
| LOW | framework/rbac/PhpManager.php | 511 | protected function getInheritedPermissionsByUser($userId) | CODE |
| LOW | framework/di/Container.php | 660 | public function resolveCallableDependencies(callable $callback, $params = []) | CODE |
| LOW | framework/web/Controller.php | 208 | private function filterSingleTypeActionParam($param, $type) | CODE |
| LOW | framework/web/Controller.php | 253 | private function filterUnionTypeActionParam($param, $type) | CODE |
| LOW | framework/web/Response.php | 825 | protected function getDispositionHeaderValue($disposition, $attachmentName) | CODE |
| LOW | framework/web/Session.php | 520 | public function getUseTransparentSessionID() | CODE |
| LOW | framework/web/Session.php | 531 | public function setUseTransparentSessionID($value) | CODE |
| LOW | framework/web/User.php | 593 | protected function getIdentityAndDurationFromCookie() | CODE |
| LOW | framework/web/IdentityInterface.php | 25 | * public static function findIdentityByAccessToken($token, $type = null) | COMMENT |
| LOW | framework/web/IdentityInterface.php | 77 | public static function findIdentityByAccessToken($token, $type = null); | CODE |
| LOW | framework/web/UrlRule.php | 577 | protected function substitutePlaceholderNames(array $matches) | CODE |
| LOW | framework/web/Request.php | 1507 | public function getAcceptableContentTypes() | CODE |
| LOW | framework/web/Request.php | 1528 | public function setAcceptableContentTypes($value) | CODE |
| LOW | framework/web/Request.php | 1921 | private function validateCsrfTokenInternal($clientSuppliedToken, $trueToken) | CODE |
| LOW | framework/web/Request.php | 1941 | protected function getSecureForwardedHeaderTrustedPart($token) | CODE |
| LOW | framework/web/Request.php | 1963 | protected function getSecureForwardedHeaderTrustedParts() | CODE |
| LOW | framework/web/Request.php | 1998 | protected function getSecureForwardedHeaderParts() | CODE |
| LOW | framework/web/ErrorHandler.php | 442 | public function createServerInformationLink() | CODE |
| LOW | framework/web/ErrorHandler.php | 470 | public function createFrameworkVersionLink() | CODE |
| LOW | framework/behaviors/CacheableWidgetBehavior.php | 189 | private function getFragmentCacheConfiguration() | CODE |
| LOW | framework/behaviors/AttributeTypecastBehavior.php | 197 | public static function clearAutoDetectedAttributeTypes() | CODE |
| LOW | framework/db/Connection.php | 843 | private function rollbackTransactionOnLevel($transaction, $level) | CODE |
| LOW | framework/db/Connection.php | 905 | private function restoreQueryBuilderConfiguration() | CODE |
| LOW | framework/db/Command.php | 1243 | protected function requireTableSchemaRefresh($name) | CODE |
| LOW | framework/db/Schema.php | 332 | public function createColumnSchemaBuilder($type, $length = null) | CODE |
| LOW | framework/db/Schema.php | 419 | public function setTransactionIsolationLevel($level) | CODE |
| LOW | framework/db/Schema.php | 833 | private function loadTableMetadataFromCache($cache, $name) | CODE |
| LOW | framework/db/Query.php | 759 | protected function getUnaliasedColumnsFromSelect() | CODE |
| LOW | framework/db/QueryBuilder.php | 168 | protected function defaultExpressionBuilders() | CODE |
| LOW | framework/db/QueryBuilder.php | 411 | protected function prepareInsertSelectSubQuery($columns, $schema, $params = []) | CODE |
| LOW | framework/db/QueryBuilder.php | 576 | private function getTableUniqueColumnNames($name, $columns, &$constraints = []) | CODE |
| LOW | framework/db/oci/Schema.php | 277 | public function createColumnSchemaBuilder($type, $length = null) | CODE |
| LOW | framework/db/oci/QueryBuilder.php | 58 | protected function defaultExpressionBuilders() | CODE |
| LOW | framework/db/sqlite/Schema.php | 222 | public function createColumnSchemaBuilder($type, $length = null) | CODE |
| LOW | framework/db/sqlite/Schema.php | 373 | public function setTransactionIsolationLevel($level) | CODE |
| LOW | framework/db/sqlite/QueryBuilder.php | 58 | protected function defaultExpressionBuilders() | CODE |
| LOW | framework/db/sqlite/conditions/InConditionBuilder.php | 38 | protected function buildCompositeInCondition($operator, $columns, $values, &$params) | CODE |
| LOW | framework/db/cubrid/Schema.php | 358 | public function setTransactionIsolationLevel($level) | CODE |
| LOW | framework/db/cubrid/Schema.php | 381 | public function createColumnSchemaBuilder($type, $length = null) | CODE |
| LOW | framework/db/cubrid/QueryBuilder.php | 55 | protected function defaultExpressionBuilders() | CODE |
| LOW | framework/db/mysql/Schema.php | 525 | public function createColumnSchemaBuilder($type, $length = null) | CODE |
| LOW | framework/db/mysql/QueryBuilder.php | 65 | protected function defaultExpressionBuilders() | CODE |
| LOW | framework/db/mysql/QueryBuilder.php | 389 | private function supportsFractionalSeconds() | CODE |
| LOW | framework/db/conditions/InConditionBuilder.php | 198 | protected function buildCompositeInCondition($operator, $columns, $values, &$params) | CODE |
| LOW | framework/db/conditions/InConditionBuilder.php | 253 | protected function getRawValuesFromTraversableObject(\Traversable $traversableObject) | CODE |
| LOW | framework/db/pgsql/Schema.php | 403 | protected function getUniqueIndexInformation($table) | CODE |
| LOW | framework/db/pgsql/QueryBuilder.php | 96 | protected function defaultExpressionBuilders() | CODE |
| LOW | framework/db/mssql/Schema.php | 827 | public function createColumnSchemaBuilder($type, $length = null) | CODE |
| LOW | framework/db/mssql/QueryBuilder.php | 56 | protected function defaultExpressionBuilders() | CODE |
| LOW | framework/db/mssql/conditions/InConditionBuilder.php | 38 | protected function buildCompositeInCondition($operator, $columns, $values, &$params) | CODE |
| LOW | framework/log/Dispatcher.php | 218 | protected function generateTargetFailErrorMessage($target, $throwable, $method) | CODE |
| LOW | framework/validators/ExistValidator.php | 123 | private function checkTargetRelationExistence($model, $attribute) | CODE |
| LOW | framework/validators/ExistValidator.php | 155 | private function checkTargetAttributeExistence($model, $attribute) | CODE |
| LOW | framework/i18n/Formatter.php | 1849 | private function setFormatterTextAttribute($formatter, $attribute, $value, $source, $alternative) | CODE |
| 1114 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | framework/db/sqlite/Command.php | 108 | $phName = ltrim($match['placeholder'], ':'); | CODE |
| LOW | framework/log/Dispatcher.php | 39 | * 'to' => 'admin@example.com', | COMMENT |
| LOW⚡ | framework/helpers/BaseConsole.php | 745 | * The first line will **not** be indented, so `Console::wrapText("Lorem ipsum dolor sit amet.", 4)` will result in | COMMENT |
| LOW⚡ | framework/helpers/BaseConsole.php | 745 | * The first line will **not** be indented, so `Console::wrapText("Lorem ipsum dolor sit amet.", 4)` will result in | COMMENT |
| LOW⚡ | framework/helpers/BaseConsole.php | 749 | * Lorem ipsum | COMMENT |
| LOW | framework/helpers/BaseHtml.php | 1460 | if (isset($options['placeholder']) && $options['placeholder'] === true) { | CODE |
| LOW | framework/helpers/BaseHtml.php | 1462 | $options['placeholder'] = $model->getAttributeLabel($attribute); | CODE |
| LOW | tests/framework/mail/BaseMailerTest.php | 242 | <p>Test Lorem ipsum...</p> | CODE |
| LOW | tests/framework/mail/BaseMailerTest.php | 252 | Test Lorem ipsum... | CODE |
| LOW | tests/framework/web/UrlManagerCreateUrlTest.php | 753 | $this->assertEquals('/user/show?name=John+Doe', $manager->createUrl(['user/show', 'name' => 'John Doe'])); | CODE |
| LOW | tests/framework/web/UrlManagerCreateUrlTest.php | 765 | $this->assertEquals('/user/profile?name=John+Doe', $manager->createUrl(['user/profile', 'name' => 'John Doe'])); | CODE |
| LOW | tests/framework/web/UrlManagerCreateUrlTest.php | 795 | $this->assertEquals('/user/show?name=John+Doe', $manager->createUrl(['user/show', 'name' => 'John Doe'])); | CODE |
| LOW⚡ | tests/framework/behaviors/AttributeBehaviorTest.php | 73 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributeBehaviorTest.php | 75 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributeBehaviorTest.php | 79 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributeBehaviorTest.php | 81 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributeBehaviorTest.php | 85 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributeBehaviorTest.php | 87 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributeBehaviorTest.php | 93 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributesBehaviorTest.php | 73 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributesBehaviorTest.php | 75 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributesBehaviorTest.php | 79 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributesBehaviorTest.php | 81 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributesBehaviorTest.php | 85 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributesBehaviorTest.php | 87 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributesBehaviorTest.php | 93 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributesBehaviorTest.php | 131 | 'John Doe', // name | CODE |
| LOW⚡ | tests/framework/behaviors/AttributesBehaviorTest.php | 135 | 'John Doe', | CODE |
| LOW⚡ | tests/framework/behaviors/AttributesBehaviorTest.php | 138 | 'John Doe', // name | CODE |
| LOW | tests/framework/db/QueryTest.php | 486 | $query->andFilterCompare('name', 'John Doe'); | CODE |
| LOW | tests/framework/db/QueryTest.php | 487 | $condition = ['=', 'name', 'John Doe']; | CODE |
| LOW | tests/framework/db/ActiveRecordTest.php | 1150 | $this->assertEquals('John Doe', $dossier->employee->fullName); | CODE |
| LOW⚡ | tests/framework/helpers/HtmlTest.php | 2189 | $html = Html::activeTextInput($model, 'name', ['placeholder' => true]); | CODE |
| LOW⚡ | tests/framework/helpers/HtmlTest.php | 2198 | $html = Html::activeTextInput($model, 'name', ['placeholder' => 'Custom placeholder']); | CODE |
| LOW⚡ | tests/framework/helpers/HtmlTest.php | 2207 | $html = Html::activeTextInput($model, '[0]name', ['placeholder' => true]); | CODE |
| LOW⚡ | tests/framework/helpers/HtmlTest.php | 2216 | $html = MyHtml::activeTextInput($model, 'name', ['placeholder' => true]); | CODE |
| LOW | tests/framework/helpers/StringHelperTest.php | 140 | $this->assertEquals('lorem ipsum', StringHelper::truncateWords('lorem ipsum', 3, '...', true)); | CODE |
| LOW | tests/framework/helpers/StringHelperTest.php | 141 | $this->assertEquals(' lorem ipsum', StringHelper::truncateWords(' lorem ipsum', 3, '...', true)); | CODE |
| LOW⚡ | tests/framework/base/ArrayableTraitTest.php | 82 | $this->assertSame('John Doe', $result['fullName']); | CODE |
| LOW⚡ | tests/framework/base/ArrayableTraitTest.php | 316 | $model->email = 'test@test.com'; | CODE |
| LOW⚡ | tests/framework/base/ArrayableTraitTest.php | 320 | $this->assertSame('test@test.com', $result['email']); | CODE |
| LOW⚡ | tests/framework/base/ArrayableTraitTest.php | 327 | $item->email = 'test@test.com'; | CODE |
| LOW⚡ | tests/framework/widgets/ActiveFieldTest.php | 680 | 'options' => ['placeholder' => 'pholder_direct'], | CODE |
| LOW⚡ | tests/framework/widgets/ActiveFieldTest.php | 686 | 'options' => ['placeholder' => 'pholder_direct'], | CODE |
| LOW⚡ | tests/framework/widgets/ActiveFieldTest.php | 692 | $this->activeField->inputOptions = ['placeholder' => 'pholder_input']; | CODE |
| LOW⚡ | tests/framework/widgets/ActiveFieldTest.php | 699 | $this->activeField->inputOptions = ['placeholder' => 'pholder_both_input']; | CODE |
| LOW⚡ | tests/framework/widgets/ActiveFieldTest.php | 702 | 'options' => ['placeholder' => 'pholder_both_direct'] | CODE |
| LOW | docs/documentation_style_guide.md | 82 | "Jane Doe", | CODE |
| LOW | docs/documentation_style_guide.md | 83 | "John Doe" | CODE |
| LOW | docs/guide/rest-resources.md | 193 | "email": "user@example.com", | CODE |
| LOW | docs/guide/runtime-logging.md | 88 | 'to' => ['admin@example.com', 'developer@example.com'], | CODE |
| LOW | docs/guide/db-query-builder.md | 425 | $query->andFilterCompare('name', 'John Doe'); | CODE |
| LOW | docs/guide/rest-quick-start.md | 167 | -d '{"username": "example", "email": "user@example.com"}' | CODE |
| LOW | docs/guide/rest-quick-start.md | 175 | {"id":1,"username":"example","email":"user@example.com","created_at":1414674789,"updated_at":1414674789} | CODE |
| LOW | docs/guide/helper-html.md | 389 | <?= Html::mailto('Contact us', 'admin@example.com') ?> | CODE |
| LOW | docs/guide/helper-array.md | 380 | 'admin' => 'admin@example.com', | CODE |
| LOW | docs/guide/helper-array.md | 417 | 'admin' => 'admin@example.com', | CODE |
| LOW | docs/guide-ja/rest-resources.md | 193 | "email": "user@example.com", | CODE |
| LOW | docs/guide-ja/runtime-logging.md | 88 | 'to' => ['admin@example.com', 'developer@example.com'], | CODE |
| LOW | docs/guide-ja/db-query-builder.md | 425 | $query->andFilterCompare('name', 'John Doe'); | CODE |
| 32 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | framework/messages/config.php | 21 | ], | COMMENT |
| LOW | framework/views/messageConfig.php | 21 | // messages will be separated from the old (translated) ones. | COMMENT |
| LOW | tests/framework/db/QueryBuilderTest.php | 241 | //[ | COMMENT |
| LOW | tests/framework/db/QueryBuilderTest.php | 861 | 'cubrid' => 'varchar', | COMMENT |
| LOW | tests/data/web/assetSources/js/jquery.js | 1 | // Let's imagine this is a jQuery plugin :) | COMMENT |
| LOW | docs/guide/helper-array.md | 261 | ['id' => '124', 'name' => 'bbb', 'class' => 'x'], | COMMENT |
| LOW | docs/guide/helper-array.md | 581 | // 'a.b' => 'string', | COMMENT |
| LOW | docs/guide-ja/helper-array.md | 261 | ['id' => '124', 'name' => 'bbb', 'class' => 'x'], | COMMENT |
| LOW | docs/guide-ru/helper-array.md | 201 | // ] | COMMENT |
| LOW | docs/guide-ru/helper-array.md | 441 | ]; | COMMENT |
| LOW | docs/guide-fr/helper-array.md | 201 | // le résultat est : | COMMENT |
| LOW | docs/guide-es/helper-array.md | 221 | COMMENT | |
| LOW | docs/guide-zh-CN/helper-array.md | 261 | ['id' => '124', 'name' => 'bbb', 'class' => 'x'], | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | framework/data/ActiveDataFilter.php | 57 | * used in [[\yii\db\QueryInterface::where()]]. However, you may want to adjust it in some special cases. | COMMENT |