symphonycms/symphony-2

View on GitHub
install/lib/class.installer.php

Summary

Maintainability
F
5 days
Test Coverage

Function install has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
Open

    private function install()
    {
        $db = null;
        $fields = $this->extendDatabaseFields(self::$POST['fields']);
        $start = time();
Severity: Minor
Found in install/lib/class.installer.php - About 1 day 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

File class.installer.php has 535 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * @package install
 */
Severity: Major
Found in install/lib/class.installer.php - About 1 day to fix

    Method install has 215 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function install()
        {
            $db = null;
            $fields = $this->extendDatabaseFields(self::$POST['fields']);
            $start = time();
    Severity: Major
    Found in install/lib/class.installer.php - About 1 day to fix

      Method checkConfiguration has 102 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function checkConfiguration()
          {
              $db = null;
              $errors = [];
              $fields = $this->extendDatabaseFields(self::$POST['fields']);
      Severity: Major
      Found in install/lib/class.installer.php - About 4 hrs to fix

        Function checkConfiguration has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            private function checkConfiguration()
            {
                $db = null;
                $errors = [];
                $fields = $this->extendDatabaseFields(self::$POST['fields']);
        Severity: Minor
        Found in install/lib/class.installer.php - About 3 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 checkRequirements has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function checkRequirements()
            {
                $errors = [];
                $phpVc = new VersionComparator(phpversion());
        
        
        Severity: Major
        Found in install/lib/class.installer.php - About 2 hrs to fix

          Method run has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function run()
              {
                  // Make sure a log file is available
                  if (is_null(Symphony::Log()) || !file_exists(Symphony::Log()->getLogPath())) {
                      $this->render(new InstallerPage('missing-log'));
          Severity: Minor
          Found in install/lib/class.installer.php - About 2 hrs to fix

            Function run has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function run()
                {
                    // Make sure a log file is available
                    if (is_null(Symphony::Log()) || !file_exists(Symphony::Log()->getLogPath())) {
                        $this->render(new InstallerPage('missing-log'));
            Severity: Minor
            Found in install/lib/class.installer.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 checkRequirements has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                private function checkRequirements()
                {
                    $errors = [];
                    $phpVc = new VersionComparator(phpversion());
            
            
            Severity: Minor
            Found in install/lib/class.installer.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 checkUnattended has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                private function checkUnattended()
                {
                    $filepath = MANIFEST . '/unattend.php';
                    if (!@file_exists($filepath) || !@is_readable($filepath)) {
                        return false;
            Severity: Minor
            Found in install/lib/class.installer.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