Showing 240 of 248 total issues

Method getFacetsCount has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getFacetsCount($minMatch)
    {
        $facets = array(
            'count' => 0,
            'catalogs' => array(),
Severity: Minor
Found in app/resto/core/utils/STACUtil.php - About 1 hr to fix

    Function parentIdFromLinks has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        private function parentIdFromLinks($links)
        {
    
            $parentId = null;
    
    
    Severity: Minor
    Found in app/resto/core/addons/STACCatalog.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 clear has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function clear($key = null)
        {
            if (isset($this->directory)) {
                if (isset($key)) {
                    $file = $this->directory . DIRECTORY_SEPARATOR . crc32($key);
    Severity: Minor
    Found in app/resto/core/RestoCache.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 writeRequestParams has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        private function writeRequestParams($params)
        {
            $arr = array();
    
            foreach ($params as $key => $value) {
    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 formatUserProfile has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function formatUserProfile($rawProfile)
        {
            // Empty profile
            $profile = array();
    
    
    Severity: Minor
    Found in app/resto/core/dbfunctions/UsersFunctions.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 sendMail has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function sendMail($params, $smtp = array())
        {
            if (! isset($params) || ! is_array($params)) {
                return false;
            }
    Severity: Minor
    Found in app/resto/core/RestoNotifier.php - About 1 hr to fix

      Method process has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function process($method, $path, $query)
          {
      
              // Special case for doc generation
              if ( $path === '/_routes' ) {
      Severity: Minor
      Found in app/resto/core/RestoRouter.php - About 1 hr to fix

        Method explodeSearchTerms has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function explodeSearchTerms($obj)
            {
                $hashtags = [];
                $output = [];
                
        Severity: Minor
        Found in app/resto/core/RestoModel.php - About 1 hr to fix

          Method format has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function format($rawDescription, $osDescription)
              {
                  $collection = array(
                      'id' => $rawDescription['id'],
                      'aliases' => isset($rawDescription['aliases']) ? json_decode($rawDescription['aliases'], true) : array(),
          Severity: Minor
          Found in app/resto/core/dbfunctions/CollectionsFunctions.php - About 1 hr to fix

            Function setThemesLinks has a Cognitive Complexity of 13 (exceeds 5 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

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

                public function __construct($config)
                {
                    if (isset($config)) {
                        if (isset($config['commonSchema'])) {
                            $this->commonSchema = $config['commonSchema'];
            Severity: Minor
            Found in app/resto/core/RestoDatabaseDriver.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 getFacetsFromKeywords has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getFacetsFromKeywords($keywords, $facetCategories, $collectionId, $options = array())
                {
                    /*
                     * One facet per keyword
                     */
            Severity: Minor
            Found in app/resto/core/dbfunctions/FacetsFunctions.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 hasRightsTo has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function hasRightsTo($action, $params = array())
                {
            
                    $rights = $this->getRights();
            
            
            Severity: Minor
            Found in app/resto/core/RestoUser.php - About 1 hr to fix

              Method updateUserProfile has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                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

                      Severity
                      Category
                      Status
                      Source
                      Language