Showing 249 of 257 total issues
Function getITagParams
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getITagParams($collection)
{
// iTag is not use because model strategy is 'none' or explicitely _useItag is set to false
if ((isset($collection->context->query['_useItag']) && filter_var($collection->context->query['_useItag'], FILTER_VALIDATE_BOOLEAN) === false) || ($collection->model->tagConfig['strategy'] === 'none')) {
return 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 explodeSearchTerms
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function explodeSearchTerms($obj)
{
$hashtags = [];
$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
Function updateExtent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function updateExtent($collection)
{
if (isset($collection->extent['temporal']['interval'][0][0]) && (! isset($this->extent['temporal']['interval'][0][0]) || $collection->extent['temporal']['interval'][0][0] < $this->extent['temporal']['interval'][0][0])) {
$this->extent['temporal']['interval'][0][0] = $collection->extent['temporal']['interval'][0][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 getChildren
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getChildren($params)
{
$childs = array();
// Initialize router to process each children individually
- 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 addLinks
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function addLinks($feature)
{
/*
* General links
*/
- 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 processITagKeywords
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function processITagKeywords($iTagFeature)
{
/*
* Initialize keywords array from faceted 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 getUsersProfiles
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getUsersProfiles($params)
{
if (isset($params['lt']) && !ctype_digit($params['lt'])) {
return RestoLogUtil::httpError(400, 'Invalid lt - should be numeric');
}
- 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 getUrlTemplate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getUrlTemplate($format)
{
/*
* HTML output is based on htmlSearchEndpoint
*/
Method updateFacet
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateFacet($facet)
{
$values = array(
$facet['id']
Method load
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load($collection)
{
/*
* Request start time
*/
Method updateFeatureDescription
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateFeatureDescription($feature, $description)
{
// Get hashtags to remove from feature before update
$hashtagsToRemove = $this->extractHashtagsFromText($feature->toArray()['properties']['description'], true);
$hashtagsToAdd = $this->extractHashtagsFromText($description, true);
Method storeFacets
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function storeFacets($facets, $userid, $collectionId = '*')
{
// Empty facets - do nothing
if (!isset($facets) || count($facets) === 0) {
return;
Method updateExtent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateExtent($collection, $extentArrays)
{
if (! isset($extentArrays)) {
return false;
}
Function storeCatalogAsFacet
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function storeCatalogAsFacet($catalog, $parentId, $childs)
{
if ( !isset($parentId) ) {
$parentId = $this->parentIdFromLinks($catalog['links'] ?? 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 parentIdFromLinks
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function parentIdFromLinks($links)
{
// Retrieve parent if any
for ($i = 0, $ii = count($links); $i < $ii; $i++ ) {
- 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 removeCatalog
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function removeCatalog($params)
{
$facetId = $params['segments'][count($params['segments']) - 1 ];
$facets = (new FacetsFunctions($this->context->dbDriver))->getFacets(array('id' => $facetId));
- 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 loadFromJSON
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function loadFromJSON($object, $modelName = null)
{
/*
* Check that object is a valid 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 prepareFeatureArray
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function prepareFeatureArray($collection, $data, $params = array())
{
/*
* Assume input file or stream is a JSON Feature
*/
- 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 geoJSONGeometryToWKT
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function geoJSONGeometryToWKT($geometry)
{
if (!isset($geometry)) {
return 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 sendActivationLink
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function sendActivationLink($params, $body)
{
if (isset($body['email'])) {
if (! filter_var($body['email'], FILTER_VALIDATE_EMAIL)) {
RestoLogUtil::httpError(400, 'Email address is invalid');
- 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"