Function compressCategorySelection
has a Cognitive Complexity of 157 (exceeds 5 allowed). Consider refactoring. Open
public function compressCategorySelection($categoryList, $strongNotList)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
$compressedList = '';
- 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
Function prepareCategorySelection
has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring. Open
public function prepareCategorySelection($dynaList)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
$strongNotList = [];
- 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 Services_Search_QueryParser.php
has 532 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class Services_Search_QueryParser
{
/*
Function filterValuesToSql
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
private function filterValuesToSql($filterValueList, $currentSession)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
// Add a list of possible text searches
- 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
Function categoryListToSql
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
private function categoryListToSql($categoryList)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
$categorySql = [];
- 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 filterValuesToSql
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function filterValuesToSql($filterValueList, $currentSession)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
// Add a list of possible text searches
Function prepareFilterValues
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
private function prepareFilterValues($search)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
$filterValueList = [];
- 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 prepareCategorySelection
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareCategorySelection($dynaList)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
$strongNotList = [];
Function strongNotListToSql
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
private function strongNotListToSql($strongNotList)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
$strongNotSql = [];
- 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 compressCategorySelection
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compressCategorySelection($categoryList, $strongNotList)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
$compressedList = '';
Method filterToQuery
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function filterToQuery($search, $sort, $currentSession, $indexFilter)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
$isUnfiltered = false;
Method prepareFilterValues
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function prepareFilterValues($search)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
$filterValueList = [];
Method categoryListToSql
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function categoryListToSql($categoryList)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
$categorySql = [];
Method strongNotListToSql
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function strongNotListToSql($strongNotList)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
$strongNotSql = [];
Avoid deeply nested control flow statements. Open
if (strpos(','.$compressedList.',', ',cat'.$headCatNumber.'_'.$subType.'_'.$subCatKey.',') === false) {
$compressedList .= 'cat'.$headCatNumber.'_'.$subType.'_'.$subCatKey.',';
} // if
Function filterToQuery
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function filterToQuery($search, $sort, $currentSession, $indexFilter)
{
SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
$isUnfiltered = false;
- 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"