CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Function cutReceipt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

static public function cutReceipt($receipt, $second)
{
    if (is_array($receipt)){
        if ($second){
            // second always prints
Severity: Minor
Found in pos/is4c-nf/lib/ReceiptLib.php - About 25 mins 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 textStyle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function textStyle($altFont=false, $bold=false, $tall=false, $wide=false, $underline=false) 
    {
        $family = 'Courier';
        $style = '';
        if ($bold) {
Severity: Minor
Found in pos/is4c-nf/lib/PrintHandlers/PdfPrintHandler.php - About 25 mins 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 emptyQueue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

static public function emptyQueue()
{
    $queue = CoreLocal::get("infoRecordQueue");    
    if (!is_array($queue)) {
        $queue = array();
Severity: Minor
Found in pos/is4c-nf/lib/TransRecord.php - About 25 mins 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 simpleReceipt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

static private function simpleReceipt($receipt, $arg1, $where)
{
    /***** jqh 09/29/05 if receipt isn't full, then display receipt in old style *****/
    $query="select linetoprint from rp_receipt WHERE " . $where . ' ORDER BY trans_id';
    if ($arg1 == 'partial') {
Severity: Minor
Found in pos/is4c-nf/lib/ReceiptLib.php - About 25 mins 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 normalize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function normalize($db_name, $mode=BasicModel::NORMALIZE_MODE_CHECK, $doCreate=false)
    {
        // don't try to detect a db structure corresponding to
        // the ViewModel class itself
        if ($this->name == '__VirtualClass_ShouldNotExist') {
Severity: Minor
Found in pos/is4c-nf/lib/models/ViewModel.php - About 25 mins 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 gettransno has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

static public function gettransno($cashierNo) 
{
    $connection = self::tDataConnect();
    $registerNo = CoreLocal::get("laneno");
    $query = "SELECT max(trans_no) as maxtransno from localtranstoday where emp_no = "
Severity: Minor
Found in pos/is4c-nf/lib/Database.php - About 25 mins 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 savingsMessage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function savingsMessage($trans_num)
    {
        $valid = preg_match('/^(\d+)\D+(\d+)\D+(\d+)$/', $trans_num, $matches);
        if (!$valid) {
            return '';
Severity: Minor
Found in pos/is4c-nf/lib/ReceiptBuilding/Savings/SeparateReceiptSavings.php - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function errorCheck()
    {
        $chargeOk = \COREPOS\pos\lib\MemberLib::chargeOk();
    
        $buttons = array('[clear]' => 'parseWrapper(\'CL\');');
Severity: Minor
Found in pos/is4c-nf/lib/Tenders/StoreChargeTender.php - About 25 mins 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 nullwrap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

static public function nullwrap($num, $char=false) 
{

    if ($char && ($num === '' || $num === null)) {
        return '';
Severity: Minor
Found in pos/is4c-nf/lib/MiscLib.php - About 25 mins 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 getAllIPs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

static public function getAllIPs()
{
    /**
      First: use OS utilities to check IP(s)
      This should be most complete but also
Severity: Minor
Found in pos/is4c-nf/lib/MiscLib.php - About 25 mins 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 search has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function search($str)
    {
        $ret = array();
        $sql = Database::pDataConnect();
        $args = array('%' . $str . '%');
Severity: Minor
Found in pos/is4c-nf/lib/Search/Products/DefaultProductSearch.php - About 25 mins 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 priceInfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function priceInfo(array $row, $quantity=1)
    {
        if (is_array($this->savedInfo)) {
            return $this->savedInfo;
        }
Severity: Minor
Found in pos/is4c-nf/lib/Scanning/DiscountTypes/MemberSale.php - About 25 mins 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 writeToScale has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function writeToScale($str)
    {
        switch(strtolower($str)){
        case 'goodbeep':
            $this->sendCmd('S334');
Severity: Minor
Found in pos/is4c-nf/lib/DriverWrappers/ssd.php - About 25 mins 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 homelessOrderNotices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function homelessOrderNotices($sql)
    {
        $OP = $this->config->get('OP_DB') . $sql->sep();

        $query = "
Severity: Minor
Found in fannie/cron/tasks/SpecialOrdersTask.php - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        $dbc = FannieDB::get($this->config->get('OP_DB'));
        $yesterday = date('Y-m-d', strtotime('yesterday'));
        $url = $this->config->get('URL');
Severity: Minor
Found in fannie/cron/tasks/NotInUseTask.php - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        $dbc = FannieDB::get($this->config->get('TRANS_DB'));

        $nabQ = 'SELECT CardNo, memType FROM ' . $this->config->get('OP_DB').$dbc->sep() . 'custdata
Severity: Minor
Found in fannie/cron/tasks/NabsTask.php - About 25 mins 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 print_docs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function print_docs($dir){
    global $CORE_PATH;
    $dh = opendir($dir);
    while(False !== ($file=readdir($dh))){
        
Severity: Minor
Found in documentation/IS4C/keyboard.php - About 25 mins 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 migrateArchive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function migrateArchive($dbc)
    {
        $matching = $dbc->matchingColumns('prodUpdate', 'prodUpdateArchive');
        $col_list = '';
        foreach($matching as $column) {
Severity: Minor
Found in fannie/cron/tasks/ProdUpdateMaintenanceTask.php - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        $cache = array();
        $objs = FannieAPI::listModules('\COREPOS\Fannie\API\monitor\Monitor');
        $escalate = false;
Severity: Minor
Found in fannie/cron/tasks/MonitorsTask.php - About 25 mins 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 consecutiveOOS has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function consecutiveOOS($dbc, $upc, $storeID, $vendorID, $ordered)
    {
        if (!isset($this->consP)) {
            $this->consP = $dbc->prepare('
                SELECT i.quantity, i.receivedQty
Severity: Minor
Found in fannie/cron/tasks/OutOfStocksTask.php - About 25 mins 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