CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/WfcClassRegistry/WfcClassRegistryPage.php

Summary

Maintainability
F
4 days
Test Coverage

File WfcClassRegistryPage.php has 667 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Copyright 2012 Whole Foods Co-op

Severity: Major
Found in fannie/modules/plugins2.0/WfcClassRegistry/WfcClassRegistryPage.php - About 1 day to fix

    Method listClasses has 247 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function listClasses()
        {
            $FANNIE_URL = $this->config->get('URL');
    
            $dbc = FannieDB::get($this->config->get('OP_DB'));
    Severity: Major
    Found in fannie/modules/plugins2.0/WfcClassRegistry/WfcClassRegistryPage.php - About 1 day to fix

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

          private function listClasses()
          {
              $FANNIE_URL = $this->config->get('URL');
      
              $dbc = FannieDB::get($this->config->get('OP_DB'));
      Severity: Minor
      Found in fannie/modules/plugins2.0/WfcClassRegistry/WfcClassRegistryPage.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 printItems has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function printItems($items, $curPlu=false, $withCancel=true)
          {
              $ret = '';
              $i = 0;
              $dbc = FannieDB::get($this->config->get('OP_DB'));
      Severity: Major
      Found in fannie/modules/plugins2.0/WfcClassRegistry/WfcClassRegistryPage.php - About 3 hrs to fix

        Method javascriptContent has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function javascriptContent()
            {
                return <<<JAVASCRIPT
        $('input[type="checkbox"][name="expired"]').click(function(){
            //window.location.reload();
        Severity: Major
        Found in fannie/modules/plugins2.0/WfcClassRegistry/WfcClassRegistryPage.php - About 2 hrs to fix

          Method printCredits has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function printCredits($items)
              {
                  $ret = '';
                  $ret .= '<form method="post" name="processCredits">';
                  $i = 0;
          Severity: Minor
          Found in fannie/modules/plugins2.0/WfcClassRegistry/WfcClassRegistryPage.php - About 1 hr to fix

            Method sign_pay_view has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function sign_pay_view()
                {
                    $key = FormLib::get('key');
                    $dbc = FannieDB::get($this->config->get('OP_DB')); 
                    $locateEmptySeat = new wfcuRegistryModel($dbc);
            Severity: Minor
            Found in fannie/modules/plugins2.0/WfcClassRegistry/WfcClassRegistryPage.php - About 1 hr to fix

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

                  private function cancel_handler()
                  {
                      $dbc = FannieDB::get($this->config->get('OP_DB'));
                      //$class_plu = FormLib::get('class_plu');
                      $model = new wfcuRegistryModel($dbc);
              Severity: Minor
              Found in fannie/modules/plugins2.0/WfcClassRegistry/WfcClassRegistryPage.php - About 1 hr to fix

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

                    private function sign_pay_view()
                    {
                        $key = FormLib::get('key');
                        $dbc = FannieDB::get($this->config->get('OP_DB')); 
                        $locateEmptySeat = new wfcuRegistryModel($dbc);
                Severity: Minor
                Found in fannie/modules/plugins2.0/WfcClassRegistry/WfcClassRegistryPage.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 printItems has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function printItems($items, $curPlu=false, $withCancel=true)
                    {
                        $ret = '';
                        $i = 0;
                        $dbc = FannieDB::get($this->config->get('OP_DB'));
                Severity: Minor
                Found in fannie/modules/plugins2.0/WfcClassRegistry/WfcClassRegistryPage.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