CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    public function getNewPars($dbc, $vendorID, $deptID, $storeID, $json)
    {
        $dlog = FannieConfig::config('TRANS_DB') . $dbc->sep() . 'dlog_15';
        $today = date('Y-m-d 00:00:00');

Severity: Major
Found in fannie/classlib2.0/data/ordering/ExponentialSmoothing.php - About 2 hrs to fix

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

        public function drawPDF()
        {
            $pdf = new \FPDF('L', 'mm', 'Letter');
            $pdf->SetMargins(3.175, 3.175, 3.175);
            $pdf->SetAutoPageBreak(false);
    Severity: Major
    Found in fannie/classlib2.0/item/signage/Signage15UpL.php - About 2 hrs to fix

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

          private static function getItemByUPC($upc)
          {
              $dbc = self::dbc();
              $upc = BarcodeLib::padUPC($upc);
      
      
      Severity: Major
      Found in fannie/ordering/OrderItemLib.php - About 2 hrs to fix

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

            private function exportAll($store)
            {
                $promoP = $this->connection->prepare('
                    SELECT q.upc, SUM(total), SUM(saleTotal)
                    FROM ' . FannieDB::fqn('productWeeklyLastQuarter', 'arch') . ' as q
        Severity: Major
        Found in fannie/item/ContributionTool.php - About 2 hrs to fix

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

              public function preprocess()
              {
                  $stores = FormLib::storePicker('store', false);
                  $items = FormLib::get('items', 50);
                  $vendors = FormLib::get('vendors', 10);
          Severity: Major
          Found in fannie/item/ContributionTool.php - About 2 hrs to fix

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

                protected function get_view()
                {
                    $this->addScript('nutrifacts.js');
                    $ret = <<<HTML
            <form method="post" target="_blank">
            Severity: Major
            Found in fannie/item/images/NutriFacts.php - About 2 hrs to fix

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

                      public static string ToString(object value)
                      {
                          if (value == null)
                              return Null;
              
              

                File AutoLoader.php has 261 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /*******************************************************************************
                
                    Copyright 2012 Whole Foods Co-op
                
                
                Severity: Minor
                Found in pos/is4c-nf/lib/AutoLoader.php - About 2 hrs to fix

                  File PatronageOverDatesReport.php has 261 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                   <?php
                  /*******************************************************************************
                  
                      Copyright 2013 Whole Foods Co-op
                      Copyright 2015 West End Food Co-op, Toronto
                  Severity: Minor
                  Found in fannie/reports/PatronageOverDates/PatronageOverDatesReport.php - About 2 hrs to fix

                    File addShelfTag.php has 261 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /*******************************************************************************
                    
                        Copyright 2009 Whole Foods Co-op
                    
                    
                    Severity: Minor
                    Found in fannie/item/addShelfTag.php - About 2 hrs to fix

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

                          function preprocess()
                          {
                              // get calling class (required)
                              $item = FormLib::get('item');
                              $pos_home = MiscLib::base_url().'gui-modules/pos2.php';
                      Severity: Minor
                      Found in pos/is4c-nf/plugins/PromptForTare/TarePromptInputPage.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

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

                          function preprocess()
                          {
                              $this->conf = new PaycardConf();
                              $this->bmpPath = $this->page_url . 'scale-drivers/drivers/NewMagellan/ss-output/tmp/';
                              $this->capture = new SigCapture($this->conf);
                      Severity: Minor
                      Found in pos/is4c-nf/plugins/Paycards/gui/PaycardEmvSuccess.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

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

                          function preprocess()
                          {
                              // check for posts before drawing anything, so we can redirect
                              if (FormLib::get('reginput', false) !== false) {
                                  $input = strtoupper(trim(FormLib::get('reginput')));
                      Severity: Minor
                      Found in pos/is4c-nf/plugins/Paycards/gui/paycardboxMsgGift.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

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

                          function preprocess()
                          {
                              // check for posts before drawing anything, so we can redirect
                              if (FormLib::get('mode') !== '') {
                                  $this->mode = FormLib::get('mode');
                      Severity: Minor
                      Found in pos/is4c-nf/plugins/Paycards/gui/PaycardEmvGift.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

                      Function handleResponseAuth has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function handleResponseAuth($authResult)
                          {
                              $xml = new XmlData($authResult['response']);
                              $dbTrans = PaycardLib::paycard_db();
                      
                      
                      Severity: Minor
                      Found in pos/is4c-nf/plugins/Paycards/GoEMerchant.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

                      Function check has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function check($str)
                          {
                              if ($this->session->get('store') !== 'wfc') {
                                  return false;
                              }
                      Severity: Minor
                      Found in pos/is4c-nf/plugins/WfcHtmlReceipt/WFCFixup.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

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

                          function body_content()
                          {
                              $num_rows = $this->temp_num_rows;
                              $result = $this->temp_result;
                              $entered = $this->entered;
                      Severity: Minor
                      Found in pos/is4c-nf/gui-modules/memlist_cards.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

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

                          function preprocess()
                          {
                              $this->bmpPath = $this->page_url . 'scale-drivers/drivers/NewMagellan/ss-output/tmp/';
                      
                              $terminalMsg = 'termSig';
                      Severity: Minor
                      Found in pos/is4c-nf/gui-modules/SigCapturePage.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

                      Function reverseTransaction has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function reverseTransaction($empNo, $registerNo, $transNo)
                          {
                              /* change the cashier to the original transaction's cashier */
                              CoreLocal::set("CashierNo",$empNo);
                              CoreLocal::set("transno",Database::gettransno($empNo));    
                      Severity: Minor
                      Found in pos/is4c-nf/lib/Undo.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

                      Function addLinesNearField has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function addLinesNearField(array $items, array $lines, $field)
                          {
                              foreach ($lines as $line) {
                                  if ($line['total'] == 0) {
                                      continue;
                      Severity: Minor
                      Found in pos/is4c-nf/lib/ReceiptBuilding/Sort/GroupSavingsSort.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

                      Severity
                      Category
                      Status
                      Source
                      Language