opsforgeio/cabot

View on GitHub

Showing 1,637 of 1,637 total issues

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

        $(document)
            .bind("mousemove."+this.widgetName, this._mouseMoveDelegate)
            .bind("mouseup."+this.widgetName, this._mouseUpDelegate);
Severity: Major
Found in cabot/static/theme/js/jquery-ui.js and 2 other locations - About 40 mins to fix
cabot/static/theme/js/jquery-ui.js on lines 865..867
cabot/static/theme/js/jquery-ui.js on lines 947..949

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

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

        cur = elem.nodeType === 1 && ( elem.className ?
          ( " " + elem.className + " " ).replace( rclass, " " ) :
          " "
        );
Severity: Minor
Found in cabot/static/bootstrap/js/jquery-1.10.2.js and 1 other location - About 40 mins to fix
cabot/static/bootstrap/js/jquery-1.10.2.js on lines 4138..4141

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

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

      for (var i = 0, n = group.length; i < n; i++) {
        if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {
          subgroup.push(node);
        }
      }
Severity: Minor
Found in cabot/static/arachnys/js/d3.js and 1 other location - About 40 mins to fix
cabot/static/arachnys/js/d3.js on lines 8431..8435

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

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

Consider simplifying this complex logical expression.
Open

    if ( o.mode === "toggle" && mode === "show" ) {
        el.from = o.to || zero;
        el.to = o.from || original;
    } else {
        el.from = o.from || ( mode === "show" ? zero : original );
Severity: Major
Found in cabot/static/theme/js/jquery-ui.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

            if ( tab.hasClass( "ui-state-disabled" ) ||
                    // tab is already loading
                    tab.hasClass( "ui-tabs-loading" ) ||
                    // can't switch durning an animation
                    this.running ||
    Severity: Major
    Found in cabot/static/theme/js/jquery-ui.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

                          if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
                              curElem = hook === "backgroundColor" ? elem.parentNode : elem;
                              while (
                                  (backgroundColor === "" || backgroundColor === "transparent") &&
                                  curElem && curElem.style
      Severity: Major
      Found in cabot/static/theme/js/jquery-ui.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                    if(
                        inst.options.greedy &&
                        !inst.options.disabled &&
                        inst.options.scope === draggable.options.scope &&
                        inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) &&
        Severity: Major
        Found in cabot/static/theme/js/jquery-ui.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                      if ( ( this.options.values.length === 2 && this.options.range === true ) &&
                              ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
                          ) {
                          newVal = otherVal;
                      }
          Severity: Major
          Found in cabot/static/theme/js/jquery-ui.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                            if (hlSpotsEnabled || options.get('spotColor') ||
                                (options.get('minSpotColor') || options.get('maxSpotColor') &&
                                    (yvalues[yvallast] === this.miny || yvalues[yvallast] === this.maxy))) {
                                canvasWidth -= Math.ceil(spotRadius);
                            }
            Severity: Major
            Found in cabot/static/theme/js/jquery.sparkline.min.js - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                        if ( nCell.nodeName.toUpperCase() == "TD" ||
                             nCell.nodeName.toUpperCase() == "TH" )
                        {
                          /* Get the col and rowspan attributes from the DOM and sanitise them */
                          iColspan = nCell.getAttribute('colspan') * 1;
              Severity: Major
              Found in cabot/static/theme/js/jquery.dataTables.min.js - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                        if (o.textpath) {
                            var textpathStyle = o.textpath.style;
                            params.font && (textpathStyle.font = params.font);
                            params["font-family"] && (textpathStyle.fontFamily = '"' + params["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g, E) + '"');
                            params["font-size"] && (textpathStyle.fontSize = params["font-size"]);
                Severity: Major
                Found in cabot/static/arachnys/js/raphael.js - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if (el.type != "text" || !(params[has]("text") || params[has]("font") || params[has]("font-size") || params[has]("x") || params[has]("y"))) {
                              return;
                          }
                  Severity: Major
                  Found in cabot/static/arachnys/js/raphael.js - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                            if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) {
                              halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? {
                                x: x0,
                                y: abs(x2 - x0) < ε ? y2 : y1
                              } : abs(y3 - y1) < ε && x1 - x3 > ε ? {
                    Severity: Major
                    Found in cabot/static/arachnys/js/d3.js - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                                          if (path1 && path2 && path1[i][0] == "M" && path2[i][0] != "M") {
                                              path2.splice(i, 0, ["M", a2.x, a2.y]);
                                              a1.bx = 0;
                                              a1.by = 0;
                                              a1.x = path1[i][1];
                      Severity: Major
                      Found in cabot/static/arachnys/js/raphael.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                } else if (g.doc.attachEvent) {
                                    return function (obj, type, fn, element) {
                                        var f = function (e) {
                                            e = e || g.win.event;
                                            var scrollY = g.doc.documentElement.scrollTop || g.doc.body.scrollTop,
                        Severity: Major
                        Found in cabot/static/arachnys/js/raphael.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                          if (letters[i] == "\n") {
                                              shift = 0;
                                              curr = 0;
                                              notfirst = 0;
                                              shifty += lineHeight;
                          Severity: Major
                          Found in cabot/static/arachnys/js/raphael.js - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if ((!(prevLabelMargin != null) || prevLabelMargin >= labelBox.x + labelBox.width || (prevAngleMargin != null) && prevAngleMargin >= labelBox.x) && labelBox.x >= 0 && (labelBox.x + labelBox.width) < this.el.width()) {
                                      if (this.options.xLabelAngle !== 0) {
                                        margin = 1.25 * this.options.gridTextSize / Math.sin(this.options.xLabelAngle * Math.PI / 180.0);
                                        prevAngleMargin = labelBox.x - margin;
                                      }
                            Severity: Major
                            Found in cabot/static/arachnys/js/morris.js - About 40 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                      if ((!(prevLabelMargin != null) || prevLabelMargin >= labelBox.x + labelBox.width || (prevAngleMargin != null) && prevAngleMargin >= labelBox.x) && labelBox.x >= 0 && (labelBox.x + labelBox.width) < _this.el.width()) {
                                        if (_this.options.xLabelAngle !== 0) {
                                          margin = 1.25 * _this.options.gridTextSize / Math.sin(_this.options.xLabelAngle * Math.PI / 180.0);
                                          prevAngleMargin = labelBox.x - margin;
                                        }
                              Severity: Major
                              Found in cabot/static/arachnys/js/morris.js - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                  if ( support.matchesSelector && documentIsHTML &&
                                    ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
                                    ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
                                
                                    try {
                                Severity: Major
                                Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                      if ( s.crossDomain == null ) {
                                        parts = rurl.exec( s.url.toLowerCase() );
                                        s.crossDomain = !!( parts &&
                                          ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
                                            ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
                                  Severity: Major
                                  Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 40 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language