Showing 248 of 248 total issues
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"
Further reading
Function setWhereFilters
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function setWhereFilters($where, $params, $hashTodiscard = null)
{
for ($i = count($where); $i--;) {
/*
* Geometry
- 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 extractHashtagsFromText
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function extractHashtagsFromText($text, $stringOnly)
{
$matches = null;
if (isset($text)) {
preg_match_all("/#([^ ]+)/u", $text, $matches);
- 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 formatPartialUserProfile
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function formatPartialUserProfile($rawProfile)
{
$profile = array(
'id' => $rawProfile['id'],
Method getTopologyAnalysis
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTopologyAnalysis($geometry, $params)
{
$result = null;
/*
Method geoJSONGeometryToWKT
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function geoJSONGeometryToWKT($geometry)
{
if (!isset($geometry)) {
return null;
}
Method storeOSDescription
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function storeOSDescription($collection)
{
/*
* Insert OpenSearch descriptions within osdescriptions table
* (one description per lang)
Method getPaging
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getPaging($count, $limit, $offset)
{
$count['returned'] = count($this->restoFeatures);
/*
Method __construct
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($options = array())
{
parent::__construct($options);
/*
Method addEntryElements
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addEntryElements($feature)
{
$explodedSelf = null;
/*
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']);
Method filterSummaries
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function filterSummaries($summaries, $types)
{
$filteredSummaries = array();
foreach (array_values($summaries) as $summary) {
Method processTriplet
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processTriplet()
{
$filter = array();
$not = false;
Method getLogs
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getLogs($params)
{
$where = array();
// Paginate
Method mergeRights
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function mergeRights($rights)
{
// Default rights allows only to delete/update things
// that belongs to user