Function keywordsFromFacets
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
private function keywordsFromFacets($properties, $facetCategory, $model)
{
$parentId = null;
$keywords = array();
for ($i = 0, $ii = count($facetCategory); $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
File Tag.php
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* Copyright 2018 Jérôme Gasperi
*
* Licensed under the Apache License, version 2.0 (the "License");
Method keywordsFromFacets
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function keywordsFromFacets($properties, $facetCategory, $model)
{
$parentId = null;
$keywords = array();
for ($i = 0, $ii = count($facetCategory); $i < $ii; $i++) {
Method getGenericKeywords
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getGenericKeywords($properties, $options)
{
$keywords = array();
for ($i = 0, $ii = count($properties); $i < $ii; $i++) {
$keyword = $this->getGenericKeyword($properties[$i], $options['defaultName'], $options['parentId']);
Function getGenericKeywords
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function getGenericKeywords($properties, $options)
{
$keywords = array();
for ($i = 0, $ii = count($properties); $i < $ii; $i++) {
$keyword = $this->getGenericKeyword($properties[$i], $options['defaultName'], $options['parentId']);
- 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 processITagKeywords
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processITagKeywords($iTagFeature)
{
/*
* Initialize keywords array from faceted properties
*/
Method keywordsFromITag
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function keywordsFromITag($properties, $geometry, $iTagParams)
{
/*
* No geometry = no iTag
*
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 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 getLandCoverKeywords
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getLandCoverKeywords($properties)
{
$keywords = 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"