CORE-POS/IS4C

View on GitHub
fannie/classlib2.0/FanniePage.php

Summary

Maintainability
D
2 days
Test Coverage
F
54%

File FanniePage.php has 403 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Copyright 2012 Whole Foods Co-op

Severity: Minor
Found in fannie/classlib2.0/FanniePage.php - About 5 hrs to fix

    Method lineaJS has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function lineaJS()
        {
            ob_start();
            ?>
    function lineaBarcode(upc, selector, callback) {
    Severity: Major
    Found in fannie/classlib2.0/FanniePage.php - About 3 hrs to fix

      Function preFlight has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          public function preFlight()
          {
              if (!($this->config instanceof FannieConfig)) {
                  $this->config = FannieConfig::factory();
              }
      Severity: Minor
      Found in fannie/classlib2.0/FanniePage.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 helpModal has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function helpModal()
          {
              $help = $this->helpContent();
              if (!$help) {
                  return false;
      Severity: Major
      Found in fannie/classlib2.0/FanniePage.php - About 2 hrs to fix

        Method getHeader has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getHeader()
            {
                $url = $this->config->get('URL');
                ob_start();
                $page_title = $this->title;
        Severity: Minor
        Found in fannie/classlib2.0/FanniePage.php - About 1 hr to fix

          Function getHeader has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getHeader()
              {
                  $url = $this->config->get('URL');
                  ob_start();
                  $page_title = $this->title;
          Severity: Minor
          Found in fannie/classlib2.0/FanniePage.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 preFlight has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function preFlight()
              {
                  if (!($this->config instanceof FannieConfig)) {
                      $this->config = FannieConfig::factory();
                  }
          Severity: Minor
          Found in fannie/classlib2.0/FanniePage.php - About 1 hr to fix

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

                public function checkAuth()
                {
                    foreach($this->auth_classes as $class) {
                        $try = false;
                        if (is_array($class) && count($class) == 3) {
            Severity: Minor
            Found in fannie/classlib2.0/FanniePage.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 getMessages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function getMessages()
                {
                    if (!$this->current_user || !is_object($this->connection)) {
                        return '';
                    }
            Severity: Minor
            Found in fannie/classlib2.0/FanniePage.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