File STAC.php
has 429 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* Copyright 2022 Jérôme Gasperi
*
* Licensed under the Apache License, version 2.0 (the "License");
Function setCatalogsLinksFromFacet
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private function setCatalogsLinksFromFacet($params)
{
$nbOfSegments = count($this->segments);
$leafValue = $this->segments[$nbOfSegments - 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"
Further reading
Function load
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
private function load($params = array())
{
$nbOfSegments = count($this->segments);
// Root
- 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 setCatalogsLinksFromFacet
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setCatalogsLinksFromFacet($params)
{
$nbOfSegments = count($this->segments);
$leafValue = $this->segments[$nbOfSegments - 1];
Method load
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function load($params = array())
{
$nbOfSegments = count($this->segments);
// Root
Function setThemesLinks
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function setThemesLinks()
{
$this->title = $this->segments[1];
$this->description = 'Collections for theme **' . $this->segments[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"
Further reading
Method setThemesLinks
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setThemesLinks()
{
$this->title = $this->segments[1];
$this->description = 'Collections for theme **' . $this->segments[1] . '**';
Method getChildren
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getChildren($params)
{
$childs = array();
// Initialize router to process each children individually
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 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
Avoid too many return
statements within this method. Open
return RestoLogUtil::httpError(404);
Avoid too many return
statements within this method. Open
return $this;
Avoid too many return
statements within this method. Open
return RestoLogUtil::httpError(404);
Avoid too many return
statements within this method. Open
return RestoLogUtil::httpError(404);