bourdeau/jdhm-api

View on GitHub
var/SymfonyRequirements.php

Summary

Maintainability
F
3 days
Test Coverage

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

      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

        Method addPhpIniRequirement has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

          Method addPhpIniRecommendation has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

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

                public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false)
            Severity: Minor
            Found in var/SymfonyRequirements.php - About 35 mins to fix

              The method __construct() has 366 lines of code. Current threshold is set to 100. Avoid really long methods.
              Open

                  public function __construct()
                  {
                      /* mandatory requirements follow */
              
                      $installedPhpVersion = phpversion();
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              The method __construct() has an NPath complexity of 737280. The configured NPath complexity threshold is 200.
              Open

                  public function __construct()
                  {
                      /* mandatory requirements follow */
              
                      $installedPhpVersion = phpversion();
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              NPathComplexity

              Since: 0.1

              The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

              Example

              class Foo {
                  function bar() {
                      // lots of complicated code
                  }
              }

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

              The method __construct() has a Cyclomatic Complexity of 37. The configured cyclomatic complexity threshold is 10.
              Open

                  public function __construct()
                  {
                      /* mandatory requirements follow */
              
                      $installedPhpVersion = phpversion();
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              CyclomaticComplexity

              Since: 0.1

              Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

              Example

              // Cyclomatic Complexity = 11
              class Foo {
              1   public function example() {
              2       if ($a == $b) {
              3           if ($a1 == $b1) {
                              fiddle();
              4           } elseif ($a2 == $b2) {
                              fiddle();
                          } else {
                              fiddle();
                          }
              5       } elseif ($c == $d) {
              6           while ($c == $d) {
                              fiddle();
                          }
              7        } elseif ($e == $f) {
              8           for ($n = 0; $n < $h; $n++) {
                              fiddle();
                          }
                      } else {
                          switch ($z) {
              9               case 1:
                                  fiddle();
                                  break;
              10              case 2:
                                  fiddle();
                                  break;
              11              case 3:
                                  fiddle();
                                  break;
                              default:
                                  fiddle();
                                  break;
                          }
                      }
                  }
              }

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

              The method __construct() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
              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 by phpmd

              CyclomaticComplexity

              Since: 0.1

              Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

              Example

              // Cyclomatic Complexity = 11
              class Foo {
              1   public function example() {
              2       if ($a == $b) {
              3           if ($a1 == $b1) {
                              fiddle();
              4           } elseif ($a2 == $b2) {
                              fiddle();
                          } else {
                              fiddle();
                          }
              5       } elseif ($c == $d) {
              6           while ($c == $d) {
                              fiddle();
                          }
              7        } elseif ($e == $f) {
              8           for ($n = 0; $n < $h; $n++) {
                              fiddle();
                          }
                      } else {
                          switch ($z) {
              9               case 1:
                                  fiddle();
                                  break;
              10              case 2:
                                  fiddle();
                                  break;
              11              case 3:
                                  fiddle();
                                  break;
                              default:
                                  fiddle();
                                  break;
                          }
                      }
                  }
              }

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

              Remove error control operator '@' on line 445.
              Open

                  public function __construct()
                  {
                      /* mandatory requirements follow */
              
                      $installedPhpVersion = phpversion();
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              ErrorControlOperator

              Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

              Example

              function foo($filePath) {
                  $file = @fopen($filPath); // hides exceptions
                  $key = @$array[$notExistingKey]; // assigns null to $key
              }

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

              Missing class import via use statement (line '557', column '26').
              Open

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

              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

              Missing class import via use statement (line '666', column '34').
              Open

                              $reflector = new ReflectionExtension('intl');
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 __construct has a boolean flag argument $approveCfgAbsence, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 '203', column '24').
              Open

                      $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false));
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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

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

                      $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true));
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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

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

                      $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false));
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 addPhpIniRequirement has a boolean flag argument $approveCfgAbsence, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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

              Remove error control operator '@' on line 446.
              Open

                  public function __construct()
                  {
                      /* mandatory requirements follow */
              
                      $installedPhpVersion = phpversion();
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              ErrorControlOperator

              Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

              Example

              function foo($filePath) {
                  $file = @fopen($filPath); // hides exceptions
                  $key = @$array[$notExistingKey]; // assigns null to $key
              }

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

              Missing class import via use statement (line '137', column '27').
              Open

                              throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.');
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 __construct has a boolean flag argument $optional, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 '657', column '30').
              Open

                              null !== new Collator('fr_FR'),
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 addPhpIniRecommendation has a boolean flag argument $approveCfgAbsence, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 '180', column '20').
              Open

                      return new ArrayIterator($this->requirements);
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 __construct has a boolean flag argument $optional, which is a certain sign of a Single Responsibility Principle violation.
              Open

                  public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 '216', column '24').
              Open

                      $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true));
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 '\Symfony\Component\Intl\Intl' in method '__construct'.
              Open

                                  sprintf('intl ICU version installed on your system (%s) should match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()),
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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

              Avoid using static access to class '\Symfony\Component\Intl\Intl' in method '__construct'.
              Open

                                  sprintf('intl ICU version installed on your system (%s) should match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()),
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                      } else {
                          if (null === $testMessage) {
                              $testMessage = sprintf('%s %s be %s in php.ini',
                                  $cfgName,
                                  $optional ? 'should' : 'must',
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 'PDO' in method '__construct'.
              Open

                          $drivers = PDO::getAvailableDrivers();
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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

              Avoid using static access to class '\Symfony\Component\Intl\Intl' in method '__construct'.
              Open

                                  \Symfony\Component\Intl\Intl::getIcuDataVersion() === \Symfony\Component\Intl\Intl::getIcuVersion(),
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              $this->addRequirement(
                                  version_compare(phpversion('apc'), '3.0.17', '>='),
                                  'APC version must be at least 3.0.17',
                                  'Upgrade your <strong>APC</strong> extension (3.0.17+).'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
              Open

                          } else {
                              $reflector = new ReflectionExtension('intl');
              
                              ob_start();
                              $reflector->info();
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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 '\Symfony\Component\Intl\Intl' in method '__construct'.
              Open

                                  \Symfony\Component\Intl\Intl::getIcuDataVersion() === \Symfony\Component\Intl\Intl::getIcuVersion(),
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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

              Avoid using static access to class 'DateTimeZone' in method '__construct'.
              Open

                          foreach (DateTimeZone::listAbbreviations() as $abbreviations) {
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpmd

              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

              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 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 PhpIniRequirement extends Requirement
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              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

              Each class must be in a file by itself
              Open

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

              Each class must be in a file by itself
              Open

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

              Each class must be in a file by itself
              Open

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

              Only one argument is allowed per line in a multi-line function call
              Open

                              'xdebug.show_exception_trace', false, true
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                              'xdebug.scream', false, true
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                              'date.timezone', true, false,
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                              'xdebug.scream', false, true
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                              $installedPhpVersion, self::REQUIRED_PHP_VERSION),
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                              'xdebug.show_exception_trace', false, true
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Only one argument is allowed per line in a multi-line function call
              Open

                              'date.timezone', true, false,
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 156 characters
              Open

                   * @param string        $testMessage       The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 134 characters
              Open

                   * @param bool|callback $evaluation        Either a boolean indicating whether the configuration should evaluate to true or false,
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 124 characters
              Open

                              $contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php');
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 171 characters
              Open

                   * @param string|null   $helpHtml          The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 138 characters
              Open

                              throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.');
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 157 characters
              Open

                   *                                         Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 148 characters
              Open

                  public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 157 characters
              Open

                   *                                         This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 164 characters
              Open

                   *                                         or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 134 characters
              Open

                   * @param bool|callback $evaluation        Either a boolean indicating whether the configuration should evaluate to true or false,
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 130 characters
              Open

                   * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 157 characters
              Open

                   *                                         Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 127 characters
              Open

                      $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true));
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 230 characters
              Open

                              'Set "<strong>xdebug.max_nesting_level</strong>" to e.g. "<strong>250</strong>" in php.ini<a href="#phpini">*</a> to stop Xdebug\'s infinite recursion protection erroneously throwing a fatal error in your project.'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 138 characters
              Open

                   * @param string|null   $helpText          The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 138 characters
              Open

                   * @param string|null   $helpText          The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 157 characters
              Open

                   *                                         Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 122 characters
              Open

                          sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $installedPhpVersion)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 164 characters
              Open

                   *                                         or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 135 characters
              Open

                              'Add "<strong>phar</strong>" to <strong>suhosin.executor.include.whitelist</strong> in php.ini<a href="#phpini">*</a>.'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 164 characters
              Open

                   *                                         or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 138 characters
              Open

                   * @param string|null   $helpText          The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 134 characters
              Open

                      parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional);
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 153 characters
              Open

                          'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. '.
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 136 characters
              Open

                              sprintf('Configured default timezone "%s" must be supported by your installation of PHP', @date_default_timezone_get()),
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 130 characters
              Open

                   * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 121 characters
              Open

                              'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 280 characters
              Open

                              'Your default timezone is not supported by PHP. Check for typos in your <strong>php.ini</strong> file and have a look at the list of deprecated timezones at <a href="http://php.net/manual/en/timezones.others.php">http://php.net/manual/en/timezones.others.php</a>.'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 130 characters
              Open

                   * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 158 characters
              Open

                  public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 132 characters
              Open

                          sprintf('You are running PHP version "<strong>%s</strong>", but Symfony needs at least PHP "<strong>%s</strong>" to run.
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 162 characters
              Open

                          'Change the permissions of either "<strong>app/cache/</strong>" or  "<strong>var/cache/</strong>" directory so that the web server can write into it.'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 167 characters
              Open

                   * @param bool          $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 157 characters
              Open

                   *                                         This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 122 characters
              Open

                   * @param bool          $optional          Whether this is only an optional recommendation not a mandatory requirement
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 157 characters
              Open

                   *                                         This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 128 characters
              Open

                      $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false));
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 151 characters
              Open

                  public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 160 characters
              Open

                          'Change the permissions of either "<strong>app/logs/</strong>" or  "<strong>var/logs/</strong>" directory so that the web server can write into it.'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 178 characters
              Open

                              'Set "<strong>mbstring.func_overload</strong>" to <strong>0</strong> in php.ini<a href="#phpini">*</a> to disable function overloading by the mbstring extension.'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 134 characters
              Open

                   * @param bool|callback $evaluation        Either a boolean indicating whether the configuration should evaluate to true or false,
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 156 characters
              Open

                   * @param string|null   $testMessage       The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 167 characters
              Open

                   * @param bool          $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 156 characters
              Open

                   * @param string        $testMessage       The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 171 characters
              Open

                   * @param string        $helpHtml          The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 167 characters
              Open

                   * @param bool          $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 171 characters
              Open

                   * @param string        $helpHtml          The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived)
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 157 characters
              Open

                          'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 122 characters
              Open

                          (version_compare($installedPhpVersion, '5.3.18', '>=') && version_compare($installedPhpVersion, '5.4.0', '<'))
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 228 characters
              Open

                                  sprintf('intl ICU version installed on your system (%s) should match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()),
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 209 characters
              Open

                              '<strong>PCRE 8.0+</strong> is preconfigured in PHP since 5.3.2 but you are using an outdated version of it. Symfony probably works anyway but it is recommended to upgrade your PCRE extension.'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 144 characters
              Open

                              sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'),
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 166 characters
              Open

                          'You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909',
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 132 characters
              Open

                          'Install PHP 5.3.18+ or PHP 5.4.8+ if you want nice error messages for all fatal errors in the development environment.'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 248 characters
              Open

                          'When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)',
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 161 characters
              Open

                              'Set "<strong>realpath_cache_size</strong>" to e.g. "<strong>1024</strong>" in php.ini<a href="#phpini">*</a> to improve performance on windows.'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 264 characters
              Open

                                  'In most cases you should be fine, but please verify there is no inconsistencies between data provided by Symfony and the intl extension. See https://github.com/symfony/symfony/issues/15007 for an example of inconsistencies you might run into.'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 153 characters
              Open

                          'Your project might malfunction randomly due to PHP bug #52083 ("Notice: Trying to get property of non-object"). Install PHP 5.3.4 or newer.'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Line exceeds 120 characters; contains 178 characters
              Open

                              'Set "<strong>intl.error_level</strong>" to "<strong>0</strong>" in php.ini<a href="#phpini">*</a> to inhibit the messages when an error occurs in ICU functions.'
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Multi-line function call not indented correctly; expected 12 spaces but found 16
              Open

                              $installedPhpVersion, self::REQUIRED_PHP_VERSION),
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Opening parenthesis of a multi-line function call must be the last content on the line
              Open

                              $testMessage = sprintf('%s %s be %s in php.ini',
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Opening parenthesis of a multi-line function call must be the last content on the line
              Open

                          sprintf('You are running PHP version "<strong>%s</strong>", but Symfony needs at least PHP "<strong>%s</strong>" to run.
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Opening parenthesis of a multi-line function call must be the last content on the line
              Open

                              $helpHtml = sprintf('Set <strong>%s</strong> to <strong>%s</strong> in php.ini<a href="#phpini">*</a>.',
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              Closing parenthesis of a multi-line function call must be on a line by itself
              Open

                              $installedPhpVersion, self::REQUIRED_PHP_VERSION),
              Severity: Minor
              Found in var/SymfonyRequirements.php by phpcodesniffer

              There are no issues that match your filters.

              Category
              Status