CORE-POS/IS4C

View on GitHub

Showing 6,416 of 8,296 total issues

File FannieSignage.php has 1134 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Copyright 2014 Whole Foods Co-op, Duluth, MN

Severity: Major
Found in fannie/classlib2.0/item/FannieSignage.php - About 2 days to fix

    File SQLManager.php has 1127 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*******************************************************************************
    
        Copyright 2009 Whole Foods Co-op
    
    
    Severity: Major
    Found in common/SQLManager.php - About 2 days to fix

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

          public function preprocess()
          {
              $col_select = \FormLib::get_form_value('cs','');
              $this->finishPreviewOpts();
      
      
      Severity: Minor
      Found in fannie/classlib2.0/FannieUploadPage.php - About 2 days 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

      File BasicModel.php has 1106 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*******************************************************************************
      
          Copyright 2013 Whole Foods Co-op
      
      
      Severity: Major
      Found in common/BasicModel.php - About 2 days to fix

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

            protected function get_view()
            {
                $this->addScript('rpDirect.js?date=20200708');
                $this->addOnloadCommand('rpOrder.initAutoCompletes();');
                $store = FormLib::get('store');
        Severity: Major
        Found in fannie/modules/plugins2.0/RP/RpDirectPage.php - About 2 days to fix

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

              public function get_id_view()
              {
                  $ret = '';
                  $ret .= '
          
          

          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

          File ObfWeeklyReport.php has 1067 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /*******************************************************************************
          
              Copyright 2014 Whole Foods Co-op
          
          
          Severity: Major
          Found in fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php - About 2 days to fix

            Method get_data has 524 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function get_data(){
                    global $FANNIE_OP_DB;
                    $dlog = DTransactionsModel::selectDlog($this->startDate, $this->endDate);
                    $dtrans = DTransactionsModel::selectDtrans($this->startDate, $this->endDate);
                    $mc = FormLib::get('mercato');
            Severity: Major
            Found in fannie/modules/plugins2.0/OverShortTools/OverShortMAS.php - About 2 days to fix

              File JsonWriter.cs has 1038 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

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

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

                    protected function get_view()
                    {
                        $this->addScript('rpDual.js?date=20230801');
                        $this->addOnloadCommand('rpOrder.initAutoCompletes();');
                        $store = FormLib::get('store');
                Severity: Major
                Found in fannie/modules/plugins2.0/RP/RpDualPage.php - About 2 days to fix

                  File CoopCredProgramEditor.php has 1033 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /*******************************************************************************
                  
                      Copyright 2009,2013 Whole Foods Co-op
                      Copyright 2014 West End Food Co-op, Toronto
                  Severity: Major
                  Found in fannie/modules/plugins2.0/CoopCred/programs/CoopCredProgramEditor.php - About 2 days to fix

                    Function rpOrder has 518 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var rpOrder = (function ($) {
                    
                        var mod = {};
                        var state = {
                            'retention': 60,
                    Severity: Major
                    Found in fannie/modules/plugins2.0/RP/rpDirect.js - About 2 days to fix

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

                          public function get_id_view()
                          {
                              $ret = '';
                              $ret .= '
                      
                      

                      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 rpOrder has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
                      Open

                      var rpOrder = (function ($) {
                      
                          var mod = {};
                          var state = {
                              'retention': 60,
                      Severity: Minor
                      Found in fannie/modules/plugins2.0/RP/rpOrder.js - About 2 days 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 WFC_Hybrid has a Cognitive Complexity of 123 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function WFC_Hybrid($data,$offset=0){
                      
                      $pdf=new WFC_Hybrid_PDF('P','mm','Letter'); //start new instance of PDF
                      $pdf->Open(); //open new PDF Document
                      $pdf->setTagDate(date("m/d/Y"));
                      Severity: Minor
                      Found in fannie/admin/labels/pdf_layouts/WFC_Hybrid.php - About 2 days 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_id_view has 493 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function get_id_view()
                          {
                              $settings = $this->config->get('PLUGIN_SETTINGS');
                              $prefix = $settings['ObfDatabaseV2'] . $this->connection->sep();
                              $week = FormLib::get('week');
                      Severity: Major
                      Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfDepartmentReport.php - About 2 days to fix

                        Function rpOrder has 490 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var rpOrder = (function ($) {
                        
                            var mod = {};
                            var state = {
                                'retention': 60,
                        Severity: Major
                        Found in fannie/modules/plugins2.0/RP/rpDual.js - About 2 days to fix

                          Method showEditForm has 489 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function showEditForm($upc, $display_mode=1, $expand_mode=1)
                              {
                                  $FANNIE_PRODUCT_MODULES = FannieConfig::config('PRODUCT_MODULES', array());
                                  $upc = BarcodeLib::padUPC($upc);
                          
                          
                          Severity: Major
                          Found in fannie/item/modules/BaseItemModule.php - About 2 days to fix

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

                                protected function get_view()
                                {
                                    $this->addScript('rpOrder.js?date=20210224');
                                    $this->addOnloadCommand('rpOrder.initAutoCompletes();');
                                    $store = FormLib::get('store');
                            Severity: Major
                            Found in fannie/modules/plugins2.0/RP/RpOrderPage.php - About 2 days to fix

                              Function weightedAverages has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private function weightedAverages($dbc)
                                  {
                                      // now do weighted averages
                                      $this->cronMsg('Calculating weighted averages', FannieLogger::INFO);
                                      $dbc->query('TRUNCATE TABLE productSummaryLastQuarter');
                              Severity: Minor
                              Found in fannie/cron/tasks/ProductSummarizeLastQuarter.php - About 2 days 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