CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method ManualEntryPAN has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected byte[] ManualEntryPAN(){
        byte[] ret = new byte[68];

        int pos = 0;
        ret[pos++] = 0x75;
Severity: Major
Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 2 hrs to fix

    Method ManualEntryCVV has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected byte[] ManualEntryCVV(){
            byte[] ret = new byte[75];
    
            int pos = 0;
            ret[pos++] = 0x75;
    Severity: Major
    Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 2 hrs to fix

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

                      while ($row = $this->connection->fetchRow($res)) {
                          $row['date_id'] = date('Ymd', mktime(0,0,0,$row[1],$row[2],$row[0]));
                          $ret .= sprintf('<tr><td>%s</td><td>$%s</td></tr>',
                              date('D, M jS', strtotime($row['date_id'])),
                              number_format($row['total'])
      fannie/modules/plugins2.0/CoreWarehouse/reports/WfcWeeklyReport.php on lines 39..46

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

      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

              while ($row = $this->connection->fetchRow($res)) {
                  $row['date_id'] = date('Ymd', mktime(0,0,0,$row[1],$row[2],$row[0]));
                  $ret .= sprintf('<tr><td>%s</td><td>$%s</td></tr>',
                      date('D, M jS', strtotime($row['date_id'])),
                      number_format($row['total'])
      fannie/modules/plugins2.0/CoreWarehouse/reports/WfcWeeklyReport.php on lines 118..125

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

      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

                      if ($item['startDate'] != '' && $item['endDate'] != '') {
                          $datestr = $this->getDateString($item['startDate'], $item['endDate']);
                          $pdf->SetXY($this->left, $this->top + ($this->height*$row) + ($this->height - $this->top - 20));
                          $pdf->SetFont($this->alt_font, '', $this->SMALLEST_FONT);
                          $pdf->Cell($effective_width, 20, $datestr, 0, 1, 'R');
      Severity: Major
      Found in fannie/classlib2.0/item/signage/ItemList2UpP.php and 1 other location - About 2 hrs to fix
      fannie/classlib2.0/item/signage/Signage2UpP.php on lines 110..115

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

      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

              if ($item['startDate'] != '' && $item['endDate'] != '') {
                  $datestr = $this->getDateString($item['startDate'], $item['endDate']);
                  $pdf->SetXY($this->left, $this->top + ($this->height*$row) + ($this->height - $this->top - 20));
                  $pdf->SetFont($this->alt_font, '', $this->SMALLEST_FONT);
                  $pdf->Cell($effective_width, 20, $datestr, 0, 1, 'R');
      Severity: Major
      Found in fannie/classlib2.0/item/signage/Signage2UpP.php and 1 other location - About 2 hrs to fix
      fannie/classlib2.0/item/signage/ItemList2UpP.php on lines 106..111

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

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

      <?php
      /*******************************************************************************
      
          Copyright 2010 Whole Foods Co-op
      
      
      Severity: Minor
      Found in pos/is4c-nf/lib/Scanning/SpecialUPCs/CouponCode.php - About 2 hrs to fix

        File WFC_Bulk_Repack_14UP.php has 276 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        use COREPOS\Fannie\API\FanniePlugin;
        if (!class_exists('FpdfWithBarcode')) {
            include(dirname(__FILE__) . '/../FpdfWithBarcode.php');
        }
        Severity: Minor
        Found in fannie/admin/labels/pdf_layouts/WFC_Bulk_Repack_14UP.php - About 2 hrs to fix

          File PaycardFixVoid.php has 276 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/PaycardFix/PaycardFixVoid.php - About 2 hrs to fix

            File WfcHtEvalView.php has 276 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/WfcHoursTracking/eval/WfcHtEvalView.php - About 2 hrs to fix

              File SPH_SignAndPay_Auto.cs has 276 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              using System;
              using System.IO;
              using System.IO.Ports;
              using System.Threading;
              using CustomForms;
              Severity: Minor
              Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs - About 2 hrs to fix

                Function updateBuyAmount has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function updateBuyAmount(d){
                    if (d === 'Checks' || d === '100.00' || d === '50.00' || d === 'Junk')
                        return;
                
                    $('.denom').each(function(){
                Severity: Major
                Found in fannie/modules/plugins2.0/OverShortTools/js/countV3.js - About 2 hrs to fix

                  Method trTotal has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function trTotal($session,$k, $label,$i=False) 
                  {
                      $dba = Database::mDataConnect();
                      if ($dba === false) {
                          return '';
                  Severity: Major
                  Found in pos/is4c-nf/lib/ReceiptBuilding/TenderReports/YPSITenderReport.php - About 2 hrs to fix

                    Method message has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function message($val, $ref, $reprint=false)
                        {
                            list($emp, $reg, $trans) = ReceiptLib::parseRef($ref);
                            $slip = '';
                    
                    
                    Severity: Major
                    Found in pos/is4c-nf/lib/ReceiptBuilding/Messages/EbtReceiptMessage.php - About 2 hrs to fix

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

                          function process_file($linedata, $indexes)
                          {
                              global $FANNIE_OP_DB;
                              $dbc = FannieDB::get($FANNIE_OP_DB);
                              $idR = $dbc->query("SELECT vendorID FROM vendors WHERE (vendorName='UNFI' OR vendorName LIKE 'UNFI %')
                      Severity: Major
                      Found in fannie/batches/CAP/EdlpCatalogOverwrite.php - About 2 hrs to fix

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

                            public function fetch_report_data()
                            {
                                try {
                                    $date1 = $this->form->date1;
                                    $date2 = $this->form->date2;
                        Severity: Major
                        Found in fannie/reports/Store-Specific/WFC/MarginStudy/MarginStudyReport.php - About 2 hrs to fix

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

                              function fetch_report_data()
                              {
                                  try {
                                      $date1 = $this->form->date1;
                                      $date2 = $this->form->date2;
                          Severity: Major
                          Found in fannie/reports/CashierTransactions/CashierTransactionsReport.php - About 2 hrs to fix

                            Method formTableHeader has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function formTableHeader()
                                {
                                    if (FannieConfig::config('COOP_ID') == 'WFC_Duluth') {
                                        $ret = SignsLib::visualSignSelectHTML();
                                        $this->addOnloadCommand(SignsLib::visualSignSelectJS());
                            Severity: Major
                            Found in fannie/admin/labels/ManualSignsPage.php - About 2 hrs to fix

                              File WFC_Dark_ServiceCase_12UP.php has 275 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              use COREPOS\Fannie\API\FanniePlugin;
                              if (!class_exists('FpdfWithBarcode')) {
                                  include(dirname(__FILE__) . '/../FpdfWithBarcode.php');
                              }
                              Severity: Minor
                              Found in fannie/admin/labels/pdf_layouts/WFC_Dark_ServiceCase_12UP.php - About 2 hrs to fix

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

                                    protected function get_id_view()
                                    {
                                        if (!FannieAuth::validateUserQuiet('hr_editor') && !FannieAuth::validateUserQuiet('illness_editor')) {
                                            return '<div class="alert alert-danger">You do not have access to this</div>';
                                        }
                                Severity: Major
                                Found in fannie/modules/plugins2.0/HrWeb/IllnessLog/IllnessLogsPage.php - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language