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
         */
Severity: Minor
Found in app/resto/core/RestoModel.php - About 1 hr to fix

    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] . '**';
    
    
    Severity: Minor
    Found in app/resto/core/addons/STAC.php - About 1 hr to fix

      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++) {
      Severity: Minor
      Found in app/resto/core/addons/Tag.php - About 1 hr to fix

        Function __construct has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            public function __construct($profile, $context, $autoload = false)
            {
                $this->context = $context;
        
                /*
        Severity: Minor
        Found in app/resto/core/RestoUser.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 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());
        
                /*
        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 __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'])) {
        Severity: Minor
        Found in app/resto/core/RestoNotifier.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 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
        Severity: Minor
        Found in app/resto/core/RestoQueryAnalyzer.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 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);
        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

        Method formatPartialUserProfile has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function formatPartialUserProfile($rawProfile)
            {
                
                $profile = array(
                    'id' => $rawProfile['id'],
        Severity: Minor
        Found in app/resto/core/dbfunctions/UsersFunctions.php - About 1 hr to fix

          Method getTopologyAnalysis has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getTopologyAnalysis($geometry, $params)
              {
                  $result = null;
          
                  /*
          Severity: Minor
          Found in app/resto/core/dbfunctions/GeneralFunctions.php - About 1 hr to fix

            Method geoJSONGeometryToWKT has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function geoJSONGeometryToWKT($geometry)
                {
                    if (!isset($geometry)) {
                        return null;
                    }
            Severity: Minor
            Found in app/resto/core/utils/RestoGeometryUtil.php - About 1 hr to fix

              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)
              Severity: Minor
              Found in app/resto/core/dbfunctions/CollectionsFunctions.php - About 1 hr to fix

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

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

                      public function __construct($options = array())
                      {
                          parent::__construct($options);
                  
                          /*
                  Severity: Minor
                  Found in app/resto/core/models/OpticalModel.php - About 1 hr to fix

                    Method addEntryElements has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function addEntryElements($feature)
                        {
                            $explodedSelf = null;
                            
                            /*
                    Severity: Minor
                    Found in app/resto/core/xml/ATOMFeed.php - About 1 hr to fix

                      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']);
                      Severity: Minor
                      Found in app/resto/core/addons/Tag.php - About 1 hr to fix

                        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) {
                        Severity: Minor
                        Found in app/resto/core/RestoCollections.php - About 1 hr to fix

                          Method processTriplet has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Method getLogs has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getLogs($params)
                                {
                                    $where = array();
                                    
                                    // Paginate
                            Severity: Minor
                            Found in app/resto/core/dbfunctions/LogsFunctions.php - About 1 hr to fix

                              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
                              Severity: Minor
                              Found in app/resto/core/dbfunctions/RightsFunctions.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language