sentilo/sentilo

View on GitHub

Showing 1,220 of 1,220 total issues

Function support has 115 lines of code (exceeds 25 allowed). Consider refactoring.
Open

jQuery.support = (function() {

    var support, all, a, select, opt, input, fragment, eventName, isSupported, i,
        div = document.createElement("div");

Severity: Major
Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 4 hrs to fix

    File Sensor.java has 356 lines of code (exceeds 250 allowed). 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.

      Function _fnFeatureHtmlTable has 113 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function _fnFeatureHtmlTable ( oSettings )
              {
                  /* Check if scrolling is enabled or not - if not then leave the DOM unaltered */
                  if ( oSettings.oScroll.sX === "" && oSettings.oScroll.sY === "" )
                  {
      Severity: Major
      Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.dataTables.js - About 4 hrs to fix

        User has 35 methods (exceeds 20 allowed). Consider refactoring.
        Open

        @Document
        public class User implements SectorResource<String>, CatalogDocument {
        
          private static final long serialVersionUID = 1L;
        
        

          File DefaultSearchFilterBuilderImpl.java has 354 lines of code (exceeds 250 allowed). 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.

            Function _fnAddOptionsHtml has 111 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function _fnAddOptionsHtml ( oSettings )
                    {
                        /*
                         * Create a temporary, empty, div which we can later on replace with what we have generated
                         * we do it this way to rendering the 'options' html offline - speed :-)
            Severity: Major
            Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.dataTables.js - About 4 hrs to fix

              Function tooltip has 111 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  Chartist.plugins.tooltip = function (options) {
                    options = Chartist.extend({}, defaultOptions, options);
              
                    return function tooltip(chart) {
                      var tooltipSelector = options.pointClass;

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

                    if (chartOptions !== null && chartOptions !== undefined) {
                        if (chartOptions.height !== undefined) {
                            chartHeight = chartOptions.height;    
                        }
                        if (chartOptions.topPadding !== undefined) {
                sentilo-catalog-web/src/main/webapp/static/js/sentilo/chartist.js on lines 26..39
                sentilo-catalog-web/src/main/webapp/static/js/sentilo/chartist.js on lines 187..200

                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 123.

                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

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

                    if (chartOptions !== null && chartOptions !== undefined) {
                        if (chartOptions.height !== undefined) {
                            chartHeight = chartOptions.height;    
                        }
                        if (chartOptions.topPadding !== undefined) {
                sentilo-catalog-web/src/main/webapp/static/js/sentilo/chartist.js on lines 26..39
                sentilo-catalog-web/src/main/webapp/static/js/sentilo/chartist.js on lines 115..128

                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 123.

                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

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

                    if (chartOptions !== null && chartOptions !== undefined) {
                        if (chartOptions.height !== undefined) {
                            chartHeight = chartOptions.height;    
                        }
                        if (chartOptions.topPadding !== undefined) {
                sentilo-catalog-web/src/main/webapp/static/js/sentilo/chartist.js on lines 115..128
                sentilo-catalog-web/src/main/webapp/static/js/sentilo/chartist.js on lines 187..200

                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 123.

                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

                                            case 'M':
                                                filtered = $(dates[language].monthsShort).filter(function(){
                                                    var m = this.slice(0, parts[i].length),
                                                        p = parts[i].slice(0, m.length);
                                                    return m == p;
                sentilo-catalog-web/src/main/webapp/static/js/bootstrap-datepicker.js on lines 940..947

                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 122.

                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

                                $(childUL).each(function(){
                                    $(this).find('li > label').find('input[type="checkbox"]').prop('checked', false);
                                    $.each($(this).find('li > label').find('input[type="checkbox"]'), (i,check) => {
                                        $(this).changeMultipleCheckboxesByMasterCheckValue(check.id, $(this).id, false);    
                                    });
                Severity: Major
                Found in sentilo-catalog-web/src/main/webapp/static/js/treejs.js and 1 other location - About 4 hrs to fix
                sentilo-catalog-web/src/main/webapp/static/js/treejs.js on lines 134..139

                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 122.

                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

                                            case 'MM':
                                                filtered = $(dates[language].months).filter(function(){
                                                    var m = this.slice(0, parts[i].length),
                                                        p = parts[i].slice(0, m.length);
                                                    return m == p;
                sentilo-catalog-web/src/main/webapp/static/js/bootstrap-datepicker.js on lines 948..955

                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 122.

                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

                                $(childUL).each(function(){
                                    $(this).find('li > label').find('input[type="checkbox"]').prop('checked', true);
                                    $.each($(this).find('li > label').find('input[type="checkbox"]'), (i,check) => {
                                        $(this).changeMultipleCheckboxesByMasterCheckValue(check.id, $(this).id, true);    
                                    });                    
                Severity: Major
                Found in sentilo-catalog-web/src/main/webapp/static/js/treejs.js and 1 other location - About 4 hrs to fix
                sentilo-catalog-web/src/main/webapp/static/js/treejs.js on lines 151..156

                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 122.

                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

                Function tooltip has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      return function tooltip(chart) {
                        var tooltipSelector = options.pointClass;
                        if (chart instanceof Chartist.Bar) {
                          tooltipSelector = 'ct-bar';
                        } else if (chart instanceof Chartist.Pie) {

                  Function Datepicker has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var Datepicker = function(element, options) {
                          var that = this;
                  
                          this.element = $(element);
                          this.language = options.language||this.element.data('date-language')||"en";
                  Severity: Major
                  Found in sentilo-catalog-web/src/main/webapp/static/js/bootstrap-datepicker.js - About 4 hrs to fix

                    File Component.java has 345 lines of code (exceeds 250 allowed). 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.

                      File Activity.java has 340 lines of code (exceeds 250 allowed). 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.

                        Performance has 32 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        public class Performance implements CatalogDocument, Comparable<Performance> {
                        
                          private static final long serialVersionUID = 1L;
                        
                          @JsonIgnore

                          RequestListenerThread has 32 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                          @Component("apiServer")
                          public class RequestListenerThread extends Thread {
                          
                            private static final Logger LOGGER = LoggerFactory.getLogger(RequestListenerThread.class);
                            private static final String THREAD_NAME = "API-Server-Thread";
                            Severity
                            Category
                            Status
                            Source
                            Language