BallStateCBER/datacenter-plugin-cakephp3

View on GitHub
src/Console/Installer.php

Summary

Maintainability
C
1 day
Test Coverage

File Installer.php has 307 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
declare(strict_types=1);

/**
 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
Severity: Minor
Found in src/Console/Installer.php - About 3 hrs to fix

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

        public static function modifyEnvFile($file, $options, $io)
        {
            $handler = fopen($file, 'r+');
            $toWrite = [];
            $updatedVariables = [];
    Severity: Minor
    Found in src/Console/Installer.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 modifyEnvFile has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function modifyEnvFile($file, $options, $io)
        {
            $handler = fopen($file, 'r+');
            $toWrite = [];
            $updatedVariables = [];
    Severity: Minor
    Found in src/Console/Installer.php - About 1 hr to fix

      Method postInstall has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function postInstall(Event $event)
          {
              $io = $event->getIO();
      
              $rootDir = self::getRootDir(__DIR__);
      Severity: Minor
      Found in src/Console/Installer.php - About 1 hr to fix

        Method setFolderPermissions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function setFolderPermissions($io)
            {
                $rootDir = self::getRootDir(__DIR__);
        
                // Change the permissions on a path and output the results.
        Severity: Minor
        Found in src/Console/Installer.php - About 1 hr to fix

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

              public static function postInstall(Event $event)
              {
                  $io = $event->getIO();
          
                  $rootDir = self::getRootDir(__DIR__);
          Severity: Minor
          Found in src/Console/Installer.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 copyTwitterBootstrapFiles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function copyTwitterBootstrapFiles($event)
              {
                  $io = $event->getIO();
                  $rootDir = self::getRootDir(__DIR__);
          
          
          Severity: Minor
          Found in src/Console/Installer.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 setFolderPermissions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function setFolderPermissions($io)
              {
                  $rootDir = self::getRootDir(__DIR__);
          
                  // Change the permissions on a path and output the results.
          Severity: Minor
          Found in src/Console/Installer.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 copyDataCenterFiles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function copyDataCenterFiles($event)
              {
                  $io = $event->getIO();
                  $rootDir = self::getRootDir(__DIR__);
          
          
          Severity: Minor
          Found in src/Console/Installer.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

          There are no issues that match your filters.

          Category
          Status