sentilo/sentilo

View on GitHub

Showing 1,220 of 1,220 total issues

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;

    Function ajax has 237 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        ajax: function( url, options ) {
    
            // If url is an object, simulate pre-1.5 signature
            if ( typeof url === "object" ) {
                options = url;
    Severity: Major
    Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 1 day to fix

      Function setDocument has 232 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      setDocument = Sizzle.setDocument = function( node ) {
          var doc = node ? node.ownerDocument || node : preferredDoc;
      
          // If no document and documentElement is available, return
          if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
      Severity: Major
      Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 1 day to fix

        File leaflet.canvas-markers.js has 528 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /******/ (() => { // webpackBootstrap
        /******/     var __webpack_modules__ = ([
        /* 0 */,
        /* 1 */
        /***/ (function(module) {

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

          function showLastOrders(componentId, sensorId, panel) {
          
              $(panel).empty();
          
              getLastSensorOrders(componentId, sensorId, null, function (data) {
          sentilo-catalog-web/src/main/webapp/static/js/sentilo/universal_map.js on lines 443..468

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

          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 (s.bars.show || (s.lines.show && s.lines.fill)) {
                                  var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero));
                                  format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale });
                                  if (s.bars.horizontal) {
                                      delete format[format.length - 1].y;
          Severity: Major
          Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js and 1 other location - About 7 hrs to fix
          sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.categories.js on lines 76..83

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

          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 (s.bars.show || (s.lines.show && s.lines.fill)) {
                          var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero));
                          format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale });
                          if (s.bars.horizontal) {
                              delete format[format.length - 1].y;
          sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js on lines 559..566

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

          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 showLastAlarms(componentId, sensorId, panel) {
          
              $(panel).empty();
          
              getLastSensorAlarms(componentId, sensorId, null, function (data) {
          sentilo-catalog-web/src/main/webapp/static/js/sentilo/universal_map.js on lines 479..502

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

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

                  function drawSeriesLines(series) {
                      function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {
                          var points = datapoints.points,
                              ps = datapoints.pointsize,
                              prevx = null, prevy = null;
          Severity: Major
          Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js - About 7 hrs to fix

            File oms.js has 477 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // Generated by CoffeeScript 1.6.2
            /** @preserve OverlappingMarkerSpiderfier
            https://github.com/jawj/OverlappingMarkerSpiderfier
            Copyright (c) 2011 - 2012 George MacKerron
            Released under the MIT licence: http://opensource.org/licenses/mit-license
            Severity: Minor
            Found in sentilo-catalog-web/src/main/webapp/static/js/oms.js - About 7 hrs to fix

              Function _fnScrollDraw has 182 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function _fnScrollDraw ( o )
                      {
                          var
                              nScrollHeadInner = o.nScrollHead.getElementsByTagName('div')[0],
                              nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
              Severity: Major
              Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.dataTables.js - About 7 hrs to fix

                File metrics.js has 461 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /**
                 * Dashboard functions
                 */
                
                //config
                Severity: Minor
                Found in sentilo-catalog-web/src/main/webapp/static/js/sentilo/metrics.js - About 7 hrs to fix

                  Function drawGrid has 173 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function drawGrid() {
                              var i, axes, bw, bc;
                  
                              ctx.save();
                              ctx.translate(plotOffset.left, plotOffset.top);
                  Severity: Major
                  Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js - About 6 hrs to fix

                    Function _fnCalculateColumnWidths has 169 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            function _fnCalculateColumnWidths ( oSettings )
                            {
                                var iTableWidth = oSettings.nTable.offsetWidth;
                                var iUserInputs = 0;
                                var iTmpWidth;
                    Severity: Major
                    Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.dataTables.js - About 6 hrs to fix

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

                                          if (x1 <= x2 && x1 < axisx.min) {
                                              if (x2 < axisx.min)
                                                  continue;
                                              y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
                                              x1 = axisx.min;
                      Severity: Major
                      Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js and 1 other location - About 6 hrs to fix
                      sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js on lines 1838..1849

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

                      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 (y1 >= y2 && y1 > axisy.max) {
                                              if (y2 > axisy.max)
                                                  continue;
                                              x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
                                              y1 = axisy.max;
                      Severity: Major
                      Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js and 1 other location - About 6 hrs to fix
                      sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js on lines 1852..1863

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

                      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

                      CatalogSensor has 48 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class CatalogSensor implements MutableCatalogElement {
                      
                        private String sensor;
                        @JsonInclude(value = Include.NON_NULL)
                        private String provider;

                        Function processData has 166 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function processData() {
                                    var topSentry = Number.POSITIVE_INFINITY,
                                        bottomSentry = Number.NEGATIVE_INFINITY,
                                        fakeInfinity = Number.MAX_VALUE,
                                        i, j, k, m, length,
                        Severity: Major
                        Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js - About 6 hrs to fix

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

                                              if (x1 >= x2 && x1 > axisx.max) {
                                                  if (x2 > axisx.max)
                                                      continue;
                                                  y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
                                                  x1 = axisx.max;
                          Severity: Major
                          Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js and 1 other location - About 6 hrs to fix
                          sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js on lines 1866..1877

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

                          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 (x1 >= x2 && x1 > axisx.max) {
                                                  if (x2 > axisx.max)
                                                      continue;
                                                  y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
                                                  x1 = axisx.max;
                          Severity: Major
                          Found in sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js and 1 other location - About 6 hrs to fix
                          sentilo-catalog-web/src/main/webapp/static/js/jquery.flot.js on lines 1949..1960

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

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language