bourdeau/jdhm-api

View on GitHub

Showing 162 of 162 total issues

Method __construct has 300 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct()
    {
        /* mandatory requirements follow */

        $installedPhpVersion = phpversion();
Severity: Major
Found in var/SymfonyRequirements.php - About 1 day to fix

    File SymfonyRequirements.php has 478 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /*
     * This file is part of the Symfony package.
     *
    Severity: Minor
    Found in var/SymfonyRequirements.php - About 7 hrs to fix

      Function __construct has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __construct()
          {
              /* mandatory requirements follow */
      
              $installedPhpVersion = phpversion();
      Severity: Minor
      Found in var/SymfonyRequirements.php - About 5 hrs 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 __construct has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
          {
              $cfgValue = ini_get($cfgName);
      
              if (is_callable($evaluation)) {
      Severity: Minor
      Found in var/SymfonyRequirements.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

      Avoid using undefined variables such as '$em' which will lead to PHP notices.
      Open

                  $em->persist($client);

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

      Avoid using undefined variables such as '$em' which will lead to PHP notices.
      Open

                  $em->flush();

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

      Method generateEmail has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function generateEmail(Client $client)
          {
              $domains = [
                  'foo',
                  'bar',
      Severity: Minor
      Found in src/JdhmApi/DataFixtures/ORM/LoadClient.php - About 1 hr to fix

        Method generateNames has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function generateNames(Client $client)
            {
                $firstNames = [
                    'Paul',
                    'Dave',
        Severity: Minor
        Found in src/JdhmApi/DataFixtures/ORM/LoadClient.php - About 1 hr to fix

          Each class must be in a namespace of at least one level (a top-level vendor name)
          Open

          class PhpIniRequirement extends Requirement
          Severity: Minor
          Found in var/SymfonyRequirements.php by phpcodesniffer

          Each class must be in a namespace of at least one level (a top-level vendor name)
          Open

          class Requirement
          Severity: Minor
          Found in var/SymfonyRequirements.php by phpcodesniffer

          Each class must be in a namespace of at least one level (a top-level vendor name)
          Open

          class SymfonyRequirements extends RequirementCollection
          Severity: Minor
          Found in var/SymfonyRequirements.php by phpcodesniffer

          Each class must be in a namespace of at least one level (a top-level vendor name)
          Open

          class AppCache extends HttpCache
          Severity: Minor
          Found in app/AppCache.php by phpcodesniffer

          Each class must be in a namespace of at least one level (a top-level vendor name)
          Open

          class AppKernel extends Kernel
          Severity: Minor
          Found in app/AppKernel.php by phpcodesniffer

          Each class must be in a namespace of at least one level (a top-level vendor name)
          Open

          class RequirementCollection implements IteratorAggregate
          Severity: Minor
          Found in var/SymfonyRequirements.php by phpcodesniffer

          Each class must be in a namespace of at least one level (a top-level vendor name)
          Open

          class ClientContext extends RawMinkContext

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

              public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
          Severity: Major
          Found in var/SymfonyRequirements.php - About 50 mins to fix

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

                    $em = $this->get('doctrine')->getManager();

            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

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

                private $id;
            Severity: Minor
            Found in src/JdhmApi/Entity/Client.php by phpmd

            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

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

                            $r = new ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle');
            Severity: Minor
            Found in var/SymfonyRequirements.php by phpmd

            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

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

                    $em = $this->get('doctrine')->getManager();

            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

            Severity
            Category
            Status
            Source
            Language