sentilo/sentilo

View on GitHub

Showing 627 of 1,220 total issues

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";

      Function _fnSortingClasses has 100 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function _fnSortingClasses( oSettings )
              {
                  var i, iLen, j, jLen, iFound;
                  var aaSort, sClass;
                  var iColumns = oSettings.aoColumns.length;
      Severity: Major
      Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.dataTables.js - About 4 hrs to fix

        Function showDataHistoryListAccordion has 100 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function showDataHistoryListAccordion(dataPanel, sensor, componentId, sensorId, dataType) {
        
            var sensor = sensorsLastObsMap[sensorId];
        
            tempSensorLastObsMap = {

          Function processJsonValue has 99 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function processJsonValue( settings, jsonValue, indentLevel, propertyName ) {
                  if ( typeof indentLevel === 'undefined' ) {
                      indentLevel = 0;
                  }
          
          
          Severity: Major
          Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.jsonPresenter.js - About 3 hrs to fix

            Function plotLineArea has 96 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        function plotLineArea(datapoints, axisx, axisy) {
                            var points = datapoints.points,
                                ps = datapoints.pointsize,
                                bottom = Math.min(Math.max(0, axisy.min), axisy.max),
                                i = 0, top, areaOpen = false,
            Severity: Major
            Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js - About 3 hrs to fix

              Function defaultPrefilter has 95 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function defaultPrefilter( elem, props, opts ) {
                  /*jshint validthis:true */
                  var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
                      anim = this,
                      style = elem.style,
              Severity: Major
              Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 3 hrs to fix

                Function fill has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        fill: function() {
                            var d = new Date(this.viewDate),
                                year = d.getUTCFullYear(),
                                month = d.getUTCMonth(),
                                startYear = this.startDate !== -Infinity ? this.startDate.getUTCFullYear() : -Infinity,
                Severity: Major
                Found in sentilo-catalog-web/src/main/webapp/static/js/bootstrap-datepicker.js - About 3 hrs to fix

                  Function setupTickGeneration has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function setupTickGeneration(axis) {
                              var opts = axis.options;
                  
                              // estimate number of ticks
                              var noTicks;
                  Severity: Major
                  Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js - About 3 hrs to fix

                    Function _fnBuildHead has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            function _fnBuildHead( oSettings )
                            {
                                var i, nTh, iLen, j, jLen;
                                var iThs = $('th, td', oSettings.nTHead).length;
                                var iCorrector = 0;
                    Severity: Major
                    Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.dataTables.js - About 3 hrs to fix

                      Function fnDestroy has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              this.fnDestroy = function ( bRemove )
                              {
                                  var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
                                  var nOrig = oSettings.nTableWrapper.parentNode;
                                  var nBody = oSettings.nTBody;
                      Severity: Major
                      Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.dataTables.js - About 3 hrs to fix

                        Function send has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                        send: function( headers, complete ) {
                        
                                            // Get a new xhr
                                            var handle, i,
                                                xhr = s.xhr();
                        Severity: Major
                        Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 3 hrs to fix

                          Function click has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  click: function(e) {
                                      e.preventDefault();
                                      var target = $(e.target).closest('span, td, th');
                                      if (target.length == 1) {
                                          switch(target[0].nodeName.toLowerCase()) {
                          Severity: Major
                          Found in sentilo-catalog-web/src/main/webapp/static/js/bootstrap-datepicker.js - About 3 hrs to fix

                            SearchController has 29 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            public abstract class SearchController<T extends CatalogDocument> extends CatalogBaseController implements SearchFilterResolver {
                            
                              protected static final String LIST_ACTION = "list";
                              protected static final String EXCEL_VIEW = "excelView";
                            
                            

                              WrapperBlockingQueue has 29 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                              public class WrapperBlockingQueue implements BlockingQueue<Runnable> {
                              
                                private final LinkedBlockingQueue<Runnable> blockingQueue;
                              
                                public WrapperBlockingQueue(final int capacity) {

                                SentiloRequest has 29 methods (exceeds 20 allowed). Consider refactoring.
                                Open

                                public class SentiloRequest {
                                
                                  private static final Logger LOGGER = LoggerFactory.getLogger(SentiloRequest.class);
                                  private static final String UTF8 = "UTF-8";
                                
                                

                                  Function parseDate has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          parseDate: function(date, format, language) {
                                              if (date instanceof Date) return date;
                                              if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) {
                                                  var part_re = /([\-+]\d+)([dmwy])/,
                                                      parts = date.match(/([\-+]\d+)([dmwy])/g),
                                  Severity: Major
                                  Found in sentilo-catalog-web/src/main/webapp/static/js/bootstrap-datepicker.js - About 3 hrs to fix

                                    Function drawBar has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            function drawBar(x, y, b, barLeft, barRight, offset, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {
                                                var left, right, bottom, top,
                                                    drawLeft, drawRight, drawTop, drawBottom,
                                                    tmp;
                                    
                                    
                                    Severity: Major
                                    Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js - About 3 hrs to fix

                                      Function keydown has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              keydown: function(e){
                                                  if (this.picker.is(':not(:visible)')){
                                                      if (e.keyCode == 27) // allow escape to hide and re-show picker
                                                          this.show();
                                                      return;
                                      Severity: Major
                                      Found in sentilo-catalog-web/src/main/webapp/static/js/bootstrap-datepicker.js - About 3 hrs to fix

                                        Function fnUpdate has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                                "fnUpdate": function ( oSettings, fnDraw ) {
                                                    var iListLength = 5;
                                                    var oPaging = oSettings.oInstance.fnPagingInfo();
                                                    var an = oSettings.aanFeatures.p;
                                                    var i, ien, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
                                        Severity: Minor
                                        Found in sentilo-catalog-web/src/main/webapp/static/js/DT_bootstrap.js - About 3 hrs to fix

                                        Cognitive Complexity

                                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                        A method's cognitive complexity is based on a few simple rules:

                                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                        • Code is considered more complex for each "break in the linear flow of the code"
                                        • Code is considered more complex when "flow breaking structures are nested"

                                        Further reading

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language