CORE-POS/IS4C

View on GitHub
fannie/install/InstallIndexPage.php

Summary

Maintainability
F
5 days
Test Coverage
F
28%

File InstallIndexPage.php has 800 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*******************************************************************************

    Copyright 2011 Whole Foods Co-op

Severity: Major
Found in fannie/install/InstallIndexPage.php - About 1 day to fix

    Method body_content has 355 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function body_content()
        {
            include('../config.php'); 
            ob_start();
    
    
    Severity: Major
    Found in fannie/install/InstallIndexPage.php - About 1 day to fix

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

          function body_content()
          {
              include('../config.php'); 
              ob_start();
      
      
      Severity: Minor
      Found in fannie/install/InstallIndexPage.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

      Function checkComposer has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          private function checkComposer()
          {
              if (!is_dir(dirname(__FILE__) . '/../../vendor')) {
                  $path = realpath(__DIR__ . '/../');
                  echo "<div class=\"alert alert-warning\"><b>Warning</b>: dependencies appear to be missing.</div>";
      Severity: Minor
      Found in fannie/install/InstallIndexPage.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 checkComposer has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function checkComposer()
          {
              if (!is_dir(dirname(__FILE__) . '/../../vendor')) {
                  $path = realpath(__DIR__ . '/../');
                  echo "<div class=\"alert alert-warning\"><b>Warning</b>: dependencies appear to be missing.</div>";
      Severity: Minor
      Found in fannie/install/InstallIndexPage.php - About 1 hr to fix

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

            public function create_op_dbs($con, $op_db_name)
            {
                $ret = array();
        
                foreach ($this->op_models as $class) {
        Severity: Minor
        Found in fannie/install/InstallIndexPage.php - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status