CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

        while ($row = $dbc->fetchRow($res)) {
            $dept = $row['department'] . '-' . $row['dept_name'];
            $fsName = $row['name'];
            if (!isset($subdata[$fsName]) && !isset($subdata[$fsName][$row['subSection']]) ) {
                $subdata[$fsName][$row['subSection']][$dept] = 1;
Severity: Major
Found in fannie/item/FloorSections/SubLocationViewer.php and 1 other location - About 3 hrs to fix
fannie/item/FloorSections/NewPageO.php on lines 65..74

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

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 ($row = $dbc->fetchRow($res)) {
            $dept = $row['department'] . '-' . $row['dept_name'];
            $fsName = $row['name'];
            if (!isset($subdata[$fsName]) && !isset($subdata[$fsName][$row['subSection']]) ) {
                $subdata[$fsName][$row['subSection']][$dept] = 1;
Severity: Major
Found in fannie/item/FloorSections/NewPageO.php and 1 other location - About 3 hrs to fix
fannie/item/FloorSections/SubLocationViewer.php on lines 65..74

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

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

        while ($row = $dbc->fetchRow($patR)) {
            $record = array(
                $row['cardno'],
                sprintf('%.2f',$row['purchase']),
                sprintf('%.2f',$row['discounts']),
Severity: Major
Found in fannie/reports/Patronage/PatronageReport.php and 1 other location - About 3 hrs to fix
fannie/reports/Patronage/MemberPatronageReport.php on lines 98..110

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

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

        while ($row = $dbc->fetch_row($pR)) {
            $record = array(
                $row['FY'],
                sprintf('%.2f',$row['purchase']),
                sprintf('%.2f',$row['discounts']),
Severity: Major
Found in fannie/reports/Patronage/MemberPatronageReport.php and 1 other location - About 3 hrs to fix
fannie/reports/Patronage/PatronageReport.php on lines 103..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 157.

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 pos2 has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var pos2 = (function($, errorLog) {
    var mod = {};

    var urlStem = '../';
    mod.setUrlStem = function(stem) {
Severity: Major
Found in pos/is4c-nf/gui-modules/js/pos2.js - About 3 hrs to fix

    Method get_id_view has 93 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function get_id_view()
        {
            global $FANNIE_OP_DB;
            $dbc = FannieDB::get($FANNIE_OP_DB);
    
    
    Severity: Major
    Found in fannie/batches/UNFI/RecalculateVendorSRPs.php - About 3 hrs to fix

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

          function fetch_report_data()
          {
              $dbc = $this->connection;
              $dbc->selectDB($this->config->get('OP_DB'));
      
      
      Severity: Major
      Found in fannie/reports/Members/MembersReport.php - About 3 hrs to fix

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

            public function fetch_report_data()
            {
                $dbc = $this->connection;
                $parts = FormLib::standardItemFromWhere(); 
                $query = $parts['query'];
        Severity: Major
        Found in fannie/reports/DepartmentMovement/StoreDiffMovementReport.php - About 3 hrs to fix

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

              public function fetch_report_data()
              {
                  $dbc = $this->connection;
                  $dbc->setDefaultDB($this->config->get('OP_DB'));
                  $date1 = $this->form->date1;
          Severity: Major
          Found in fannie/reports/TaxForgiveness/TaxForgivenessReport.php - About 3 hrs to fix

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

                public function showEditForm($upc, $display_mode=1, $expand_mode=0)
                {
                    $ret = '';
                    $thead = '';
                    $upc = BarcodeLib::padUPC($upc);
            Severity: Major
            Found in fannie/item/modules/CurrentBatchesModule.php - About 3 hrs to fix

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

                  public function get_view()
                  { 
                      $dbc = $this->connection;
                      $dbc->selectDB($this->config->get('OP_DB'));
                      $ret = '';
              Severity: Major
              Found in fannie/item/DepartmentDiscrepancyPage.php - About 3 hrs to fix

                File OrderAjax.php has 321 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /*******************************************************************************
                
                    Copyright 2015 Whole Foods Co-op
                
                
                Severity: Minor
                Found in fannie/ordering/OrderAjax.php - About 3 hrs to fix

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

                      override public void Read()
                      {
                          string buffer = "";
                          if (this.verbose_mode > 0) {
                              System.Console.WriteLine("Reading serial weigh data");
                  pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Magellan_Scale.cs on lines 151..186

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

                  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

                      override public void Read()
                      {
                          string buffer = "";
                          if (this.verbose_mode > 0) {
                              System.Console.WriteLine("Reading serial data");
                  pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Magellan_WeighOnly.cs on lines 150..185

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

                  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

                          if ($this->connection->tableExists("$source")) {
                              $tQuery = "SELECT tenderType
                                  FROM $source
                                  WHERE tenderType != ''";
                              $tResults = $this->connection->query($tQuery);
                  fannie/modules/plugins2.0/CoopCred/models/vmodels/CCredHistoryTodaySumModel.php on lines 87..106

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

                  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

                          if ($this->connection->tableExists("$source")) {
                              $tQuery = "SELECT tenderType
                                  FROM $source
                                  WHERE tenderType != ''";
                              $tResults = $this->connection->query($tQuery);
                  fannie/modules/plugins2.0/CoopCred/models/vmodels/CCredHistoryTodayModel.php on lines 88..107

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

                  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 monthEnd has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Function skuMap has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var skuMap = (function ($) {
                    
                        var mod = {};
                    
                        function impl(search_term, callback) {
                    Severity: Major
                    Found in fannie/item/likecodes/skuMap.js - About 3 hrs to fix

                      File MemberLib.php has 320 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /*******************************************************************************
                      
                          Copyright 2016 Whole Foods Co-op
                      
                      
                      Severity: Minor
                      Found in pos/is4c-nf/lib/MemberLib.php - About 3 hrs to fix

                        Method getBathchesBySuperDept has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function getBathchesBySuperDept($superDepts,$contacts)
                            {
                                $dbc = FannieDB::get($this->config->get('OP_DB'));
                                $date = date('Y-m-d').' 00:00:00';
                                $d = date('d');
                        Severity: Major
                        Found in fannie/cron/tasks/EndSalesBatchAlertTask.php - About 3 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language