CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Function vendorEditor has 106 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var vendorEditor = (function($) {

    var mod = {};

    mod.vendorNew = function(){
Severity: Major
Found in fannie/item/vendors/index.js - About 4 hrs to fix

    Method addItem has 106 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function addItem(array $row, $quantity, $priceObj)
        {
            if ($quantity == 0) return false;
    
            $pricing = $priceObj->priceInfo($row,$quantity);
    Severity: Major
    Found in pos/is4c-nf/lib/Scanning/PriceMethods/BigGroupPM.php - About 4 hrs to fix

      Method upload_content has 106 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function upload_content()
          {
              $db = WfcHtLib::hours_dbconnect();
      
              $ADP_COL = 3;
      Severity: Major
      Found in fannie/modules/plugins2.0/WfcHoursTracking/WfcHtUploadPage.php - About 4 hrs to fix

        Method PopulateMultidimensionalArray has 106 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                private object PopulateMultidimensionalArray(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, string id)
                {
                    int rank = contract.UnderlyingType.GetArrayRank();
        
                    if (id != null)

          Method ParseArrayIndexer has 106 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private PathFilter ParseArrayIndexer(char indexerCloseChar)
                  {
                      int start = _currentIndex;
                      int? end = null;
                      List<int> indexes = null;

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

            using System;
            using System.Collections.Generic;
            #if NET20
            using Newtonsoft.Json.Utilities.LinqBridge;
            #endif
            pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/ExpressionValueProvider.cs on lines 27..114

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

            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

            using System;
            using System.Collections.Generic;
            #if NET20
            using Newtonsoft.Json.Utilities.LinqBridge;
            #endif
            pos/is4c-nf/scale-drivers/drivers/NewMagellan/Newtonsoft.Json/Serialization/DynamicValueProvider.cs on lines 27..113

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

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

                public function post_cleanup_handler()
                {
                    $dbc = $this->connection;
                    $dbc->selectDB($this->config->OP_DB);
                    $bids = FormLib::get('bid');
            Severity: Major
            Found in fannie/batches/UNFI/VPBPIII.php and 2 other locations - About 4 hrs to fix
            fannie/batches/UNFI/VPBPIV.php on lines 76..98
            fannie/batches/UNFI/VPBPV.php on lines 77..99

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

            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 = $dbc->fetchRow($result)) {
                    $upc[] = $row['upc'];
                    $brand[] = $row['brand'];
                    $desc[] = $row['description'];
                    $queue[] = $row['queue'];
            fannie/modules/plugins2.0/WfcBatchCheck/noauto/SalesChangeQueuesUnchecked.php on lines 112..127

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

            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 (!empty($_FILES['img2']['tmp_name']) && file_exists($_FILES['img2']['tmp_name'])) {
                        $ext = pathinfo($_FILES['img2']['name'], PATHINFO_EXTENSION);
                        $file = md5(rand());
                        while (file_exists(__DIR__  . "/image/{$file}.{$ext}")) {
                            $file = md5(rand());
            Severity: Major
            Found in fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php and 3 other locations - About 4 hrs to fix
            fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php on lines 188..196
            fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php on lines 197..205
            fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php on lines 316..324

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

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

                public function post_cleanup_handler()
                {
                    $dbc = $this->connection;
                    $dbc->selectDB($this->config->OP_DB);
                    $bids = FormLib::get('bid');
            Severity: Major
            Found in fannie/batches/UNFI/VPBPV.php and 2 other locations - About 4 hrs to fix
            fannie/batches/UNFI/VPBPIII.php on lines 53..75
            fannie/batches/UNFI/VPBPIV.php on lines 76..98

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

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

                public function post_cleanup_handler()
                {
                    $dbc = $this->connection;
                    $dbc->selectDB($this->config->OP_DB);
                    $bids = FormLib::get('bid');
            Severity: Major
            Found in fannie/batches/UNFI/VPBPIV.php and 2 other locations - About 4 hrs to fix
            fannie/batches/UNFI/VPBPIII.php on lines 53..75
            fannie/batches/UNFI/VPBPV.php on lines 77..99

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

            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 (!empty($_FILES['img2']['tmp_name']) && file_exists($_FILES['img2']['tmp_name'])) {
                        $ext = pathinfo($_FILES['img2']['name'], PATHINFO_EXTENSION);
                        $file = md5(rand());
                        while (file_exists(__DIR__  . "/image/{$file}.{$ext}")) {
                            $file = md5(rand());
            Severity: Major
            Found in fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php and 3 other locations - About 4 hrs to fix
            fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php on lines 188..196
            fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php on lines 316..324
            fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php on lines 325..333

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

            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 (!empty($_FILES['img1']['tmp_name']) && file_exists($_FILES['img1']['tmp_name'])) {
                        $ext = pathinfo($_FILES['img1']['name'], PATHINFO_EXTENSION);
                        $file = md5(rand());
                        while (file_exists(__DIR__  . "/image/{$file}.{$ext}")) {
                            $file = md5(rand());
            Severity: Major
            Found in fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php and 3 other locations - About 4 hrs to fix
            fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php on lines 197..205
            fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php on lines 316..324
            fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php on lines 325..333

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

            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 = $dbc->fetchRow($result)) {
                    $upc[] = $row['upc'];
                    $brand[] = $row['brand'];
                    $desc[] = $row['description'];
                    $queue[] = $row['queue'];
            fannie/modules/plugins2.0/WfcBatchCheck/noauto/SalesChangeQueuesDNC.php on lines 109..123

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

            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 (!empty($_FILES['img1']['tmp_name']) && file_exists($_FILES['img1']['tmp_name'])) {
                        $ext = pathinfo($_FILES['img1']['name'], PATHINFO_EXTENSION);
                        $file = md5(rand());
                        while (file_exists(__DIR__  . "/image/{$file}.{$ext}")) {
                            $file = md5(rand());
            Severity: Major
            Found in fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php and 3 other locations - About 4 hrs to fix
            fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php on lines 188..196
            fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php on lines 197..205
            fannie/modules/plugins2.0/IncidentTracker/AlertIncident.php on lines 325..333

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

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

            <?php
            /*******************************************************************************
            
                Copyright 2010 Whole Foods Co-op
            
            
            Severity: Minor
            Found in fannie/ordering/historical.php - About 4 hrs to fix

              File DeliVendorAliasPage.php has 342 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /*******************************************************************************
              
                  Copyright 2014 Foods Co-op
              
              
              Severity: Minor
              Found in fannie/item/vendors/DeliVendorAliasPage.php - About 4 hrs to fix

                Function subDept has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var subDept = (function($) {
                    var mod = {};
                
                    var deptList = new Vue({
                        el: '#deptselect',
                Severity: Major
                Found in fannie/item/departments/sub.js - About 4 hrs to fix

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

                  static public function printReceipt($arg1, $ref, $second=False, $email=False) 
                  {
                      if($second) $email = False; // store copy always prints
                      if($arg1 != "full") $email = False;
                      $reprint = $arg1 == 'reprint' ? true : false;
                  Severity: Major
                  Found in pos/is4c-nf/lib/ReceiptLib.php - About 4 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language