sentilo/sentilo

View on GitHub

Showing 1,220 of 1,220 total issues

PlatformActivity has 40 methods (exceeds 20 allowed). Consider refactoring.
Open

public class PlatformActivity {

  @JsonInclude(value = Include.NON_NULL)
  private String tenant;
  private long totalRequests;

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

    function makeAudioLinkChartLine(id, ph, data) {
        
        var html = 
            '<div class="activity_text_element">' +
            '    <span class="label label-info">' + data.timestamp + '</span>&nbsp;' +
    sentilo-catalog-web/src/main/webapp/static/js/sentilo/scripts_graphics.js on lines 39..56
    sentilo-catalog-web/src/main/webapp/static/js/sentilo/scripts_graphics.js on lines 59..76

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

    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

    function makeVideoLinkChartLine(id, ph, data) {
        
        var html = 
            '<div class="activity_text_element">' +
            '    <span class="label label-info">' + data.timestamp + '</span>&nbsp;' +
    sentilo-catalog-web/src/main/webapp/static/js/sentilo/scripts_graphics.js on lines 19..36
    sentilo-catalog-web/src/main/webapp/static/js/sentilo/scripts_graphics.js on lines 59..76

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

    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

    function makeImageLinkChartLine(id, ph, data) {
        
        var html = 
            '<div class="activity_text_element">' +
            '    <span class="label label-info">' + data.timestamp + '</span>&nbsp;' +
    sentilo-catalog-web/src/main/webapp/static/js/sentilo/scripts_graphics.js on lines 19..36
    sentilo-catalog-web/src/main/webapp/static/js/sentilo/scripts_graphics.js on lines 39..56

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

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

            function _fnGatherData( oSettings )
            {
                var iLoop, i, iLen, j, jLen, jInner,
                     nTds, nTrs, nTd, nTr, aLocalData, iThisIndex,
                    iRow, iRows, iColumn, iColumns, sNodeName,
    Severity: Major
    Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.dataTables.js - About 5 hrs to fix

      ActiveSubscription has 39 methods (exceeds 20 allowed). Consider refactoring.
      Open

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

        EventMessage has 39 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class EventMessage {
        
          protected String message;
          protected String timestamp;
          @JsonInclude(value = Include.NON_NULL)

          Function tagsInput has 129 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.fn.tagsInput = function(options) { 
              var settings = jQuery.extend({
                interactive:true,
                defaultText:'add a tag',
                minChars:0,
          Severity: Major
          Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.tagsinput.js - About 5 hrs to fix

            Function Callbacks has 127 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            jQuery.Callbacks = function( options ) {
            
                // Convert options from String-formatted to Object-formatted if needed
                // (we check in cache first)
                options = typeof options === "string" ?
            Severity: Major
            Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 5 hrs to fix

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

                          for (i = 0; i < xaxes.length; ++i) {
                              axis = xaxes[i];
                              if (axis && axis.used) {
                                  key = "x" + axis.n;
                                  if (pos[key] == null && axis.n == 1)
              Severity: Major
              Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js and 1 other location - About 5 hrs to fix
              sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js on lines 397..409

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

              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

                          for (i = 0; i < yaxes.length; ++i) {
                              axis = yaxes[i];
                              if (axis && axis.used) {
                                  key = "y" + axis.n;
                                  if (pos[key] == null && axis.n == 1)
              Severity: Major
              Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js and 1 other location - About 5 hrs to fix
              sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js on lines 383..395

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

              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

              File SensorController.java has 376 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.

                ExcelGeneratorUtils has 38 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class ExcelGeneratorUtils {
                
                  private enum ListType {
                    provider, application, component, sensor, sensortype, componenttype, permission, grant, user, alert, alertrule, tenant, tenantpermission, activesubscription, federationconfig, sector;
                  }

                  Consider simplifying this complex logical expression.
                  Open

                              if ( event.pageX == null && original.clientX != null ) {
                                  eventDoc = event.target.ownerDocument || document;
                                  doc = eventDoc.documentElement;
                                  body = eventDoc.body;
                  
                  
                  Severity: Critical
                  Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 5 hrs to fix

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

                    var refreshChartControlLabels = function(theNavData) {
                        
                        // This is a chart callback function
                        // When data is loaded onto chart, calls this function
                        // for update window labels
                    sentilo-catalog-web/src/main/webapp/static/js/sentilo/sensor_data.js on lines 209..222

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

                    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

                    var refreshChartControlLabels = function(theNavData) {
                        
                        // This is a chart callback function
                        // When data is loaded onto chart, calls this function
                        // for update window labels
                    sentilo-catalog-web/src/main/webapp/static/js/sentilo/component_detail.js on lines 232..245

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

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

                            function _fnSort ( oSettings, bApplyClasses )
                            {
                                var
                                    i, iLen, j, jLen, k, kLen,
                                    sDataType, nTh,
                    Severity: Major
                    Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.dataTables.js - About 4 hrs to fix

                      DocumentFile has 37 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class DocumentFile implements CatalogDocument, TenantResource, EntityResource {
                      
                        private static final long serialVersionUID = 6553719639654955139L;
                      
                        @Id

                        FederationConfig has 37 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        public class FederationConfig implements CatalogDocument, TenantResource, AlphabeticalSortable {
                        
                          private static final long serialVersionUID = 1L;
                        
                          @NotBlank

                          Tenant has 36 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                          @Document
                          public class Tenant implements CatalogDocument, AlphabeticalSortable {
                          
                            private static final long serialVersionUID = 6968628203407382531L;
                          
                          
                            Severity
                            Category
                            Status
                            Source
                            Language