opsforgeio/cabot

View on GitHub

Showing 1,637 of 1,637 total issues

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

  function d3_cross2d(a, b, c) {
    return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
  }
Severity: Major
Found in cabot/static/arachnys/js/d3.js and 1 other location - About 1 hr to fix
cabot/static/arachnys/js/d3.js on lines 4792..4794

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

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 d3_geom_polygonInside(p, a, b) {
    return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]);
  }
Severity: Major
Found in cabot/static/arachnys/js/d3.js and 1 other location - About 1 hr to fix
cabot/static/arachnys/js/d3.js on lines 1182..1184

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

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 (q[6] !== 'Z') {
          offsetmins = parseInt(q[8], 10) * 60 + parseInt(q[9], 10);
          if (q[7] === '+') {
            offsetmins = 0 - offsetmins;
          }
Severity: Major
Found in cabot/static/arachnys/js/morris.js and 1 other location - About 1 hr to fix
cabot/static/arachnys/js/morris.js on lines 559..564

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

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

    _animate: function( toShow, toHide, data ) {
        var total, easing, duration,
            that = this,
            adjust = 0,
            down = toShow.length &&
Severity: Minor
Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

    Function _toggle has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _toggle: function( event, eventData ) {
            var that = this,
                toShow = eventData.newPanel,
                toHide = eventData.oldPanel;
    
    
    Severity: Minor
    Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

      Function _mouseCapture has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _mouseCapture: function( event ) {
              var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
                  that = this,
                  o = this.options;
      
      
      Severity: Minor
      Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

        Function _fnAjaxParameters has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function _fnAjaxParameters( oSettings )
            {
              var iColumns = oSettings.aoColumns.length;
              var aoData = [], mDataProp, aaSort, aDataSort;
              var i, j;
        Severity: Minor
        Found in cabot/static/theme/js/jquery.dataTables.min.js - About 1 hr to fix

          Function _determineDate has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _determineDate: function(inst, date, defaultDate) {
                  var offsetNumeric = function(offset) {
                          var date = new Date();
                          date.setDate(date.getDate() + offset);
                          return date;
          Severity: Minor
          Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

            Function addEvent has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                addEvent = (function () {
                    if (g.doc.addEventListener) {
                        return function (obj, type, fn, element) {
                            var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,
                                f = function (e) {
            Severity: Minor
            Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

              Function d3_time_scale has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function d3_time_scale(linear, methods, format) {
                  function scale(x) {
                    return linear(x);
                  }
                  scale.invert = function(x) {
              Severity: Minor
              Found in cabot/static/arachnys/js/d3.js - About 1 hr to fix

                Function Highlight has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Rickshaw.Graph.Behavior.Series.Highlight = function(args) {
                
                  this.graph = args.graph;
                  this.legend = args.legend;
                
                
                Severity: Minor
                Found in cabot/static/arachnys/js/rickshaw.js - About 1 hr to fix

                  Function alert has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def alert(self):
                          if not self.alerts_enabled:
                              return
                          if self.overall_status != self.PASSING_STATUS:
                              # Don't alert every time
                  Severity: Minor
                  Found in cabot/cabotapp/models.py - About 1 hr 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

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

                        else if ( oOpts.order == "current" && oOpts.filter == "applied" )
                        {
                          for ( i=0, iLen=aiDisplay.length ; i<iLen ; i++ )
                          {
                            tr = aoData[ aiDisplay[i] ].nTr;
                  Severity: Major
                  Found in cabot/static/theme/js/jquery.dataTables.min.js and 1 other location - About 1 hr to fix
                  cabot/static/theme/js/jquery.dataTables.min.js on lines 5007..5054

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

                  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 (routlier > rwhisker) {
                                      target.drawCircle((routlier - minValue) * unitSize + canvasLeft,
                                          canvasHeight / 2,
                                          options.get('spotRadius'),
                                          options.get('outlierLineColor'),
                  Severity: Major
                  Found in cabot/static/theme/js/jquery.sparkline.min.js and 1 other location - About 1 hr to fix
                  cabot/static/theme/js/jquery.sparkline.min.js on lines 2474..2480

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

                  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

                        else if ( oOpts.order == "current" && oOpts.filter == "none" )
                        {
                          for ( i=0, iLen=aiDisplayMaster.length ; i<iLen ; i++ )
                          {
                            tr = aoData[ aiDisplayMaster[i] ].nTr;
                  Severity: Major
                  Found in cabot/static/theme/js/jquery.dataTables.min.js and 1 other location - About 1 hr to fix
                  cabot/static/theme/js/jquery.dataTables.min.js on lines 5018..5054

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

                  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 (loutlier < lwhisker) {
                                      target.drawCircle((loutlier - minValue) * unitSize + canvasLeft,
                                          canvasHeight / 2,
                                          options.get('spotRadius'),
                                          options.get('outlierLineColor'),
                  Severity: Major
                  Found in cabot/static/theme/js/jquery.sparkline.min.js and 1 other location - About 1 hr to fix
                  cabot/static/theme/js/jquery.sparkline.min.js on lines 2481..2487

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

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

                      resize: function() {
                          var that = $(this).data("ui-resizable"),
                              o = that.options,
                              cs = that.size,
                              os = that.originalSize,
                  Severity: Minor
                  Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                    Function _fnAjaxUpdateDraw has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function _fnAjaxUpdateDraw ( oSettings, json )
                        {
                          if ( json.sEcho !== undefined )
                          {
                            /* Protect against old returns over-writing a new one. Possible when you get
                    Severity: Minor
                    Found in cabot/static/theme/js/jquery.dataTables.min.js - About 1 hr to fix

                      Function scale has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      $.effects.effect.scale = function( o, done ) {
                      
                          // Create element
                          var el = $( this ),
                              options = $.extend( true, {}, o ),
                      Severity: Minor
                      Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                        Function Grid has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function Grid(options) {
                              var _this = this;
                              if (typeof options.element === 'string') {
                                this.el = $(document.getElementById(options.element));
                              } else {
                        Severity: Minor
                        Found in cabot/static/arachnys/js/morris.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language