sentilo/sentilo

View on GitHub

Showing 1,220 of 1,220 total issues

AbstractBaseCrudServiceImpl has 47 methods (exceeds 20 allowed). Consider refactoring.
Open

public abstract class AbstractBaseCrudServiceImpl<T extends CatalogDocument> extends AbstractBaseServiceImpl implements CrudService<T>, ApplicationContextAware {

  protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractBaseCrudServiceImpl.class);

  private ApplicationContext context;

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

        $.each(data.artifactsMetrics, function(index, element ) {            
            var name = element.name.split(":");
            var tabname= name[1] + "-" + name[2];
            var state=getStatus(element.timestamp,element.state);
            buildAbstractElement(name[1],name[2], element.timestamp, state ) ;  
    sentilo-catalog-web/src/main/webapp/static/js/sentilo/metrics.js on lines 91..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 165.

    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 2 locations. Consider refactoring.
    Open

        $.each(data.artifactsMetrics, function(index, element ) {                   
            var name = element.name.split(":");
            var tabname= name[1] + "-" + name[2];
            var state=getStatus(element.timestamp,element.state);
            buildAbstractElement(name[1],name[2], element.timestamp, state ) ;  
    sentilo-catalog-web/src/main/webapp/static/js/sentilo/metrics.js on lines 60..68

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

    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 setEditMode(but) {
             $(but).parent().find('#bAcep').show();
             $(but).parent().find('#bCanc').show();
             $(but).parent().find('#bEdit').hide();
             $(but).parent().find('#bElim').hide();
    sentilo-catalog-web/src/main/webapp/static/js/sentilo/additional_info.js on lines 99..106

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

    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 setNormalMode(but) {
             $(but).parent().find('#bAcep').hide();
             $(but).parent().find('#bCanc').hide();
             $(but).parent().find('#bEdit').show();
             $(but).parent().find('#bElim').show();
    sentilo-catalog-web/src/main/webapp/static/js/sentilo/additional_info.js on lines 108..115

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

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

        $.fn.treejs = function( options ) {
    
            // get the reference of target element
            targetElement = this;
    
    
    Severity: Major
    Found in sentilo-catalog-web/src/main/webapp/static/js/treejs.js - About 6 hrs to fix

      Provider has 45 methods (exceeds 20 allowed). Consider refactoring.
      Open

      @Document
      public class Provider implements Entity, FederatedResource, SectorResourceGranted, SyncResource, AlphabeticalSortable {
      
        private static final long serialVersionUID = 1L;
      
      

        Function legend has 152 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Chartist.plugins.legend = function (options) {
        
                // Catch invalid options
                if (options && options.position) {
                    if (!(options.position === 'top' || options.position === 'bottom' || options.position instanceof HTMLElement)) {

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

              var img = $('<img id="link-image" />').attr('src', s3Link)
                  .on('load', function () {
                      if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) {
                          img.attr('src', getErrorImage());
                          $("#image-wrapper").html(img);
          sentilo-catalog-web/src/main/webapp/static/js/sentilo/media_players.js on lines 269..279

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

          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 img = $('<img id="link-image" />').attr('src', extendedLink)
              .on('load', function() {
                  if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) {
                      img.attr('src', getErrorImage());
                      $("#image-wrapper").html(img);
          sentilo-catalog-web/src/main/webapp/static/js/sentilo/universal_map.js on lines 1070..1080

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

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

                  function _fnDraw( oSettings )
                  {
                      /* Provide a pre-callback function which can be used to cancel the draw is false is returned */
                      var aPreDraw = _fnCallbackFire( oSettings, 'aoPreDrawCallback', 'preDraw', [oSettings] );
                      if ( $.inArray( false, aPreDraw ) !== -1 )
          Severity: Major
          Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.dataTables.js - About 5 hrs to fix

            Function DateRangePicker has 148 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var DateRangePicker = function (element, options, cb) {
                    var hasOptions = typeof options == 'object'
                    var localeObject;
            
                    //state
            Severity: Major
            Found in sentilo-catalog-web/src/main/webapp/static/js/daterangepicker.js - About 5 hrs to fix

              Alert has 43 methods (exceeds 20 allowed). Consider refactoring.
              Open

              @Document
              public class Alert implements SectorResourceGranted, EntityResource, SyncResource, AlphabeticalSortable {
              
                private static final long serialVersionUID = 1L;
              
              

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

                                                if( (event.data.minChars <= $(event.data.fake_input).val().length) && (!event.data.maxChars || (event.data.maxChars >= $(event.data.fake_input).val().length)) )
                                                    $(event.data.real_input).addTag($(event.data.fake_input).val(),{focus:true,unique:(settings.unique)});
                sentilo-catalog-web/src/main/webapp/static/js/jquery.tagsinput.js on lines 296..297

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

                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( (event.data.minChars <= $(event.data.fake_input).val().length) && (!event.data.maxChars || (event.data.maxChars >= $(event.data.fake_input).val().length)) )
                                            $(event.data.real_input).addTag($(event.data.fake_input).val(),{focus:true,unique:(settings.unique)});
                sentilo-catalog-web/src/main/webapp/static/js/jquery.tagsinput.js on lines 282..283

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

                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

                SensorController has 41 methods (exceeds 20 allowed). Consider refactoring.
                Open

                @Controller
                @RequestMapping("/admin/sensor")
                public class SensorController extends CrudController<Sensor> {
                
                  @Autowired

                  File daterangepicker.js has 395 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /**
                  * @version: 1.0
                  * @author: Dan Grossman http://www.dangrossman.info/
                  * @date: 2012-08-20
                  * @copyright: Copyright (c) 2012 Dan Grossman. All rights reserved.
                  Severity: Minor
                  Found in sentilo-catalog-web/src/main/webapp/static/js/daterangepicker.js - About 5 hrs to fix

                    Function legend has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            return function legend(chart) {
                    
                                function removeLegendElement() {
                                    var legendElement = chart.container.querySelector('.ct-legend');
                                    if (legendElement) {

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

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

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

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