CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Function body_content has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    function body_content()
    {
        echo '<div class="baseHeight">';
        // generate message to print
        $amt = $this->conf->get("paycard_amount");
Severity: Minor
Found in pos/is4c-nf/plugins/Paycards/gui/PaycardEmvPage.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 handleResponseAuth has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private function handleResponseAuth($authResult)
    {
        $json = json_decode($authResult['response'], true);

        // initialize
Severity: Minor
Found in pos/is4c-nf/plugins/Paycards/ValueLink.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 preprocess has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    function preprocess()
    {
        $this->conf = new PaycardConf();
        if (FormLib::get('doLookup', false) !== false) {
            $ref = FormLib::get('id');
Severity: Minor
Found in pos/is4c-nf/plugins/Paycards/gui/PaycardTransLookupPage.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 variable_slip has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected function variable_slip($ref, $reprint=False, $sigSlip=False){
        global $CORE_LOCAL;
        $date = ReceiptLib::build_time(time());
        list($emp,$reg,$trans) = explode('-', $ref);
        $sort = 'asc';
Severity: Minor
Found in pos/is4c-nf/plugins/CoopCred/receiptMessages/CCredUsedBalances.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 curlSend has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected function curlSend($data=False,$type='POST',$xml=False, $extraOpts=array(), $autoHandle=true)
    {
        if($data && $type == 'GET') {
            $this->GATEWAY .= $data;
        }
Severity: Minor
Found in pos/is4c-nf/plugins/Paycards/BasicCCModule.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 variable_slip has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected function variable_slip($ref, $reprint=False, $sigSlip=False){
        global $CORE_LOCAL;
        $date = ReceiptLib::build_time(time());
        list($emp,$reg,$trans) = explode('-', $ref);
        $sort = 'asc';
Severity: Minor
Found in pos/is4c-nf/plugins/CoopCred/receiptMessages/CCredSigSlip.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 loadClass has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    static public function loadClass($name)
    {
        $map = CoreLocal::get("ClassLookup");
        if (!is_array($map)) {
            // attempt to build map before giving up
Severity: Minor
Found in pos/is4c-nf/lib/AutoLoader.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 commonHeader has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected function commonHeader()
    {
        $myUrl = $this->page_url;
        $this->add_onload_command("betterDate();\n\$('#reginput').focus();");

Severity: Minor
Found in pos/is4c-nf/lib/gui/BasicCorePage.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 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function errorCheck()
    {
        $clearButton = array(_('OK [clear]') => 'parseWrapper(\'CL\');');
        if ( CoreLocal::get("isMember") != 0 && (($this->amount - CoreLocal::get("amtdue") - 0.005) > CoreLocal::get("dollarOver")) && (CoreLocal::get("cashOverLimit") == 1)) {
            return DisplayLib::boxMsg(
Severity: Minor
Found in pos/is4c-nf/lib/Tenders/CheckTender.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 trTotal has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function trTotal($session,$k, $label,$i=False) 
{
    $dba = Database::mDataConnect();
    if ($dba === false) {
        return '';
Severity: Minor
Found in pos/is4c-nf/lib/ReceiptBuilding/TenderReports/YPSITenderReport.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 deptkey has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function deptkey($price, $dept,$ret=array()) 
    {
        if ($this->session->get("quantity") == 0 && $this->session->get("multiple") == 0) {
            $this->session->set("quantity",1);
        }
Severity: Minor
Found in pos/is4c-nf/lib/DeptLib.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 priceInfo has a Cognitive Complexity of 16 (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/EveryoneSale.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 simpleRow has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private function simpleRow($shortname,$nicename,$cmd,$tab,$i)
    {
        $t_index = 'jobs';
        // if shortname is a task class name, switch indexes
        // and populate defaults if the task is not enabled
Severity: Minor
Found in fannie/cron/management/CronManagementPage.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 scanScripts has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private function scanScripts($dir,$arr)
    {
        if (!is_dir($dir)){ 
            if (substr($dir,-4) == ".php") {
                $arr[] = $dir;
Severity: Minor
Found in fannie/cron/management/CronManagementPage.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 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function run()
    {
        global $FANNIE_OP_DB, $FANNIE_TRANS_DB;
        $dbc = FannieDB::get($FANNIE_OP_DB);

Severity: Minor
Found in fannie/cron/tasks/AutoParsTask.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 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function fetch_report_data()
    {
        $dbc = $this->connection;
        $dbc->selectDB($this->config->get('OP_DB'));
        $query = '';
Severity: Minor
Found in fannie/reports/DepartmentMovement/HourlyMovementReport.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 report_description_content has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function report_description_content()
    {
        if ($this->report_format != 'html') {
            return array();
        }
Severity: Minor
Found in fannie/reports/from-search/PreviousPromos/PreviousPromosReport.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 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function fetch_report_data()
    {
        $dbc = $this->connection;
        $dbc->selectDB($this->config->get('TRANS_DB'));

Severity: Minor
Found in fannie/admin/LookupReceipt/RawPTrans.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 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get()
    {
        $input = $this->readInput();
        if (isset($input['id'])) {
            $ids = is_array($input['id']) ? $input['id'] : array($input['id']);
Severity: Minor
Found in fannie/modules/plugins2.0/REST/RestGetOnly.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 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get_id_view()
    {
        $parP = $this->connection->prepare("
            SELECT SUM(movement)
            FROM " . FannieDB::fqn('Smoothed', 'plugin:WarehouseDatabase') . "
Severity: Minor
Found in fannie/modules/plugins2.0/RP/RpForecast.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