Yii 2: The Fast, Secure and Professional PHP Framework
This report summarizes scanner evidence for yiisoft/yii2, a PHP project with 14,277 GitHub stars. SynthScan examined 435,542 lines of code across 1963 source files, recording 1487 pattern matches distributed across 4 syntactic categories. The legacy adjusted pattern signal is 3.5 (Low 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.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 1395 finding(s).
Are imports declared and package/API names verified? 92 finding(s).
Are wrappers, guards, and repeated structures necessary? 1381 finding(s).
Which changes need focused human review? 1487 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 1487 distinct pattern matches across 4 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 | framework/UPGRADE.md | 1197 | `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 | 581 | protected function getDirectPermissionsByUser($userId) | CODE |
| LOW | framework/rbac/DbManager.php | 605 | protected function getInheritedPermissionsByUser($userId) | CODE |
| LOW | framework/rbac/PhpManager.php | 493 | protected function getDirectPermissionsByUser($userId) | CODE |
| LOW | framework/rbac/PhpManager.php | 513 | protected function getInheritedPermissionsByUser($userId) | CODE |
| LOW | framework/di/Container.php | 660 | public function resolveCallableDependencies(callable $callback, $params = []) | CODE |
| LOW | framework/web/Controller.php | 210 | private function filterSingleTypeActionParam($param, $type) | CODE |
| LOW | framework/web/Controller.php | 255 | private function filterUnionTypeActionParam($param, $type) | CODE |
| LOW | framework/web/Response.php | 825 | protected function getDispositionHeaderValue($disposition, $attachmentName) | CODE |
| LOW | framework/web/Session.php | 523 | public function getUseTransparentSessionID() | CODE |
| LOW | framework/web/Session.php | 534 | public function setUseTransparentSessionID($value) | CODE |
| LOW | framework/web/User.php | 600 | 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 | 1513 | public function getAcceptableContentTypes() | CODE |
| LOW | framework/web/Request.php | 1534 | public function setAcceptableContentTypes($value) | CODE |
| LOW | framework/web/Request.php | 1927 | private function validateCsrfTokenInternal($clientSuppliedToken, $trueToken) | CODE |
| LOW | framework/web/Request.php | 1947 | protected function getSecureForwardedHeaderTrustedPart($token) | CODE |
| LOW | framework/web/Request.php | 1969 | protected function getSecureForwardedHeaderTrustedParts() | CODE |
| LOW | framework/web/Request.php | 2004 | 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 | 59 | 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 | 59 | 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 | 524 | 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 | 197 | protected function buildCompositeInCondition($operator, $columns, $values, &$params) | CODE |
| LOW | framework/db/conditions/InConditionBuilder.php | 252 | protected function getRawValuesFromTraversableObject(\Traversable $traversableObject) | CODE |
| LOW | framework/db/pgsql/Schema.php | 403 | protected function getUniqueIndexInformation($table) | CODE |
| LOW | framework/db/pgsql/QueryBuilder.php | 97 | protected function defaultExpressionBuilders() | CODE |
| LOW | framework/db/mssql/Schema.php | 827 | public function createColumnSchemaBuilder($type, $length = null) | CODE |
| LOW | framework/db/mssql/QueryBuilder.php | 57 | 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 | 221 | 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 | 1851 | private function setFormatterTextAttribute($formatter, $attribute, $value, $source, $alternative) | CODE |
| 1321 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 | 1149 | $this->assertEquals('John Doe', $dossier->employee->fullName); | CODE |
| LOW⚡ | tests/framework/helpers/HtmlTest.php | 2237 | $html = Html::activeTextInput($model, 'name', ['placeholder' => true]); | CODE |
| LOW⚡ | tests/framework/helpers/HtmlTest.php | 2246 | $html = Html::activeTextInput($model, 'name', ['placeholder' => 'Custom placeholder']); | CODE |
| LOW⚡ | tests/framework/helpers/HtmlTest.php | 2255 | $html = Html::activeTextInput($model, '[0]name', ['placeholder' => true]); | CODE |
| LOW⚡ | tests/framework/helpers/HtmlTest.php | 2264 | $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 | 'sqlsrv' => 'nvarchar(max)', | 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 |