CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

    static public function addDepartmentUsed($paymentDepartment=0,$programID=0)
    {
        global $CORE_LOCAL;

        /* I think it could default to using the current ones set by programOK()
Severity: Minor
Found in pos/is4c-nf/plugins/CoopCred/CoopCredLib.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 body_content has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function body_content() 
    {
        ?>
        <div class="baseHeight">
        <div class="centeredDisplay colored rounded">
Severity: Minor
Found in pos/is4c-nf/gui-modules/refundComment.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 downloadPage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function downloadPage($url, $opts=array(), $curl=false)
{
    $fsURL = str_replace('/', '_', $url);
    if (file_exists(__DIR__ . '/.cachedURL' . $fsURL)) {
        return file_get_contents(__DIR__ . '/.cachedURL' . $fsURL);
Severity: Minor
Found in pos/is4c-nf/gui-modules/help/HelpPage.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 adjustUPC has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function adjustUPC($entered)
    {
        // expand UPC-E to UPC-A
        if (substr($entered, 0, 1) == 0 && strlen($entered) == 7) {
            $parser = new UPC($this->session);
Severity: Minor
Found in pos/is4c-nf/gui-modules/productlist.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 preprocess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function preprocess(){
        global $CORE_LOCAL;

        // a selection was made
        if (isset($_REQUEST['search'])){
Severity: Minor
Found in pos/is4c-nf/plugins/CoopCred/tenderlist_coopCred.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 check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function check($str)
    {
        // only check & warn once per transaction
        if (CoreLocal::get('cashDropWarned') == True) return False;

Severity: Minor
Found in pos/is4c-nf/plugins/CashDrop/CashDropPreParser.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 writeInput has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function writeInput($name, $current_value, $storage)
    {
        if ($storage == Conf::INI_SETTING) {
            if (!is_numeric($current_value) && strtolower($current_value) !== 'true' && strtolower($current_value !== 'false')) {
                Conf::save($name, "'" . $current_value . "'");
Severity: Minor
Found in pos/is4c-nf/install/conf/FormFactory.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 checkUpcQuantities has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function checkUpcQuantities($voidable, $quantity, $scale, $row)
    {
        if ($voidable == 0 && $quantity == 1) {
            throw new Exception(DisplayLib::boxMsg(
                _("Item already voided"),
Severity: Minor
Found in pos/is4c-nf/parser/parse/VoidCmd.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 sanitizeValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function sanitizeValue($current_value, $is_array, $quoted)
    {
        if (!$is_array && !$quoted) {
            // unquoted must be a number or boolean
            if (!is_numeric($current_value) && strtolower($current_value) !== 'true' && strtolower($current_value) !== 'false') {
Severity: Minor
Found in pos/is4c-nf/install/conf/FormFactory.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 get_parse_chain has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static public function get_parse_chain($type='COREPOS\\pos\\parser\\Parser')
    {
        $set = AutoLoader::ListModules($type);
        $set = array_reverse($set);

Severity: Minor
Found in pos/is4c-nf/parser/Parser.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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function parse($str)
    {
        $this->source = $this->getPrefix($str);
        if ($this->source == self::GS1_ITEM_PREFIX ||
            $this->source == self::GS1_EXPANDED_PREFIX) {
Severity: Minor
Found in pos/is4c-nf/parser/parse/UPC.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 expandUPCE has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function expandUPCE($entered)
    {
        $par6 = substr($entered, -1);
        if ($par6 == 0) $entered = substr($entered, 0, 3)."00000".substr($entered, 3, 3);
        elseif ($par6 == 1) $entered = substr($entered, 0, 3)."10000".substr($entered, 3, 3);
Severity: Minor
Found in pos/is4c-nf/parser/parse/UPC.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 preprocess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function preprocess()
    {
        $drawers = new Drawers($this->session, Database::pDataConnect());
        $this->myDrawer = $drawers->current();
        $this->available = $drawers->available();
Severity: Minor
Found in pos/is4c-nf/gui-modules/drawerPage.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 initWritableFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static private function initWritableFile($filename, $template)
    {
        $fptr = fopen($filename,'w');
        if ($fptr) {
            if ($template !== False) {
Severity: Minor
Found in pos/is4c-nf/install/conf/Conf.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 preprocess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function preprocess()
    {
        // get calling class (required)
        $class = $this->form->tryGet('class');
        $class = str_replace('-', '\\', $class);
Severity: Minor
Found in pos/is4c-nf/gui-modules/requestInfo.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 requestInfoCallback has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    static public function requestInfoCallback($info)
    {
        if ($info === '' || strtoupper($info) == 'CL') {
            // clear/blank => go back to adminlist
            return MiscLib::base_url.'gui-modules/adminlist.php';
Severity: Minor
Found in pos/is4c-nf/lib/adminlogin/AnyTenderReportRequest.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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function parse($str)
    {
        if (!strpos($str,"**") && strpos($str,"*") != 0 &&
            strpos($str,"*") != strlen($str)-1){
            $split = explode("*",$str);
Severity: Minor
Found in pos/is4c-nf/parser/preparse/Quantity.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 readIniJson has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function readIniJson()
    {
        $json = dirname(__FILE__) . '/../../ini.json';
        $ret = new \COREPOS\pos\lib\LocalStorage\UnitTestStorage();
        if (file_exists($json)) {
Severity: Minor
Found in pos/is4c-nf/lib/LocalStorage/CoreLocal.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 nthReceipt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

static private function nthReceipt()
{
    if (CoreLocal::get('lotterySpin') !== false && CoreLocal::get('lotterySpin') !== '') {
        return CoreLocal::get('lotterySpin') < CoreLocal::get('nthReceipt');
    } elseif (CoreLocal::get('nthReceipt') > 0 && CoreLocal::get('nthReceipt') < 1) {
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 refresh has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function refresh()
    {
        self::clear();
        $json = __DIR__ . '/../../ini.json';
        if (file_exists($json)) {
Severity: Minor
Found in pos/is4c-nf/lib/LocalStorage/LaneConfig.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