CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

File PISuspensionPage.php has 364 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Copyright 2013 Whole Foods Co-op

Severity: Minor
Found in fannie/modules/plugins2.0/PIKiller/PISuspensionPage.php - About 4 hrs to fix

    File CoopCredJiggerTool.php has 364 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/CoopCredJiggerTool.php - About 4 hrs to fix

      File RBA_Stub.cs has 364 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;
      Severity: Minor
      Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/RBA_Stub.cs - About 4 hrs to fix

        Method sendAuth has 118 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function sendAuth()
            {
                // initialize
                $dbTrans = PaycardLib::paycard_db();
                if (!$dbTrans) {
        Severity: Major
        Found in pos/is4c-nf/plugins/Paycards/GoEMerchant.php - About 4 hrs to fix

          Method results_content has 118 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function results_content()
              {
                  global $FANNIE_OP_DB;
                  $dbc = FannieDB::get($FANNIE_OP_DB);
                  $start = date('Y-m-d', strtotime(FormLib::get_form_value('start',date('Y-m-d'))));
          Severity: Major
          Found in fannie/batches/CAP/CoopDealsReviewPage.php - About 4 hrs to fix

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

                public function get_id_view()
                {
                    global $FANNIE_URL;
                    $ret = '';
            
            
            Severity: Major
            Found in fannie/modules/plugins2.0/GiveUsMoneyPlugin/GumLoanPayoffPage.php - About 4 hrs to fix

              Method etl has 118 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function etl($config)
                  {
                      $settings = $config->get('PLUGIN_SETTINGS');
                      $mydb = $settings['MyWebDB'] . $this->connection->sep();
                      $opdb = $config->get('OP_DB') . $this->connection->sep();
              Severity: Major
              Found in fannie/modules/plugins2.0/MyWeb/models/MySpecialOrdersModel.php - About 4 hrs to fix

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

                    public function fetch_report_data()
                    {
                        $dbc = $this->connection;
                
                        try {
                Severity: Major
                Found in fannie/modules/plugins2.0/CoreWarehouse/reports/CWCouponReport.php - About 4 hrs to fix

                  Method loadItems has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function loadItems()
                      {
                          if ($this->source == 'provided') {
                              return $this->items;
                          }
                  Severity: Major
                  Found in fannie/classlib2.0/item/FannieSignage.php - About 4 hrs to fix

                    File JsonSchemaBuilder.cs has 363 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    using System;
                    using System.Collections.Generic;
                    using Newtonsoft.Json.Serialization;
                    #if NET20
                    using Newtonsoft.Json.Utilities.LinqBridge;

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

                          public function cliWrapper()
                          {
                              $out = $this->post_view();
                              $out = str_replace('<tr>', '', $out);
                              $out = str_replace('<td>', '', $out);
                      Severity: Major
                      Found in fannie/modules/plugins2.0/RP/RpImport.php and 1 other location - About 4 hrs to fix
                      fannie/modules/plugins2.0/RP/RpImportCsv.php on lines 269..282

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

                      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 cliWrapper()
                          {
                              $out = $this->post_view();
                              $out = str_replace('<tr>', '', $out);
                              $out = str_replace('<td>', '', $out);
                      Severity: Major
                      Found in fannie/modules/plugins2.0/RP/RpImportCsv.php and 1 other location - About 4 hrs to fix
                      fannie/modules/plugins2.0/RP/RpImport.php on lines 266..279

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

                      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 (!isset($otherData[$lc])) {
                                                  $otherData[$lc] = array();
                                              } else { 
                                                  if (!in_array($lc, $dupes)) {
                                                      $dupes[] = $lc;
                      Severity: Major
                      Found in fannie/modules/plugins2.0/RP/RpImport.php and 1 other location - About 4 hrs to fix
                      fannie/modules/plugins2.0/RP/RpImportCsv.php on lines 456..470

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

                      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 (!isset($otherData[$lc])) {
                                          $otherData[$lc] = array();
                                      } else { 
                                          if (!in_array($lc, $dupes)) {
                                              $dupes[] = $lc;
                      Severity: Major
                      Found in fannie/modules/plugins2.0/RP/RpImportCsv.php and 1 other location - About 4 hrs to fix
                      fannie/modules/plugins2.0/RP/RpImport.php on lines 454..468

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

                      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

                              if (isset($item['batchName']) && strstr($item['batchName'], 'Co-op Deals') && !strstr($item['batchName'], 'TPR')) {
                                  return __DIR__ . '/cd_line_16.png';
                              } elseif (isset($item['batchName']) && strstr(strtoupper($item['batchName']), 'FRESH DEALS')) {
                                  return __DIR__ . '/noauto/images/freshdeals_bottom_4.png';
                              } elseif (!empty($item['batchName'])) {
                      fannie/modules/plugins2.0/CoopDealsSigns/LegacySmartSigns4UpL.php on lines 124..138

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

                      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

                              if (isset($item['batchName']) && strstr($item['batchName'], 'Co-op Deals') && !strstr($item['batchName'], 'TPR')) {
                                  return __DIR__ . '/noauto/images/codeals_top_2.png';
                              } elseif (isset($item['batchName']) && strstr(strtoupper($item['batchName']), 'FRESH DEALS')) {
                                  return __DIR__ . '/noauto/images/freshdeals_top_4.png';
                              } elseif (!empty($item['batchName'])) {
                      fannie/modules/plugins2.0/CoopDealsSigns/LegacySmartSigns4UpL.php on lines 158..172

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

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

                      <?php
                      /*******************************************************************************
                      
                          Copyright 2013 Whole Foods Co-op
                      
                      
                      Severity: Minor
                      Found in fannie/item/vendors/DefaultUploadPage.php - About 4 hrs to fix

                        Function lcBatch has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var lcBatch = (function ($) {
                        
                            var mod = {};
                        
                            mod.toggleInact = function(show) {
                        Severity: Major
                        Found in fannie/item/likecodes/lcBatch.js - About 4 hrs to fix

                          Method parse has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function parse($str){
                                  global $CORE_LOCAL;
                                  $ret = $this->default_json();
                                  $pStyle = "<p style='font-weight:bold; text-align:center; margin: 0em 0em 0em -1.0em;'>";
                                  if (!in_array('CoopCred', $CORE_LOCAL->get('PluginList'))) {
                          Severity: Major
                          Found in pos/is4c-nf/plugins/CoopCred/CoopCredCheckQ.php - About 4 hrs to fix

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

                                public function get_view()
                                {
                                    $ret = '';
                                    $ret .= '<form action="' . filter_input(INPUT_SERVER, 'PHP_SELF') . '" method="post" id="signform">';
                                    $mods = FannieAPI::listModules('\COREPOS\Fannie\API\item\FannieSignage');
                            Severity: Major
                            Found in fannie/admin/labels/FpdfEditorPage.php - About 4 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language