Showing 240 of 248 total issues
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);
}
Method prepareFeatureArray
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function prepareFeatureArray($collection, $data, $params = array())
{
/*
* Assume input file or stream is a JSON Feature
*/
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 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++) {
Function __construct
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($profile, $context, $autoload = false)
{
$this->context = $context;
/*
- 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 getSelectClause
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function getSelectClause($featureTableName, $featureColumns, $user, $options)
{
$sanitized = $this->sanitizeSQLColumns($featureColumns, isset($options['fields']) ? array_map('trim', explode(',', $options['fields'])) : 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 __construct
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($servicesInfos, $lang)
{
foreach (array_keys($servicesInfos) as $key) {
// Translation
if (isset($servicesInfos[$key]['message'])) {
- 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"