CORE-POS/IS4C

View on GitHub
fannie/admin/labels/MovementTagTracker.php

Summary

Maintainability
F
5 days
Test Coverage
F
17%

File MovementTagTracker.php has 740 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Copyright 2015 Whole Foods Co-op

Severity: Major
Found in fannie/admin/labels/MovementTagTracker.php - About 1 day to fix

    Method get_id_view has 175 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function get_id_view()
        {
            $storepicker = FormLib::storePicker();
            $save = FormLib::get('save');
            $dbc = FannieDB::get($this->config->get('OP_DB'));
    Severity: Major
    Found in fannie/admin/labels/MovementTagTracker.php - About 7 hrs to fix

      Method get_data_view has 109 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function get_data_view()
          {
              $dbc = Fanniedb::get($this->config->get('op_db'));
      
              $storeID = FormLib::get('store', false);
      Severity: Major
      Found in fannie/admin/labels/MovementTagTracker.php - About 4 hrs to fix

        Function draw_table has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            private function draw_table($storeName, $storeID)
            {
                $dbc = FannieDB::get($this->config->get('OP_DB'));
                $params = array();
                $prep = $dbc->prepare("SELECT * FROM MovementTrackerParams");
        Severity: Minor
        Found in fannie/admin/labels/MovementTagTracker.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 draw_table has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function draw_table($storeName, $storeID)
            {
                $dbc = FannieDB::get($this->config->get('OP_DB'));
                $params = array();
                $prep = $dbc->prepare("SELECT * FROM MovementTrackerParams");
        Severity: Major
        Found in fannie/admin/labels/MovementTagTracker.php - About 2 hrs to fix

          Method get_view has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function get_view()
              {
                  $storeID = COREPOS\Fannie\API\lib\Store::getIdByIp();
                  $ret = "";
          
          
          Severity: Major
          Found in fannie/admin/labels/MovementTagTracker.php - About 2 hrs to fix

            Method get_replacetags has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function get_replacetags($storeID, $volMin, $volMax, $posLimit, $negLimit)
                {
                    $dbc = FannieDB::get($this->config->get('OP_DB'));
                    $date = new DateTime();
                    $date->sub(new DateInterval('P1M'));
            Severity: Minor
            Found in fannie/admin/labels/MovementTagTracker.php - About 1 hr to fix

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

                  public function get_data_view()
                  {
                      $dbc = Fanniedb::get($this->config->get('op_db'));
              
                      $storeID = FormLib::get('store', false);
              Severity: Minor
              Found in fannie/admin/labels/MovementTagTracker.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 draw_expired_table has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function draw_expired_table()
                  {
                      $dbc = FannieDB::get($this->config->get('OP_DB'));
                      $storeID = COREPOS\Fannie\API\lib\Store::getIdByIp();
                      $date = new DateTime();
              Severity: Minor
              Found in fannie/admin/labels/MovementTagTracker.php - About 1 hr to fix

                Function get_id_view has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function get_id_view()
                    {
                        $storepicker = FormLib::storePicker();
                        $save = FormLib::get('save');
                        $dbc = FannieDB::get($this->config->get('OP_DB'));
                Severity: Minor
                Found in fannie/admin/labels/MovementTagTracker.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 post_upcs_handler has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function post_upcs_handler()
                    {
                        $dbc = fanniedb::get($this->config->get('op_db'));
                        $upcs = FormLib::get('upcs');
                        $adjustments = FormLib::get('adjustments');
                Severity: Minor
                Found in fannie/admin/labels/MovementTagTracker.php - About 1 hr to fix

                  Method get_exclusionName_handler has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function get_exclusionName_handler()
                      {
                          $dbc = fanniedb::get($this->config->get('op_db'));
                          $name = FormLib::get('exclusionName');
                          $dept = FormLib::get('addDepartment');
                  Severity: Minor
                  Found in fannie/admin/labels/MovementTagTracker.php - About 1 hr to fix

                    Method get_addRange_handler has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function get_addRange_handler()
                        {
                            $start = FormLib::get('start');
                            $end = FormLib::get('end');
                            $change = FormLib::get('change');
                    Severity: Minor
                    Found in fannie/admin/labels/MovementTagTracker.php - About 1 hr to fix

                      Function post_upcs_handler has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function post_upcs_handler()
                          {
                              $dbc = fanniedb::get($this->config->get('op_db'));
                              $upcs = FormLib::get('upcs');
                              $adjustments = FormLib::get('adjustments');
                      Severity: Minor
                      Found in fannie/admin/labels/MovementTagTracker.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 get_replacetags has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          private function get_replacetags($storeID, $volMin, $volMax, $posLimit, $negLimit)
                      Severity: Minor
                      Found in fannie/admin/labels/MovementTagTracker.php - About 35 mins to fix

                        Function get_exclusionName_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function get_exclusionName_handler()
                            {
                                $dbc = fanniedb::get($this->config->get('op_db'));
                                $name = FormLib::get('exclusionName');
                                $dept = FormLib::get('addDepartment');
                        Severity: Minor
                        Found in fannie/admin/labels/MovementTagTracker.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