CORE-POS/IS4C

View on GitHub

Showing 8,297 of 8,298 total issues

File JsonValidatingReader.cs has 679 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.Collections.Generic;
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
using System.Numerics;
#endif

    File JsonReader.cs has 679 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Globalization;
    using Newtonsoft.Json.Serialization;

      Method render_data has 307 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function render_data($data,$headers=array(),$footers=array(),$format='html')
          {
              $url = $this->config->get('URL');
              $ret = "";
              switch(strtolower($format)) {
      Severity: Major
      Found in fannie/classlib2.0/FannieReportPage.php - About 1 day to fix

        File DisplayLib.php has 677 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*******************************************************************************
        
            Copyright 2012 Whole Foods Co-op
        
        
        Severity: Major
        Found in pos/is4c-nf/lib/DisplayLib.php - About 1 day to fix

          Method post_id_handler has 306 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function post_id_handler()
              {
                  global $FANNIE_OP_DB, $FANNIE_TRANS_DB, $FANNIE_ARCHIVE_DB;
                  $dbc = FannieDB::get($FANNIE_OP_DB);
          
          

            File ObfSummaryReport.php has 675 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /*******************************************************************************
            
                Copyright 2014 Whole Foods Co-op
            
            
            Severity: Major
            Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php - About 1 day to fix

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

              <?php
              
              include(__DIR__ . '/../../../../config.php');
              if (!class_exists('FannieAPI')) {
                  include(__DIR__ . '/../../../../classlib2.0/FannieAPI.php');
              Severity: Major
              Found in fannie/modules/plugins2.0/HrWeb/Status/StatusesPage.php and 3 other locations - About 1 day to fix
              fannie/modules/plugins2.0/HrWeb/Department/DepartmentsPage.php on lines 1..75
              fannie/modules/plugins2.0/HrWeb/Position/PositionsPage.php on lines 1..75
              fannie/modules/plugins2.0/HrWeb/Store/StoresPage.php on lines 1..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 331.

              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

              <?php
              
              include(__DIR__ . '/../../../../config.php');
              if (!class_exists('FannieAPI')) {
                  include(__DIR__ . '/../../../../classlib2.0/FannieAPI.php');
              fannie/modules/plugins2.0/HrWeb/Position/PositionsPage.php on lines 1..75
              fannie/modules/plugins2.0/HrWeb/Status/StatusesPage.php on lines 1..75
              fannie/modules/plugins2.0/HrWeb/Store/StoresPage.php on lines 1..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 331.

              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

              <?php
              
              include(__DIR__ . '/../../../../config.php');
              if (!class_exists('FannieAPI')) {
                  include(__DIR__ . '/../../../../classlib2.0/FannieAPI.php');
              Severity: Major
              Found in fannie/modules/plugins2.0/HrWeb/Position/PositionsPage.php and 3 other locations - About 1 day to fix
              fannie/modules/plugins2.0/HrWeb/Department/DepartmentsPage.php on lines 1..75
              fannie/modules/plugins2.0/HrWeb/Status/StatusesPage.php on lines 1..75
              fannie/modules/plugins2.0/HrWeb/Store/StoresPage.php on lines 1..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 331.

              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

              <?php
              
              include(__DIR__ . '/../../../../config.php');
              if (!class_exists('FannieAPI')) {
                  include(__DIR__ . '/../../../../classlib2.0/FannieAPI.php');
              Severity: Major
              Found in fannie/modules/plugins2.0/HrWeb/Store/StoresPage.php and 3 other locations - About 1 day to fix
              fannie/modules/plugins2.0/HrWeb/Department/DepartmentsPage.php on lines 1..75
              fannie/modules/plugins2.0/HrWeb/Position/PositionsPage.php on lines 1..75
              fannie/modules/plugins2.0/HrWeb/Status/StatusesPage.php on lines 1..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 331.

              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

              Method displayUI has 303 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function displayUI($dateStr, $store, $type){
                      global $FANNIE_PLUGIN_SETTINGS;
                      $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['OverShortDatabase']);
              
                      $startDate = $dateStr;
              Severity: Major
              Found in fannie/modules/plugins2.0/OverShortTools/OverShortSafecountV3.php - About 1 day to fix

                Function process_file has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function process_file($linedata, $indexes)
                    {
                        global $FANNIE_OP_DB;
                        $dbc = FannieDB::get($FANNIE_OP_DB);
                        $user = FannieAuth::getUID($this->current_user);
                Severity: Minor
                Found in fannie/item/vendors/UpdateUploadPage.php - About 1 day to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                File WfcClassRegistryPage.php has 667 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /*******************************************************************************
                
                    Copyright 2012 Whole Foods Co-op
                
                
                Severity: Major
                Found in fannie/modules/plugins2.0/WfcClassRegistry/WfcClassRegistryPage.php - About 1 day to fix

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

                      public function calculate_footers($data)
                      {
                          if (empty($data)) {
                              return array();
                          }
                  fannie/reports/WicSalesReport/WicSalesReport.php on lines 152..193

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

                  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 calculate_footers($data)
                      {
                          if (empty($data)) {
                              return array();
                          }
                  Severity: Major
                  Found in fannie/reports/WicSalesReport/WicSalesReport.php and 1 other location - About 1 day to fix
                  fannie/reports/ManufacturerMovement/ManufacturerMovementReport.php on lines 178..219

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

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

                  <?php
                  use COREPOS\Fannie\API\item\StandardAccounting;
                  //header('Content-Type: application/ms-excel');
                  //header('Content-Disposition: attachment; filename="EOMreport.xls"');
                  include('../../../../config.php');
                  Severity: Major
                  Found in fannie/reports/Store-Specific/WFC/EOMreport/index.php - About 1 day to fix

                    Method ShowEditForm has 299 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function ShowEditForm($memNum,$country="US",$inProgramID=-1)
                        {
                            global $FANNIE_URL;
                            global $FANNIE_PLUGIN_LIST,$FANNIE_PLUGIN_SETTINGS;
                    
                    
                    Severity: Major
                    Found in fannie/modules/plugins2.0/CoopCred/membership/CoopCredMember.php - About 1 day to fix

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

                      function recalcDropVariance(e) {
                          var elem = e.target;
                          var cash = $(elem).closest('tr').find('.pos').html();
                          var myself = elem.value;
                          var diff = Math.round((myself - cash) * 100) / 100;
                      Severity: Major
                      Found in fannie/modules/plugins2.0/OverShortTools/js/countV3.js and 1 other location - About 1 day to fix
                      fannie/modules/plugins2.0/OverShortTools/js/countV2.js on lines 281..300

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

                      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 recalcDropVariance(e) {
                          var elem = e.target;
                          var cash = $(elem).closest('tr').find('.pos').html();
                          var myself = elem.value;
                          var diff = Math.round((myself - cash) * 100) / 100;
                      Severity: Major
                      Found in fannie/modules/plugins2.0/OverShortTools/js/countV2.js and 1 other location - About 1 day to fix
                      fannie/modules/plugins2.0/OverShortTools/js/countV3.js on lines 285..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 274.

                      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

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

                          public function get_id_view()
                          {
                              $this->addScript($this->config->get('URL') . 'src/javascript/jquery.floatThead.min.js');
                              $this->addScript('pricing-batch.js');
                              $dbc = $this->connection;
                      Severity: Major
                      Found in fannie/batches/UNFI/VendorPricingBatchPage.php - About 1 day to fix
                        Severity
                        Category
                        Status
                        Source
                        Language