CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method get_id_view has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function get_id_view()
    {
        $upc = BarcodeLib::padUPC($this->id);
        $store = FormLib::get('store', 1);
        $info = $this->getMostRecent($upc, $store);
Severity: Major
Found in fannie/item/inventory/InvCountPage.php - About 2 hrs to fix

    Method ParseComment has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            private void ParseComment()
            {
                // should have already parsed / character before reaching this method
                _charPos++;
    
    

      Function programOK has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          static public function programOK($pKey='', $conn='') 
          {
              global $CORE_LOCAL;
      
              if (!$CORE_LOCAL->get("memberID")) {
      Severity: Minor
      Found in pos/is4c-nf/plugins/CoopCred/CoopCredLib.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 loadSampleData has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          static public function loadSampleData($sql, $table, $quiet=false)
          {
              $success = true; 
              ob_start();
              echo _("Loading") . " `$table` ";
      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 memReceiptMessages has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      static public function memReceiptMessages($cardNo)
      {
          $dbc = Database::pDataConnect();
          $memQ = 'SELECT msg_text,modifier_module
                FROM custReceiptMessage
      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 standalone_receipt has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function standalone_receipt($ref, $reprint=false)
          {
              list($emp, $reg, $trans) = ReceiptLib::parseRef($ref);
      
              $dbc = Database::tDataConnect();
      Severity: Minor
      Found in pos/is4c-nf/lib/ReceiptBuilding/Messages/DeclineReceiptMessage.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 errorCheck has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function errorCheck()
          {
              //force negative entered value when the total is negative.
              if (CoreLocal::get("amtdue") <0 && $this->amount >= 0) {
                  $this->amount = -1 * $this->amount;
      Severity: Minor
      Found in pos/is4c-nf/lib/Tenders/TenderModule.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 updateDiscount has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function updateDiscount(DiscountModule $mod, $doSubtotal=true)
          {
              $changed = true;
              // serialize/unserialize before saving to avoid
              // auto-session errors w/ undefined classes
      Severity: Minor
      Found in pos/is4c-nf/lib/DiscountModule.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 run has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function run()
          {
              global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
              $dbc = FannieDB::get($FANNIE_OP_DB);
              $local_dtrans = $FANNIE_TRANS_DB . $dbc->sep() . 'dtransactions';
      Severity: Minor
      Found in fannie/cron/tasks/PullRemoteTransactionsTask.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 fetch_report_data has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function fetch_report_data()
          {
              global $FANNIE_OP_DB;
              /* provide a department range and date range to
                 get history for all products in those departments
      Severity: Minor
      Found in fannie/reports/CostHistory/CostHistoryReport.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 fetch_report_data has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function fetch_report_data()
          {
              /* provide a department range and date range to
                 get history for all products in those departments
                 for that time period AND current price
      Severity: Minor
      Found in fannie/reports/PriceHistory/PriceHistoryReport.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 fetch_report_data has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function fetch_report_data()
          {
              $dbc = $this->connection;
              $parts = FormLib::standardItemFromWhere(); 
              $query = $parts['query'];
      Severity: Minor
      Found in fannie/reports/SaleTypeMovement/SaleTypeMovementReport.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 generateNewDeliShort_24UPTag has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      function generateNewDeliShort_24UPTag($x, $y, $guide, $width, $height, $pdf, $row, $dbc, $showPrice, $showBarcode,  $offset)
      {
          $upc = $row['upc'];
          $desc = $row['description'];
          $brand = $row['brand'];
      Severity: Minor
      Found in fannie/admin/labels/pdf_layouts/New_WFC_Deli_Short.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 select_to_table2 has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      function select_to_table2($query,$args,$border,$bgcolor,$width="120",$spacing="0",$padding="0",$headers=array(),$nostart=False)
      {
          global $FANNIE_OP_DB;
          $dbc = FannieDB::get($FANNIE_OP_DB);
          $prep = $dbc->prepare($query);
      Severity: Minor
      Found in fannie/src/functions.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 confset has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      function confset($key, $value)
      {
          $FILEPATH = realpath(dirname(__FILE__).'/../');
          $lines = array();
          $found = false;
      Severity: Minor
      Found in fannie/install/util.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 get_view has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function get_view()
          {
              $lib_class = $this->lib_class;
              $dbc = $lib_class::getDB();
      
      
      Severity: Minor
      Found in fannie/modules/plugins2.0/OpenBookFinancing/ObfWeekEntryPage.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 run has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function run()
          {
              $settings = $this->config->get('PLUGIN_SETTINGS');
              $dbc = FannieDB::get($settings['CommentDB']);
              $cmP = $dbc->prepare("SELECT * FROM Comments WHERE categoryID=? AND ccNotified=0");
      Severity: Minor
      Found in fannie/modules/plugins2.0/CommentTracker/CommentSummaryTask.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 fetch_report_data has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function fetch_report_data()
          {
              $dbc = FannieDB::get('HoursTracking');
              
              // get level info
      Severity: Minor
      Found in fannie/modules/plugins2.0/WfcHoursTracking/reports/WfcPtoStudy.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 show_sheet has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          function show_sheet($emp_no, $periodID){
              global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
              $ts_db = FannieDB::get($FANNIE_PLUGIN_SETTINGS['TimesheetDatabase']);
              include ('./includes/header.html');
      
      
      Severity: Minor
      Found in fannie/modules/plugins2.0/TimesheetPlugin/ViewsheetPage.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 get_id_view has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function get_id_view(){
              global $FANNIE_TRANS_DB,$FANNIE_URL;
              $table = DTransactionsModel::selectDlog($this->__models['start'],$this->__models['end']);
              $my = date('Ym',strtotime($this->__models['start']));
      
      
      Severity: Minor
      Found in fannie/modules/plugins2.0/PIKiller/PIPurchasesPage.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