CORE-POS/IS4C

View on GitHub

Showing 8,297 of 8,298 total issues

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

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                mod.orderAll = function() {
                    var buttons = $('button.orderAll');
                    var meters = $('.progress');
                    buttons.prop('disabled', true);
                    meters.show();
            Severity: Major
            Found in fannie/modules/plugins2.0/RP/rpFloral.js and 1 other location - About 1 day to fix
            fannie/modules/plugins2.0/RP/rpDirect.js on lines 530..553

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 313.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                mod.orderAll = function() {
                    var buttons = $('button.orderAll');
                    var meters = $('.progress');
                    buttons.prop('disabled', true);
                    meters.show();
            Severity: Major
            Found in fannie/modules/plugins2.0/RP/rpDirect.js and 1 other location - About 1 day to fix
            fannie/modules/plugins2.0/RP/rpFloral.js on lines 329..352

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 313.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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,

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  <?php
                  /*******************************************************************************
                  
                      Copyright 2013 Whole Foods Co-op
                  
                  
                  fannie/modules/plugins2.0/CoreWarehouse/models/SumTendersByDayModel.php on lines 1..68
                  fannie/modules/plugins2.0/CoreWarehouse/models/SumUpcSalesByDayModel.php on lines 1..68

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 361.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  <?php
                  /*******************************************************************************
                  
                      Copyright 2013 Whole Foods Co-op
                  
                  
                  fannie/modules/plugins2.0/CoreWarehouse/models/SumDeptSalesByDayModel.php on lines 1..68
                  fannie/modules/plugins2.0/CoreWarehouse/models/SumUpcSalesByDayModel.php on lines 1..68

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 361.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  <?php
                  /*******************************************************************************
                  
                      Copyright 2013 Whole Foods Co-op
                  
                  
                  fannie/modules/plugins2.0/CoreWarehouse/models/SumDeptSalesByDayModel.php on lines 1..68
                  fannie/modules/plugins2.0/CoreWarehouse/models/SumTendersByDayModel.php on lines 1..68

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 361.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                      <?php
                      /*******************************************************************************
                      
                          Copyright 2014 Whole Foods Co-op
                          Copyright 2014 West End Food Co-op
                      fannie/modules/plugins2.0/CoopCred/tasks/CoopCredLaneSyncTask.php on lines 1..115

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 358.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                      <?php
                      /*******************************************************************************
                      
                          Copyright 2014 Whole Foods Co-op
                          Copyright 2014 West End Food Co-op
                      fannie/modules/plugins2.0/CoopCred/tasks/CoopCredOneLaneSyncTask.php on lines 1..126

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 358.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 4 locations. Consider refactoring.
                      Open

                          public function report_description_content()
                          {
                              if ($this->report_format != 'html') {
                                  return array();
                              }
                      Severity: Major
                      Found in fannie/reports/DepartmentMovement/ReducedMovementReport.php and 3 other locations - About 1 day to fix
                      fannie/reports/DDD/SmartDDDReport.php on lines 47..101
                      fannie/reports/DepartmentMovement/SmartMovementReport.php on lines 50..104
                      fannie/reports/Trends/TrendsReport.php on lines 40..90

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 356.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language