tomchentw/react-toastr

View on GitHub

Showing 289 of 289 total issues

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

        (ce.prototype.setScrollLeft = function(e) {
          this.horiz.scrollLeft != e && (this.horiz.scrollLeft = e),
            this.disableHoriz &&
              this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz")
        }),
Severity: Major
Found in docs/build/0.320b8cca.js and 1 other location - About 2 hrs to fix
docs/build/0.320b8cca.js on lines 6509..6513

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

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

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

        (ce.prototype.setScrollTop = function(e) {
          this.vert.scrollTop != e && (this.vert.scrollTop = e),
            this.disableVert &&
              this.enableZeroWidthBar(this.vert, this.disableVert, "vert")
        }),
Severity: Major
Found in docs/build/0.320b8cca.js and 1 other location - About 2 hrs to fix
docs/build/0.320b8cca.js on lines 6504..6508

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

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 showPrimarySelection has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        (_e.prototype.showPrimarySelection = function() {
          var e = window.getSelection(),
            t = this.cm,
            r = t.doc.sel.primary(),
            o = r.from(),
Severity: Major
Found in docs/build/0.320b8cca.js - About 2 hrs to fix

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

          ;(Ve.prototype.init = function(e) {
            function prepareCopyCut(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 highlightWorker has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            function highlightWorker(e) {
              var t = e.doc
              if (!(t.highlightFrontier >= e.display.viewTo)) {
                var n = +new Date() + e.options.workTime,
                  r = getContextBefore(e, t.highlightFrontier),
      Severity: Major
      Found in docs/build/0.320b8cca.js - About 2 hrs to fix

        Function poll has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                (Ve.prototype.poll = function() {
                  var e = this,
                    t = this.cm,
                    n = this.textarea,
                    r = this.prevInput
        Severity: Major
        Found in docs/build/0.320b8cca.js - About 2 hrs to fix

          Function tokenBase has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function tokenBase(e, t) {
                    var n = e.next()
                    if ('"' == n || "'" == n)
                      return (t.tokenize = tokenString(n)), t.tokenize(e, t)
                    if ("." == n && e.match(/^\d+(?:[eE][+\-]?\d+)?/))
          Severity: Major
          Found in docs/build/0.320b8cca.js - About 2 hrs to fix

            Function applyTextInput has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  function applyTextInput(e, t, n, r, o) {
                    var i = e.doc
                    ;(e.display.shift = !1), r || (r = i.sel)
                    var a = e.state.pasteIncoming || "paste" == o,
                      s = U(t),
            Severity: Major
            Found in docs/build/0.320b8cca.js - About 2 hrs to fix

              Function updateDoc has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    function updateDoc(e, t, n, r) {
                      function spansFor(e) {
                        return n ? n[e] : null
                      }
                      function update(e, n, o) {
              Severity: Minor
              Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                              if (
                                !((u >= 0 && d <= 0) || (u <= 0 && d >= 0)) &&
                                ((u <= 0 &&
                                  (l.marker.inclusiveRight && o.inclusiveLeft
                                    ? cmp(c.to, n) >= 0
                Severity: Critical
                Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                  Function onScrollWheel has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        function onScrollWheel(e, t) {
                          var r = wheelEventDelta(t),
                            o = r.x,
                            i = r.y,
                            a = e.display,
                  Severity: Minor
                  Found in docs/build/0.320b8cca.js - About 2 hrs to fix

                    Function highlightLine has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          function highlightLine(e, t, n, r) {
                            var o = [e.state.modeGen],
                              i = {}
                            runMode(
                              e,
                    Severity: Minor
                    Found in docs/build/0.320b8cca.js - About 1 hr to fix

                      Function fromTextArea has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              (CodeMirror$1.fromTextArea = function fromTextArea(e, t) {
                                function save() {
                                  e.value = a.getValue()
                                }
                                if (
                      Severity: Minor
                      Found in docs/build/0.320b8cca.js - About 1 hr to fix

                        Function makeChangeSingleDocInEditor has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              function makeChangeSingleDocInEditor(e, t, n) {
                                var r = e.doc,
                                  o = e.display,
                                  i = t.from,
                                  a = t.to,
                        Severity: Minor
                        Found in docs/build/0.320b8cca.js - About 1 hr to fix

                          Function xmlToken has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                    function xmlToken(n, i, a) {
                                      if (2 == a.depth)
                                        return (
                                          n.match(/^.*?\*\//) ? (a.depth = 1) : n.skipToEnd(), "comment"
                                        )
                          Severity: Minor
                          Found in docs/build/0.320b8cca.js - About 1 hr to fix

                            Function indentLine has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  function indentLine(e, t, n, r) {
                                    var o,
                                      i = e.doc
                                    null == n && (n = "add"),
                                      "smart" == n &&
                            Severity: Minor
                            Found in docs/build/0.320b8cca.js - About 1 hr to fix

                              Function regChange has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                    function regChange(e, t, n, r) {
                                      null == t && (t = e.doc.first),
                                        null == n && (n = e.doc.first + e.doc.size),
                                        r || (r = 0)
                                      var o = e.display
                              Severity: Minor
                              Found in docs/build/0.320b8cca.js - About 1 hr to fix

                                Function locateNodeInLineView has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

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

                                  Function findPosH has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        function findPosH(e, t, n, r, o) {
                                          function findNextLine() {
                                            var r = t.line + n
                                            return (
                                              !(r < e.first || r >= e.first + e.size) &&
                                  Severity: Minor
                                  Found in docs/build/0.320b8cca.js - About 1 hr to fix

                                    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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language