sentilo/sentilo

View on GitHub

Showing 1,220 of 1,220 total issues

Function DataTable has 4213 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var DataTable = function( oInit )
    {
        
        
        /**
Severity: Major
Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.dataTables.js - About 3 wks to fix

    File jquery-1.9.0.js has 6540 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * jQuery JavaScript Library v1.9.0
     * http://jquery.com/
     *
     * Includes Sizzle.js
    Severity: Major
    Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 2 wks to fix

      File jquery.dataTables.js has 5000 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * @summary     DataTables
       * @description Paginate, search and sort HTML tables
       * @version     1.9.4
       * @file        jquery.dataTables.js
      Severity: Major
      Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.dataTables.js - About 2 wks to fix

        Function Plot has 1941 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function Plot(placeholder, data_, options_, plugins) {
                // data is on the form:
                //   [ series1, series2 ... ]
                // where series is either just the data as [ [x1, y1], [x2, y2], ... ]
                // or { data: [ [x1, y1], [x2, y2], ... ], label: "some label", ... }
        Severity: Major
        Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js - About 1 wk to fix

          File jquery.flot.js has 1955 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* Javascript plotting library for jQuery, version 0.8 alpha.
          
          Copyright (c) 2007-2012 IOLA and Ole Laursen.
          Licensed under the MIT license.
          
          
          Severity: Major
          Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js - About 5 days to fix

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

            function showNumericDataChart(url, dataPanel, sensorType, unit, filters) {
                jsonGET(url, filters, function(data) {
                    var chartAnchor = $('<div id="num-chart" class="ct-chart ct-perfect-fourth ct-chart-centered-labels"></div>');
                    $(dataPanel).html(chartAnchor);
                    printNumericalChart(data, sensorType, unit, '#num-chart', {height: 220, bottomPadding: 20});
            sentilo-catalog-web/src/main/webapp/static/js/sentilo/sensor_data.js on lines 49..114

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

            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

            function showNumericDataChart(url, dataPanel, sensorType, unit, filters) {
                jsonGET(url, filters, function(data) {
                    var chartAnchor = $('<div id="num-chart" class="ct-chart ct-perfect-fourth ct-chart-centered-labels"></div>');
                    $(dataPanel).html(chartAnchor);
                    printNumericalChart(data, sensorType, unit, '#num-chart', {height: 240, bottomPadding: 40});
            sentilo-catalog-web/src/main/webapp/static/js/sentilo/component_detail.js on lines 164..229

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

            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

            function showBooleanDataChart(url, dataPanel, filters) {
                jsonGET(url, filters, function(data) {
                    var chartAnchor = $('<div id="bool-chart" class="ct-chart ct-perfect-fourth ct-chart-centered-labels"></div>');
                    $(dataPanel).html(chartAnchor);
                    printBooleanChart(data, '#bool-chart', {height: 220, bottomPadding: 20});
            sentilo-catalog-web/src/main/webapp/static/js/sentilo/sensor_data.js on lines 116..181

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

            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

            function showBooleanDataChart(url, dataPanel, filters) {
                jsonGET(url, filters, function(data) {
                    var chartAnchor = $('<div id="bool-chart" class="ct-chart ct-perfect-fourth ct-chart-centered-labels"></div>');
                    $(dataPanel).html(chartAnchor);
                    printBooleanChart(data, '#bool-chart', {height: 220, bottomPadding: 20});
            sentilo-catalog-web/src/main/webapp/static/js/sentilo/component_detail.js on lines 97..162

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

            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( attributes.dataSource == null )
                            {
                                alert('Error: Missing dataSource JSON object');
                                return false;
            Severity: Major
            Found in sentilo-catalog-web/src/main/webapp/static/js/treejs.js and 1 other location - About 2 days to fix
            sentilo-catalog-web/src/main/webapp/static/js/treejs.js on lines 55..100

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

            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( attributes.dataSource == null )
                        {
                            alert('Error: Missing dataSource JSON object');
                            return false;
            Severity: Major
            Found in sentilo-catalog-web/src/main/webapp/static/js/treejs.js and 1 other location - About 2 days to fix
            sentilo-catalog-web/src/main/webapp/static/js/treejs.js on lines 271..315

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

            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 layerFactory has 516 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function layerFactory(L) {
            
                const CanvasIconLayer = (L.Layer ? L.Layer : L.Class).extend({
            
                    //Add event listeners to initialized section.

              File universal_map.js has 929 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              
              var sensorsLastObsMap = [];
              var defaultChartObsLimit = 10;
              var maxChartObsLimit = 200;
              var componentDetailUrl;
              Severity: Major
              Found in sentilo-catalog-web/src/main/webapp/static/js/sentilo/universal_map.js - About 2 days to fix

                File bootstrap-datepicker.js has 908 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* =========================================================
                 * bootstrap-datepicker.js
                 * http://www.eyecon.ro/bootstrap-datepicker
                 * =========================================================
                 * Copyright 2012 Stefan Petre
                Severity: Major
                Found in sentilo-catalog-web/src/main/webapp/static/js/bootstrap-datepicker.js - About 2 days to fix

                  File markerclusterer.js has 711 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /**
                   * @name MarkerClustererPlus for Google Maps V3
                   * @version 2.1.1 [November 4, 2013]
                   * @author Gary Little
                   * @fileoverview
                  Severity: Major
                  Found in sentilo-catalog-web/src/main/webapp/static/js/markerclusterer.js - About 1 day to fix

                    File ExcelGeneratorUtils.java has 671 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.

                      Component has 71 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      @Document
                      public class Component implements FederatedResource, CatalogDocument, SectorResourceGranted, EntityResource, AlphabeticalSortable {
                      
                        private static final long serialVersionUID = 1L;
                      
                      

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

                        users.forEach(function (e) {    
                        var updated = false;
                            
                        if((e.tenantsAuth && e.tenantsAuth.indexOf(e.tenantId)) || !e.tenantsAuth){
                            db.user.update({"_id" : e._id}, { $push: { "tenantsAuth" : e.tenantId}} );
                        Severity: Major
                        Found in scripts/upgrades/1.8.0/mongodb/upgrade_1.8.0.js and 1 other location - About 1 day to fix
                        scripts/upgrades/1.6.0/mongodb/fix_bug_tenantFields.js on lines 8..26

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

                        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(e.tenantId){
                                  var updated = false;
                                    
                                  if((e.tenantsAuth && e.tenantsAuth.indexOf(e.tenantId)) || !e.tenantsAuth){
                                    db.component.update({"_id" : e._id}, { $push: { "tenantsAuth" : e.tenantId}} );
                        Severity: Major
                        Found in scripts/upgrades/1.6.0/mongodb/fix_bug_tenantFields.js and 1 other location - About 1 day to fix
                        scripts/upgrades/1.8.0/mongodb/upgrade_1.8.0.js on lines 9..28

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

                        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

                        Sensor has 68 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        @Document
                        public class Sensor implements FederatedResource, CatalogDocument, SectorResourceGranted, EntityResource, SyncResource, AlphabeticalSortable {
                        
                          private static final long serialVersionUID = 1L;
                        
                        
                          Severity
                          Category
                          Status
                          Source
                          Language