tomchentw/react-toastr

View on GitHub

Showing 289 of 289 total issues

Function calculateScrollPos has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      function calculateScrollPos(e, t) {
        var n = e.display,
          r = textHeight(e.display)
        t.top < 0 && (t.top = 0)
        var o =
Severity: Minor
Found in docs/build/0.320b8cca.js - About 1 hr to fix

    Function domTextBetween has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          function domTextBetween(e, t, n, r, o) {
            function recognizeMarker(e) {
              return function(t) {
                return t.id == e
              }
    Severity: Minor
    Found in docs/build/0.320b8cca.js - About 1 hr to fix

      Function onCopyCut has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function onCopyCut(e) {
                if (!signalDOMEvent(r, e)) {
                  if (r.somethingSelected())
                    setLastCopied({ lineWise: !1, text: r.getSelections() }),
                      "cut" == e.type && r.replaceSelection("", null, "cut")
      Severity: Minor
      Found in docs/build/0.320b8cca.js - About 1 hr to fix

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

          componentWillUnmount() {
            if (!_.isUndefined(this.state.hidingTimoutId)) {
              clearTimeout(this.state.hidingTimoutId)
            }
            this.setState = _.noop
        Severity: Major
        Found in src/components/ToastMessage/ToastMessagejQuery.jsx and 1 other location - About 1 hr to fix
        src/components/ToastMessage/ToastMessageAnimated.jsx on lines 77..82

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

        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

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

          componentWillUnmount() {
            if (!_.isUndefined(this.state.hidingTimoutId)) {
              clearTimeout(this.state.hidingTimoutId)
            }
            this.setState = _.noop
        Severity: Major
        Found in src/components/ToastMessage/ToastMessageAnimated.jsx and 1 other location - About 1 hr to fix
        src/components/ToastMessage/ToastMessagejQuery.jsx on lines 82..87

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

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

                  transposeChars: function(e) {
                    return runInOp(e, function() {
                      for (var t = e.listSelections(), n = [], r = 0; r < t.length; r++)
                        if (t[r].empty()) {
                          var o = t[r].head,
        Severity: Minor
        Found in docs/build/0.320b8cca.js - About 1 hr to fix

          Function pollSelection has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  (_e.prototype.pollSelection = function() {
                    if (
                      null == this.readDOMTimeout &&
                      !this.gracePeriod &&
                      this.selectionChanged()
          Severity: Minor
          Found in docs/build/0.320b8cca.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                          if (c && u) {
                            var h,
                              f = e.rangeCount && e.getRangeAt(0)
                            try {
                              h = w(c.node, c.offset, u.offset, u.node)
            Severity: Critical
            Found in docs/build/0.320b8cca.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                        if (l != a.length) {
                          for (
                            o.lastOrigin = o.lastSelOrigin = null;
                            (r = a.pop()).ranges;
              
              
              Severity: Critical
              Found in docs/build/0.320b8cca.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                            if (!(cmp(c.to, s.from) < 0 || cmp(c.from, s.to) > 0)) {
                              var u = [l, 1],
                                d = cmp(c.from, s.from),
                                p = cmp(c.to, s.to)
                              ;(d < 0 || (!a.inclusiveLeft && !d)) &&
                Severity: Critical
                Found in docs/build/0.320b8cca.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                            else if (!clickInGutter(t, e)) {
                              var r = posFromMouse(t, e),
                                o = e_button(e),
                                i = r ? clickRepeat(r, o) : "single"
                              window.focus(),
                  Severity: Critical
                  Found in docs/build/0.320b8cca.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                              if (
                                (o = t.markedSpans[i]).marker.collapsed &&
                                !o.marker.widgetNode &&
                                o.from == n.to &&
                                (null == o.to || o.to != n.from) &&
                    Severity: Critical
                    Found in docs/build/0.320b8cca.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                                else if (d.node && d.node.parentNode == i) {
                                  for (; a != d.node; ) a = rm(a)
                                  var p = o && null != t && t <= c && d.lineNumber
                                  d.changes &&
                                    (indexOf(d.changes, "gutter") > -1 && (p = !1),
                      Severity: Critical
                      Found in docs/build/0.320b8cca.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                  if (p.test(n))
                                    return (
                                      (">" == n && t.lexical && ">" == t.lexical.type) ||
                                        (e.eat("=")
                                          ? ("!" != n && "=" != n) || e.eat("=")
                        Severity: Critical
                        Found in docs/build/0.320b8cca.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                      if (
                                        null == i.to ||
                                        (a.inclusiveRight ? i.to >= t : i.to > t) ||
                                        (i.from == t &&
                                          "bookmark" == a.type &&
                          Severity: Critical
                          Found in docs/build/0.320b8cca.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                      if (
                                        this.contextMenuPending ||
                                        !t.state.focused ||
                                        (K(n) && !r && !this.composing) ||
                                        t.isReadOnly() ||
                            Severity: Critical
                            Found in docs/build/0.320b8cca.js - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                          if (
                                            null == i.from ||
                                            (a.inclusiveLeft ? i.from <= t : i.from < t) ||
                                            (i.from == t &&
                                              "bookmark" == a.type &&
                              Severity: Critical
                              Found in docs/build/0.320b8cca.js - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                                if (
                                                  (Object.keys(e.options || {}).forEach(function(n) {
                                                    return t.editor.setOption(n, e.options[n])
                                                  }),
                                                  this.props.editorDidConfigure &&
                                Severity: Critical
                                Found in docs/build/0.320b8cca.js - About 1 hr to fix

                                  Function runMode has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        function runMode(e, t, n, r, o, i, a) {
                                          var s = n.flattenSpans
                                          null == s && (s = e.options.flattenSpans)
                                          var l,
                                            c = 0,
                                  Severity: Minor
                                  Found in docs/build/0.320b8cca.js - About 1 hr to fix

                                    Function onMouseDown has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          function onMouseDown(e) {
                                            var t = this,
                                              n = t.display
                                            if (
                                              !(signalDOMEvent(t, e) || (n.activeTouch && n.input.supportsTouch()))
                                    Severity: Minor
                                    Found in docs/build/0.320b8cca.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language