GreenCape/phing-tasks

View on GitHub

Showing 18 of 18 total issues

Method main has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function main()
    {
        $this->log("Formatting file {$this->file}");
        $tmp = tempnam(dirname($this->file), 'tmp');

Severity: Major
Found in src/FormatInitFileTask.php - About 3 hrs to fix

    Function main has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        public function main()
        {
            $fmt     = "  %-22s %s\n";
    
            `phing -h`;
    Severity: Minor
    Found in src/HelpTask.php - About 2 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

    Method main has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function main()
        {
            $fmt     = "  %-22s %s\n";
    
            `phing -h`;
    Severity: Major
    Found in src/HelpTask.php - About 2 hrs to fix

      Function main has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public function main()
          {
              // GreenCape first, so entries get overwritten if provided by Joomla
              $repos = array(
                  'greencape/joomla-legacy',
      Severity: Minor
      Found in src/JoomlaVersionsTask.php - About 2 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 setData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function setData($data)
          {
              foreach ($data as $file => $lines)
              {
                  if (!file_exists($file))
      Severity: Minor
      Found in src/CoverageCollector.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

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

          public function main()
          {
              $this->log("Formatting file {$this->file}");
              $tmp = tempnam(dirname($this->file), 'tmp');
      
      
      Severity: Minor
      Found in src/FormatInitFileTask.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 findClassDeclaration has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function findClassDeclaration($code)
          {
              $result = [];
      
              $identifier  = '([\S]+)';
      Severity: Minor
      Found in src/UmlFilter.php - About 1 hr to fix

        Method getTarball has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function getTarball()
            {
                $versions  = json_decode(file_get_contents($this->versionFile), true);
                $requested = $this->version;
        
        
        Severity: Minor
        Found in src/JoomlaDownloadTask.php - About 1 hr to fix

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

              public function main()
              {
                  // GreenCape first, so entries get overwritten if provided by Joomla
                  $repos = array(
                      'greencape/joomla-legacy',
          Severity: Minor
          Found in src/JoomlaVersionsTask.php - About 1 hr to fix

            Method generateDiagramSource has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function generateDiagramSource($code)
                {
                    $namespace = $this->findNamespace($code);
                    $uses      = $this->findUseStatements($code);
                    $classes   = $this->findClassDeclaration($code);
            Severity: Minor
            Found in src/UmlFilter.php - About 1 hr to fix

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

                  private function handleReports(\PHP_CodeCoverage $coverage)
                  {
                      if ($this->clover)
                      {
                          $this->log("Generating code coverage report in Clover XML format ...");
              Severity: Minor
              Found in src/CombineCoverageTask.php - About 1 hr to fix

                Function generateDiagramSource has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function generateDiagramSource($code)
                    {
                        $namespace = $this->findNamespace($code);
                        $uses      = $this->findUseStatements($code);
                        $classes   = $this->findClassDeclaration($code);
                Severity: Minor
                Found in src/UmlFilter.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

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

                    protected function getFileSetFiles()
                    {
                        if (count($this->fileSets) == 0 && count($this->fileLists) == 0)
                        {
                            throw new \BuildException("Need either nested fileset or nested filelist to iterate through");
                Severity: Minor
                Found in src/traits/FileSet.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 getTarball has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function getTarball()
                    {
                        $versions  = json_decode(file_get_contents($this->versionFile), true);
                        $requested = $this->version;
                
                
                Severity: Minor
                Found in src/JoomlaDownloadTask.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 findClassDeclaration has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function findClassDeclaration($code)
                    {
                        $result = [];
                
                        $identifier  = '([\S]+)';
                Severity: Minor
                Found in src/UmlFilter.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

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

                    protected function filterContainers($availableContainers)
                    {
                        if ($this->state !== null)
                        {
                            $filteredContainers = array();
                Severity: Minor
                Found in src/Docker.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

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

                    protected function findUseStatements($code)
                    {
                        $uses       = [];
                        $identifier = '([\S]+)';
                
                
                Severity: Minor
                Found in src/UmlFilter.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

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

                    public function findBestMatch($pattern, $path, $version)
                    {
                        $bestVersion = '0';
                        $bestFile    = null;
                        foreach (glob("$path/*") as $filename)
                Severity: Minor
                Found in src/VersionMatchTask.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

                Severity
                Category
                Status
                Source
                Language