opsforgeio/cabot

View on GitHub

Showing 1,637 of 1,637 total issues

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

        hsla: {
            props: {
                hue: {
                    idx: 0,
                    type: "degrees"
Severity: Major
Found in cabot/static/theme/js/jquery-ui.js and 1 other location - About 1 hr to fix
cabot/static/theme/js/jquery-ui.js on lines 4857..4872

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

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

    elproto.show = function () {
        !this.removed && this.paper.safari(this.node.style.display = "");
        return this;
    };
Severity: Major
Found in cabot/static/arachnys/js/raphael.js and 1 other location - About 1 hr to fix
cabot/static/arachnys/js/raphael.js on lines 4464..4467

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

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

    _destroy: function() {
        var contents;

        // clean up main element
        this.element
Severity: Minor
Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

    Function option has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        option: function( key, value ) {
            var options = key,
                parts,
                curOption,
                i;
    Severity: Minor
    Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

      Function offsetString has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  offsetString = function(offset) {
                      try {
                          return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
                              offset, $.datepicker._getFormatConfig(inst));
                      }
      Severity: Minor
      Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

        Function _attachHandlers has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _attachHandlers: function(inst) {
                var stepMonths = this._get(inst, "stepMonths"),
                    id = "#" + inst.id.replace( /\\\\/g, "\\" );
                inst.dpDiv.find("[data-handler]").map(function () {
                    var handler = {
        Severity: Minor
        Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

          Function intersect has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {
                  if (
                      mmax(x1, x2) < mmin(x3, x4) ||
                      mmin(x1, x2) > mmax(x3, x4) ||
                      mmax(y1, y2) < mmin(y3, y4) ||
          Severity: Minor
          Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

            Function color has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                R.color = function (clr) {
                    var rgb;
                    if (R.is(clr, "object") && "h" in clr && "s" in clr && "b" in clr) {
                        rgb = R.hsb2rgb(clr);
                        clr.r = rgb.r;
            Severity: Minor
            Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

              Function dragstart has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function dragstart(id, position, move, end) {
                    return function() {
                      var target = this, parent = target.parentNode, event_ = event.of(target, arguments), eventTarget = d3.event.target, eventId = id(), drag = eventId == null ? "drag" : "drag-" + eventId, origin_ = position(parent, eventId), dragged = 0, offset, w = d3.select(d3_window).on(move + "." + drag, moved).on(end + "." + drag, ended), dragRestore = d3_event_dragSuppress();
                      if (origin) {
                        offset = origin.apply(target, arguments);
              Severity: Minor
              Found in cabot/static/arachnys/js/d3.js - About 1 hr to fix

                Function y has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          ret.y = (function() {
                            var _j, _len1, _ref, _results1;
                            _ref = this.options.ykeys;
                            _results1 = [];
                            for (idx = _j = 0, _len1 = _ref.length; _j < _len1; idx = ++_j) {
                Severity: Minor
                Found in cabot/static/arachnys/js/morris.js - About 1 hr to fix

                  Function event has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      zoom.event = function(g) {
                        g.each(function() {
                          var event_ = event.of(this, arguments), view1 = view;
                          if (d3_transitionInheritId) {
                            d3.select(this).transition().each("start.zoom", function() {
                  Severity: Minor
                  Found in cabot/static/arachnys/js/d3.js - About 1 hr to fix

                    Function arc has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      d3.svg.arc = function() {
                        var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;
                        function arc() {
                          var r0 = innerRadius.apply(this, arguments), r1 = outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) + d3_svg_arcOffset, a1 = endAngle.apply(this, arguments) + d3_svg_arcOffset, da = (a1 < a0 && (da = a0,
                          a0 = a1, a1 = da), a1 - a0), df = da < π ? "0" : "1", c0 = Math.cos(a0), s0 = Math.sin(a0), c1 = Math.cos(a1), s1 = Math.sin(a1);
                    Severity: Minor
                    Found in cabot/static/arachnys/js/d3.js - About 1 hr to fix

                      Function d3_geom_voronoiAttachCircle has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function d3_geom_voronoiAttachCircle(arc) {
                          var lArc = arc.P, rArc = arc.N;
                          if (!lArc || !rArc) return;
                          var lSite = lArc.site, cSite = arc.site, rSite = rArc.site;
                          if (lSite === rSite) return;
                      Severity: Minor
                      Found in cabot/static/arachnys/js/d3.js - About 1 hr to fix

                        Function addLine has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          addLine: function (series) {
                            var line = document.createElement('li');
                            line.className = 'line';
                            if (series.disabled) {
                              line.className += ' disabled';
                        Severity: Minor
                        Found in cabot/static/arachnys/js/rickshaw.js - About 1 hr to fix

                          Function domain has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            domain: function(data) {
                          
                              var stackedData = data || this.graph.stackedData || this.graph.stackData();
                              var firstPoint = stackedData[0][0];
                          
                          
                          Severity: Minor
                          Found in cabot/static/arachnys/js/rickshaw.js - About 1 hr to fix

                            Function data has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              data: function( key, value ) {
                                var attrs, name,
                                  data = null,
                                  i = 0,
                                  elem = this[0];
                            Severity: Minor
                            Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 1 hr to fix

                              Function Order has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              Rickshaw.Graph.Behavior.Series.Order = 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 show has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  Collapse.prototype.show = function () {
                                    if (this.transitioning || this.$element.hasClass('in')) return
                                
                                    var startEvent = $.Event('show.bs.collapse')
                                    this.$element.trigger(startEvent)
                                Severity: Minor
                                Found in cabot/static/bootstrap/js/bootstrap.js - About 1 hr to fix

                                  Function to has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  spaces.hsla.to = function ( rgba ) {
                                      if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
                                          return [ null, null, null, rgba[ 3 ] ];
                                      }
                                      var r = rgba[ 0 ] / 255,
                                  Severity: Minor
                                  Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                                    Function _mouseStart has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        _mouseStart: function(event) {
                                    
                                            var curleft, curtop, cursor,
                                                o = this.options,
                                                iniPos = this.element.position(),
                                    Severity: Minor
                                    Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language