CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method dont_print_nothing_handler has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function dont_print_nothing_handler()
    {
        $store = COREPOS\Fannie\API\lib\Store::getIdByIp();
        $mtLength = $store == 1 ? 3 : 7;

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

    File BsonWriter.cs has 285 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.IO;
    #if !(NET20 || NET35 || PORTABLE40 || PORTABLE)

      Method PopulateList has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              private object PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, string id)
              {
                  IWrappedCollection wrappedCollection = list as IWrappedCollection;
                  object underlyingList = wrappedCollection != null ? wrappedCollection.UnderlyingCollection : list;
      
      

        Method ParseData has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private string ParseData(string s)
            {
                if (s.Substring(0,2) == "S0") { // scanner message
                    if (s.Substring(0,4) == "S08A" || s.Substring(0,4) == "S08F") { // UPC-A or EAN-13
                        return s.Substring(4);
        Severity: Major
        Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Magellan_Scale.cs - About 2 hrs to fix

          Method ParseData has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private string ParseData(string s)
              {
                  if (s.Substring(0,1) == "0") { // scanner message
                      if (s.Substring(0,3) == "08A" || s.Substring(0,3) == "08F") { // UPC-A or EAN-13
                          return s.Substring(3);
          Severity: Major
          Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_NCR_Scale.cs - About 2 hrs to fix

            MercuryE2E has 25 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class MercuryE2E extends BasicCCModule 
            {
                private $voidTrans;
                private $voidRef;
                protected $SOAPACTION = "http://www.mercurypay.com/CreditTransaction";
            Severity: Minor
            Found in pos/is4c-nf/plugins/Paycards/MercuryE2E.php - About 2 hrs to fix

              Class JsonSerializer has 25 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  public class JsonSerializer
                  {
                      internal TypeNameHandling _typeNameHandling;
                      internal FormatterAssemblyStyle _typeNameAssemblyFormat;
                      internal PreserveReferencesHandling _preserveReferencesHandling;

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

                try:
                    opts, args = getopt.getopt(sys.argv[1:], "u:p:v", ["user=", "password=", "verbose"])
                except getopt.GetoptError as err:
                    print((str(err)))
                    usage()
                fannie/modules/plugins2.0/UnfiInvoiceGrabber/noauto/myunfi.py on lines 25..30
                fannie/modules/plugins2.0/UnfiInvoiceGrabber/noauto/myunfi2.py on lines 26..31

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

                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

                try:
                    opts, args = getopt.getopt(sys.argv[1:], "u:p:a:", ["user=", "password=", "account="])
                except getopt.GetoptError as err:
                    print((str(err)))
                    usage()
                fannie/modules/plugins2.0/USFoodsInvoiceGrabber/noauto/usf.py on lines 18..23
                fannie/modules/plugins2.0/UnfiInvoiceGrabber/noauto/myunfi2.py on lines 26..31

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

                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

                try:
                    opts, args = getopt.getopt(sys.argv[1:], "u:p:a:", ["user=", "password=", "account="])
                except getopt.GetoptError as err:
                    print((str(err)))
                    usage()
                fannie/modules/plugins2.0/USFoodsInvoiceGrabber/noauto/usf.py on lines 18..23
                fannie/modules/plugins2.0/UnfiInvoiceGrabber/noauto/myunfi.py on lines 25..30

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

                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

                        $data[] = array(
                            'Transactions',
                            number_format($total_trans->lastYear),
                            number_format($proj_trans),
                            '',
                fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 774..788

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

                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

                        $data[] = array(
                            'Transactions',
                            number_format($total_trans->lastYear),
                            number_format($proj_trans),
                            '',
                fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php on lines 763..777

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

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

                <?php
                /*******************************************************************************
                
                    Copyright 2015 Whole Foods Co-op
                
                
                Severity: Minor
                Found in fannie/cron/tasks/OrderGenTask.php - About 2 hrs to fix

                  File New_WFC_Deli_Narrow.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

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

                    File MKSalesSummaryReport.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    use COREPOS\Fannie\API\data\DataCache;
                    
                    include(dirname(__FILE__).'/../../../../config.php');

                      Method prepareDataCapBalance has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function prepareDataCapBalance($type, $prompt=false)
                          {
                              $this->conf->set('DatacapBalanceCheck', '??');
                              $this->conf->set('EWICBalance', '??');
                              $termID = $this->getTermID();
                      Severity: Major
                      Found in pos/is4c-nf/plugins/Paycards/MercuryDC.php - About 2 hrs to fix

                        Method plugin_transaction_reset has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function plugin_transaction_reset(){
                                global $CORE_LOCAL;
                        
                                $dbc = CoopCredLib::ccDataConnect();
                                if ($dbc === False) {
                        Severity: Major
                        Found in pos/is4c-nf/plugins/CoopCred/CoopCred.php - About 2 hrs to fix

                          Method setMember has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              static public function setMember($member, $personNumber, $row=array())
                              {
                                  $conn = Database::pDataConnect();
                          
                                  /**
                          Severity: Major
                          Found in pos/is4c-nf/lib/MemberLib.php - About 2 hrs to fix

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

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

                              Method checkPriceChanges has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function checkPriceChanges()
                                  {
                                      global $FANNIE_OP_DB;
                                      $dbc = FannieDB::get($FANNIE_OP_DB);
                              
                              
                              Severity: Major
                              Found in fannie/batches/UNFI/RecalculateVendorSRPs.php - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language