CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method touchScreenKeyboard has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

static public function touchScreenKeyboard($selector='#reginput')
{
    return '
        <button type="button" class="pos-button" style="width: 25px;"
            onclick="s=$(\'' . $selector . '\').val(); $(\'' . $selector . '\').val(s + \'Q\');">Q</button>
Severity: Major
Found in pos/is4c-nf/lib/DisplayLib.php - About 2 hrs to fix

    Method process_file has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function process_file($linedata, $indexes)
        {
            $dbc = $this->connection;
            $dbc->selectDB($this->config->get('OP_DB'));
            $VENDOR_ID = $this->getVendorID();
    Severity: Major
    Found in fannie/batches/UNFI/load-classes/AlbertsUploadPage.php - About 2 hrs to fix

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

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

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

            function fetch_report_data()
            {
                $dbc = $this->connection;
                $dbc->selectDB($this->config->get('OP_DB'));
                $date1 = $this->form->date1;
        Severity: Major
        Found in fannie/reports/CouponExplorer/CouponExplorerReport.php - About 2 hrs to fix

          Method generateSoupTag2UpD has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function generateSoupTag2UpD($x, $y, $guide, $width, $height, $pdf, $row, $dbc, $j)
          {
              $store = COREPOS\Fannie\API\lib\Store::getIdByIp();
              $upc = $row['upc'];
              $brand = $row['description'];
          Severity: Major
          Found in fannie/admin/labels/pdf_layouts/Soup_Signs_2UP.php - About 2 hrs to fix

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

                protected function get_view()
                {
                    $this->addScript('../../../src/javascript/vue.js');
                    $this->addScript('qlEdit.js?date=20210825');
            
            
            Severity: Major
            Found in fannie/modules/plugins2.0/QuickLookups/QLEdit.php - About 2 hrs to fix

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

                  protected function get_view()
                  {
                      return <<<HTML
              <form>
              <div class="row">
              Severity: Major
              Found in fannie/modules/plugins2.0/Pickup/PArrivalsEntry.php - About 2 hrs to fix

                Method get_comments has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function get_comments($mode='new')
                    {
                        $id = FormLib::get('id');
                        $trx = ($id) ? 'highlight' : '';
                        $dbc = FannieDB::get($this->config->get('OP_DB'));
                Severity: Major
                Found in fannie/modules/plugins2.0/CustomerServiceLog/CustomerServiceLog.php - About 2 hrs to fix

                  Method body_content has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function body_content(){
                          global $FANNIE_URL, $FANNIE_PLUGIN_SETTINGS;
                          $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['OverShortDatabase']);
                          $this->addScript('js/count.js');
                          ob_start();
                  Severity: Major
                  Found in fannie/modules/plugins2.0/OverShortTools/OverShortDepositSlips.php - About 2 hrs to fix

                    Method post_view has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function post_view()
                        {
                            $items = array();
                            foreach (explode("\n", $this->form->in) as $line) {
                                if (preg_match('/(\d+)\](.)\[(.+){(.+)}(.+)\|(.+)_/', $line, $matches)) {
                    Severity: Major
                    Found in fannie/modules/plugins2.0/RP/RpImport.php - About 2 hrs to fix

                      Method post_view has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function post_view()
                          {
                              $items = array();
                              foreach (explode("\n", $this->form->in) as $line) {
                                  if (preg_match('/(\d+)\](.)\[(.+){(.+)}(.+)\|(.+)_/', $line, $matches)) {
                      Severity: Major
                      Found in fannie/modules/plugins2.0/RP/RpImportCsv.php - About 2 hrs to fix

                        Method itemListTab has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function itemListTab($orderID)
                            {
                                $poi = new PurchaseOrderItemsModel($this->connection);
                                $poi->orderID($orderID);
                                $poi->load();
                        Severity: Major
                        Found in fannie/purchasing/EditOnePurchaseOrder.php - About 2 hrs to fix

                          Method post_upc_view has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function post_upc_view()
                              {
                                  if(FormLib::get('print') == "now") {
                                    return $this->print_tag();
                                  } else {
                          Severity: Major
                          Found in fannie/item/addShelfTag.php - About 2 hrs to fix

                            Method post_save_handler has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function post_save_handler()
                                {
                                    global $FANNIE_OP_DB;
                            
                                    $upcs = FormLib::get('upc', array());
                            Severity: Major
                            Found in fannie/item/EditItemsFromSearch.php - About 2 hrs to fix

                              Method cli has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function cli($argc, $argv)
                                  {
                                      if ($argc > 2 && $argv[1] == '--doc') {
                                          array_shift($argv);
                                          array_shift($argv);
                              Severity: Major
                              Found in common/BasicModel.php - About 2 hrs to fix

                                Method MessageToFrames has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        private byte[] MessageToFrames(string msg)
                                        {
                                            byte[] payload = System.Text.Encoding.UTF8.GetBytes(msg);
                                            byte[] resp;
                                            if (payload.Length <= 125) {
                                Severity: Major
                                Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/WebSocketServer.cs - About 2 hrs to fix

                                  File UnfiUploadPage.php has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  <?php
                                  /*******************************************************************************
                                  
                                      Copyright 2013 Whole Foods Co-op
                                  
                                  
                                  Severity: Minor
                                  Found in fannie/batches/UNFI/load-classes/UnfiUploadPage.php - About 2 hrs to fix

                                    File StaffArAccountsPage.php has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    <?php
                                    /*******************************************************************************
                                    
                                        Copyright 2013 Whole Foods Co-op
                                    
                                    

                                      File TraceJsonWriter.cs has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

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

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

                                            function endOrderAll(count, meters, buttons) {
                                                if (count > 15 || mod.all <= 0) {
                                                    meters.hide();
                                                    buttons.prop('disabled', false);
                                                } else {
                                        Severity: Major
                                        Found in fannie/modules/plugins2.0/RP/rpDirect.js and 3 other locations - About 2 hrs to fix
                                        fannie/modules/plugins2.0/RP/rpDual.js on lines 500..507
                                        fannie/modules/plugins2.0/RP/rpFloral.js on lines 319..326
                                        fannie/modules/plugins2.0/RP/rpOrder.js on lines 446..453

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

                                        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