detain/myadmin-fraudrecord-plugin

View on GitHub

Showing 6 of 29 total issues

Function update_fraudrecord has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

function update_fraudrecord($custid, $module = 'default', $ip = false)
{
    //myadmin_log('accounts', 'info', "update_fraudrecord($custid, $module) Called", __LINE__, __FILE__);
    $module = get_module_name($module);
    $db = get_module_db($module);
Severity: Minor
Found in src/fraudrecord.inc.php - About 3 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

Method update_fraudrecord has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function update_fraudrecord($custid, $module = 'default', $ip = false)
{
    //myadmin_log('accounts', 'info', "update_fraudrecord($custid, $module) Called", __LINE__, __FILE__);
    $module = get_module_name($module);
    $db = get_module_db($module);
Severity: Major
Found in src/fraudrecord.inc.php - About 2 hrs to fix

    Method update_fraudrecord_noaccount has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function update_fraudrecord_noaccount($data)
    {
        //myadmin_log('accounts', 'info', "update_fraudrecord_noaccount Called", __LINE__, __FILE__);
        $h = [
            '_action' => 'query',
    Severity: Minor
    Found in src/fraudrecord.inc.php - About 1 hr to fix

      Method fraudrecord_report has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function fraudrecord_report($custid, $module, $type, $text, $value)
      {
          //myadmin_log('accounts', 'info', "fraudrecord_report($custid, $module, $type, $text, $value) Called", __LINE__, __FILE__);
          $module = get_module_name($module);
          $db = get_module_db($module);
      Severity: Minor
      Found in src/fraudrecord.inc.php - About 1 hr to fix

        Function update_fraudrecord_noaccount has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        function update_fraudrecord_noaccount($data)
        {
            //myadmin_log('accounts', 'info', "update_fraudrecord_noaccount Called", __LINE__, __FILE__);
            $h = [
                '_action' => 'query',
        Severity: Minor
        Found in src/fraudrecord.inc.php - About 55 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

        Method fraudrecord_report has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function fraudrecord_report($custid, $module, $type, $text, $value)
        Severity: Minor
        Found in src/fraudrecord.inc.php - About 35 mins to fix
          Severity
          Category
          Status
          Source
          Language