CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    public function fetch_report_data()
    {
        $store = FormLib::get('store', false);
        if (!$store) {
            $store = COREPOS\Fannie\API\lib\Store::getIdByIp();
Severity: Major
Found in fannie/batches/EndCapper/EndCapperReport.php - About 4 hrs to fix

    Method import has 105 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static public function import($zipfile, $vendorID, $repeat=false)
        {
            global $FANNIE_OP_DB;
            $za = new ZipArchive();
            $try = $za->open($zipfile);
    Severity: Major
    Found in fannie/modules/plugins2.0/UnfiInvoiceGrabber/UIGLib.php - About 4 hrs to fix

      Method get_new_view has 105 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function get_new_view()
          {
              $settings = $this->config->get('PLUGIN_SETTINGS');
              $prefix = $settings['IncidentDB'] . $this->connection->sep();
      
      
      Severity: Major
      Found in fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php - About 4 hrs to fix

        Method ParseValue has 105 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                private bool ParseValue()
                {
                    while (true)
                    {
                        char currentChar = _chars[_charPos];

          Method WriteEscapedJavaScriptString has 105 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public static void WriteEscapedJavaScriptString(TextWriter writer, string s, char delimiter, bool appendDelimiters,
                      bool[] charEscapeFlags, StringEscapeHandling stringEscapeHandling, ref char[] writeBuffer)
                  {
                      // leading delimiter
                      if (appendDelimiters)

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

                var upc = $('<input type="text" name="upc[]" required />')
                    .addClass('form-control')
                    .addClass('item-upc')
                    .addClass('input-sm')
                    .addClass('upc-field')
            Severity: Major
            Found in fannie/purchasing/js/manual.js and 1 other location - About 4 hrs to fix
            fannie/purchasing/js/manual.js on lines 3..17

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

            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

                var sku = $('<input type="text" name="sku[]" required />')
                    .addClass('form-control')
                    .addClass('item-sku')
                    .addClass('upc-field')
                    .addClass('input-sm')
            Severity: Major
            Found in fannie/purchasing/js/manual.js and 1 other location - About 4 hrs to fix
            fannie/purchasing/js/manual.js on lines 23..37

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

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

            <?php
            /*******************************************************************************
            
                Copyright 2009 Whole Foods Co-op
            
            
            Severity: Minor
            Found in fannie/cron/nightly.dtrans.php - About 4 hrs to fix

              File OrderItemLib.php has 341 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              /**
                @class OrderItemLib
                
              Severity: Minor
              Found in fannie/ordering/OrderItemLib.php - About 4 hrs to fix

                File JsonSchemaGenerator.cs has 341 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                using System;
                using System.Globalization;
                using System.ComponentModel;
                using System.Collections.Generic;
                using Newtonsoft.Json.Linq;

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

                          if ($vidsStart != false && $vidsEnd != false) {
                              $ret .= "<h3 align=\"center\">Multiple Vendor View</h3>";
                              $vidsA = array($vidsStart, $vidsEnd);
                              $vidsP = $dbc->prepare("SELECT * FROM batchReviewLog WHERE forced >= ? AND forced < ? 
                                  AND vid <> 1 GROUP BY vid;");
                  Severity: Major
                  Found in fannie/batches/UNFI/VendorPricingBatchPage.php and 3 other locations - About 4 hrs to fix
                  fannie/batches/UNFI/VPBPIII.php on lines 730..744
                  fannie/batches/UNFI/VPBPIV.php on lines 824..838
                  fannie/batches/UNFI/VPBPV.php on lines 878..892

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

                  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

                          if ($vidsStart != false && $vidsEnd != false) {
                              $ret .= "<h3 align=\"center\">Multiple Vendor View</h3>";
                              $vidsA = array($vidsStart, $vidsEnd);
                              $vidsP = $dbc->prepare("SELECT * FROM batchReviewLog WHERE forced >= ? AND forced < ? GROUP BY vid;");
                              $vidsR = $dbc->execute($vidsP, $vidsA);
                  Severity: Major
                  Found in fannie/batches/UNFI/VPBPIII.php and 3 other locations - About 4 hrs to fix
                  fannie/batches/UNFI/VPBPIV.php on lines 824..838
                  fannie/batches/UNFI/VPBPV.php on lines 878..892
                  fannie/batches/UNFI/VendorPricingBatchPage.php on lines 244..259

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

                  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 (substr($shortname, -4) != '.php') {
                              $t_index = 'tasks';
                              $obj = new $shortname(); 
                              if (!isset($tab['tasks'][$shortname])) {
                                  $tab['tasks'][$shortname] = array(
                  Severity: Major
                  Found in fannie/cron/management/CronManagementPage.php and 1 other location - About 4 hrs to fix
                  fannie/cron/management/CronManagementPage.php on lines 260..277

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

                  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

                          if ($vidsStart != false && $vidsEnd != false) {
                              $ret .= "<h3 align=\"center\">Multiple Vendor View</h3>";
                              $vidsA = array($vidsStart, $vidsEnd);
                              $vidsP = $dbc->prepare("SELECT * FROM batchReviewLog WHERE forced >= ? AND forced < ? GROUP BY vid;");
                              $vidsR = $dbc->execute($vidsP, $vidsA);
                  Severity: Major
                  Found in fannie/batches/UNFI/VPBPV.php and 3 other locations - About 4 hrs to fix
                  fannie/batches/UNFI/VPBPIII.php on lines 730..744
                  fannie/batches/UNFI/VPBPIV.php on lines 824..838
                  fannie/batches/UNFI/VendorPricingBatchPage.php on lines 244..259

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

                  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 (substr($shortname, -4) != '.php') {
                              $t_index = 'tasks';
                              $obj = new $shortname(); 
                              if (!isset($tab['tasks'][$shortname])) {
                                  // cast-to-string necessary to correctly compare
                  Severity: Major
                  Found in fannie/cron/management/CronManagementPage.php and 1 other location - About 4 hrs to fix
                  fannie/cron/management/CronManagementPage.php on lines 373..388

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

                  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

                          if ($vidsStart != false && $vidsEnd != false) {
                              $ret .= "<h3 align=\"center\">Multiple Vendor View</h3>";
                              $vidsA = array($vidsStart, $vidsEnd);
                              $vidsP = $dbc->prepare("SELECT * FROM batchReviewLog WHERE forced >= ? AND forced < ? GROUP BY vid;");
                              $vidsR = $dbc->execute($vidsP, $vidsA);
                  Severity: Major
                  Found in fannie/batches/UNFI/VPBPIV.php and 3 other locations - About 4 hrs to fix
                  fannie/batches/UNFI/VPBPIII.php on lines 730..744
                  fannie/batches/UNFI/VPBPV.php on lines 878..892
                  fannie/batches/UNFI/VendorPricingBatchPage.php on lines 244..259

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

                  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

                      if (isset($origins[$row['upc']])) {
                          $pdf->SetXY($full_x,$full_y+24);
                          $pdf->Cell($width,4,strtoupper($origins[$row['upc']]),0,1,'L');
                      } else if ($row['upc'] === '' && isset($row['originName']) && strlen($row['originName']) > 0) {
                          $pdf->SetXY($full_x,$full_y+24);
                  Severity: Major
                  Found in fannie/admin/labels/pdf_layouts/WFC_Produce.php and 1 other location - About 4 hrs to fix
                  fannie/admin/labels/pdf_layouts/WFC_Produce_Single.php on lines 158..164

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

                  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

                      if (isset($origins[$row['upc']])) {
                          $pdf->SetXY($full_x,$full_y+20);
                          $pdf->Cell($width,4,strtoupper($origins[$row['upc']]),0,1,'L');
                      } else if ($row['upc'] === '' && isset($row['originName']) && strlen($row['originName']) > 0) {
                          $pdf->SetXY($full_x,$full_y+20);
                  Severity: Major
                  Found in fannie/admin/labels/pdf_layouts/WFC_Produce_Single.php and 1 other location - About 4 hrs to fix
                  fannie/admin/labels/pdf_layouts/WFC_Produce.php on lines 164..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 166.

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

                  <?php
                  /*******************************************************************************
                  
                      Copyright 2001, 2004 Wedge Community Co-op
                      Copyright 2014 West End Food Coop, Toronto

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

                        function fetch_report_data()
                        {
                            $dbc = $this->connection;
                            $dbc->selectDB($this->config->get('OP_DB'));
                            $start = FormLib::get_form_value('date1','');
                    Severity: Major
                    Found in fannie/reports/FloorSectionSales/floorSectionSalesReport.php - About 4 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language