CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method listFromUpcomingSale has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function listFromUpcomingSale($dbc)
    {
        $ids = '';
        $args = array();
        $s_def = $dbc->tableDefinition('SignProperties');
Severity: Major
Found in fannie/classlib2.0/item/FannieSignage.php - About 2 hrs to fix

    Method getUpdateItemLine has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static private function getUpdateItemLine($item_info, $labelInfo)
        {
            $line = 'CCOSPIC' . chr(253); 
            foreach (ServiceScaleLib::$WRITE_ITEM_FIELDS as $key => $field_info) {
                if (isset($item_info[$key])) {
    Severity: Major
    Found in fannie/classlib2.0/item/EpScaleLib.php - About 2 hrs to fix

      Method getItemNonForm has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getItemNonForm($orderID)
      {
          global $FANNIE_OP_DB, $TRANS;
          $dbc = FannieDB::get($FANNIE_OP_DB);
      
      
      Severity: Major
      Found in fannie/ordering/ajax-calls.php - About 2 hrs to fix

        Method javascriptContent has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function javascriptContent()
            {
                $js = <<<JAVASCRIPT
        function copyOrder(oid){
            if (confirm("Copy this order?")){
        Severity: Major
        Found in fannie/ordering/OrderReviewPage.php - About 2 hrs to fix

          Method get_schedule_setup_view has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Method get_upc_date1_date2_handler has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function get_upc_date1_date2_handler()
                {
                    $dbc = FannieDB::get($this->config->get('OP_DB'));
                    $dlog = DTransactionsModel::selectDlog($this->date1, $this->date2);
                    $dtrans = DTransactionsModel::selectDtrans($this->date1, $this->date2);
            Severity: Major
            Found in fannie/item/OpenRingReceipts.php - About 2 hrs to fix

              Method HandleMsg has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public override void HandleMsg(string msg)
                  { 
                      // optional predicate for "termSig" message
                      // predicate string is displayed on sig capture screen
                      if (msg.Length > 7 && msg.Substring(0, 7) == "termSig") {
              Severity: Major
              Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Datacap_PDCX.cs - About 2 hrs to fix

                Method HandleMsg has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public override void HandleMsg(string msg){ 
                
                        // optional predicate for "termSig" message
                        // predicate string is displayed on sig capture screen
                        if (msg.Length > 7 && msg.Substring(0, 7) == "termSig") {
                Severity: Major
                Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 2 hrs to fix

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

                          public new static JConstructor Load(JsonReader reader)
                          {
                              if (reader.TokenType == JsonToken.None)
                              {
                                  if (!reader.Read())
                  pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Linq/JProperty.cs on lines 331..353

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

                  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

                          public new static JProperty Load(JsonReader reader)
                          {
                              if (reader.TokenType == JsonToken.None)
                              {
                                  if (!reader.Read())
                  pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Linq/JConstructor.cs on lines 194..216

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

                  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 get_complete_view()
                      {
                          $ret = "";
                          $order_num = $_GET['order_num'];
                          
                  fannie/modules/plugins2.0/DeliCateringOrders/noauto/DeliCateringOrdersPageBackup0627.php on lines 140..170

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

                  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 get_complete_view()
                      {        
                          $ret = "";
                          $order_num = $_GET['order_num'];
                          
                  fannie/modules/plugins2.0/DeliCateringOrders/DeliCateringOrdersPage.php on lines 51..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 130.

                  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
                  /*******************************************************************************
                  
                      Copyright 2015 Whole Foods Co-op
                  
                  
                  Severity: Major
                  Found in fannie/classlib2.0/data/models/op/UsersModel.php and 1 other location - About 2 hrs to fix
                  fannie/classlib2.0/data/models/op/PosKeysModel.php on lines 1..49

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

                  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
                  /*******************************************************************************
                  
                      Copyright 2013 Whole Foods Co-op
                  
                  
                  Severity: Major
                  Found in fannie/classlib2.0/data/models/op/PosKeysModel.php and 1 other location - About 2 hrs to fix
                  fannie/classlib2.0/data/models/op/UsersModel.php on lines 1..54

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

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

                  <?php
                  /*******************************************************************************
                  
                      Copyright 2012 Whole Foods Co-op
                  
                  
                  Severity: Minor
                  Found in fannie/reports/FloorSectionSales/floorSectionSalesReport.php - About 2 hrs to fix

                    File KeyboardView.php has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    include(__DIR__ . '/../../config.php');
                    if (!class_exists('FannieAPI')) {
                        include_once(__DIR__ . '/../../classlib2.0/FannieAPI.php');
                    }
                    Severity: Minor
                    Found in fannie/admin/PosKeyboards/KeyboardView.php - About 2 hrs to fix

                      File DIScanner.php has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      include(dirname(__FILE__).'/../../../config.php');
                      if (!class_exists('FannieAPI')) {
                          include(__DIR__ . '/../../../classlib2.0/FannieAPI.php');
                      Severity: Minor
                      Found in fannie/modules/plugins2.0/DeliInventory/DIScanner.php - About 2 hrs to fix

                        Function piJS has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                        var piJS = (function($) {
                            var mod = {};
                        
                            var extractFields = function(data) {
                                var pieces = data.split("^");
                        Severity: Minor
                        Found in fannie/modules/plugins2.0/PIKiller/edit.js - About 2 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 cleanup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function cleanup($json)
                            {
                                switch ($this->conf->get("paycard_mode")) {
                                    case PaycardLib::PAYCARD_MODE_ADDVALUE:
                                    case PaycardLib::PAYCARD_MODE_ACTIVATE:
                        Severity: Minor
                        Found in pos/is4c-nf/plugins/Paycards/MercuryE2E.php - About 2 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 printReceiptHeader has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                        static public function printReceiptHeader($dateTimeStamp, $ref) 
                        {
                            self::initDriver();
                            $receipt = self::$PRINT->TextStyle(True);
                            $imgCache = CoreLocal::get('ImageCache');
                        Severity: Minor
                        Found in pos/is4c-nf/lib/ReceiptLib.php - About 2 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