CORE-POS/IS4C

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

Summary

Maintainability
D
1 day
Test Coverage
F
51%

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

    function preprocess()
    {
        $entered = $this->getInput();
        if ($entered === false) {
            return true;
Severity: Minor
Found in pos/is4c-nf/gui-modules/memlist.php - About 4 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

File memlist.php has 307 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*******************************************************************************

   Copyright 2010 Whole Foods Co-op

Severity: Minor
Found in pos/is4c-nf/gui-modules/memlist.php - About 3 hrs to fix

    Method preprocess has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function preprocess()
        {
            $entered = $this->getInput();
            if ($entered === false) {
                return true;
    Severity: Major
    Found in pos/is4c-nf/gui-modules/memlist.php - About 2 hrs to fix

      Function runSearch has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          private function runSearch($entered)
          {
              $lookups = AutoLoader::ListModules('COREPOS\\pos\\lib\\MemberLookup', True);
              $results = array();
              foreach ($lookups as $class) {
      Severity: Minor
      Found in pos/is4c-nf/gui-modules/memlist.php - About 1 hr 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 listDisplay has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function listDisplay()
          {
              ob_start();
              echo "<div class=\"listbox\">"
                  ."<select name=\"search\" size=\"15\" "
      Severity: Minor
      Found in pos/is4c-nf/gui-modules/memlist.php - About 1 hr to fix

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

            private function wefcCardCheck($cardNo)
            {
                $dba = Database::pDataConnect();
                if ($this->form->tryGet('memberCard') !== '') {
                    $memberCard = $this->form->memberCard;
        Severity: Minor
        Found in pos/is4c-nf/gui-modules/memlist.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

        Avoid too many return statements within this method.
        Open

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

          Avoid too many return statements within this method.
          Open

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

            There are no issues that match your filters.

            Category
            Status