Function preprocess
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
function preprocess()
{
$entered = $this->getInput();
if ($entered === false) {
return true;
- Read upRead up
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
Method preprocess
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function preprocess()
{
$entered = $this->getInput();
if ($entered === false) {
return true;
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) {
- Read upRead up
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\" "
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;
- Read upRead up
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;
Avoid too many return
statements within this method. Open
return true;