CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    function body_content(){
        global $FANNIE_URL, $FANNIE_PLUGIN_SETTINGS;
        $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['OverShortDatabase']);
        $this->addScript('js/countV3.js?date=20220927');
        $this->addScript($FANNIE_URL.'src/javascript/jquery.js');
Severity: Major
Found in fannie/modules/plugins2.0/OverShortTools/OverShortSafecountV3.php - About 2 hrs to fix

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

        function fetch_report_data()
        {
            $accounting = $this->config->get('ACCOUNTING_MODULE');
            if (!class_exists($accounting)) {
                $accounting = '\COREPOS\Fannie\API\item\Accounting';
    Severity: Major
    Found in fannie/modules/plugins2.0/OverShortTools/OverShortTransfers.php - About 2 hrs to fix

      Method calculateWeek has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function calculateWeek($start)
          {
              $startTS = strtotime($start);
              $end = date('Y-m-d', mktime(0, 0, 0, date('n',$startTS), date('j',$startTS) + 6, date('Y',$startTS)));
              echo "Week $start - $end\n";

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

            public function run()
            {
                global $FANNIE_PLUGIN_SETTINGS, $FANNIE_AR_DEPARTMENTS, $FANNIE_TRANS_DB, $FANNIE_OP_DB;
                $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['StaffArPayrollDB']);
        
        

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

              public function run()
              {
                  if (!class_exists('Automattic\WooCommerce\Client')) {
                      $this->cronMsg('Library missing. Use composer to install automattic/woocommerce');
                      return false;
          Severity: Major
          Found in fannie/modules/plugins2.0/WooSync/WooCustomersTask.php - About 2 hrs to fix

            Method get_view has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function get_view(){
                    // comment out WFC scan coord tools if COOP_ID is somewhere else
                    $wfcTools = ($this->config->get('COOP_ID') != 'WFC_Duluth') ? array('<!--', '-->') : array('', '');
                    return <<<HTML
            <!doctype html>
            Severity: Major
            Found in fannie/modules/plugins2.0/ShelfAudit/SaMenuPage.php - About 2 hrs to fix

              Method form_content has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function form_content()
                  {
                      $ret = '';
              
                      $review = FormLib::get('review',False);
              Severity: Major
              Found in fannie/mem/MemberSearchPage.php - About 2 hrs to fix

                Method showEditForm has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function showEditForm($memNum, $country="US")
                    {
                        $account = self::getAccount();
                        $ret = "<div class=\"panel panel-default\">
                            <div class=\"panel-heading\">Household Members</div>
                Severity: Major
                Found in fannie/mem/modules/HouseholdSeparateDiscounts.php - About 2 hrs to fix

                  Method get_view has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function get_view()
                      {
                          global $FANNIE_OP_DB;
                          $dbc = FannieDB::get($FANNIE_OP_DB);
                          $vendOpts = "<option value=0></option>";
                  Severity: Major
                  Found in fannie/item/PriceRuleEditor.php - About 2 hrs to fix

                    Method get_create_handler has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function get_create_handler()
                        {
                            
                            global $FANNIE_OP_DB;
                            $local = FannieDB::get($FANNIE_OP_DB);
                    Severity: Major
                    Found in fannie/item/WFC-Uproducts/NewClassPage.php - About 2 hrs to fix

                      Method ReadMetadataProperties has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              private bool ReadMetadataProperties(JsonReader reader, ref Type objectType, ref JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, object existingValue, out object newValue, out string id)
                              {
                                  id = null;
                                  newValue = null;
                      
                      

                        Method PopulateObject has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                private object PopulateObject(object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, string id)
                                {
                                    OnDeserializing(reader, contract, newObject);
                        
                                    // only need to keep a track of properies presence if they are required or a value should be defaulted if missing

                          File SPH_Datacap_IPTran.cs has 275 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          using System;
                          using System.IO;
                          using System.Threading;
                          using System.Net;
                          using System.Net.Sockets;
                          Severity: Minor
                          Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_Datacap_IPTran.cs - About 2 hrs to fix

                            Function baseItem has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                            var baseItem = (function() {
                                var mod = {};
                            
                                mod.chainSubs = function(store_id) {
                                    chainSubDepartments(
                            Severity: Minor
                            Found in fannie/item/modules/baseItem.js - About 2 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 preprocess has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                                function preprocess()
                                {
                                    // I haven't tracked down the cause but some mechanisms for getting here
                                    // do NOT unset msgrepeat which leads to an approval immediately triggering
                                    // into another ewic transaction
                            Severity: Minor
                            Found in pos/is4c-nf/plugins/Paycards/gui/PaycardEmvWic.php - About 2 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 loadCsvLines has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                                static private function loadCsvLines($sql, $table, $path)
                                {
                                    $loaded = 0;
                                    echo _("line-by-line") . "<br>\n";
                                    $fptr = fopen($path, 'r');
                            Severity: Minor
                            Found in pos/is4c-nf/install/data/Loader.php - About 2 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 messageModFooters has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                            static private function messageModFooters($receipt, $where, $ref, $reprint, $nth)
                            {
                                // check if message mods have data
                                // and add them to the receipt
                                $dbc = Database::tDataConnect();
                            Severity: Minor
                            Found in pos/is4c-nf/lib/ReceiptLib.php - About 2 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 scaledisplaymsg has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                            static public function scaledisplaymsg($input="")
                            {
                                $reginput = trim(strtoupper($input));
                            
                                $scans = '';
                            Severity: Minor
                            Found in pos/is4c-nf/lib/DisplayLib.php - About 2 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 process_file has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                                function process_file($linedata, $indexes)
                                {
                                    $dbc = $this->connection;
                                    $dbc->selectDB($this->config->get('OP_DB'));
                                    $vendorID = $this->getVendorID();
                            Severity: Minor
                            Found in fannie/batches/UNFI/load-classes/CpwProduceUploadPage.php - About 2 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 process_file has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                                function process_file($linedata, $indexes)
                                {
                                    $prefix = FormLib::get('prefix');
                                    $start = FormLib::get('start');
                                    $end = FormLib::get('end');
                            Severity: Minor
                            Found in fannie/batches/EndCapper/EndCapUpload.php - About 2 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

                            Severity
                            Category
                            Status
                            Source
                            Language