CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

File RpFloralPage.php has 410 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

include(__DIR__ . '/../../../config.php');
if (!class_exists('FannieAPI')) {
    include(__DIR__ . '/../../../classlib2.0/FannieAPI.php');
Severity: Minor
Found in fannie/modules/plugins2.0/RP/RpFloralPage.php - About 5 hrs to fix

    Method HandleDeviceMessage has 146 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected override void HandleDeviceMessage(byte[] msg)
        {
            if (this.verbose_mode > 0)
                System.Console.Write("DMSG: {0}: ",current_state);
    
    
    Severity: Major
    Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs - About 5 hrs to fix

      EditBatchPage has 43 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class EditBatchPage extends FannieRESTfulPage
      {
          protected $must_authenticate = true;
          protected $auth_classes = array('batches','batches_audited');
          protected $title = 'Sales Batches Tool';
      Severity: Minor
      Found in fannie/batches/newbatch/EditBatchPage.php - About 5 hrs to fix

        FannieSignage has 43 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class FannieSignage 
        {
            protected $items = array();
            protected $source = '';
            protected $source_id = 0;
        Severity: Minor
        Found in fannie/classlib2.0/item/FannieSignage.php - About 5 hrs to fix

          Class DefaultContractResolver has 43 methods (exceeds 20 allowed). Consider refactoring.
          Open

              public class DefaultContractResolver : IContractResolver
              {
                  private static readonly IContractResolver _instance = new DefaultContractResolver(true);
          
                  internal static IContractResolver Instance

            Class ReflectionUtils has 43 methods (exceeds 20 allowed). Consider refactoring.
            Open

                internal static class ReflectionUtils
                {
                    public static readonly Type[] EmptyTypes;
            
                    static ReflectionUtils()

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

                  public function materializeValue()
                  {
                      $value = $this->param_value();
                      if ($this->is_array()) {
                          if ($value === '') {
              Severity: Major
              Found in fannie/classlib2.0/data/models/op/ParametersModel.php and 1 other location - About 5 hrs to fix
              pos/is4c-nf/lib/models/op/ParametersModel.php on lines 63..87

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

              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 materializeValue()
                  {
                      $value = $this->param_value();
                      if ($this->is_array()) {
                          if ($value === '') {
              Severity: Major
              Found in pos/is4c-nf/lib/models/op/ParametersModel.php and 1 other location - About 5 hrs to fix
              fannie/classlib2.0/data/models/op/ParametersModel.php on lines 47..71

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

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

              <?php
              /*******************************************************************************
              
                  Copyright 2012 Whole Foods Co-op
              
              
              Severity: Minor
              Found in fannie/classlib2.0/FanniePage.php - About 5 hrs to fix

                Function scanner has 145 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var scanner = (function ($) {
                    var mod = {};
                
                    var lastSearch = 0;
                
                
                Severity: Major
                Found in fannie/modules/plugins2.0/DeliInventory/scanner.js - About 5 hrs to fix

                  Method javascript_content has 145 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function javascript_content()
                      {
                          return <<<JAVASCRIPT
                  var uniqTable = document.getElementById('uniq-table');
                  var currentRow = 2;
                  Severity: Major
                  Found in fannie/batches/UNFI/VPBPIII.php - About 5 hrs to fix

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

                        public function fetch_report_data()
                        {
                            $dbc = $this->connection;
                            $dbc->selectDB($this->config->get('OP_DB'));
                            $data = array();
                    Severity: Major
                    Found in fannie/reports/EquitySales/EquitySalesReport.php - About 5 hrs to fix

                      File ViewPickups.php has 408 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      use COREPOS\Fannie\API\lib\Store;
                      
                      include(__DIR__ . '/../../../config.php');
                      Severity: Minor
                      Found in fannie/modules/plugins2.0/Pickup/ViewPickups.php - About 5 hrs to fix

                        File WebSocketServer.cs has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        using System;
                        using System.Net;
                        using System.Net.Sockets;
                        using System.Collections.Generic;
                        using System.Threading;
                        Severity: Minor
                        Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/WebSocketServer.cs - About 5 hrs to fix

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

                              protected string GetSignature(bool udp=true)
                              {
                                  string xml="<?xml version=\"1.0\"?>"
                                      + "<TStream>"
                                      + "<Transaction>"
                          pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Datacap_EMVX.cs on lines 698..738

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

                          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

                              protected string GetSignature(bool udp=true)
                              {
                                  string xml="<?xml version=\"1.0\"?>"
                                      + "<TStream>"
                                      + "<Transaction>"
                          pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Datacap_Gen2.cs on lines 779..819

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

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

                              public function doc()
                              {
                                  return '
                          Use:
                          This is IT CORE\'s transaction log. A rather important table.
                          Severity: Major
                          Found in fannie/classlib2.0/data/models/trans/DTransactionsModel.php - About 5 hrs to fix

                            Function get has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                            Open

                            static public function get($session){
                            
                                $DESIRED_TENDERS = array("CK"=>"CHECK TENDERS",
                                             "CC"=>"CREDIT CARD TENDERS",
                                             "CA"=>"CASH TENDERS",
                            Severity: Minor
                            Found in pos/is4c-nf/lib/ReceiptBuilding/TenderReports/WfcTenderReport.php - About 5 hrs 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

                            Function sort has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function sort(array $rowset)
                                {
                                    $tax = false;
                                    $discount = false;
                                    $total = false;
                            Severity: Minor
                            Found in pos/is4c-nf/lib/ReceiptBuilding/Sort/DefaultReceiptSort.php - About 5 hrs 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

                            Function fetch_report_data has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function fetch_report_data()
                                {
                                    $date_id = date('Ymd', strtotime(FormLib::get('date', date('Y-m-d'))));
                                    $date_str = date('Y-m-d', strtotime(FormLib::get('date', date('Y-m-d'))));
                                    $store = FormLib::get('store', false);
                            Severity: Minor
                            Found in fannie/reports/Paycards/PcDailyReport.php - About 5 hrs 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

                            Severity
                            Category
                            Status
                            Source
                            Language