sentilo/sentilo

View on GitHub

Showing 1,220 of 1,220 total issues

Avoid too many return statements within this function.
Open

                return results;
Severity: Major
Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return ret;
    Severity: Major
    Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return (Math.round(res))
      Severity: Major
      Found in sentilo-catalog-web/src/main/webapp/static/js/sentilo/metrics.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return ret == null ?
                        undefined :
                        ret;
        Severity: Major
        Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return jQuery.makeArray( selector, this );
          Severity: Major
          Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                    return results;
            Severity: Major
            Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return a.compareDocumentPosition ? -1 : 1;
              Severity: Major
              Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return ( context || rootjQuery ).find( selector );
                Severity: Major
                Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return compare & 4 ? -1 : 1;
                  Severity: Major
                  Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return i ?
                                // Do a sibling check if the nodes have a common ancestor
                                siblingCheck( ap[i], bp[i] ) :
                    
                                // Otherwise nodes in our document sort first
                    Severity: Major
                    Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                                      left: parseInt(xaxes[axisNumber(point, "x") - 1].p2c(+point.x) + plotOffset.left, 10),
                      Severity: Minor
                      Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js and 1 other location - About 30 mins to fix
                      sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js on lines 208..208

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 45.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                        @SuppressWarnings("unchecked")
                        private void addProviderListTo(final Model model) {
                          final List<Provider> providers = (List<Provider>) getResourcesUserSectorsGranted(providerService);
                          final List<OptionDTO> providersDTO = CatalogUtils.toOptionList(providers);
                          model.addAttribute(Constants.MODEL_PROVIDERS, providersDTO);
                      sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/controller/admin/AlertController.java on lines 119..124
                      sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/controller/admin/AlertRuleController.java on lines 212..217

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 40.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                      /*
                       * Sentilo
                       *
                       * Original version 1.4 Copyright (C) 2013 Institut Municipal d’Informàtica, Ajuntament de
                       * Barcelona. Modified by Opentrends adding support for multitenant deployments and SaaS.
                      sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/exception/DuplicateKeyException.java on lines 1..43
                      sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/exception/TenantPermissionException.java on lines 1..47

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 40.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                               if(params.buttonsColumn == 'first'){
                                   this.find('thead tr').prepend('<th name="buttons" class="span2"></th>');  //encabezado vacío
                                   this.find('tbody tr').prepend(colEdicHtml);
                               }else{
                      sentilo-catalog-web/src/main/webapp/static/js/sentilo/additional_info.js on lines 60..63

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 45.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                        public CatalogInputMessage parsePutRequest(final SentiloRequest request) {
                          final String providerId = request.getResourcePart(0);
                          final CatalogInputMessage inputMessage = readInternal(request, CatalogInputMessage.class);
                          inputMessage.setProviderId(providerId);
                      
                      
                      sentilo-platform/sentilo-platform-server/src/main/java/org/sentilo/platform/server/converter/CatalogConverter.java on lines 39..45

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 40.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                               }else{
                                   this.find('thead tr').append('<th name="buttons" class="span2"></th>');  //encabezado vacío
                                   this.find('tbody tr').append(colEdicHtml);
                               }
                      sentilo-catalog-web/src/main/webapp/static/js/sentilo/additional_info.js on lines 57..60

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 45.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                      /*
                       * Sentilo
                       *
                       * Original version 1.4 Copyright (C) 2013 Institut Municipal d’Informàtica, Ajuntament de
                       * Barcelona. Modified by Opentrends adding support for multitenant deployments and SaaS.
                      sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/exception/ResourceNotFoundException.java on lines 1..46
                      sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/exception/TenantPermissionException.java on lines 1..47

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 40.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                        public CatalogInputMessage parsePostRequest(final SentiloRequest request) {
                          final String providerId = request.getResourcePart(0);
                          final CatalogInputMessage inputMessage = readInternal(request, CatalogInputMessage.class);
                          inputMessage.setProviderId(providerId);
                      
                      
                      sentilo-platform/sentilo-platform-server/src/main/java/org/sentilo/platform/server/converter/CatalogConverter.java on lines 47..53

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 40.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                        @SuppressWarnings("unchecked")
                        private void addApplicationListTo(final Model model) {
                          final List<Application> applications = (List<Application>) getResourcesUserSectorsGranted(applicationService);
                          final List<OptionDTO> applicationDto = CatalogUtils.toOptionList(applications);
                          model.addAttribute(Constants.MODEL_APPLICATIONS, applicationDto);
                      sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/controller/admin/AlertController.java on lines 112..117
                      sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/controller/admin/AlertRuleController.java on lines 212..217

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 40.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                        @SuppressWarnings("unchecked")
                        private void addProviderListTo(final Model model) {
                          final List<Provider> providers = (List<Provider>) getResourcesUserSectorsGranted(providerService);
                          final List<OptionDTO> providersDTO = CatalogUtils.toOptionList(providers);
                          model.addAttribute(Constants.MODEL_PROVIDERS, providersDTO);
                      sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/controller/admin/AlertController.java on lines 112..117
                      sentilo-catalog-web/src/main/java/org/sentilo/web/catalog/controller/admin/AlertController.java on lines 119..124

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 40.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language