CORE-POS/IS4C

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

Summary

Maintainability
D
2 days
Test Coverage
F
35%

File ManualSignsPage.php has 372 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Copyright 2015 Whole Foods Co-op

Severity: Minor
Found in fannie/admin/labels/ManualSignsPage.php - About 4 hrs to fix

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

        public function get_view()
        {
            $ret = '';
            $ret .= '<form target="_blank" action="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '" method="post" id="signform">';
            $mods = FannieAPI::listModules('\COREPOS\Fannie\API\item\FannieSignage');
    Severity: Major
    Found in fannie/admin/labels/ManualSignsPage.php - About 3 hrs to fix

      Method formTableHeader has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function formTableHeader()
          {
              if (FannieConfig::config('COOP_ID') == 'WFC_Duluth') {
                  $ret = SignsLib::visualSignSelectHTML();
                  $this->addOnloadCommand(SignsLib::visualSignSelectJS());
      Severity: Major
      Found in fannie/admin/labels/ManualSignsPage.php - About 2 hrs to fix

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

            protected function get_queueID_handler()
            {
                $prep = $this->connection->prepare('
                    SELECT p.upc,
                        ' . ItemText::longBrandSQL() . ',
        Severity: Minor
        Found in fannie/admin/labels/ManualSignsPage.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 post_handler has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function post_handler()
            {
                $brands = FormLib::get('brand');
                $descriptions = FormLib::get('description');
                $prices = FormLib::get('price');
        Severity: Minor
        Found in fannie/admin/labels/ManualSignsPage.php - About 1 hr to fix

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

              protected function get_queueID_handler()
              {
                  $prep = $this->connection->prepare('
                      SELECT p.upc,
                          ' . ItemText::longBrandSQL() . ',
          Severity: Minor
          Found in fannie/admin/labels/ManualSignsPage.php - About 1 hr to fix

            Function get_view has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public function get_view()
                {
                    $ret = '';
                    $ret .= '<form target="_blank" action="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '" method="post" id="signform">';
                    $mods = FannieAPI::listModules('\COREPOS\Fannie\API\item\FannieSignage');
            Severity: Minor
            Found in fannie/admin/labels/ManualSignsPage.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 formTableBody has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function formTableBody($items)
                {
                    $max = count($items) > 32 ? count($items) : 32;
                    $ret = '';
                    for ($i=0; $i<$max; $i++) {
            Severity: Minor
            Found in fannie/admin/labels/ManualSignsPage.php - About 1 hr to fix

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

                  public function post_handler()
                  {
                      $brands = FormLib::get('brand');
                      $descriptions = FormLib::get('description');
                      $prices = FormLib::get('price');
              Severity: Minor
              Found in fannie/admin/labels/ManualSignsPage.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

              There are no issues that match your filters.

              Category
              Status