CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

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

    Copyright 2011 Whole Foods Co-op

Severity: Major
Found in fannie/sync/special/tenders.wfc.php and 2 other locations - About 2 hrs to fix
fannie/sync/special/memtype.ypsi.php on lines 1..41
fannie/sync/special/subdepts.wfc.php on lines 1..39

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

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 ($found_charge) {
                $actual = array();
                $num=0;
                while ($arRows[$card_no][$num]['charges'] == 0) {
                    $num++;
fannie/modules/plugins2.0/StatementsPlugin/StatementsPluginBusiness.php on lines 212..223

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

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 3 locations. Consider refactoring.
Open

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

    Copyright 2011 Whole Foods Co-op

Severity: Major
Found in fannie/sync/special/memtype.ypsi.php and 2 other locations - About 2 hrs to fix
fannie/sync/special/subdepts.wfc.php on lines 1..39
fannie/sync/special/tenders.wfc.php on lines 1..42

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

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 3 locations. Consider refactoring.
Open

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

    Copyright 2011 Whole Foods Co-op

Severity: Major
Found in fannie/sync/special/subdepts.wfc.php and 2 other locations - About 2 hrs to fix
fannie/sync/special/memtype.ypsi.php on lines 1..41
fannie/sync/special/tenders.wfc.php on lines 1..42

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

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 (substr($item['upc'], 0, 3) == '002') {
                    $right = sprintf('%.2f', $row['normal_price']);
                    $right = str_replace('.', '', $right);
                    $right = str_pad($right, 4, '0', STR_PAD_LEFT);
                    $item['upc'] = substr($item['upc'], 0, 9) . $right;
Severity: Major
Found in fannie/admin/labels/PickTagsPage.php and 1 other location - About 2 hrs to fix
fannie/admin/labels/PickTagsPage.php on lines 78..83

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

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

    function form_content()
    {
        $dbc = FannieDB::get($this->config->get('OP_DB'));
        $stores = FormLib::storePicker();
        ob_start();
Severity: Major
Found in fannie/purchasing/reports/OutOfStockReport.php and 1 other location - About 2 hrs to fix
fannie/purchasing/reports/TotalPurchasesReport.php on lines 102..149

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

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

class UnfiInvoiceGrabber extends \COREPOS\Fannie\API\FanniePlugin 
{
    public $plugin_settings = array(
    'UnfiInvoiceUser' => array('default'=>'','label'=>'Username',
                    'description'=>'Username to log into UNFI website'), 
fannie/modules/plugins2.0/Mercato/Mercato.php on lines 3..20

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

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

    function form_content()
    {
        $dbc = FannieDB::get($this->config->get('OP_DB'));
        $stores = FormLib::storePicker();
        ob_start();
Severity: Major
Found in fannie/purchasing/reports/TotalPurchasesReport.php and 1 other location - About 2 hrs to fix
fannie/purchasing/reports/OutOfStockReport.php on lines 134..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 125.

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

class Mercato extends \COREPOS\Fannie\API\FanniePlugin 
{
    public $plugin_settings = array(
    'MercatoFtpHost' => array('default'=>'', 'label'=>'SFTP Hostname',
            'description'=>'Mercato SFTP server'), 
Severity: Major
Found in fannie/modules/plugins2.0/Mercato/Mercato.php and 1 other location - About 2 hrs to fix
fannie/modules/plugins2.0/UnfiInvoiceGrabber/UnfiInvoiceGrabber.php on lines 31..47

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

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 (substr($item['upc'], 0, 3) == '002') {
                    $right = sprintf('%.2f', $itemW['normal_price']);
                    $right = str_replace('.', '', $right);
                    $right = str_pad($right, 4, '0', STR_PAD_LEFT);
                    $item['upc'] = substr($item['upc'], 0, 9) . $right;
Severity: Major
Found in fannie/admin/labels/PickTagsPage.php and 1 other location - About 2 hrs to fix
fannie/admin/labels/PickTagsPage.php on lines 163..168

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

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 countV3.js has 257 lines of code (exceeds 250 allowed). Consider refactoring.
Open

function loader(){
    $('#display').html('');
    var date1 = $('#startDate').val();
    var date2 = $('#endDate').val();
    var store = $('select[name=store]').val();
Severity: Minor
Found in fannie/modules/plugins2.0/OverShortTools/js/countV3.js - About 2 hrs to fix

    File OldSpecialOrdersPage.php has 257 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*******************************************************************************
    
        Copyright 2014 Whole Foods Co-op
    
    
    Severity: Minor
    Found in fannie/ordering/OldSpecialOrdersPage.php - About 2 hrs to fix

      File JTokenReader.cs has 257 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      using System;
      using Newtonsoft.Json.Utilities;
      
      namespace Newtonsoft.Json.Linq
      {

        VoidCmd has 21 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class VoidCmd extends Parser implements AdminLoginInterface
        {
            private $scaleprice = 0;
        
            public function check($str)
        Severity: Minor
        Found in pos/is4c-nf/parser/parse/VoidCmd.php - About 2 hrs to fix

          DTrans has 21 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class DTrans 
          {
          
              /**
                Array of default values for dtransaction-style tables
          Severity: Minor
          Found in fannie/classlib2.0/data/DTrans.php - About 2 hrs to fix

            Class SPH_Datacap_EMVX has 21 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public class SPH_Datacap_EMVX : SerialPortHandler 
            {
                private DsiEMVX emv_ax_control = null;
                private DsiPDCX pdc_ax_control = null;
                private string device_identifier = null;
            Severity: Minor
            Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Datacap_EMVX.cs - About 2 hrs to fix

              Class RBA_Stub has 21 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public class RBA_Stub : SPH_IngenicoRBA_Common 
              {
                  new private SerialPort sp = null;
              
                  private RbaButtons emv_buttons = RbaButtons.Credit;
              Severity: Minor
              Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/RBA_Stub.cs - About 2 hrs to fix

                Function lcEditor has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var lcEditor = (function ($) {
                
                    var mod = {};
                
                    function ajax(dstr) {
                Severity: Major
                Found in fannie/item/likecodes/lcEditor.js - About 2 hrs to fix

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

                      public function message($val, $ref, $reprint=False)
                      {
                          if ($reprint || CoreLocal::get('isStaff') || CoreLocal::get('memType') == 4) {
                              return '';
                          }
                  Severity: Major
                  Found in pos/is4c-nf/plugins/SurveyReceipt/SurveyReceiptMessage.php - About 2 hrs to fix

                    Method errorCheck has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function errorCheck()
                        {
                            global $CORE_LOCAL;
                    
                            $this->conn = CoopCredLib::ccDataConnect();
                    Severity: Major
                    Found in pos/is4c-nf/plugins/CoopCred/CoopCredTender.php - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language