CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/ShelfAudit/SaOrderingPage.php

Summary

Maintainability
D
2 days
Test Coverage

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

    function body_content(){
        ob_start();
        $elem = '#upc_in';
        $this->add_onload_command('$(\'#upc_in\').focus();');
        ?>
Severity: Minor
Found in fannie/modules/plugins2.0/ShelfAudit/SaOrderingPage.php - About 5 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 body_content has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function body_content(){
        ob_start();
        $elem = '#upc_in';
        $this->add_onload_command('$(\'#upc_in\').focus();');
        ?>
Severity: Major
Found in fannie/modules/plugins2.0/ShelfAudit/SaOrderingPage.php - About 4 hrs to fix

    Method preprocess has 99 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function preprocess()
        {
            global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB, $FANNIE_URL, $FANNIE_TRANS_DB;
    
            //$this->addScript($FANNIE_URL.'src/javascript/jquery.js');
    Severity: Major
    Found in fannie/modules/plugins2.0/ShelfAudit/SaOrderingPage.php - About 3 hrs to fix

      File SaOrderingPage.php has 309 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*******************************************************************************
      
          Copyright 2013 Whole Foods Co-op
      
      
      Severity: Minor
      Found in fannie/modules/plugins2.0/ShelfAudit/SaOrderingPage.php - About 3 hrs to fix

        Function preprocess has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            public function preprocess()
            {
                global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB, $FANNIE_URL, $FANNIE_TRANS_DB;
        
                //$this->addScript($FANNIE_URL.'src/javascript/jquery.js');
        Severity: Minor
        Found in fannie/modules/plugins2.0/ShelfAudit/SaOrderingPage.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 javascript_content has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function javascript_content(){
                ob_start();
                ?>
        function paint_focus(elem){
            if (elem == 'upc_in'){
        Severity: Minor
        Found in fannie/modules/plugins2.0/ShelfAudit/SaOrderingPage.php - About 1 hr to fix

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

              function css_content(){
                  ob_start();
                  ?>
          .saleInfo {
              color: green;
          Severity: Minor
          Found in fannie/modules/plugins2.0/ShelfAudit/SaOrderingPage.php - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status