CORE-POS/IS4C

View on GitHub
fannie/src/functions.php

Summary

Maintainability
C
7 hrs
Test Coverage
F
31%

Function select_to_table2 has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

function select_to_table2($query,$args,$border,$bgcolor,$width="120",$spacing="0",$padding="0",$headers=array(),$nostart=False)
{
    global $FANNIE_OP_DB;
    $dbc = FannieDB::get($FANNIE_OP_DB);
    $prep = $dbc->prepare($query);
Severity: Minor
Found in fannie/src/functions.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

Method select_to_table2 has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function select_to_table2($query,$args,$border,$bgcolor,$width="120",$spacing="0",$padding="0",$headers=array(),$nostart=False)
{
    global $FANNIE_OP_DB;
    $dbc = FannieDB::get($FANNIE_OP_DB);
    $prep = $dbc->prepare($query);
Severity: Minor
Found in fannie/src/functions.php - About 1 hr to fix

    Method select_to_table2 has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function select_to_table2($query,$args,$border,$bgcolor,$width="120",$spacing="0",$padding="0",$headers=array(),$nostart=False)
    Severity: Major
    Found in fannie/src/functions.php - About 1 hr to fix

      Function select_to_table_row has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function select_to_table_row($row, $number_cols)
      {
          echo "<tr align left>\n";
          for ($i=0;$i<$number_cols; $i++) {
              echo "<td width=";
      Severity: Minor
      Found in fannie/src/functions.php - About 45 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 select_to_table has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function select_to_table($query,$args,$border,$bgcolor, $no_end=false)
      Severity: Minor
      Found in fannie/src/functions.php - About 35 mins to fix

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

        function select_to_table3($arr,$number_cols,$border,$bgcolor, $no_end=false)
        Severity: Minor
        Found in fannie/src/functions.php - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status