CORE-POS/IS4C

View on GitHub

Showing 6,416 of 8,296 total issues

Method ajax_display_program has 481 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function ajax_display_program($id){
        global $FANNIE_PLUGIN_SETTINGS, $FANNIE_URL, $FANNIE_OP_DB;

        $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['CoopCredDatabase']);

Severity: Major
Found in fannie/modules/plugins2.0/CoopCred/programs/CoopCredProgramEditor.php - About 2 days to fix

    Method HandleDeviceMessage has a Cognitive Complexity of 133 (exceeds 20 allowed). Consider refactoring.
    Open

        protected override void HandleDeviceMessage(byte[] msg)
        {
            if (this.verbose_mode > 0)
                System.Console.Write("DMSG: {0}: ",current_state);
    
    
    Severity: Minor
    Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs - About 2 days to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method HandleDeviceMessage has a Cognitive Complexity of 133 (exceeds 20 allowed). Consider refactoring.
    Open

        protected virtual void HandleDeviceMessage(byte[] msg){
            if (this.verbose_mode > 0)
                System.Console.Write("DMSG: {0}: ",current_state);
    
            if (msg == null) msg = new byte[0];
    Severity: Minor
    Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 2 days to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function filter has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
    Open

        public function filter($dbc, $data)
        {
            $reverseMap = array();
            $tenderTTL = 0.00;
            $tax = False;
    Severity: Minor
    Found in pos/is4c-nf/lib/ReceiptBuilding/Filter/DefaultReceiptFilter.php - About 2 days to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function filter has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
    Open

        public function filter($dbc, $data)
        {
            $reverseMap = array();
            $tenderTTL = 0.00;
            $tax = False;
    Severity: Minor
    Found in fannie/modules/plugins2.0/EReceipt/EReceiptFilter.php - About 2 days to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function rpOrder has a Cognitive Complexity of 116 (exceeds 5 allowed). Consider refactoring.
    Open

    var rpOrder = (function ($) {
    
        var mod = {};
        var state = {
            'retention': 60,
    Severity: Minor
    Found in fannie/modules/plugins2.0/RP/rpFloral.js - About 2 days to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    File VPBPV.php has 946 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    
    <?php
    /*******************************************************************************
    
        Copyright 2010 Whole Foods Co-op
    Severity: Major
    Found in fannie/batches/UNFI/VPBPV.php - About 2 days to fix

      File DefaultContractResolver.cs has 944 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      using System;
      using System.Collections;
      #if !(NET35 || NET20 || PORTABLE || PORTABLE40)
      using System.Collections.Concurrent;
      #endif

        File FannieReportPage.php has 939 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*******************************************************************************
        
            Copyright 2012 Whole Foods Co-op
        
        
        Severity: Major
        Found in fannie/classlib2.0/FannieReportPage.php - About 2 days to fix

          Function render_data has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring.
          Open

              public function render_data($data,$headers=array(),$footers=array(),$format='html')
              {
                  $url = $this->config->get('URL');
                  $ret = "";
                  switch(strtolower($format)) {
          Severity: Minor
          Found in fannie/classlib2.0/FannieReportPage.php - About 2 days to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function body_content has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring.
          Open

              function body_content(){
                  //Should this really be done with global?
                  global $FANNIE_PLUGIN_LIST, $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
                  ob_start();
          
          
          Severity: Minor
          Found in fannie/install/InstallPluginsPage.php - About 2 days to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          File ReceiptLib.php has 927 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /*******************************************************************************
          
              Copyright 2001, 2004 Wedge Community Co-op
          
          
          Severity: Major
          Found in pos/is4c-nf/lib/ReceiptLib.php - About 2 days to fix

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

                public function fetch_report_data()
                {
                    $class_lib = $this->class_lib;
                    $dbc = $class_lib::getDB();
                    
            Severity: Major
            Found in fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php - About 2 days to fix

              Function rpOrder has 440 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var rpOrder = (function ($) {
              
                  var mod = {};
                  var state = {
                      'retention': 60,
              Severity: Major
              Found in fannie/modules/plugins2.0/RP/rpOrder.js - About 2 days to fix

                Function WFC_Hybrid_Single has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring.
                Open

                function WFC_Hybrid_Single($data,$offset=0){
                
                $pdf=new WFC_Hybrid_Single_PDF('L','mm',array(25.4, 53.975)); //start new instance of PDF
                $pdf->Open(); //open new PDF Document
                $pdf->setTagDate(date("m/d/Y"));
                Severity: Minor
                Found in fannie/admin/labels/pdf_layouts/WFC_Hybrid_Single.php - About 2 days to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                File FormLib.php has 890 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /*******************************************************************************
                
                    Copyright 2012 Whole Foods Co-op
                
                
                Severity: Major
                Found in fannie/classlib2.0/lib/FormLib.php - About 2 days to fix

                  File VPBPIV.php has 886 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /*******************************************************************************
                  
                      Copyright 2010 Whole Foods Co-op
                  
                  
                  Severity: Major
                  Found in fannie/batches/UNFI/VPBPIV.php - About 2 days to fix

                    File RpDirectPage.php has 883 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    include(__DIR__ . '/../../../config.php');
                    if (!class_exists('FannieAPI')) {
                        include(__DIR__ . '/../../../classlib2.0/FannieAPI.php');
                    Severity: Major
                    Found in fannie/modules/plugins2.0/RP/RpDirectPage.php - About 2 days to fix

                      Method showBatchDisplay has 425 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function showBatchDisplay($id, $order='natural')
                          {
                              global $FANNIE_SERVER_DBMS,$FANNIE_URL;
                              $dbc = $this->connection;
                              $uid = getUID($this->current_user);
                      Severity: Major
                      Found in fannie/batches/newbatch/EditBatchPage.php - About 2 days to fix

                        Function batchEdit has 420 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var batchEdit = (function ($) {
                            var mod = {};
                        
                            var alerthi = function() {
                                alert('hi');
                        Severity: Major
                        Found in fannie/batches/newbatch/edit.js - About 2 days to fix
                          Severity
                          Category
                          Status
                          Source
                          Language