CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

var paycardboxmsgAuth = (function($) {
    var mod = {};

    var called = false;

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

var stChart = (function() {
    var mod = {};

    var _fontSize = 12;

Severity: Minor
Found in fannie/reports/SalesToday/stChart.js - 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 salesToday has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var salesToday = (function($) {
    var mod = {};

    mod.reloadGraph = function() {
        var url='SalesTodayReport.php?';
Severity: Minor
Found in fannie/reports/SalesToday/salesToday.js - 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 dataCallback has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function dataCallback(data)
{
    if (data.indexOf(":") !== -1) {
        // data from the cc terminal
        // run directly; don't include user input
Severity: Minor
Found in pos/is4c-nf/js/poll-scale.js - 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 saveAtmAmount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function saveAtmAmount(){
    var ret = '';
    if ($('#atmFill').length !== 0) {
        ret += 'fill:'+$('#atmFill').val();
    } else {
Severity: Minor
Found in fannie/modules/plugins2.0/OverShortTools/js/count.js - 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 PaycardTransLookupPage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var PaycardTransLookupPage = (function($) {
    var mod = {};

    var gettingResult = 1;
    var enter_url = '';
Severity: Minor
Found in pos/is4c-nf/plugins/Paycards/js/PaycardTransLookupPage.js - 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 editBatchLine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function editBatchLine(id)
{
    var name = $('tr#batchRow' + id + ' a:first').html();
    var type = $('#type'+id).html();
    var startdate = $('#startdate'+id).html();
Severity: Minor
Found in fannie/batches/newbatch/list.js - 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 handlePaycards has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function handlePaycards($entered, $json)
    {
        /* this breaks the model a bit, but I'm putting
         * putting the CC parser first manually to minimize
         * code that potentially handles the PAN */
Severity: Minor
Found in pos/is4c-nf/ajax/AjaxParser.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)
    {
        $ret = $this->default_json();
        if (strlen($str) == 4 && $str == '1042') {
            $str = '1042T';
Severity: Minor
Found in pos/is4c-nf/plugins/AnnualMeeting/AnnualMeetingParser.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 validateAndHome has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function validateAndHome(){
    var dcheck=false;
    $('select.editDept').each(function(){
        if ($(this).val() === '0'){
            dcheck=true;
Severity: Minor
Found in fannie/ordering/view.js - 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)
    {
        if (strlen($str) < 4 || strlen($str) > 5) return false;
        $plu = substr($str,0,4);
        if (in_array($plu, $this->plus)){
Severity: Minor
Found in pos/is4c-nf/plugins/AnnualMeeting/AnnualMeetingParser.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 ajax has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function ajax()
    {
        $ret = array('success' => false, 'msg' => _('password invalid, please re-enter'));
        $passwd = $this->getPassword();
        if (strlen($passwd) > 0 && Authenticate::checkPassword($passwd)) {
Severity: Minor
Found in pos/is4c-nf/ajax/AjaxLogin.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 sendVoid has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function sendVoid()
    {
        $this->GATEWAY = 'https://api.payeezy.com/v1/transactions/' . $authcode;
        $this->GATEWAY = 'https://api.globalgatewaye4.firstdata.com/transaction/v32';
        if ($this->conf->get("training") == 1) {
Severity: Minor
Found in pos/is4c-nf/plugins/Paycards/ValueLink.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 findTransaction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function findTransaction()
    {
        $dbc = Database::tDataConnect();
        $query = '
            SELECT MAX(paycardTransactionID) 
Severity: Minor
Found in pos/is4c-nf/plugins/Paycards/gui/PaycardEmvVoid.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 getIssuerOverride has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getIssuerOverride($issuer)
    {
        if ($this->conf->get('PaycardsTenderCodeVisa') && $issuer == 'Visa') {
            return array($this->conf->get('PaycardsTenderCodeVisa'));
        } elseif ($this->conf->get('PaycardsTenderCodeMC') && $issuer == 'MasterCard') {
Severity: Minor
Found in pos/is4c-nf/plugins/Paycards/lib/PaycardTenders.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 handleResponseBalance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function handleResponseBalance($balResult)
    {
        $xml = new XmlData($balResult["response"]);

        $comm = $this->pmod->commError($balResult);
Severity: Minor
Found in pos/is4c-nf/plugins/Paycards/Valutec.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 validateAmount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function validateAmount($amt)
    {
        $due = CoreLocal::get("amtdue");
        if (!is_numeric($amt) || abs($amt) < 0.005) {
        } elseif ($amt > 0 && $due < 0) {
Severity: Minor
Found in pos/is4c-nf/plugins/StripeDotCom/gui/StripeAmountPage.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)
    {
        $ret = array();
        if ($this->interceptVoid) {
            $ret['main_frame'] = $this->interceptVoid;
Severity: Minor
Found in pos/is4c-nf/plugins/Paycards/lib/paycardEntered.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()
    {
        if (FormLib::get('token', false)) {
            $token = json_decode(FormLib::get('token'), true);
            $amt = FormLib::get('amount');
Severity: Minor
Found in pos/is4c-nf/plugins/StripeDotCom/gui/StripeCreditPage.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 message has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function message($val, $ref, $reprint=False){

        global $CORE_LOCAL;

        if ($val == 0) {
Severity: Minor
Found in pos/is4c-nf/plugins/CoopCred/receiptMessages/CCredSigSlip.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