CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

function caseSizeField(row)
{
    var caseSize = $('<input type="text" name="case-size[]" required />')
        .val(1)
        .addClass('item-units')
Severity: Major
Found in fannie/purchasing/js/manual.js and 1 other location - About 2 hrs to fix
fannie/purchasing/js/manual.js on lines 46..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 83.

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 ($exists) {
                $dbc->execute($upP, array($item['reg'], $item['sale'], $dept, $item['caseSize'], $item['size'], $item['sku'], $vendorID));
            } else {
                $dbc->execute($insP, array($item['upc'], $item['sku'], $brand, $description, $item['size'], $item['caseSize'], $item['reg'], $item['sale'], $dept, $vendorID));
            }
Severity: Major
Found in fannie/batches/UNFI/load-classes/CpwProduceUploadPage.php and 1 other location - About 2 hrs to fix
fannie/modules/plugins2.0/CpwPriceImport/CpwPriceTask.php on lines 140..144

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

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 ($exists) {
                $dbc->execute($upP, array($item['reg'], $item['sale'], $dept, $item['caseSize'], $item['size'], $item['sku'], $vendorID));
            } else {
                $dbc->execute($insP, array($item['upc'], $item['sku'], $brand, $description, $item['size'], $item['caseSize'], $item['reg'], $item['sale'], $dept, $vendorID));
            }
Severity: Major
Found in fannie/modules/plugins2.0/CpwPriceImport/CpwPriceTask.php and 1 other location - About 2 hrs to fix
fannie/batches/UNFI/load-classes/CpwProduceUploadPage.php on lines 160..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 129.

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 function post_countryID_name_abbr_handler()
    {
        global $FANNIE_OP_DB;
        $dbc = FannieDB::get($FANNIE_OP_DB);
        $model = new OriginCountryModel($dbc);
Severity: Major
Found in fannie/item/origins/OriginEditor.php and 1 other location - About 2 hrs to fix
fannie/item/origins/OriginEditor.php on lines 155..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 129.

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

    private function updateSKU($dbc, $id, $sku, $plu)
    {
        $skuP = $dbc->prepare('
            SELECT upc
            FROM vendorSKUtoPLU
Severity: Major
Found in fannie/item/vendors/SkuMapPage.php and 1 other location - About 2 hrs to fix
fannie/item/vendors/SkuMapPage.php on lines 183..202

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

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

    private function updatePLU($dbc, $id, $sku, $plu)
    {
        $pluP = $dbc->prepare('
            SELECT sku
            FROM vendorSKUtoPLU
Severity: Major
Found in fannie/item/vendors/SkuMapPage.php and 1 other location - About 2 hrs to fix
fannie/item/vendors/SkuMapPage.php on lines 161..181

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

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

    private function productStats($dbc)
    {
        $msg = "Products summary\n";
        $prodP = $dbc->prepare('SELECT COUNT(*) FROM products');
        $backP = $dbc->prepare('SELECT COUNT(*) FROM productBackup');
fannie/modules/plugins2.0/ReportMetrics/ReportMetricsTask.php on lines 190..205

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

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

    private function custdataStats($dbc)
    {
        $msg = "Custdata summary\n";
        $custP = $dbc->prepare('SELECT COUNT(*) FROM custdata WHERE personNum=1');
        $backP = $dbc->prepare('SELECT COUNT(*) FROM custdataBackup');
fannie/modules/plugins2.0/ReportMetrics/ReportMetricsTask.php on lines 173..188

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

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 function post_stateID_name_abbr_handler()
    {
        global $FANNIE_OP_DB;
        $dbc = FannieDB::get($FANNIE_OP_DB);
        $model = new OriginStateProvModel($dbc);
Severity: Major
Found in fannie/item/origins/OriginEditor.php and 1 other location - About 2 hrs to fix
fannie/item/origins/OriginEditor.php on lines 138..153

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

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

<?php
/*******************************************************************************

    Copyright 2009 Whole Foods Co-op

Severity: Minor
Found in fannie/item/vendors/EditVendorItems.php - About 2 hrs to fix

    Function positionInfo has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function positionInfo(object) {
    
      var p_elm = object;
    
      this.getElementLeft = getElementLeft;
    Severity: Major
    Found in fannie/modules/plugins2.0/CoopCred/programs/CalendarControl.js - About 2 hrs to fix

      Method sendAuth has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function sendAuth()
          {
              // initialize
              $dbTrans = Database::tDataConnect();
              if (!$dbTrans) {
      Severity: Major
      Found in pos/is4c-nf/plugins/Paycards/Valutec.php - About 2 hrs to fix

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

            public function message($val, $ref, $reprint=False){
        
                global $CORE_LOCAL;
        
                if ($val == 0) {
        Severity: Major
        Found in pos/is4c-nf/plugins/CoopCred/receiptMessages/CCredSigSlip.php - About 2 hrs to fix

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

              function body_content()
              {
                  $prefix = $this->session->get('houseCouponPrefix');
                  if ($prefix == '') {
                      $prefix = '00499999';
          Severity: Major
          Found in pos/is4c-nf/gui-modules/HouseCouponList.php - About 2 hrs to fix

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

            static private function trTotal($codes,$label,$listEach=False,$reportIfNone=True) {
                global $CORE_LOCAL;
            
                $db_a = self::$db_a;
            
            

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

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

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

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

                  File PickTagsPage.php has 265 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  use COREPOS\Fannie\API\item\signage\Tags4x8P;
                  use COREPOS\Fannie\API\lib\Store;
                  
                  
                  Severity: Minor
                  Found in fannie/admin/labels/PickTagsPage.php - About 2 hrs to fix

                    Method drawPage has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function drawPage()
                        {
                            $url = $this->config->URL;
                            if ($this->preprocess() === false) {
                                return;
                    Severity: Major
                    Found in fannie/admin/HelpPopup.php - About 2 hrs to fix

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

                          public function get_id_view()
                          {
                              $dbc = $this->connection;
                              $settings = $this->config->get('PLUGIN_SETTINGS');
                              $dbc->selectDB($settings['ScheduledEmailDB']);
                        Severity
                        Category
                        Status
                        Source
                        Language