At a glance
- Files analysed
- 53
- Findings
- 7
- Errors
- 0
- Warnings
- 7
platform PHP: Symfony (composer.json requires symfony/framework-bundle; bin/console)
not analysed: 191 files (XML 59, Twig 32, YAML 30, SVG 29, JavaScript 9, SCSS 5, binary 4, JSON 3, Markdown 3, CSS 2, Ignore List 2, NEON 2, ApacheConf 1, EditorConfig 1, JSON with Comments 1, Shell 1, Text 1, demo 1, dev 1, lock 1, robots.txt 1, test 1, unknown 1)
What it checks
Checked today
- Size: long files, classes and functions
- Complexity: functions and file level code with too many paths
- Naming: mixed styles in a file, generic, one letter and very long names
- Duplication: blocks repeated inside a file, even with renamed variables
- Security:
eval, shell commands, unserialize and includes built from data, SQL with values pasted in, request input never sanitized, output never escaped
Not checked yet
- Symfony rules: best practices for controllers, services and templates
- Security checks: hard coded secrets
- Tests: whether there are any, and how much test code there is next to the app code
- Repository hygiene:
.gitignore, a lockfile, no committed vendor/ or .env, a README with setup steps
The security checks read one call or statement at a time and never follow a value through variables, so they show where to look, not proof of a hole. A long or branchy function is common in a large, mature project; each finding is a place worth a closer look, not a judgement of the code as a whole.
Findings by check
A value equal to a limit is no finding.
Where they concentrate
The 10 files with the most findings
Findings per top level folder
Grades
AOverall: 99 out of 100
3 of 5 metrics graded
round((3 × 100Complexity+2 × 98Duplication+1 × 99Naming) ÷ 6) = 99
Weights: Complexity 3, Duplication 2, Naming 1. Size and Security are not graded, so they are left out and the other weights are rescaled.
A summary of the grades below, which you can recompute. Not a pass mark, and not a hiring decision.
The table shows how many files got each letter. A file with nothing to judge for a metric gets no grade for it. The whole project column pools every file's grade, so a file with more code to judge counts for more. The overall above weights those whole project grades. In the full engine output these are CodeLength, CyclomaticComplexity, Duplication, NamingConvention and Security.
Security
Findings only, never a grade: a wrong security grade would hurt more than none. A finding the author already silenced with a phpcs comment counts as suppressed, apart from Errors and Warnings, so you can tell reviewed code from unreviewed code.
8 rules ran over 41 files, none found anything.
The 10 worst places
Security findings are listed in their own section above. A place is a file and a line, so a function that is both too long and too complex shows once, with both findings. Places rank by their worst finding: errors first, then by how far the measured value goes beyond its limit. Each message is the engine's own, word for word.
#1 demo-3.1.0/config/bundles.php:13
| 13 | Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], |
| 14 | Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], |
| 15 | Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true], |
| 16 | Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true], |
| 17 | Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true], |
| 18 | Symfonycasts\SassBundle\SymfonycastsSassBundle::class => ['all' => true], |
| 19 | Symfony\UX\Icons\UXIconsBundle::class => ['all' => true], |
| 20 | ]; |
#2 demo-3.1.0/src/EventSubscriber/RedirectToPreferredLocaleSubscriber.php:30
| 30 | final class RedirectToPreferredLocaleSubscriber implements EventSubscriberInterface |
| 31 | { |
| 32 | public function __construct( |
| 33 | private readonly UrlGeneratorInterface $urlGenerator, |
| 34 | /** @var string[] */ |
| 35 | private array $enabledLocales, |
| 36 | private ?string $defaultLocale = null, |
| 37 | ) { |
| 38 | if (empty($this->enabledLocales)) { |
| 39 | throw new \UnexpectedValueException('The list of supported locales must not be empty.'); |
#3 demo-3.1.0/src/Command/AddUserCommand.php:91
| 91 | protected function interact(InputInterface $input, OutputInterface $output): void |
| 92 | { |
| 93 | /** @var string|null $username */ |
| 94 | $username = $input->getArgument('username'); |
| 95 | /** @var string|null $password */ |
| 96 | $password = $input->getArgument('password'); |
| 97 | /** @var string|null $email */ |
| 98 | $email = $input->getArgument('email'); |
| 99 | /** @var string|null $fullName */ |
| 100 | $fullName = $input->getArgument('full-name'); |
#4 demo-3.1.0/src/Controller/UserController.php:63
| 63 | Request $request, |
| 64 | EntityManagerInterface $entityManager, |
| 65 | Security $security, |
| 66 | ): Response { |
| 67 | $form = $this->createForm(ChangePasswordType::class, $user); |
| 68 | $form->handleRequest($request); |
| 69 | |
| 70 | if ($form->isSubmitted() && $form->isValid()) { |
| 71 | $entityManager->flush(); |
| 72 | |
#5 demo-3.1.0/tests/Form/DataTransformer/TagArrayToStringTransformerTest.php:24
| 24 | final class TagArrayToStringTransformerTest extends TestCase |
| 25 | { |
| 26 | /** |
| 27 | * Ensures that tags are created correctly. |
| 28 | */ |
| 29 | public function testCreateTheRightAmountOfTags(): void |
| 30 | { |
| 31 | $tags = $this->getMockedTransformer()->reverseTransform('Hello, Demo, How'); |
| 32 | |
| 33 | $this->assertCount(3, $tags); |
#6 demo-3.1.0/src/Entity/User.php:161
| 161 | public function __unserialize(array $data): void |
| 162 | { |
| 163 | [$this->id, $this->username, $this->password] = $data; |
| 164 | } |
| 165 | } |
#7 demo-3.1.0/src/Twig/SourceCodeExtension.php:136
| 136 | $r = new \ReflectionObject($callable); |
| 137 | |
| 138 | return $r->getMethod('__invoke'); |
| 139 | } |
| 140 | |
| 141 | return new \ReflectionFunction($callable); |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * @return array{file_path: string|false, starting_line: int, source_code: string} |
Full engine output
All 7 findings, exactly as the engine printed them: symfony-demo.txt (plain text).