Showing 249 of 257 total issues
Function search
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function search($params, $body)
{
if ($this->context->method === 'POST') {
$params = $this->jsonQueryToKVP($body);
}
- 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 remapInputProperties
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function remapInputProperties($properties)
{
if (empty($this->inputMapping)) {
return $properties;
}
- 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 prepareORFilters
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function prepareORFilters($filterName, $filterValue, $exclusion)
{
/*
* Set quote to "'" for non numeric filter types
*/
- 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 instantiateRoute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function instantiateRoute($validRoute, $method, $params)
{
/*
* In resto 5.x first element of route is an "authenticationIsRequired" boolean
* In restto >=6.x first element of route can also be an array
- 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 validateFilterString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function validateFilterString($filterKey, $value)
{
/*
* If operation = "in" then value is a comma separated list - check pattern for each element of the list
*/
- 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 keywordsFromITag
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function keywordsFromITag($properties, $geometry, $iTagParams)
{
/*
* No geometry = no iTag
*
- 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 intersectsExpression
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function intersectsExpression($not)
{
$filter = array(
'not' => $not
);
- 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 deeply nested control flow statements. Open
for ($i = count($this->statistics[$filter['osKey']]['oneOf']); $i--;) {
$this->startElement('parameters:Option');
$this->writeAttribute('value', $this->statistics[$filter['osKey']]['oneOf'][$i]['const']);
$this->endElement();
}
Function remap
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function remap($featureArray, $collection)
{
/*
* These properties are discarded from output
*/
- 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 deeply nested control flow statements. Open
if ($exploded[$j]) {
$output[] = $exploded[$j];
}
Function operationExpression
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function operationExpression()
{
// Special case for IS NULL
if ($this->lexer->lookahead['value'] === 'is') {
$this->lexer->moveNext();
- 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 addGeoRSS
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function addGeoRSS($type, $coordinates)
{
$geometry = array();
switch ($type) {
case 'Point':
- 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 toOSKeys
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function toOSKeys($filterNames, $processSearchTerms = false)
{
$arr = array();
foreach ($filterNames as $key => $obj) {
if (isset($this->searchFilters[$key])) {
- 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 deeply nested control flow statements. Open
if (isset($filter['options'][$i]['label'])) {
$this->writeAttribute('label', $filter['options'][$i]['label']);
}
Function addEntryElements
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function addEntryElements($feature)
{
$explodedSelf = null;
/*
- 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 getPicture
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getPicture($profile, $storageInfo = null)
{
// Create picture url from email
if (!isset($profile['picture'])) {
return 'https://robohash.org/' . md5($profile['email']) . '?gravatar=hashed&bgset=any&size=400x400';
- 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 getLogs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getLogs($params)
{
$where = array();
// Paginate
- 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 checkMandatoryFilters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function checkMandatoryFilters($searchFilters, $paramsWithOperation)
{
$missing = array();
foreach (array_keys($searchFilters) as $filterName) {
if (isset($searchFilters[$filterName])) {
- 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 getWhereClause
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getWhereClause($filtersAndJoins, $options = array())
{
$size = count($filtersAndJoins['filters']);
if ($size > 0) {
- 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 getUsersProfiles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getUsersProfiles($params, $userid)
{
// Only returns activated profiles
$where = array(
'activated=1'
- 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"