tomchentw/react-toastr

View on GitHub

Showing 289 of 289 total issues

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

          r.right && r.bottom
            ? ((n.scrollbarFiller.style.display = "block"),
              (n.scrollbarFiller.style.height = r.bottom + "px"),
              (n.scrollbarFiller.style.width = r.right + "px"))
            : (n.scrollbarFiller.style.display = ""),
Severity: Major
Found in docs/build/0.320b8cca.js and 1 other location - About 1 hr to fix
docs/build/0.320b8cca.js on lines 2928..2934

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

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

Function clear has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      ;(xe.prototype.clear = function() {
        var e = this
        if (!this.explicitlyCleared) {
          var t = this.doc.cm,
            n = t && !t.curOp
Severity: Minor
Found in docs/build/0.320b8cca.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

              if (o && !n && !d && null != ge)
                return (
                  i && u && updateScrollTop(e, Math.max(0, s.scrollTop + i * ge)),
                  setScrollLeft(e, Math.max(0, s.scrollLeft + o * ge)),
                  (!i || (i && u)) && e_preventDefault(t),
    Severity: Critical
    Found in docs/build/0.320b8cca.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

                  if (
                    !a ||
                    a.bad ||
                    !s ||
                    s.bad ||
      Severity: Critical
      Found in docs/build/0.320b8cca.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                    if (
                      ((t.contextMenuPending = !1),
                      (t.wrapper.style.cssText = p),
                      (o.style.cssText = u),
                      a &&
        Severity: Critical
        Found in docs/build/0.320b8cca.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                    if (
                      ((e.trailingSpace = 32 == u.charCodeAt(t.length - 1)),
                      n || r || o || p || l)
                    ) {
                      var x = n || ""
          Severity: Critical
          Found in docs/build/0.320b8cca.js - About 1 hr to fix

            Function stretchSpansOverChange has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  function stretchSpansOverChange(e, t) {
                    if (t.full) return null
                    var n = isLine(e, t.from.line) && getLine(e, t.from.line).markedSpans,
                      r = isLine(e, t.to.line) && getLine(e, t.to.line).markedSpans
                    if (!n && !r) return null
            Severity: Minor
            Found in docs/build/0.320b8cca.js - About 1 hr to fix

              Function patchDisplay has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    function patchDisplay(e, t, n) {
                      function rm(t) {
                        var n = t.nextSibling
                        return (
                          l && y && e.display.currentWheelTarget == t
              Severity: Minor
              Found in docs/build/0.320b8cca.js - About 1 hr to fix

                Function addLegacyProps has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        (function addLegacyProps(e) {
                          ;(e.off = off),
                            (e.on = V),
                            (e.wheelEventPixels = wheelEventPixels),
                            (e.Doc = Se),
                Severity: Minor
                Found in docs/build/0.320b8cca.js - About 1 hr to fix

                  Function expressionInner has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function expressionInner(e, t) {
                            if (m.state.fatArrowAt == m.stream.start) {
                              var n = t ? arrowBodyNoComma : arrowBody
                              if ("(" == e)
                                return cont(
                  Severity: Minor
                  Found in docs/build/0.320b8cca.js - About 1 hr to fix

                    Function postUpdateDisplay has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          function postUpdateDisplay(e, t) {
                            for (
                              var n = t.viewport, r = !0;
                              ((r &&
                                e.options.lineWrapping &&
                    Severity: Minor
                    Found in docs/build/0.320b8cca.js - About 1 hr to fix

                      Function skipAtomicInner has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            function skipAtomicInner(e, t, n, r, o) {
                              var i = getLine(e, t.line)
                              if (i.markedSpans)
                                for (var a = 0; a < i.markedSpans.length; ++a) {
                                  var s = i.markedSpans[a],
                      Severity: Minor
                      Found in docs/build/0.320b8cca.js - About 1 hr to fix

                        Function leftButtonStartDrag has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              function leftButtonStartDrag(e, t, n, r) {
                                var o = e.display,
                                  i = !1,
                                  c = operation(e, function(t) {
                                    l && (o.scroller.draggable = !1),
                        Severity: Minor
                        Found in docs/build/0.320b8cca.js - About 1 hr to fix

                          Function extendTo has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  function extendTo(t) {
                                    if (0 != cmp(d, t))
                                      if (((d = t), "rectangle" == r.unit)) {
                                        for (
                                          var o = [],
                          Severity: Minor
                          Found in docs/build/0.320b8cca.js - About 1 hr to fix

                            Function indent has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        indent: function(t, r) {
                                          if (t.tokenize == tokenComment) return e.Pass
                                          if (t.tokenize != tokenBase) return 0
                                          var o,
                                            s = r && r.charAt(0),
                            Severity: Minor
                            Found in docs/build/0.320b8cca.js - About 1 hr to fix

                              Function m has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    m = (function(e) {
                                      function Editor() {
                                        _classCallCheck(this, Editor)
                                        var e = _possibleConstructorReturn(
                                          this,
                              Severity: Minor
                              Found in docs/build/0.320b8cca.js - About 1 hr to fix

                                Function scrollPosIntoView has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      function scrollPosIntoView(e, t, n, r) {
                                        null == r && (r = 0)
                                        var o
                                        e.options.lineWrapping ||
                                          t != n ||
                                Severity: Minor
                                Found in docs/build/0.320b8cca.js - About 1 hr to fix

                                  Function addChangeToHistory has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        function addChangeToHistory(e, t, n, r) {
                                          var o = e.history
                                          o.undone.length = 0
                                          var i,
                                            a,
                                  Severity: Minor
                                  Found in docs/build/0.320b8cca.js - About 1 hr to fix

                                    Function nodeAndOffsetInLineMap has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          function nodeAndOffsetInLineMap(e, t, n) {
                                            for (var r, o, i, a, s, l, c = 0; c < e.length; c += 3)
                                              if (
                                                ((s = e[c]),
                                                (l = e[c + 1]),
                                    Severity: Minor
                                    Found in docs/build/0.320b8cca.js - About 1 hr to fix

                                      Function addWidget has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                                  addWidget: function(e, t, n, r, o) {
                                                    var i = this.display,
                                                      a = (e = cursorCoords(this, clipPos(this.doc, e))).bottom,
                                                      s = e.left
                                                    if (
                                      Severity: Minor
                                      Found in docs/build/0.320b8cca.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language