Showing 249 of 257 total issues

Function getGenericKeywords has a Cognitive Complexity of 11 (exceeds 5 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']);
Severity: Minor
Found in app/resto/core/addons/Tag.php - About 1 hr 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 kvpsToQueryString has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function kvpsToQueryString($kvps)
    {
        $paramsStr = '';
        if (!is_array($kvps)) {
            return $paramsStr;
Severity: Minor
Found in app/resto/core/utils/RestoUtil.php - About 1 hr 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 jsonQueryToKVP has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function jsonQueryToKVP($jsonQuery)
    {

        $params = array();

Severity: Minor
Found in app/resto/core/addons/STAC.php - About 1 hr 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 getThemesRootLinks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getThemesRootLinks()
    {
        $links = array();

        // Load collections
Severity: Minor
Found in app/resto/core/utils/STACUtil.php - About 1 hr 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 storeCollectionDescription has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function storeCollectionDescription($collection)
    {
        /*
         * First generate a right keywords array
         */
Severity: Minor
Found in app/resto/core/dbfunctions/CollectionsFunctions.php - About 1 hr 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 mergeRights has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function mergeRights($rights)
    {

        // Default rights allows only to delete/update things
        // that belongs to user
Severity: Minor
Found in app/resto/core/dbfunctions/RightsFunctions.php - About 1 hr 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 storeOSDescription has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function storeOSDescription($collection)
    {
        /*
         * Insert OpenSearch descriptions within osdescriptions table
         * (one description per lang)
Severity: Minor
Found in app/resto/core/dbfunctions/CollectionsFunctions.php - About 1 hr 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 getLinks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function getLinks($sorting, $collectionId)
    {
        /*
         * Base links are always returned
         */
Severity: Minor
Found in app/resto/core/RestoFeatureCollection.php - About 1 hr 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 cql2FiltersToSQL has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function cql2FiltersToSQL($cql2Filters, $operator)
    {
        $filters = array();
        $paramsWithOperation = array();

Severity: Minor
Found in app/resto/core/dbfunctions/FiltersFunctions.php - About 1 hr 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 sanitizeSQLColumns has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function sanitizeSQLColumns($featureColumns, $fields)
    {
        $discarded = array();
        
        /*
Severity: Minor
Found in app/resto/core/dbfunctions/FeaturesFunctions.php - About 1 hr 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 getTimeExtent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function getTimeExtent($dates)
    {
        if (count($dates) === 0 || !isset($dates[0])) {
            return array(
                'startDate' => null,
Severity: Minor
Found in app/resto/core/dbfunctions/CollectionsFunctions.php - About 1 hr 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

Method storeUserProfile has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function storeUserProfile($profile, $storageInfo)
    {
        if (!is_array($profile) || !isset($profile['email'])) {
            RestoLogUtil::httpError(400, 'Cannot save user profile - invalid user identifier');
        }
Severity: Minor
Found in app/resto/core/dbfunctions/UsersFunctions.php - About 1 hr to fix

    Method processITagKeywords has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function processITagKeywords($iTagFeature)
        {
            /*
             * Initialize keywords array from faceted properties
             */
    Severity: Minor
    Found in app/resto/core/addons/Tag.php - About 1 hr to fix

      Method namedOperation has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function namedOperation($value)
          {
              switch ($value) {
                  case self::T_IS_NULL:
                      return 'isNull';
      Severity: Minor
      Found in app/resto/core/utils/Lexer.php - About 1 hr to fix

        Method getChildren has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getChildren($params)
            {
                $childs = array();
        
                // Initialize router to process each children individually
        Severity: Minor
        Found in app/resto/core/addons/STAC.php - About 1 hr to fix

          Method checkGeoJSONFeature has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function checkGeoJSONFeature($object)
              {
                  // Default is nice
                  $error = 'Invalid GeoJSON feature';
          
          
          Severity: Minor
          Found in app/resto/core/utils/RestoGeometryUtil.php - About 1 hr to fix

            Method keywordsFromITag has 29 lines of code (exceeds 25 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 1 hr to fix

              Method addGeoRSSWhere has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function addGeoRSSWhere($type, $geometry)
                  {
                      $this->startElement('georss:where');
                      $this->startElement('gml:' . $type);
                      switch ($type) {
              Severity: Minor
              Found in app/resto/core/xml/ATOMFeed.php - About 1 hr to fix

                Method intersectsExpression has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function intersectsExpression($not)
                    {
                        $filter = array(
                            'not' => $not
                        );
                Severity: Minor
                Found in app/resto/core/utils/FilterParser.php - About 1 hr to fix

                  Method getUsersProfiles has 28 lines of code (exceeds 25 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 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language