opsforgeio/cabot

View on GitHub

Showing 1,637 of 1,637 total issues

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

        ne: function(event, dx, dy) {
            return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
        },
Severity: Major
Found in cabot/static/theme/js/jquery-ui.js and 3 other locations - About 1 hr to fix
cabot/static/theme/js/jquery-ui.js on lines 2882..2884
cabot/static/theme/js/jquery-ui.js on lines 2885..2887
cabot/static/theme/js/jquery-ui.js on lines 2891..2893

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

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

    $.fn.simpledraw = function (width, height, useExisting, interact) {
        var target, mhandler;
        if (useExisting && (target = this.data('_jqs_vcanvas'))) {
            return target;
        }
Severity: Minor
Found in cabot/static/theme/js/jquery.sparkline.min.js - About 1 hr to fix

    Function start has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        start: function() {
            var element, p, co, ch, cw, width, height,
                that = $(this).data("ui-resizable"),
                o = that.options,
                el = that.element,
    Severity: Minor
    Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

      Function fnDeleteRow has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          this.fnDeleteRow = function( mTarget, fnCallBack, bRedraw )
          {
            /* Find settings from table node */
            var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
            var i, iLen, iAODataIndex;
      Severity: Minor
      Found in cabot/static/theme/js/jquery.dataTables.min.js - About 1 hr to fix

        Function _slide has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _slide: function( event, index, newVal ) {
                var otherVal,
                    newValues,
                    allowed;
        
        
        Severity: Minor
        Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

          Function fnAddData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.fnAddData = function( mData, bRedraw )
              {
                if ( mData.length === 0 )
                {
                  return [];
          Severity: Minor
          Found in cabot/static/theme/js/jquery.dataTables.min.js - About 1 hr to fix

            Function _create has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _create: function() {
                    var that = this,
                        options = this.options;
            
                    this.running = false;
            Severity: Minor
            Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

              Function _eventHandler has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _eventHandler: function( event ) {
                      var options = this.options,
                          active = this.active,
                          anchor = $( event.currentTarget ),
                          tab = anchor.closest( "li" ),
              Severity: Minor
              Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                Function _position has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        _position: function() {
                            var position = this.options.position,
                                myAt = [],
                                offset = [ 0, 0 ],
                                isVisible;
                Severity: Minor
                Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                  Function _fnUpdateInfo has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function _fnUpdateInfo ( oSettings )
                      {
                        /* Show information about the table */
                        if ( !oSettings.oFeatures.bInfo || oSettings.aanFeatures.i.length === 0 )
                        {
                  Severity: Minor
                  Found in cabot/static/theme/js/jquery.dataTables.min.js - About 1 hr to fix

                    Function tuneText has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        tuneText = function (el, params) {
                            if (el.type != "text" || !(params[has]("text") || params[has]("font") || params[has]("font-size") || params[has]("x") || params[has]("y"))) {
                                return;
                            }
                            var a = el.attrs,
                    Severity: Minor
                    Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

                      Function catmullRom2bezier has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function catmullRom2bezier(crp, z) {
                              var d = [];
                              for (var i = 0, iLen = crp.length; iLen - 2 * !z > i; i += 2) {
                                  var p = [
                                              {x: +crp[i - 2], y: +crp[i - 1]},
                      Severity: Minor
                      Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

                        Function solveCurveX has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function solveCurveX(x, epsilon) {
                                    var t0, t1, t2, x2, d2, i;
                                    for(t2 = x, i = 0; i < 8; i++) {
                                        x2 = sampleCurveX(t2) - x;
                                        if (abs(x2) < epsilon) {
                        Severity: Minor
                        Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

                          Function d3_rgb_parse has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function d3_rgb_parse(format, rgb, hsl) {
                              var r = 0, g = 0, b = 0, m1, m2, name;
                              m1 = /([a-z]+)\((.*)\)/i.exec(format);
                              if (m1) {
                                m2 = m1[2].split(",");
                          Severity: Minor
                          Found in cabot/static/arachnys/js/d3.js - About 1 hr to fix

                            Function d3_geom_voronoiRemoveBeach has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function d3_geom_voronoiRemoveBeach(beach) {
                                var circle = beach.circle, x = circle.x, y = circle.cy, vertex = {
                                  x: x,
                                  y: y
                                }, previous = beach.P, next = beach.N, disappearing = [ beach ];
                            Severity: Minor
                            Found in cabot/static/arachnys/js/d3.js - About 1 hr to fix

                              Function calcPoints has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  Line.prototype.calcPoints = function() {
                                    var row, y, _i, _len, _ref, _results;
                                    _ref = this.data;
                                    _results = [];
                                    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                              Severity: Minor
                              Found in cabot/static/arachnys/js/morris.js - About 1 hr to fix

                                Function cleanData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  cleanData: function( elems, /* internal */ acceptData ) {
                                    var elem, type, id, data,
                                      i = 0,
                                      internalKey = jQuery.expando,
                                      cache = jQuery.cache,
                                Severity: Minor
                                Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 1 hr to fix

                                  Function style has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    style: function( elem, name, value, extra ) {
                                      // Don't set styles on text and comment nodes
                                      if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
                                        return;
                                      }
                                  Severity: Minor
                                  Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 1 hr to fix

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

                                                    if(event.pageY - this.offset.click.top > containment[3]) {
                                                        pageY = containment[3] + this.offset.click.top;
                                                    }
                                    Severity: Major
                                    Found in cabot/static/theme/js/jquery-ui.js and 3 other locations - About 1 hr to fix
                                    cabot/static/theme/js/jquery-ui.js on lines 1475..1477
                                    cabot/static/theme/js/jquery-ui.js on lines 1478..1480
                                    cabot/static/theme/js/jquery-ui.js on lines 1481..1483

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

                                    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 (y) {
                                              range = d3_scaleRange(y);
                                              backgroundUpdate.attr("y", range[0]).attr("height", range[1] - range[0]);
                                              redrawY(gUpdate);
                                            }
                                    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 8824..8828

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

                                    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