VSVverkeerskunde/gvq-api

View on GitHub
src/Account/Controllers/AccountViewController.php

Summary

Maintainability
F
4 days
Test Coverage

File AccountViewController.php has 485 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php declare(strict_types=1);

namespace VSV\GVQ_API\Account\Controllers;

use Ramsey\Uuid\Uuid;
Severity: Minor
Found in src/Account/Controllers/AccountViewController.php - About 7 hrs to fix

    The class AccountViewController has an overall complexity of 67 which is very high. The configured complexity threshold is 50.
    Open

    class AccountViewController extends AbstractController
    {
        /**
         * @var RegistrationFormType
         */

    The class AccountViewController has 15 public methods. Consider refactoring AccountViewController to keep number of public methods under 10.
    Open

    class AccountViewController extends AbstractController
    {
        /**
         * @var RegistrationFormType
         */

    TooManyPublicMethods

    Since: 0.1

    A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

    By default it ignores methods starting with 'get' or 'set'.

    Example

    Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

    AccountViewController has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class AccountViewController extends AbstractController
    {
        /**
         * @var RegistrationFormType
         */
    Severity: Minor
    Found in src/Account/Controllers/AccountViewController.php - About 2 hrs to fix

      Method sendActivation has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function sendActivation(Request $request, string $id): Response
          {
              $user = $this->userRepository->getById(Uuid::fromString($id));
      
              if (!$user) {
      Severity: Major
      Found in src/Account/Controllers/AccountViewController.php - About 2 hrs to fix

        Method registerIframe has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function registerIframe(Request $request): Response
            {
                if (!$this->canRegister()) {
                    return new Response('', Response::HTTP_FORBIDDEN);
                }
        Severity: Minor
        Found in src/Account/Controllers/AccountViewController.php - About 1 hr to fix

          Method register has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function register(Request $request): Response
              {
                  if (!$this->canRegister()) {
                      return new Response('', Response::HTTP_FORBIDDEN);
                  }
          Severity: Minor
          Found in src/Account/Controllers/AccountViewController.php - About 1 hr to fix

            Function requestPassword has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                public function requestPassword(Request $request): Response
                {
                    $form = $this->createRequestPasswordForm();
                    $form->handleRequest($request);
            
            
            Severity: Minor
            Found in src/Account/Controllers/AccountViewController.php - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method requestPassword has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function requestPassword(Request $request): Response
                {
                    $form = $this->createRequestPasswordForm();
                    $form->handleRequest($request);
            
            
            Severity: Minor
            Found in src/Account/Controllers/AccountViewController.php - About 1 hr to fix

              Method __construct has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      TranslatorInterface $translator,
                      UuidFactoryInterface $uuidFactory,
                      UserRepository $userRepository,
                      CompanyRepository $companyRepository,
                      RegistrationRepository $registrationRepository,
              Severity: Major
              Found in src/Account/Controllers/AccountViewController.php - About 1 hr to fix

                Method login has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function login(Request $request): Response
                    {
                        $form = $this->createLoginForm();
                        $form->handleRequest($request);
                
                
                Severity: Minor
                Found in src/Account/Controllers/AccountViewController.php - About 1 hr to fix

                  Function login has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function login(Request $request): Response
                      {
                          $form = $this->createLoginForm();
                          $form->handleRequest($request);
                  
                  
                  Severity: Minor
                  Found in src/Account/Controllers/AccountViewController.php - About 45 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function activate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function activate(string $urlSuffix): Response
                      {
                          $registration = $this->registrationRepository->getByUrlSuffix(
                              new UrlSuffix($urlSuffix)
                          );
                  Severity: Minor
                  Found in src/Account/Controllers/AccountViewController.php - About 35 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  The method __construct has 10 parameters. Consider reducing the number of parameters to less than 10.
                  Open

                      public function __construct(
                          TranslatorInterface $translator,
                          UuidFactoryInterface $uuidFactory,
                          UserRepository $userRepository,
                          CompanyRepository $companyRepository,

                  This function has 10 parameters, which is greater than the 7 authorized.
                  Open

                      public function __construct(
                          TranslatorInterface $translator,
                          UuidFactoryInterface $uuidFactory,
                          UserRepository $userRepository,
                          CompanyRepository $companyRepository,

                  A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                  Noncompliant Code Example

                  With a maximum number of 4 parameters:

                  function doSomething($param1, $param2, $param3, $param4, $param5) {
                  ...
                  }
                  

                  Compliant Solution

                  function doSomething($param1, $param2, $param3, $param4) {
                  ...
                  }
                  

                  Reduce the number of returns of this function 4, down to the maximum allowed 3.
                  Open

                      public function register(Request $request): Response

                  Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function myFunction(){ // Noncompliant as there are 4 return statements
                    if (condition1) {
                      return true;
                    } else {
                      if (condition2) {
                        return false;
                      } else {
                        return true;
                      }
                    }
                    return false;
                  }
                  

                  Reduce the number of returns of this function 4, down to the maximum allowed 3.
                  Open

                      public function registerIframe(Request $request): Response

                  Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function myFunction(){ // Noncompliant as there are 4 return statements
                    if (condition1) {
                      return true;
                    } else {
                      if (condition2) {
                        return false;
                      } else {
                        return true;
                      }
                    }
                    return false;
                  }
                  

                  Class "AccountViewController" has 25 methods, which is greater than 20 authorized. Split it into smaller classes.
                  Open

                  class AccountViewController extends AbstractController

                  A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.

                  The class AccountViewController has a coupling between objects value of 28. Consider to reduce the number of dependencies under 13.
                  Open

                  class AccountViewController extends AbstractController
                  {
                      /**
                       * @var RegistrationFormType
                       */

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  Missing class import via use statement (line '477', column '24').
                  Open

                              $now = new \DateTimeImmutable();

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  The method createRegisterForm has a boolean flag argument $use_company_type, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                      private function createRegisterForm(bool $use_company_type = false): FormInterface

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                  The method __construct has a boolean flag argument $registrationsClosed, which is a certain sign of a Single Responsibility Principle violation.
                  Open

                          bool $registrationsClosed = false

                  BooleanArgumentFlag

                  Since: 1.4.0

                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                  Example

                  class Foo {
                      public function bar($flag = true) {
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                  Missing class import via use statement (line '704', column '17').
                  Open

                              new \DateTimeImmutable(),

                  MissingImport

                  Since: 2.7.0

                  Importing all external classes in a file through use statements makes them clearly visible.

                  Example

                  function make() {
                      return new \stdClass();
                  }

                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                  Avoid using static access to class '\VSV\GVQ_API\User\Repositories\Entities\UserEntity' in method 'login'.
                  Open

                                      $securityUser = UserEntity::fromUser($user);

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method requestPassword uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  return $this->redirectToRoute('accounts_view_request_password_success');
                              }

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  The method redirectToLandingPage uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              return $this->redirectToRoute('dashboard');
                          }

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  The method login uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                              } else {
                                  $this->addFlash('danger', $this->translator->trans('Credentials.invalid'));
                              }

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\VSV\GVQ_API\User\ValueObjects\Password' in method 'resetPassword'.
                  Open

                                  $user = $user->withPassword(Password::fromPlainText($data['password']));

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method activate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              return $this->render('accounts/activate_error.html.twig');
                          }

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\Ramsey\Uuid\Uuid' in method 'sendActivation'.
                  Open

                          $user = $this->userRepository->getById(Uuid::fromString($id));

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Define a constant instead of duplicating this literal "warning" 3 times.
                  Open

                                  $this->addFlash('warning', $this->translator->trans('Account.inactive'));

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "security.authorization_checker" 3 times.
                  Open

                              $this->get('security.authorization_checker')->isGranted('ROLE_ADMIN') ||

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "email" 3 times.
                  Open

                              $user = $this->userRepository->getByEmail(new Email($data['email']));

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Define a constant instead of duplicating this literal "translator" 5 times.
                  Open

                                  'translator' => $this->translator,

                  Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                  On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                  Noncompliant Code Example

                  With the default threshold of 3:

                  function run() {
                    prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                    execute('action1');
                    release('action1');
                  }
                  

                  Compliant Solution

                  ACTION_1 = 'action1';
                  
                  function run() {
                    prepare(ACTION_1);
                    execute(ACTION_1);
                    release(ACTION_1);
                  }
                  

                  Exceptions

                  To prevent generating some false-positives, literals having less than 5 characters are excluded.

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      public function registerIframe(Request $request): Response
                      {
                          if (!$this->canRegister()) {
                              return new Response('', Response::HTTP_FORBIDDEN);
                          }
                  Severity: Major
                  Found in src/Account/Controllers/AccountViewController.php and 1 other location - About 1 day to fix
                  src/Account/Controllers/AccountViewController.php on lines 229..278

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 263.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      public function register(Request $request): Response
                      {
                          if (!$this->canRegister()) {
                              return new Response('', Response::HTTP_FORBIDDEN);
                          }
                  Severity: Major
                  Found in src/Account/Controllers/AccountViewController.php and 1 other location - About 1 day to fix
                  src/Account/Controllers/AccountViewController.php on lines 173..222

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 263.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Avoid excessively long variable names like $registrationRepository. Keep variable name length under 20.
                  Open

                      private $registrationRepository;

                  LongVariable

                  Since: 0.2

                  Detects when a field, formal or local variable is declared with a long name.

                  Example

                  class Something {
                      protected $reallyLongIntName = -3; // VIOLATION - Field
                      public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                          $otherReallyLongName = -5; // VIOLATION - Local
                          for ($interestingIntIndex = 0; // VIOLATION - For
                               $interestingIntIndex < 10;
                               $interestingIntIndex++ ) {
                          }
                      }
                  }

                  Source https://phpmd.org/rules/naming.html#longvariable

                  Avoid excessively long variable names like $registrationRepository. Keep variable name length under 20.
                  Open

                          RegistrationRepository $registrationRepository,

                  LongVariable

                  Since: 0.2

                  Detects when a field, formal or local variable is declared with a long name.

                  Example

                  class Something {
                      protected $reallyLongIntName = -3; // VIOLATION - Field
                      public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                          $otherReallyLongName = -5; // VIOLATION - Local
                          for ($interestingIntIndex = 0; // VIOLATION - For
                               $interestingIntIndex < 10;
                               $interestingIntIndex++ ) {
                          }
                      }
                  }

                  Source https://phpmd.org/rules/naming.html#longvariable

                  Avoid excessively long variable names like $requestPasswordFormType. Keep variable name length under 20.
                  Open

                      private $requestPasswordFormType;

                  LongVariable

                  Since: 0.2

                  Detects when a field, formal or local variable is declared with a long name.

                  Example

                  class Something {
                      protected $reallyLongIntName = -3; // VIOLATION - Field
                      public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                          $otherReallyLongName = -5; // VIOLATION - Local
                          for ($interestingIntIndex = 0; // VIOLATION - For
                               $interestingIntIndex < 10;
                               $interestingIntIndex++ ) {
                          }
                      }
                  }

                  Source https://phpmd.org/rules/naming.html#longvariable

                  Avoid excessively long variable names like $current_activation_url. Keep variable name length under 20.
                  Open

                          $current_activation_url = '';

                  LongVariable

                  Since: 0.2

                  Detects when a field, formal or local variable is declared with a long name.

                  Example

                  class Something {
                      protected $reallyLongIntName = -3; // VIOLATION - Field
                      public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                          $otherReallyLongName = -5; // VIOLATION - Local
                          for ($interestingIntIndex = 0; // VIOLATION - For
                               $interestingIntIndex < 10;
                               $interestingIntIndex++ ) {
                          }
                      }
                  }

                  Source https://phpmd.org/rules/naming.html#longvariable

                  Avoid excessively long variable names like $resetPasswordFormType. Keep variable name length under 20.
                  Open

                      private $resetPasswordFormType;

                  LongVariable

                  Since: 0.2

                  Detects when a field, formal or local variable is declared with a long name.

                  Example

                  class Something {
                      protected $reallyLongIntName = -3; // VIOLATION - Field
                      public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                          $otherReallyLongName = -5; // VIOLATION - Local
                          for ($interestingIntIndex = 0; // VIOLATION - For
                               $interestingIntIndex < 10;
                               $interestingIntIndex++ ) {
                          }
                      }
                  }

                  Source https://phpmd.org/rules/naming.html#longvariable

                  Avoid variables with short names like $id. Configured minimum length is 3.
                  Open

                      public function sendActivation(Request $request, string $id): Response

                  ShortVariable

                  Since: 0.2

                  Detects when a field, local, or parameter has a very short name.

                  Example

                  class Something {
                      private $q = 15; // VIOLATION - Field
                      public static function main( array $as ) { // VIOLATION - Formal
                          $r = 20 + $this->q; // VIOLATION - Local
                          for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                              $r += $this->q;
                          }
                      }
                  }

                  Source https://phpmd.org/rules/naming.html#shortvariable

                  The parameter $use_company_type is not named in camelCase.
                  Open

                      private function createRegisterForm(bool $use_company_type = false): FormInterface
                      {
                          $formBuilder = $this->createFormBuilder(
                              null,
                              [

                  CamelCaseParameterName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name parameters.

                  Example

                  class ClassName {
                      public function doSomething($user_name) {
                      }
                  }

                  Source

                  Expected 1 space after closing brace; newline found
                  Open

                          }

                  The variable $current_activation_url is not named in camelCase.
                  Open

                      public function sendActivation(Request $request, string $id): Response
                      {
                          $user = $this->userRepository->getById(Uuid::fromString($id));
                  
                          if (!$user) {

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $current_activation_url is not named in camelCase.
                  Open

                      public function sendActivation(Request $request, string $id): Response
                      {
                          $user = $this->userRepository->getById(Uuid::fromString($id));
                  
                          if (!$user) {

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $current_activation_url is not named in camelCase.
                  Open

                      public function sendActivation(Request $request, string $id): Response
                      {
                          $user = $this->userRepository->getById(Uuid::fromString($id));
                  
                          if (!$user) {

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  The variable $use_company_type is not named in camelCase.
                  Open

                      private function createRegisterForm(bool $use_company_type = false): FormInterface
                      {
                          $formBuilder = $this->createFormBuilder(
                              null,
                              [

                  CamelCaseVariableName

                  Since: 0.2

                  It is considered best practice to use the camelCase notation to name variables.

                  Example

                  class ClassName {
                      public function doSomething() {
                          $data_module = new DataModule();
                      }
                  }

                  Source

                  There are no issues that match your filters.

                  Category
                  Status