opsforgeio/cabot

View on GitHub

Showing 840 of 1,637 total issues

Consider simplifying this complex logical expression.
Open

                if ((tt1[0] != tt2[0]) ||
                    (tt1[0].toLowerCase() == "r" && (tt1[2] != tt2[2] || tt1[3] != tt2[3])) ||
                    (tt1[0].toLowerCase() == "s" && (tt1[3] != tt2[3] || tt1[4] != tt2[4]))
                    ) {
                    return;
Severity: Major
Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

        if ((navigator.vendor == "Apple Computer, Inc.") && (version && version[1] < 4 || navigator.platform.slice(0, 2) == "iP") ||
            (navigator.vendor == "Google Inc." && version && version[1] < 8)) {
    
            paperproto.safari = function () {
                var rect = this.rect(-99, -99, this.width + 99, this.height + 99).attr({stroke: "none"});
    Severity: Major
    Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

      Function bezierBBox has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          R.bezierBBox = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
      Severity: Major
      Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

        Function intersect has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {
        Severity: Major
        Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
                    support.getById && context.nodeType === 9 && documentIsHTML &&
                    Expr.relative[ tokens[1].type ] ) {
          
                  context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
          Severity: Major
          Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

            if ( jQuery.expr && jQuery.expr.filters ) {
              jQuery.expr.filters.hidden = function( elem ) {
                // Support: Opera <= 12.12
                // Opera reports offsetWidths and offsetHeights less than zero on some elements
                return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
            Severity: Major
            Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 1 hr to fix

              Function get_initial has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  def get_initial(self):
                      if self.initial:
                          initial = self.initial
                      else:
                          initial = {}
              Severity: Minor
              Found in cabot/cabotapp/views.py - About 55 mins 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

              Function drawPieSlice has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      drawPieSlice: function (x, y, radius, startAngle, endAngle, lineColor, fillColor) {
              Severity: Major
              Found in cabot/static/theme/js/jquery.sparkline.min.js - About 50 mins to fix

                Function _drawRect has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        _drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) {
                Severity: Major
                Found in cabot/static/theme/js/jquery.sparkline.min.js - About 50 mins to fix

                  Function _drawRect has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          _drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) {
                  Severity: Major
                  Found in cabot/static/theme/js/jquery.sparkline.min.js - About 50 mins to fix

                    Function _drawCircle has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            _drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) {
                    Severity: Major
                    Found in cabot/static/theme/js/jquery.sparkline.min.js - About 50 mins to fix

                      Function _drawCircle has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              _drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) {
                      Severity: Major
                      Found in cabot/static/theme/js/jquery.sparkline.min.js - About 50 mins to fix

                        Function print has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            paperproto.print = function (x, y, string, font, size, origin, letter_spacing) {
                        Severity: Major
                        Found in cabot/static/arachnys/js/raphael.js - About 50 mins to fix

                          Function access has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
                          Severity: Major
                          Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 50 mins to fix

                            Function drawCircle has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    drawCircle: function (x, y, radius, lineColor, fillColor, lineWidth) {
                            Severity: Minor
                            Found in cabot/static/theme/js/jquery.sparkline.min.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                            if (searchText.length) {
                                              startpos = option.search_text.search(zregex);
                                              text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
                                              option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
                                            }
                              Severity: Major
                              Found in cabot/static/theme/js/chosen.jquery.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                            if (stackMin < 0 && stackMax > 0) {
                                                                if (val < 0) {
                                                                    stackRangesNeg[i] += Math.abs(val);
                                                                } else {
                                                                    stackRanges[i] += val;
                                Severity: Major
                                Found in cabot/static/theme/js/jquery.sparkline.min.js - About 45 mins to fix

                                  Function drawLine has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          drawLine: function (x1, y1, x2, y2, lineColor, lineWidth) {
                                  Severity: Minor
                                  Found in cabot/static/theme/js/jquery.sparkline.min.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
                                                  option.search_match = true;
                                                }
                                    Severity: Major
                                    Found in cabot/static/theme/js/chosen.jquery.js - About 45 mins to fix

                                      Function drawRect has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              drawRect: function (x, y, width, height, lineColor, fillColor) {
                                      Severity: Minor
                                      Found in cabot/static/theme/js/jquery.sparkline.min.js - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language