CORE-POS/IS4C

View on GitHub

Showing 8,297 of 8,298 total issues

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

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

    Copyright 2013 Whole Foods Co-op

Severity: Major
Found in pos/is4c-nf/lib/models/trans/MemDiscountAddModel.php and 1 other location - About 2 days to fix
pos/is4c-nf/lib/models/trans/MemDiscountRemoveModel.php on lines 1..164

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 419.

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

    public function post_handler()
    {
        $lib_class = $this->lib_class;
        $dbc = $lib_class::getDB();

fannie/modules/plugins2.0/OpenBookFinancing/ObfWeekEntryPage.php on lines 97..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 418.

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

    public function post_handler()
    {
        $lib_class = $this->lib_class;
        $dbc = $lib_class::getDB();

fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeekEntryPageV2.php on lines 89..118

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 418.

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 ObfWeeklyReportV2.php has 847 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Copyright 2014 Whole Foods Co-op

Severity: Major
Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 2 days to fix

    Method fetch_report_data has 405 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/ObfWeeklyReportV2.php - About 2 days to fix

      Method getValue has 402 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getValue($coupID)
          {
              $infoW = $this->lookupCoupon($coupID);
              if ($infoW === false) {
                  return array('value' => 0, 'department' => 0, 'description' => '');
      Severity: Major
      Found in pos/is4c-nf/lib/Scanning/SpecialUPCs/HouseCoupon.php - About 2 days to fix

        File AlertIncident.php has 832 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        use COREPOS\Fannie\Plugin\IncidentTracker\notifiers\Email;
        use COREPOS\Fannie\Plugin\IncidentTracker\notifiers\Basecamp;
        
        
        Severity: Major
        Found in fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php - About 2 days to fix

          File JContainer.cs has 831 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          using System;
          using System.Collections.Generic;
          #if !PORTABLE40
          using System.Collections.Specialized;
          #endif

            File SPH_IngenicoRBA_Common.cs has 830 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            using System;
            using System.IO.Ports;
            using System.Threading;
            using System.Collections;
            using System.Collections.Generic;

              Function get_data has a Cognitive Complexity of 99 (exceeds 5 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: Minor
              Found in fannie/modules/plugins2.0/OverShortTools/OverShortMAS.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

              File RpOrderPage.php has 829 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              include(__DIR__ . '/../../../config.php');
              if (!class_exists('FannieAPI')) {
                  include(__DIR__ . '/../../../classlib2.0/FannieAPI.php');
              Severity: Major
              Found in fannie/modules/plugins2.0/RP/RpOrderPage.php - About 1 day to fix

                File AdvancedItemSearch.php has 826 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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

                  File JsonSerializerInternalWriter.cs has 819 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  using System;
                  using System.Collections;
                  using System.Collections.Generic;
                  using System.ComponentModel;
                  #if !(NET35 || NET20 || PORTABLE40)

                    File MercuryE2E.php has 818 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /*******************************************************************************
                    
                        Copyright 2012 Whole Foods Co-op
                    
                    
                    Severity: Major
                    Found in pos/is4c-nf/plugins/Paycards/MercuryE2E.php - About 1 day to fix

                      Function run has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function run()
                          {
                              global $FANNIE_OP_DB;
                              $dbc = FannieDB::get($FANNIE_OP_DB);
                              $now = date('Y-m-d 00:00:00');
                      Severity: Minor
                      Found in fannie/cron/tasks/SalesBatchTask.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

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

                      <?php
                      /*******************************************************************************
                      
                          Copyright 2009 Whole Foods Co-op
                      
                      
                      Severity: Major
                      Found in fannie/cron/CompressProdUpdate/compress_dept.php and 1 other location - About 1 day to fix
                      fannie/cron/CompressProdUpdate/compress_price.php on lines 1..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 402.

                      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 2009 Whole Foods Co-op
                      
                      
                      Severity: Major
                      Found in fannie/cron/CompressProdUpdate/compress_price.php and 1 other location - About 1 day to fix
                      fannie/cron/CompressProdUpdate/compress_dept.php on lines 1..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 402.

                      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

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

                          function body_content()
                          {
                              global $FANNIE_OP_DB, $FANNIE_PLUGIN_SETTINGS;
                              $ts_db = FannieDB::get($FANNIE_PLUGIN_SETTINGS['TimesheetDatabase']);
                      
                      
                      Severity: Minor
                      Found in fannie/modules/plugins2.0/TimesheetPlugin/PayrollSummaryPage.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

                      File VPBPIII.php has 807 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /*******************************************************************************
                      
                          Copyright 2010 Whole Foods Co-op
                      
                      
                      Severity: Major
                      Found in fannie/batches/UNFI/VPBPIII.php - About 1 day to fix

                        SQLManager has 100 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class SQLManager 
                        {
                            /**
                             Logging object (PSR-3)
                            */
                        Severity: Major
                        Found in common/SQLManager.php - About 1 day to fix
                          Severity
                          Category
                          Status
                          Source
                          Language