CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

            case 'D+': // must purchase more than amount in $ from department
                $minQ = "select case when sum(total) is null
                    then 0 else sum(total) end
                    " . $this->baseSQL($transDB, $coupID, 'department');
                $minR = $transDB->query($minQ);
Severity: Major
Found in pos/is4c-nf/lib/Scanning/SpecialUPCs/HouseCoupon.php and 1 other location - About 3 hrs to fix
pos/is4c-nf/lib/Scanning/SpecialUPCs/HouseCoupon.php on lines 224..236

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

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

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

    Copyright 2014 Whole Foods Co-op

Severity: Minor
Found in fannie/reports/DepartmentMovement/SmartMovementReport.php - About 3 hrs to fix

    File WFC_Produce_SmartSigns.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    use COREPOS\Fannie\API\FanniePlugin;
    if (!class_exists('FpdfWithBarcode')) {
        include(dirname(__FILE__) . '/../FpdfWithBarcode.php');
    }
    Severity: Minor
    Found in fannie/admin/labels/pdf_layouts/WFC_Produce_SmartSigns.php - About 3 hrs to fix

      File EmployeesPage.php has 312 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: Minor
      Found in fannie/modules/plugins2.0/HrWeb/Employee/EmployeesPage.php - About 3 hrs to fix

        File OverShortCashierPage.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*******************************************************************************
        
            Copyright 2013 Whole Foods Co-op
        
        
        Severity: Minor
        Found in fannie/modules/plugins2.0/OverShortTools/OverShortCashierPage.php - About 3 hrs to fix

          File EqRecurTask.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
            Process recurring transactions
          
          
          Severity: Minor
          Found in fannie/modules/plugins2.0/RecurringEquity/EqRecurTask.php - About 3 hrs to fix

            Function render has 87 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                render() {
                    let items = this.props.items.map((i) =>
                        <Item key={i.id} {...i}
                            manageItem={this.props.manageItem}
                            toggle={this.props.manageItem.toggle} />
            Severity: Major
            Found in fannie/batches/EndCapper/src/ToolBar.js - About 3 hrs to fix

              Function renderChart has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  mod.renderChart = function(hide) {
                      var ctx = document.getElementById('obfCanvas');
              
                      var myChart = new Chart(ctx, {
                          type: 'line',
              Severity: Major
              Found in fannie/modules/plugins2.0/OpenBookFinancingV2/summary.js - About 3 hrs to fix

                Function cwDash has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var cwDash = (function ($) {
                
                    var mod = {};
                
                    mod.salesChart = function(json) {
                Severity: Major
                Found in fannie/modules/plugins2.0/CoreWarehouse/cwDash.js - About 3 hrs to fix

                  Function handheld has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var handheld = (function($) {
                      var mod = {};
                  
                      mod.paintFocus = function(elem){
                          if (elem == 'upc_in'){
                  Severity: Major
                  Found in fannie/modules/plugins2.0/ShelfAudit/js/handheld.js - About 3 hrs to fix

                    Function marginTool has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var marginTool = (function($) {
                        var mod = {};
                    
                        mod.createBatch = function() {
                            var cArray = Array();
                    Severity: Major
                    Found in fannie/item/marginTool.js - About 3 hrs to fix

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

                          function body_content()
                          {
                              global $FANNIE_OP_DB;
                              $dbc = FannieDB::getReadOnly($FANNIE_OP_DB);
                      
                      
                      Severity: Major
                      Found in fannie/admin/labels/ShelfTagIndex.php - About 3 hrs to fix

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

                            function body_content()
                            {
                                include(dirname(__FILE__) . '/../config.php');
                                ob_start();
                                echo showInstallTabs('Theming');
                        Severity: Major
                        Found in fannie/install/InstallThemePage.php - About 3 hrs to fix

                          Method departmentTables has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function departmentTables()
                              {
                                  $plugin = $this->config->get('PLUGIN_SETTINGS');
                                  $ret = '<div class="panel panel-default">
                                      <div class="panel-heading">Super Departments</div>
                          Severity: Major
                          Found in fannie/modules/plugins2.0/InstaCart/InstaInExPage.php - About 3 hrs to fix

                            Method post_charges has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function post_charges(){
                                    global $FANNIE_TRANS_DB;
                                    $EMP_NO = $this->config->get('EMP_NO');
                                    $LANE_NO = $this->config->get('REGISTER_NO');
                                    $ret = "<b>Date</b>: ".date("m/d/Y")."<br />
                            Severity: Major
                            Found in fannie/modules/plugins2.0/WfcGazetteBilling/WfcGazetteBillingPage.php - About 3 hrs to fix

                              Method post_handler has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function post_handler()
                                  {
                                      $uid = FannieAuth::getUID($this->current_user);
                                      $settings = $this->config->get('PLUGIN_SETTINGS');
                                      $this->connection->selectDB($settings['IncidentDB']);
                              Severity: Major
                              Found in fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php - About 3 hrs to fix

                                File ItemStatusPage.php has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                <?php
                                /*******************************************************************************
                                
                                    Copyright 2014 Whole Foods Community Co-op
                                
                                
                                Severity: Minor
                                Found in fannie/item/handheld/ItemStatusPage.php - About 3 hrs to fix

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

                                      function addSale(lc, price, cost) {
                                          $.ajax({
                                              'url': 'LikeCodeBatchPage.php',
                                              'method': 'post',
                                              'data': 'id=' + lc + '&sale=' + price + '&cost=' + cost,
                                  Severity: Major
                                  Found in fannie/item/likecodes/lcBatch.js and 1 other location - About 3 hrs to fix
                                  fannie/item/likecodes/lcBatch.js on lines 44..53

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

                                  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

                                      function addPriceChange(lc, price, cost) {
                                          $.ajax({
                                              'url': 'LikeCodeBatchPage.php',
                                              'method': 'post',
                                              'data': 'id=' + lc + '&price=' + price + '&cost=' + cost,
                                  Severity: Major
                                  Found in fannie/item/likecodes/lcBatch.js and 1 other location - About 3 hrs to fix
                                  fannie/item/likecodes/lcBatch.js on lines 64..73

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

                                  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

                                  while ($itemsW = $dbc->fetch_row($itemsR)) {
                                      if (!isset($items[$itemsW['order_id']])) {
                                          $items[$itemsW['order_id']] = $itemsW['description'];
                                      } else {
                                          $items[$itemsW['order_id']] .= "; ".$itemsW['description'];
                                  Severity: Major
                                  Found in fannie/ordering/historical.php and 1 other location - About 3 hrs to fix
                                  fannie/ordering/clearinghouse.php on lines 275..286

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

                                  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