zammad/zammad

View on GitHub

Showing 2,064 of 4,422 total issues

Avoid deeply nested control flow statements.
Open

            if (m.css) { css = (css ? css + ";" : "") + m.css; }
Severity: Major
Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                { if (oldCur[k].marker == span.marker) { continue spans } }
    Severity: Major
    Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                if (dir < 0 ? preventCursorRight : preventCursorLeft)
                  { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }
      Severity: Major
      Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    if (this.buffer.charAt(i) !== foundCurrentBuffer.charAt(i)) {
                      existingLength = i
                      break
                    }
        Severity: Major
        Found in app/assets/javascripts/app/lib/base/jquery.textmodule.js - About 45 mins to fix

          Function _upload has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              _upload: function(id, params){
                  this._options.onUpload(id, this.getName(id), true);
          
                  var file = this._files[id],
                      name = this.getName(id),
          Severity: Minor
          Found in app/assets/javascripts/app/lib/base/jquery.fineuploader-3.0.js - 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 (cropped) {
                      minCanvasWidth = cropBox.width;
                      minCanvasHeight = cropBox.height;
          
                      if (minCanvasHeight * aspectRatio > minCanvasWidth) {
          Severity: Major
          Found in app/assets/javascripts/app/lib/base/cropper.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                  if (cutTop && cutBot) {
                    display.view = display.view.slice(0, cutTop.index)
                      .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))
                      .concat(display.view.slice(cutBot.index));
                    display.viewTo += lendiff;
            Severity: Major
            Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                      if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) {
                        if (indexOf(newGroup, Number(m[1])) > -1) {
                          lst(newChanges)[prop] = change[prop];
                          delete change[prop];
                        }
              Severity: Major
              Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                        if (keywords.propertyIsEnumerable(word)) {
                          var kw = keywords[word]
                          return ret(kw.type, kw.style, word)
                        }
                Severity: Major
                Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                            if (!loose) loose = next;
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/marked.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
                                  { collapsed = sp; }
                    Severity: Major
                    Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                if (pos == 0) return
                      Severity: Major
                      Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                  if (bull !== b && !(bull.length > 1 && b.length > 1)) {
                                    src = cap.slice(i + 1).join('\n') + src;
                                    i = l - 1;
                                  }
                        Severity: Major
                        Found in app/assets/javascripts/app/lib/base/marked.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                    } else if (sp.from > pos && nextChange > sp.from) {
                                      nextChange = sp.from;
                                    }
                          Severity: Major
                          Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                      if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))
                                        { return skipAtomicInner(doc, near, pos, dir, mayClear) }
                            Severity: Major
                            Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix

                              Function _disableDropOutside has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  _disableDropOutside: function(e){
                                      // run only once for all instances
                                      if (!qq.UploadDropZone.dropOutsideDisabled ){
                              
                                          // for these cases we need to catch onDrop to reset dropArea
                              Severity: Minor
                              Found in app/assets/javascripts/app/lib/base/jquery.fineuploader-3.0.js - 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 (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }
                              Severity: Major
                              Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                        if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false))
                                          return ret("async", "keyword", word)
                                Severity: Major
                                Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                        } else if (opening && (next.length === 0 || /\s/.test(next) || closeBefore.indexOf(next) > -1)) {
                                          curType = "both";
                                        } else {
                                          return CodeMirror.Pass;
                                        }
                                  Severity: Major
                                  Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                  for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}
                                    Severity: Major
                                    Found in app/assets/javascripts/app/lib/base/codemirror.js - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language