CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method postCustdata has 136 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function postCustdata($dbc, $id, $json)
    {
        $config = FannieConfig::factory();
        $ret = array('errors' => 0, 'error-msg' => '');

Severity: Major
Found in fannie/classlib2.0/member/MemberREST.php - About 5 hrs to fix

    Method process_file has 136 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function process_file($linedata, $indexes)
        {
            global $FANNIE_OP_DB;
            $dbc = FannieDB::get($FANNIE_OP_DB);
    
    
    Severity: Major
    Found in fannie/item/likecodes/LikeCodePriceUploadPage.php - About 5 hrs to fix

      Function productList has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

      var productList = (function($) {
          var mod = {};
      
          var drawCheckbox = function(elem, cell, field) {
              var fs = elem.find('.' + cell + ':first').html();
      Severity: Minor
      Found in fannie/item/productList.js - About 5 hrs 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 format has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

          public function format(array $row)
          {
              if ($row['trans_type'] == 'D') {
                  // department open ring; not much to format
                  return $this->align($row['description'],'',$row['total'],$this->flags($row));
      Severity: Minor
      Found in pos/is4c-nf/lib/ReceiptBuilding/Format/ItemReceiptFormat.php - About 5 hrs 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 fetch_report_data has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

          public function fetch_report_data()
          {
              $class_lib = $this->class_lib;
              $dbc = $class_lib::getDB();
              
      Severity: Minor
      Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 5 hrs 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 updateVendors has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

          public function updateVendors($data)
          {
              $vendLC = new VendorLikeCodeMapModel($this->connection);
              $activeP = $this->connection->prepare("SELECT storeID FROM LikeCodeActiveMap WHERE inUse=1 AND likeCode=?");
              $catP = $this->connection->prepare("
      Severity: Minor
      Found in fannie/modules/plugins2.0/RP/RpImport.php - About 5 hrs 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 fetch_report_data has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

          public function fetch_report_data()
          {
              $dbc = $this->connection;
      
              try {
      Severity: Minor
      Found in fannie/modules/plugins2.0/CoreWarehouse/reports/CWCouponReport.php - About 5 hrs 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 fetch_report_data has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

          function fetch_report_data(){
              global $FANNIE_OP_DB, $FANNIE_PLUGIN_SETTINGS;
      
              $ret = array();
      
      

      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 WriteToken has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
      Open

              private void WriteToken(IList<JsonSchemaModel> schemas)
              {
                  foreach (SchemaScope schemaScope in _stack)
                  {
                      bool isInUniqueArray = (schemaScope.TokenType == JTokenType.Array && schemaScope.IsUniqueArray && schemaScope.ArrayItemCount > 0);

      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 ParseExpression has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
      Open

              private QueryExpression ParseExpression()
              {
                  QueryExpression rootExpression = null;
                  CompositeExpression parentExpression = null;
      
      

      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 Read has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
      Open

          override public void Read()
          {
              showPaymentScreen();
              System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
      
      
      Severity: Minor
      Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/RBA_Stub.cs - About 5 hrs 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 PcDailyReport.php has 392 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*******************************************************************************
      
          Copyright 2013 Whole Foods Co-op
      
      
      Severity: Minor
      Found in fannie/reports/Paycards/PcDailyReport.php - About 5 hrs to fix

        File OpenRingReceipts.php has 392 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*******************************************************************************
        
            Copyright 2015 Whole Foods Community Co-op
        
        
        Severity: Minor
        Found in fannie/item/OpenRingReceipts.php - About 5 hrs to fix

          Method run has 135 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function run()
              {
                  $dbc = FannieDB::get($this->config->get('OP_DB'));
                  $this->freshenCache($dbc);
                  $this->forecast = $this->forecastFactor($dbc, $this->forecast/$this->multiplier, $this->vendors, $this->store);
          Severity: Major
          Found in fannie/cron/tasks/OrderGenTask.php - About 5 hrs to fix

            Method get_date_handler has 135 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function get_date_handler()
                {
                    $date = $this->date;
                    $date2 = FormLib::get('date2','');
                    if ($date === '' && $date2 !== '') {
            Severity: Major
            Found in fannie/admin/LookupReceipt/ReprintReceiptPage.php - About 5 hrs to fix

              Method WFC_Dark_Shelf_Labels has 135 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function WFC_Dark_Shelf_Labels($data,$offset=0){
              
              $pdf=new WFC_Dark_Shelf_Labels_PDF('P','mm','Letter'); //start new instance of PDF
              $pdf->Open(); //open new PDF Document
              $pdf->setTagDate(date("m/d/Y"));
              Severity: Major
              Found in fannie/admin/labels/pdf_layouts/WFC_Dark_Shelf_Labels.php - About 5 hrs to fix

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

                    public function body_content()
                    {
                        include(dirname(__FILE__) . '/../config.php');
                        ob_start();
                
                
                Severity: Major
                Found in fannie/install/InstallStoresPage.php - About 5 hrs to fix

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

                      public function fetch_report_data()
                      {
                          $dbc = ObfLibV2::getDB();
                          $start = FormLib::get('from');
                          $end = FormLib::get('to');
                  Severity: Major
                  Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfTrendReport.php - About 5 hrs to fix

                    Method post_id_handler has 135 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function post_id_handler()
                        {
                            global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
                            $this->card_no = $this->id;
                            if ($this->auth_mode == 'None')
                    Severity: Major
                    Found in fannie/modules/plugins2.0/PIKiller/PIMemberPage.php - About 5 hrs to fix

                      Method get_id_confirm_view has 135 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function get_id_confirm_view()
                          {
                              
                              $ret = '';
                              $data = array();
                        Severity
                        Category
                        Status
                        Source
                        Language