CORE-POS/IS4C

View on GitHub
pos/is4c-nf/gui-modules/memlist_cards.php

Summary

Maintainability
D
2 days
Test Coverage
F
17%

Function preprocess has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
Open

    function preprocess(){
        // set variable ahead of time
        // so we know if lookup found no one
        // vs. lookup didn't happen
        $this->temp_num_rows = -1;
Severity: Minor
Found in pos/is4c-nf/gui-modules/memlist_cards.php - About 1 day 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 preprocess has 129 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function preprocess(){
        // set variable ahead of time
        // so we know if lookup found no one
        // vs. lookup didn't happen
        $this->temp_num_rows = -1;
Severity: Major
Found in pos/is4c-nf/gui-modules/memlist_cards.php - About 5 hrs to fix

    Method body_content has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function body_content()
        {
            $num_rows = $this->temp_num_rows;
            $result = $this->temp_result;
            $entered = $this->entered;
    Severity: Major
    Found in pos/is4c-nf/gui-modules/memlist_cards.php - About 2 hrs to fix

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

          function body_content()
          {
              $num_rows = $this->temp_num_rows;
              $result = $this->temp_result;
              $entered = $this->entered;
      Severity: Minor
      Found in pos/is4c-nf/gui-modules/memlist_cards.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

      Avoid too many return statements within this method.
      Open

              return True;
      Severity: Major
      Found in pos/is4c-nf/gui-modules/memlist_cards.php - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status