tomchentw/react-toastr

View on GitHub

Showing 218 of 289 total issues

Function ./node_modules/react-styleguidist/lib/rsg-components/Editor/Editor.js has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

  "./node_modules/react-styleguidist/lib/rsg-components/Editor/Editor.js": function(
    e,
    t,
    n
  ) {
Severity: Minor
Found in docs/build/0.320b8cca.js - About 3 hrs 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 insertLineContent has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      function insertLineContent(e, t, n) {
        var r = e.markedSpans,
          o = e.text,
          i = 0
        if (r)
Severity: Major
Found in docs/build/0.320b8cca.js - About 3 hrs to fix

    Function markText has 87 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          function markText(e, t, n, r, o) {
            if (r && r.shared) return markTextShared(e, t, n, r, o)
            if (e.cm && !e.cm.curOp) return operation(e.cm, markText)(e, t, n, r, o)
            var i = new xe(e, o),
              a = cmp(t, n)
    Severity: Major
    Found in docs/build/0.320b8cca.js - About 3 hrs to fix

      Function pollContent has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              (_e.prototype.pollContent = function() {
                null != this.readDOMTimeout &&
                  (clearTimeout(this.readDOMTimeout), (this.readDOMTimeout = null))
                var e = this.cm,
                  t = e.display,
      Severity: Major
      Found in docs/build/0.320b8cca.js - About 3 hrs to fix

        Function onContextMenu has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                (Ve.prototype.onContextMenu = function(e) {
                  function prepareSelectAllHack() {
                    if (null != o.selectionStart) {
                      var e = n.somethingSelected(),
                        i = "​" + (e ? o.value : "")
        Severity: Major
        Found in docs/build/0.320b8cca.js - About 3 hrs to fix

          Function onDrop has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                function onDrop(e) {
                  var t = this
                  if (
                    (clearDragCursor(t),
                    !signalDOMEvent(t, e) && !eventInWidget(t.display, e))
          Severity: Major
          Found in docs/build/0.320b8cca.js - About 3 hrs to fix

            Function d has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                      d = (function() {
                        function kw(e) {
                          return { type: e, style: "keyword" }
                        }
                        var e = kw("keyword a"),
            Severity: Major
            Found in docs/build/0.320b8cca.js - About 2 hrs to fix

              Function init has 72 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    ;(_e.prototype.init = function(e) {
                      function onCopyCut(e) {
                        if (!signalDOMEvent(r, e)) {
                          if (r.somethingSelected())
                            setLastCopied({ lineWise: !1, text: r.getSelections() }),
              Severity: Major
              Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                Function Display has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      function Display(e, t, r) {
                        var o = this
                        ;(this.input = r),
                          (o.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler")),
                          o.scrollbarFiller.setAttribute("cm-not-content", "true"),
                Severity: Major
                Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                  Function measureCharInner has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        function measureCharInner(e, t, n, r) {
                          var o,
                            i = nodeAndOffsetInLineMap(t.map, n, r),
                            l = i.node,
                            c = i.start,
                  Severity: Major
                  Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                    Function updateLineGutter has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          function updateLineGutter(e, t, n, r) {
                            if (
                              (t.gutter && (t.node.removeChild(t.gutter), (t.gutter = null)),
                              t.gutterBackground &&
                                (t.node.removeChild(t.gutterBackground),
                    Severity: Major
                    Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                      Consider simplifying this complex logical expression.
                      Open

                                    if (a)
                                      for (var s = 0; s < a.length; s++) {
                                        var l = a[s]
                                        ;(null != l.to && o == e.line && e.ch >= l.to) ||
                                          (null == l.from && o != e.line) ||
                      Severity: Critical
                      Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if (((t.curOp.focus = activeElt()), !signalDOMEvent(t, e))) {
                                  a && s < 11 && 27 == e.keyCode && (e.returnValue = !1)
                                  var n = e.keyCode
                                  t.display.shift = 16 == n || e.shiftKey
                                  var r = handleKeyBinding(t, e)
                        Severity: Critical
                        Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                          Consider simplifying this complex logical expression.
                          Open

                                        if (g.top - f.top <= 3) {
                                          var x = (c ? v : m) && b,
                                            C = (c ? m : v) && y ? s : (h ? f : g).left,
                                            w = x ? l : (h ? g : f).right
                                          add(C, f.top, w - C, f.bottom)
                          Severity: Critical
                          Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if (
                                      (o.lastOp == r ||
                                        (o.lastOrigin == t.origin &&
                                          t.origin &&
                                          (("+" == t.origin.charAt(0) &&
                            Severity: Critical
                            Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                              Consider simplifying this complex logical expression.
                              Open

                                            if (r.line >= e.display.viewFrom) {
                                              var a = i.styles,
                                                s =
                                                  i.text.length > e.options.maxHighlightLength
                                                    ? copyState(t.mode, r.state)
                              Severity: Critical
                              Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                                Function buildToken has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      function buildToken(e, t, n, r, o, i, l) {
                                        if (t) {
                                          var c,
                                            u = e.splitSpaces ? splitSpaces(t, e.trailingSpace) : t,
                                            d = e.cm.state.specialChars,
                                Severity: Major
                                Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                                  Function moveVisually has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        function moveVisually(e, t, n, r) {
                                          var o = getOrder(t, e.doc.direction)
                                          if (!o) return moveLogically(t, n, r)
                                          n.ch >= t.text.length
                                            ? ((n.ch = t.text.length), (n.sticky = "before"))
                                  Severity: Major
                                  Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                                    Function buildLineContent has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          function buildLineContent(e, t) {
                                            var n = eltP("span", null, null, l ? "padding-right: .1px" : null),
                                              r = {
                                                pre: eltP("pre", [n], "CodeMirror-line"),
                                                content: n,
                                    Severity: Major
                                    Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                                      Function drawForLine has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              function drawForLine(t, n, r) {
                                                function coords(n, r) {
                                                  return charCoords(e, Pos(t, n), "div", u, r)
                                                }
                                                function wrapX(t, n, r) {
                                      Severity: Major
                                      Found in docs/build/0.320b8cca.js - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language