Showing 248 of 248 total issues
Method getLinks
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getLinks($sorting, $collectionId)
{
/*
* Base links are always returned
*/
Function setOutputFormat
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function setOutputFormat()
{
$this->outputFormat = $this->getPathSuffix();
/*
- 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 toArray
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function toArray()
{
$osDescription = $this->osDescription[$this->context->lang] ?? $this->osDescription['en'];
- 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 formatPartialUserProfile
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function formatPartialUserProfile($rawProfile)
{
$profile = array(
'id' => $rawProfile['id'],
- 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 extractToponym
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function extractToponym($params, &$details, &$hashToDiscard)
{
$foundLocation = null;
/*
Method getType
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getType(&$value)
{
$type = self::T_NONE;
switch (true) {
Method getFacetsCount
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFacetsCount($minMatch)
{
$facets = array(
'count' => 0,
'catalogs' => array(),
Function parentIdFromLinks
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function parentIdFromLinks($links)
{
$parentId = 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 clear
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function clear($key = null)
{
if (isset($this->directory)) {
if (isset($key)) {
$file = $this->directory . DIRECTORY_SEPARATOR . crc32($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
Function writeRequestParams
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function writeRequestParams($params)
{
$arr = array();
foreach ($params as $key => $value) {
- 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 formatUserProfile
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function formatUserProfile($rawProfile)
{
// Empty profile
$profile = 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
Method sendMail
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sendMail($params, $smtp = array())
{
if (! isset($params) || ! is_array($params)) {
return false;
}
Method process
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process($method, $path, $query)
{
// Special case for doc generation
if ( $path === '/_routes' ) {
Method explodeSearchTerms
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function explodeSearchTerms($obj)
{
$hashtags = [];
$output = [];
Method format
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function format($rawDescription, $osDescription)
{
$collection = array(
'id' => $rawDescription['id'],
'aliases' => isset($rawDescription['aliases']) ? json_decode($rawDescription['aliases'], true) : array(),
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
Function __construct
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($config)
{
if (isset($config)) {
if (isset($config['commonSchema'])) {
$this->commonSchema = $config['commonSchema'];
- 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 getFacetsFromKeywords
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getFacetsFromKeywords($keywords, $facetCategories, $collectionId, $options = array())
{
/*
* One facet per keyword
*/
- 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 hasRightsTo
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function hasRightsTo($action, $params = array())
{
$rights = $this->getRights();
Method updateUserProfile
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateUserProfile($profile, $storageInfo)
{
if (!is_array($profile) || !isset($profile['email'])) {
RestoLogUtil::httpError(400);
}