puphpet/puphpet

View on GitHub
app/SymfonyRequirements.php

Summary

Maintainability
F
4 days
Test Coverage

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

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

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

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

    <?php
    
    /*
     * This file is part of the Symfony package.
     *
    Severity: Major
    Found in app/SymfonyRequirements.php - About 1 day to fix

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

          public function __construct()
          {
              /* mandatory requirements follow */
      
              $installedPhpVersion = phpversion();
      Severity: Minor
      Found in app/SymfonyRequirements.php - About 6 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 app/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 app/SymfonyRequirements.php - About 50 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 app/SymfonyRequirements.php - About 45 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 app/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 app/SymfonyRequirements.php - About 35 mins to fix

              Function getPhpRequiredVersion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function getPhpRequiredVersion()
                  {
                      if (!file_exists($path = __DIR__.'/../composer.lock')) {
                          return false;
                      }
              Severity: Minor
              Found in app/SymfonyRequirements.php - About 25 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

              There are no issues that match your filters.

              Category
              Status