jbox-web/redmine_bootstrap_kit

View on GitHub

Showing 278 of 361 total issues

Method to_html has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def to_html
      if @options.has_key?(:reverse) && @options[:reverse] == true
        my_pagination =  pagination.reverse
      else
        my_pagination = pagination
Severity: Minor
Found in app/helpers/bootstrap/will_paginate_helper.rb - About 45 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

Avoid deeply nested control flow statements.
Open

      if (stream.eat(/[a-zA-Z$@_]/)) {
        stream.eatWhile(/[\w]/);
        // Only one ? ! = is allowed and only as the last character
        stream.eat(/[\?\!\=]/);
        return "atom";
Severity: Major
Found in assets/javascripts/codemirror/mode/ruby/ruby.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

          if (stream.eat(/[\+\-\*\/\&\|\:\!]/)) {
            return "atom";
          }
    Severity: Major
    Found in assets/javascripts/codemirror/mode/ruby/ruby.js - About 45 mins to fix

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

          easeInOutBack: function (x, t, b, c, d, s) {
      Severity: Minor
      Found in assets/javascripts/jquery_file_tree/jquery_easing.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

              if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state);
        Severity: Major
        Found in assets/javascripts/codemirror/mode/ruby/ruby.js - About 45 mins to fix

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

              easeInBack: function (x, t, b, c, d, s) {
          Severity: Minor
          Found in assets/javascripts/jquery_file_tree/jquery_easing.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                  if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state);
            Severity: Major
            Found in assets/javascripts/codemirror/mode/ruby/ruby.js - About 45 mins to fix

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

                  easeOutBack: function (x, t, b, c, d, s) {
              Severity: Minor
              Found in assets/javascripts/jquery_file_tree/jquery_easing.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                    } else if (ch == "@" && stream.match(/^@?[a-zA-Z_]/)) {
                      stream.eat("@");
                      stream.eatWhile(/[\w]/);
                      return "variable-2";
                    } else if (ch == "$") {
                Severity: Major
                Found in assets/javascripts/codemirror/mode/ruby/ruby.js - About 45 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                        if ((sp.from == null || sp.from < ch) &&
                            (sp.to == null || sp.to > ch) &&
                            (!found || found.width < sp.marker.width))
                          found = sp.marker;
                  Severity: Major
                  Found in assets/javascripts/codemirror/codemirror.js - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                          if (display.wheelStartX == null) {
                            display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
                            display.wheelDX = dx; display.wheelDY = dy;
                            setTimeout(function() {
                              if (display.wheelStartX == null) return;
                    Severity: Major
                    Found in assets/javascripts/codemirror/codemirror.js - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                            if (sp.marker.collapsed && !sp.marker.replacedWith && sp.from == span.to &&
                                (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
                                lineIsHiddenInner(doc, line, sp)) return true;
                      Severity: Major
                      Found in assets/javascripts/codemirror/codemirror.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                              if (target == display.scrollbarH || target == display.scrollbarH.firstChild ||
                                  target == display.scrollbarV || target == display.scrollbarV.firstChild ||
                                  target == display.scrollbarFiller || target == display.gutterFiller) return null;
                        Severity: Major
                        Found in assets/javascripts/codemirror/codemirror.js - About 40 mins to fix

                          Function markTextShared has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            function markTextShared(doc, from, to, options, type) {
                          Severity: Minor
                          Found in assets/javascripts/codemirror/codemirror.js - About 35 mins to fix

                            Function buildTokenMeasure has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              function buildTokenMeasure(builder, text, style, startStyle, endStyle) {
                            Severity: Minor
                            Found in assets/javascripts/codemirror/codemirror.js - About 35 mins to fix

                              Function buildLineElement has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                function buildLineElement(cm, line, lineNo, dims, reuse) {
                              Severity: Minor
                              Found in assets/javascripts/codemirror/codemirror.js - About 35 mins to fix

                                Function charIdxInLine has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    function charIdxInLine(start, line, character, forward, includeChar) {
                                Severity: Minor
                                Found in assets/javascripts/codemirror/keymap/vim.js - About 35 mins to fix

                                  Function dialog has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      function dialog(cm, template, shortText, onClose, options) {
                                  Severity: Minor
                                  Found in assets/javascripts/codemirror/keymap/vim.js - About 35 mins to fix

                                    Function coordsCharInner has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                      function coordsCharInner(cm, lineObj, lineNo, x, y) {
                                    Severity: Minor
                                    Found in assets/javascripts/codemirror/codemirror.js - About 35 mins to fix

                                      Function countColumn has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                        function countColumn(string, end, tabSize, startIndex, startValue) {
                                      Severity: Minor
                                      Found in assets/javascripts/codemirror/codemirror.js - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language