CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method get_id_view has 176 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();
        $store = FormLib::get('store', 0);
Severity: Major
Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php - About 7 hrs to fix

    File GumMainPage.php has 460 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

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

          public function fetch_report_data()
          {
              $settings = $this->config->get('PLUGIN_SETTINGS');
              $dbc = FannieDB::get($settings['WarehouseDatabase']);
              $opdb = $this->config->get('OP_DB') . $dbc->sep();
      Severity: Major
      Found in fannie/modules/plugins2.0/CoreWarehouse/reports/CWImpactReport.php - About 7 hrs to fix

        File DTransactionsModel.php has 460 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*******************************************************************************
        
            Copyright 2013 Whole Foods Co-op
        
        
        Severity: Minor
        Found in fannie/classlib2.0/data/models/trans/DTransactionsModel.php - About 7 hrs to fix

          File CoopCredInputTool.php has 459 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /*******************************************************************************
          
              Copyright 2010,2013 Whole Foods Co-op, Duluth, MN
              Copyright 2014 West End Food Co-op, Toronto, ON, Canada
          Severity: Minor
          Found in fannie/modules/plugins2.0/CoopCred/membership/CoopCredInputTool.php - About 7 hrs to fix

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

                public function get_id_view()
                {
                    $storepicker = FormLib::storePicker();
                    $save = FormLib::get('save');
                    $dbc = FannieDB::get($this->config->get('OP_DB'));
            Severity: Major
            Found in fannie/admin/labels/MovementTagTracker.php - About 7 hrs to fix

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

              function reprice(upc){
                  if ($('#newprice'+upc).length > 0) return;
              
                  var elem = $('#row'+upc).find('.srp');
                  var srp = elem.html();
              Severity: Major
              Found in fannie/batches/UNFI/pricing-batch-II.js and 1 other location - About 7 hrs to fix
              fannie/batches/UNFI/pricing-batch.js on lines 66..78

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

              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

              function reprice(upc){
                  if ($('#newprice'+upc).length > 0) return;
              
                  var elem = $('#row'+upc).find('.srp');
                  var srp = elem.html();
              Severity: Major
              Found in fannie/batches/UNFI/pricing-batch.js and 1 other location - About 7 hrs to fix
              fannie/batches/UNFI/pricing-batch-II.js on lines 68..80

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

              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

                          foreach ($rows as $row) {
                              switch ($row['DoW']) {
                                  case 1:
                                      $thisYear['Sun'] = round($row['ttl'], 2);
                                      break;
              Severity: Major
              Found in fannie/modules/plugins2.0/RP/RpCleanupTask.php and 1 other location - About 7 hrs to fix
              fannie/modules/plugins2.0/RP/RpSegmentation.php on lines 55..79

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

              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

                      foreach ($rows as $row) {
                          switch ($row['DoW']) {
                              case 1:
                                  $lastYear['Sun'] = round($row['ttl'], 2);
                                  break;
              Severity: Major
              Found in fannie/modules/plugins2.0/RP/RpSegmentation.php and 1 other location - About 7 hrs to fix
              fannie/modules/plugins2.0/RP/RpCleanupTask.php on lines 51..75

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

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

              <?php
              /*******************************************************************************
              
                  Copyright 2013 Whole Foods Co-op
              
              
              Severity: Minor
              Found in fannie/purchasing/EditOnePurchaseOrder.php - About 7 hrs to fix

                Method run has 174 lines of code (exceeds 25 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: Major
                Found in fannie/cron/tasks/SalesBatchTask.php - About 6 hrs to fix

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

                      public function fetch_report_data()
                      {
                          /*
                          $storeInfo = FormLib::storePicker();
                          echo '<form action="EOMTaxReport.php" method="get">'
                  Severity: Major
                  Found in fannie/reports/Store-Specific/WFC/EOMreport/EOMTaxReport.php - About 6 hrs to fix

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

                        function body_content(){
                            global $FANNIE_OP_DB, $FANNIE_PLUGIN_SETTINGS;
                            $ts_db = FannieDB::get($FANNIE_PLUGIN_SETTINGS['TimesheetDatabase']);
                    
                            include('./includes/header.html');
                    Severity: Major
                    Found in fannie/modules/plugins2.0/TimesheetPlugin/TsWagesReport.php - About 6 hrs to fix

                      Method list_content has 174 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function list_content()
                          {
                              global $FANNIE_OP_DB;
                              $dbc = FannieDB::get($FANNIE_OP_DB);
                      
                      
                      Severity: Major
                      Found in fannie/item/ProductListPage.php - About 6 hrs to fix

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

                                while ($row = $dbc->fetchRow($result)) {
                                    $record = array();
                                    if ($groupby == "date") {
                                        $record[] = $row['month'] . '/' . $row['day'] . '/' . $row['year'];
                                        $record[] = number_format($row['qty'], 2);
                        Severity: Major
                        Found in fannie/reports/WicSalesReport/WicSalesReport.php and 1 other location - About 6 hrs to fix
                        fannie/reports/ManufacturerMovement/ManufacturerMovementReport.php on lines 158..173

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

                        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($result)) {
                                    $record = array();
                                    if ($groupby == "date") {
                                        $record[] = $row['month'] . '/' . $row['day'] . '/' . $row['year'];
                                        $record[] = number_format($row['qty'], 2);
                        fannie/reports/WicSalesReport/WicSalesReport.php on lines 132..147

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

                        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

                            protected $preview_opts = array(
                                'memnum' => array(
                                    'display_name' => 'Member Number',
                                    'default' => 0,
                                    'required' => true
                        Severity: Major
                        Found in fannie/mem/patronage/PatronageUploadPage.php and 1 other location - About 6 hrs to fix
                        fannie/modules/plugins2.0/LBMX/LbmxImport.php on lines 13..59

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

                        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

                            protected $preview_opts = array(
                                'vendorID' => array(
                                    'display_name' => 'Vendor ID',
                                    'default' => 0,
                                    'required' => true
                        Severity: Major
                        Found in fannie/modules/plugins2.0/LBMX/LbmxImport.php and 1 other location - About 6 hrs to fix
                        fannie/mem/patronage/PatronageUploadPage.php on lines 39..85

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

                        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 orderview.js has 455 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        var orderView = (function($) {
                            var mod = {};
                            var forceUPC = true;
                        
                            mod.forceUPC = function(f) {
                        Severity: Minor
                        Found in fannie/ordering/orderview.js - About 6 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language