Showing 240 of 248 total issues

Function load has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    private function load($params = array())
    {
        $nbOfSegments = count($this->segments);

        // Root
Severity: Minor
Found in app/resto/core/addons/STAC.php - About 3 hrs 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 keywordsFromFacets has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    private function keywordsFromFacets($properties, $facetCategory, $model)
    {
        $parentId = null;
        $keywords = array();
        for ($i = 0, $ii = count($facetCategory); $i < $ii; $i++) {
Severity: Minor
Found in app/resto/core/addons/Tag.php - About 3 hrs 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 setCatalogsLinksFromFacet has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function setCatalogsLinksFromFacet($params)
    {
        $nbOfSegments = count($this->segments);
        $leafValue = $this->segments[$nbOfSegments - 1];
        
Severity: Major
Found in app/resto/core/addons/STAC.php - About 3 hrs to fix

    Function analyze has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        public function analyze($params, $model)
        {
            /*
             * Store original params
             */
    Severity: Minor
    Found in app/resto/core/RestoQueryAnalyzer.php - About 3 hrs 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 search has 85 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function search($context, $user, $model, $collections, $paramsWithOperation, $sorting)
        {
            /*
             * Check that mandatory filters are set
             */
    Severity: Major
    Found in app/resto/core/dbfunctions/FeaturesFunctions.php - About 3 hrs to fix

      Function splitString has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function splitString($str)
          {
              $quotted = explode('"', $str);
      
              /*
      Severity: Minor
      Found in app/resto/core/utils/RestoUtil.php - About 3 hrs 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 search has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          public function search($context, $user, $model, $collections, $paramsWithOperation, $sorting)
          {
              /*
               * Check that mandatory filters are set
               */
      Severity: Minor
      Found in app/resto/core/dbfunctions/FeaturesFunctions.php - About 3 hrs 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 hello has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function hello()
          {
              
              $minMatch = isset($this->context->addons['STAC']['options']['minMatch']) && is_int($this->context->addons['STAC']['options']['minMatch']) ? $this->context->addons['STAC']['options']['minMatch'] : 0;
             
      Severity: Major
      Found in app/resto/core/api/ServicesAPI.php - About 3 hrs to fix

        Method getRootCatalogLinks has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getRootCatalogLinks($minMatch)
            {
                $links = array();
        
                /*
        Severity: Major
        Found in app/resto/core/utils/STACUtil.php - About 3 hrs to fix

          Method getSummaries has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getSummaries($types, $collectionId)
              {
                  
                  $summaries = array();
          
          
          Severity: Major
          Found in app/resto/core/dbfunctions/FacetsFunctions.php - About 3 hrs to fix

            Method __construct has 77 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function __construct($options = array())
                {
                    parent::__construct($options);
            
                    /*
            Severity: Major
            Found in app/resto/core/models/LandCoverModel.php - About 3 hrs to fix

              Method __construct has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function __construct($options = array())
                  {
                      parent::__construct($options);
              
                      /*
              Severity: Major
              Found in app/resto/core/models/DefaultModel.php - About 2 hrs to fix

                Method load has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function load($params = array())
                    {
                        $nbOfSegments = count($this->segments);
                
                        // Root
                Severity: Major
                Found in app/resto/core/addons/STAC.php - About 2 hrs to fix

                  Method toArray has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function toArray()
                      {
                  
                          $osDescription = $this->osDescription[$this->context->lang] ?? $this->osDescription['en'];
                  
                  
                  Severity: Major
                  Found in app/resto/core/RestoCollection.php - About 2 hrs to fix

                    RestoModel has 24 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    abstract class RestoModel
                    {
                        /*
                         * Model options
                         */
                    Severity: Minor
                    Found in app/resto/core/RestoModel.php - About 2 hrs to fix

                      File FacetsFunctions.php has 275 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /*
                       * Copyright 2018 Jérôme Gasperi
                       *
                       * Licensed under the Apache License, version 2.0 (the "License");
                      Severity: Minor
                      Found in app/resto/core/dbfunctions/FacetsFunctions.php - About 2 hrs to fix

                        File RestoCollection.php has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        /*
                         * Copyright 2018 Jérôme Gasperi
                         *
                         * Licensed under the Apache License, version 2.0 (the "License");
                        Severity: Minor
                        Found in app/resto/core/RestoCollection.php - About 2 hrs to fix

                          File RestoUtil.php has 269 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          /*
                           * Copyright 2018 Jérôme Gasperi
                           *
                           * Licensed under the Apache License, version 2.0 (the "License");
                          Severity: Minor
                          Found in app/resto/core/utils/RestoUtil.php - About 2 hrs to fix

                            File ATOMFeed.php has 269 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            /*
                             * Copyright 2018 Jérôme Gasperi
                             *
                             * Licensed under the Apache License, version 2.0 (the "License");
                            Severity: Minor
                            Found in app/resto/core/xml/ATOMFeed.php - About 2 hrs to fix

                              Method featureArrayToKeysValues has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function featureArrayToKeysValues($collection, $featureArray, $protected, $updatabled)
                                  {
                                      // Initialize
                                      $keysAndValues = array(
                                          'links' => isset($featureArray['links']) ? json_encode($featureArray['links'], JSON_UNESCAPED_SLASHES) : null,
                              Severity: Major
                              Found in app/resto/core/dbfunctions/FeaturesFunctions.php - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language