CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

File rpFloral.js has 333 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var rpOrder = (function ($) {

    var mod = {};
    var state = {
        'retention': 60,
Severity: Minor
Found in fannie/modules/plugins2.0/RP/rpFloral.js - About 4 hrs to fix

    File CoopDealsSignsPage.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*******************************************************************************
    
        Copyright 2009,2013 Whole Foods Co-op
    
    
    Severity: Minor
    Found in fannie/batches/CAP/CoopDealsSignsPage.php - About 4 hrs to fix

      File XlsBatchPage.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*******************************************************************************
      
          Copyright 2009 Whole Foods Co-op
      
      
      Severity: Minor
      Found in fannie/batches/xlsbatch/XlsBatchPage.php - About 4 hrs to fix

        File DTrans.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

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

          <?php
          include(dirname(__FILE__) . '/../../../config.php');
          if (!class_exists('FannieAPI')) {
              include(dirname(__FILE__) . '/../../../classlib2.0/FannieAPI.php');
          }
          Severity: Major
          Found in fannie/modules/plugins2.0/TargetedPromos/DevelopersList.php and 1 other location - About 4 hrs to fix
          fannie/modules/plugins2.0/TargetedPromos/DefectorList.php on lines 1..36

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

          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
          include(dirname(__FILE__) . '/../../../config.php');
          if (!class_exists('FannieAPI')) {
              include(dirname(__FILE__) . '/../../../classlib2.0/FannieAPI.php');
          }
          Severity: Major
          Found in fannie/modules/plugins2.0/TargetedPromos/DefectorList.php and 1 other location - About 4 hrs to fix
          fannie/modules/plugins2.0/TargetedPromos/DevelopersList.php on lines 1..37

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

          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 ProductsModel.php has 332 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/op/ProductsModel.php - About 4 hrs to fix

            Function obfSummary has 99 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var obfSummary = (function () {
                var mod = {};
            
                var inp = {};
            
            
            Severity: Major
            Found in fannie/modules/plugins2.0/OpenBookFinancingV2/summary.js - About 3 hrs to fix

              Method setAltMemMsg has 99 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  static public function setAltMemMsg($store, $member, $row)
                  {
                      if ($store == 'WEFC_Toronto') {
                          $chargeOk = self::chargeOk();
                          /* Doesn't quite allow for StoreCharge/PrePay for regular members
              Severity: Major
              Found in pos/is4c-nf/lib/MemberLib.php - About 3 hrs to fix

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

                    protected function get_id_view()
                    {
                        $args = explode(',', $this->id);
                        list($inStr, $args) = $this->connection->safeInClause($args);
                
                
                Severity: Major
                Found in fannie/modules/plugins2.0/RP/RpPrintOrders.php - About 3 hrs to fix

                  Method preprocess has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function preprocess()
                      {
                          global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB, $FANNIE_URL, $FANNIE_TRANS_DB;
                  
                          //$this->addScript($FANNIE_URL.'src/javascript/jquery.js');
                  Severity: Major
                  Found in fannie/modules/plugins2.0/ShelfAudit/SaOrderingPage.php - About 3 hrs to fix

                    Method deactivate_account has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function deactivate_account($cardno, $reason, $type)
                        {
                            global $FANNIE_OP_DB;
                            $dbc = FannieDB::get($FANNIE_OP_DB);
                    
                    
                    Severity: Major
                    Found in fannie/mem/MemStatusEditor.php - About 3 hrs to fix

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

                          public function get_view()
                          {
                              global $FANNIE_OP_DB;
                              $dbc = FannieDB::get($FANNIE_OP_DB);
                              $this->normalizeOriginNames();
                      Severity: Major
                      Found in fannie/item/origins/OriginEditor.php - About 3 hrs to fix

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

                            function get_view()
                            {
                                global $FANNIE_OP_DB;
                                $dbc = FannieDB::get($FANNIE_OP_DB);
                        
                        
                        Severity: Major
                        Found in fannie/item/ProdReviewPage.php - About 3 hrs to fix

                          Method Compare has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  internal static int Compare(JTokenType valueType, object objA, object objB)
                                  {
                                      if (objA == null && objB == null)
                                          return 0;
                                      if (objA != null && objB == null)

                            Method CreateObjectUsingCreatorWithParameters has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    private object CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor<object> creator, string id)
                                    {
                                        ValidationUtils.ArgumentNotNull(creator, "creator");
                            
                                        // only need to keep a track of properies presence if they are required or a value should be defaulted if missing

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

                                  mod.inc = function(btn, amt) {
                                      var elem = $(btn).parent().find('input.orderAmt');
                                      var next = ($(elem).val() * 1) + amt;
                                      if (next < 0) {
                                          next = 0;
                              Severity: Major
                              Found in fannie/modules/plugins2.0/RP/rpOrder.js and 3 other locations - About 3 hrs to fix
                              fannie/modules/plugins2.0/RP/rpDirect.js on lines 336..344
                              fannie/modules/plugins2.0/RP/rpDual.js on lines 328..336
                              fannie/modules/plugins2.0/RP/rpFloral.js on lines 163..171

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

                              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 4 locations. Consider refactoring.
                              Open

                                  mod.inc = function(btn, amt) {
                                      var elem = $(btn).parent().find('input.orderAmt');
                                      var next = ($(elem).val() * 1) + amt;
                                      if (next < 0) {
                                          next = 0;
                              Severity: Major
                              Found in fannie/modules/plugins2.0/RP/rpDirect.js and 3 other locations - About 3 hrs to fix
                              fannie/modules/plugins2.0/RP/rpDual.js on lines 328..336
                              fannie/modules/plugins2.0/RP/rpFloral.js on lines 163..171
                              fannie/modules/plugins2.0/RP/rpOrder.js on lines 296..304

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

                              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

                                  mod.showSourcing = function() {
                                      $('.upc').show();
                                      $('.sku').show();
                                      $('.vendor').show();
                                      $('.trash').show();
                              Severity: Major
                              Found in fannie/modules/plugins2.0/DeliInventory/di.js and 1 other location - About 3 hrs to fix
                              fannie/modules/plugins2.0/DeliInventory/di.js on lines 253..260

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

                              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 4 locations. Consider refactoring.
                              Open

                                  mod.inc = function(btn, amt) {
                                      var elem = $(btn).parent().find('input.orderAmt');
                                      var next = ($(elem).val() * 1) + amt;
                                      if (next < 0) {
                                          next = 0;
                              Severity: Major
                              Found in fannie/modules/plugins2.0/RP/rpFloral.js and 3 other locations - About 3 hrs to fix
                              fannie/modules/plugins2.0/RP/rpDirect.js on lines 336..344
                              fannie/modules/plugins2.0/RP/rpDual.js on lines 328..336
                              fannie/modules/plugins2.0/RP/rpOrder.js on lines 296..304

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

                              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