Showing 249 of 257 total issues

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);
        }
Severity: Minor
Found in app/resto/core/addons/STAC.php - About 55 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 remapInputProperties has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function remapInputProperties($properties)
    {
        if (empty($this->inputMapping)) {
            return $properties;
        }
Severity: Minor
Found in app/resto/core/RestoModel.php - About 55 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 prepareORFilters has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function prepareORFilters($filterName, $filterValue, $exclusion)
    {
        /*
         * Set quote to "'" for non numeric filter types
         */
Severity: Minor
Found in app/resto/core/dbfunctions/FiltersFunctions.php - About 55 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 instantiateRoute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function instantiateRoute($validRoute, $method, $params)
    {
        /*
         * In resto 5.x first element of route is an "authenticationIsRequired" boolean
         * In restto >=6.x first element of route can also be an array
Severity: Minor
Found in app/resto/core/RestoRouter.php - About 55 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 validateFilterString has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private function validateFilterString($filterKey, $value)
    {
        /*
         * If operation = "in" then value is a comma separated list - check pattern for each element of the list
         */
Severity: Minor
Found in app/resto/core/RestoModel.php - About 45 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 keywordsFromITag has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private function keywordsFromITag($properties, $geometry, $iTagParams)
    {
        /*
         * No geometry = no iTag
         *
Severity: Minor
Found in app/resto/core/addons/Tag.php - About 45 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 intersectsExpression has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private function intersectsExpression($not)
    {
        $filter = array(
            'not' => $not
        );
Severity: Minor
Found in app/resto/core/utils/FilterParser.php - About 45 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

Avoid deeply nested control flow statements.
Open

                                for ($i = count($this->statistics[$filter['osKey']]['oneOf']); $i--;) {
                                    $this->startElement('parameters:Option');
                                    $this->writeAttribute('value', $this->statistics[$filter['osKey']]['oneOf'][$i]['const']);
                                    $this->endElement();
                                }
Severity: Major
Found in app/resto/core/xml/OSDD.php - About 45 mins to fix

    Function remap has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function remap($featureArray, $collection)
        {
            /*
             * These properties are discarded from output
             */
    Severity: Minor
    Found in app/resto/core/RestoModel.php - About 45 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

    Avoid deeply nested control flow statements.
    Open

                                if ($exploded[$j]) {
                                    $output[] = $exploded[$j];
                                }
    Severity: Major
    Found in app/resto/core/utils/RestoUtil.php - About 45 mins to fix

      Function operationExpression has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private function operationExpression()
          {
              // Special case for IS NULL
              if ($this->lexer->lookahead['value'] === 'is') {
                  $this->lexer->moveNext();
      Severity: Minor
      Found in app/resto/core/utils/FilterParser.php - About 45 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 addGeoRSS has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private function addGeoRSS($type, $coordinates)
          {
              $geometry = array();
              switch ($type) {
                  case 'Point':
      Severity: Minor
      Found in app/resto/core/xml/ATOMFeed.php - About 45 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 toOSKeys has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function toOSKeys($filterNames, $processSearchTerms = false)
          {
              $arr = array();
              foreach ($filterNames as $key => $obj) {
                  if (isset($this->searchFilters[$key])) {
      Severity: Minor
      Found in app/resto/core/RestoModel.php - About 45 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

      Avoid deeply nested control flow statements.
      Open

                                  if (isset($filter['options'][$i]['label'])) {
                                      $this->writeAttribute('label', $filter['options'][$i]['label']);
                                  }
      Severity: Major
      Found in app/resto/core/xml/OSDD.php - About 45 mins to fix

        Function addEntryElements has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            private function addEntryElements($feature)
            {
                $explodedSelf = null;
                
                /*
        Severity: Minor
        Found in app/resto/core/xml/ATOMFeed.php - About 45 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 getPicture has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            private function getPicture($profile, $storageInfo = null)
            {
                // Create picture url from email
                if (!isset($profile['picture'])) {
                    return 'https://robohash.org/' . md5($profile['email']) . '?gravatar=hashed&bgset=any&size=400x400';
        Severity: Minor
        Found in app/resto/core/dbfunctions/UsersFunctions.php - About 45 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 getLogs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getLogs($params)
            {
                $where = array();
                
                // Paginate
        Severity: Minor
        Found in app/resto/core/dbfunctions/LogsFunctions.php - About 45 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 checkMandatoryFilters has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            private function checkMandatoryFilters($searchFilters, $paramsWithOperation)
            {
                $missing = array();
                foreach (array_keys($searchFilters) as $filterName) {
                    if (isset($searchFilters[$filterName])) {
        Severity: Minor
        Found in app/resto/core/dbfunctions/FeaturesFunctions.php - About 45 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 getWhereClause has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getWhereClause($filtersAndJoins, $options = array())
            {
                $size = count($filtersAndJoins['filters']);
        
                if ($size > 0) {
        Severity: Minor
        Found in app/resto/core/dbfunctions/FiltersFunctions.php - About 45 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 getUsersProfiles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getUsersProfiles($params, $userid)
            {
                // Only returns activated profiles
                $where = array(
                    'activated=1'
        Severity: Minor
        Found in app/resto/core/dbfunctions/UsersFunctions.php - About 45 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