CORE-POS/IS4C

View on GitHub

Showing 6,416 of 8,296 total issues

File MercuryDC.php has 790 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

use COREPOS\pos\lib\Database;
use COREPOS\pos\lib\ReceiptLib;
use COREPOS\pos\lib\TransRecord;
Severity: Major
Found in pos/is4c-nf/plugins/Paycards/MercuryDC.php - About 1 day to fix

    Method fetch_report_data has 373 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function fetch_report_data()
        {
            global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
            $dbc = $this->connection;
            $dbc->selectDB($this->config->get('OP_DB'));
    Severity: Major
    Found in fannie/reports/OwnerJoinLeave/OwnerJoinLeaveReport.php - About 1 day to fix

      Method getTable has 371 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getTable()
          {
              $this->addScript('pricing-batch-II.js');
              $dbc = $this->connection;
              $dbc->selectDB($this->config->OP_DB);
      Severity: Major
      Found in fannie/batches/UNFI/VPBPV.php - About 1 day to fix

        File ReflectionUtils.cs has 781 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        using System;
        using System.Collections.Generic;
        #if !(PORTABLE || PORTABLE40 || NET35 || NET20)
        using System.Numerics;
        #endif

          Function outputPDF has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
          Open

              function outputPDF(){
                  global $FANNIE_PLUGIN_SETTINGS;
                  $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['OverShortDatabase']);
                  $start = FormLib::get_form_value('startDate');
                  $end = FormLib::get_form_value('endDate');
          Severity: Minor
          Found in fannie/modules/plugins2.0/OverShortTools/OverShortDepositSlips.php - About 1 day 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 ajax_save_program has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
          Open

              private function ajax_save_program(){
          
                  global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
          
                  $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['CoopCredDatabase']);
          Severity: Minor
          Found in fannie/modules/plugins2.0/CoopCred/programs/CoopCredProgramEditor.php - About 1 day 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 displayUI has 359 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function displayUI($dateStr, $store){
                  global $FANNIE_PLUGIN_SETTINGS;
                  $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['OverShortDatabase']);
          
                  $startDate = $dateStr;
          Severity: Major
          Found in fannie/modules/plugins2.0/OverShortTools/OverShortSafecountPage.php - About 1 day to fix

            Method ajax_save_program has 359 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function ajax_save_program(){
            
                    global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
            
                    $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['CoopCredDatabase']);
            Severity: Major
            Found in fannie/modules/plugins2.0/CoopCred/programs/CoopCredProgramEditor.php - About 1 day to fix

              File ItemEditorPage.php has 765 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /*******************************************************************************
              
                  Copyright 2013 Whole Foods Community Co-op
              
              
              Severity: Major
              Found in fannie/item/ItemEditorPage.php - About 1 day to fix

                Method body_content has 355 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function body_content()
                    {
                        include('../config.php'); 
                        ob_start();
                
                
                Severity: Major
                Found in fannie/install/InstallIndexPage.php - About 1 day to fix

                  File ProdLocationEditor.php has 758 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /*******************************************************************************
                  
                      Copyright 2013 Whole Foods Community Co-op
                  
                  
                  Severity: Major
                  Found in fannie/item/ProdLocationEditor.php - About 1 day to fix

                    Method get_orderID_customer_handler has 347 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function get_orderID_customer_handler()
                        {
                            $dbc = $this->connection;
                            $dbc->selectDB($this->config->get('OP_DB'));
                            $TRANS = $this->config->get('TRANS_DB') . $dbc->sep();
                    Severity: Major
                    Found in fannie/ordering/OrderViewPage.php - About 1 day to fix

                      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

                        Function showBatchDisplay has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function showBatchDisplay($id, $order='natural')
                            {
                                global $FANNIE_SERVER_DBMS,$FANNIE_URL;
                                $dbc = $this->connection;
                                $uid = getUID($this->current_user);
                        Severity: Minor
                        Found in fannie/batches/newbatch/EditBatchPage.php - About 1 day 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

                        Class JsonWriter has 90 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                            public abstract class JsonWriter : IDisposable
                            {
                                internal enum State
                                {
                                    Start = 0,

                          File JValue.cs has 733 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          using System;
                          using System.Collections.Generic;
                          using Newtonsoft.Json.Utilities;
                          using System.Globalization;
                          #if !(NET35 || NET20 || PORTABLE40)

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

                                function check($str)
                                {
                                    if ($str == "TERMMANUAL") {
                                        UdpComm::udpSend("termManual");
                                        $this->session->set("paycard_keyed", true);
                            Severity: Minor
                            Found in pos/is4c-nf/parser/parse/SigTermCommands.php - About 1 day 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 338 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function body_content()
                                {
                                    include(dirname(__FILE__) . '/../config.php');
                                    // set a default if needed
                                    if (!isset($FANNIE_PRODUCT_MODULES) || !is_array($FANNIE_PRODUCT_MODULES) || count($FANNIE_PRODUCT_MODULES) === 0) {
                            Severity: Major
                            Found in fannie/install/InstallProductsPage.php - About 1 day to fix

                              Method fetch_report_data has 333 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function fetch_report_data()
                                  {
                                      $class_lib = $this->class_lib;
                                      $dbc = $class_lib::getDB();
                                      
                              Severity: Major
                              Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php - About 1 day to fix

                                File HouseCouponEditor.php has 721 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                <?php
                                /*******************************************************************************
                                
                                    Copyright 2012 Whole Foods Co-op
                                
                                
                                Severity: Major
                                Found in fannie/modules/plugins2.0/HouseCoupon/HouseCouponEditor.php - About 1 day to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language