Showing 240 of 248 total issues

Function createToken has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function createToken($params)
    {

        // A token can be only be created by admin 
        if ( !$this->user->hasGroup(RestoConstants::GROUP_ADMIN_ID) ) {
Severity: Minor
Found in app/resto/core/api/AuthAPI.php - About 25 mins to fix

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 getQueryables has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getQueryables()
    {
        $queryables = array();
        foreach (array_keys($this->searchFilters) as $filterKey) {
            if (isset($this->searchFilters[$filterKey]['queryable'])) {
Severity: Minor
Found in app/resto/core/RestoModel.php - About 25 mins to fix

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 getFeaturesInCollection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFeaturesInCollection($params)
    {

        // This should return HTTP 400 but we discard it instead otherwise it brokes pystac requests
        if (isset($params['collections'])) {
Severity: Minor
Found in app/resto/core/api/FeaturesAPI.php - About 25 mins to fix

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 processComplexInterval has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function processComplexInterval($dbh, $columnName, $values)
    {
        $quote = true;

        /*
Severity: Minor
Found in app/resto/core/utils/QueryUtil.php - About 25 mins to fix

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 getFiltersFromQuery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFiltersFromQuery($query)
    {
        $params = array();
        $unknowns = array();
        foreach ($query as $key => $value) {
Severity: Minor
Found in app/resto/core/RestoModel.php - About 25 mins to fix

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 updateFeatureProperty has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateFeatureProperty($params, $body)
    {
        $feature = new RestoFeature($this->context, $this->user, array(
            'featureId' => $params['featureId'],
            'collection' => $this->context->keeper->getRestoCollection($params['collectionId'], $this->user)->load()
Severity: Minor
Found in app/resto/core/api/FeaturesAPI.php - About 25 mins to fix

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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function load($object = null, $modelName = null)
    {

        if (isset($object)) {
            return $this->loadFromJSON($object, $modelName);
Severity: Minor
Found in app/resto/core/RestoCollection.php - About 25 mins to fix

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 cleanAssociativeArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function cleanAssociativeArray($associativeArray)
    {
        // Output
        $cleanArray = array();

Severity: Minor
Found in app/resto/core/utils/RestoUtil.php - About 25 mins to fix

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();

        /*
Severity: Minor
Found in app/resto/core/addons/Tag.php - About 25 mins to fix

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 clearUpload has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function clearUpload($body)
    {
        try {
            if (isset($body) && is_array($body['files'])) {
                for ($i = count($body['files']); $i--;) {
Severity: Minor
Found in app/resto/core/utils/RestoFileUtil.php - About 25 mins to fix

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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function load($params = array())
    {
       
        if ( !$this->isLoaded ) {
            
Severity: Minor
Found in app/resto/core/RestoCollections.php - About 25 mins to fix

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 storeProfile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function storeProfile($profile, $storageInfo)
    {
        $userInfo = (new UsersFunctions($this->context->dbDriver))->storeUserProfile(
            $profile,
            $storageInfo
Severity: Minor
Found in app/resto/core/api/UsersAPI.php - About 25 mins to fix

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 cleanFilters has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function cleanFilters($searchFilters)
    {
        $query = array();
        $exclude = array(
            'count',
Severity: Minor
Found in app/resto/core/RestoFeatureCollection.php - About 25 mins to fix

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 prepareFilterQueryKeywords has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function prepareFilterQueryKeywords($featureTableName, $filterName, $searchTerms, $exclusion)
    {
        $terms = array();
        $filters = array(
            'with' => array(),
Severity: Minor
Found in app/resto/core/dbfunctions/FiltersFunctions.php - About 25 mins to fix

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 removeGroup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function removeGroup($params)
    {
        if (! isset($params['id'])) {
            RestoLogUtil::httpError(400, 'Missing mandatory group identifier');
        }
Severity: Minor
Found in app/resto/core/dbfunctions/GroupsFunctions.php - About 25 mins to fix

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 updateExtent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateExtent($collection, $extentArrays)
    {
        if (! isset($extentArrays)) {
            return false;
        }
Severity: Minor
Found in app/resto/core/dbfunctions/CollectionsFunctions.php - About 25 mins to fix

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 corsIsAllowed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function corsIsAllowed($httpOrigin)
    {
        /*
         * No white list => all allowed
         */
Severity: Minor
Found in app/resto/core/Resto.php - About 25 mins to fix

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 getPaging has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getPaging($count, $limit, $offset)
    {
        $count['returned'] = count($this->restoFeatures);

        /*
Severity: Minor
Found in app/resto/core/RestoFeatureCollection.php - About 25 mins to fix

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 answer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function answer($response, $responseStatus)
    {
        if (isset($response)) {
            /*
             * HTTP 1.1 headers
Severity: Minor
Found in app/resto/core/Resto.php - About 25 mins to fix

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 formatGroups has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function formatGroups($results, $groupId)
    {

        // 404 if no empty results when id is specified
        if (! isset($results) || (isset($groupId) && count($results) === 0)) {
Severity: Minor
Found in app/resto/core/dbfunctions/GroupsFunctions.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language