tomchentw/react-toastr

View on GitHub

Showing 289 of 289 total issues

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

                  (u >= 0 &&
                    (l.marker.inclusiveRight && o.inclusiveLeft
                      ? cmp(c.from, r) <= 0
                      : cmp(c.from, r) < 0)))
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 560..563

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

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

                ((u <= 0 &&
                  (l.marker.inclusiveRight && o.inclusiveLeft
                    ? cmp(c.to, n) >= 0
                    : cmp(c.to, n) > 0)) ||
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 564..567

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

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

      function cursorCoords(e, t, n, r, o, i) {
        function get(t, a) {
          var s = measureCharPrepared(e, o, t, a ? "right" : "left", i)
          return (
            a ? (s.left = s.right) : (s.right = s.left),
Severity: Minor
Found in docs/build/0.320b8cca.js - About 1 hr to fix

    Function updateHeightsInViewport has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          function updateHeightsInViewport(e) {
            for (
              var t = e.display, n = t.lineDiv.offsetTop, r = 0;
              r < t.view.length;
              r++
    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

          if (this.props.timeOut > 0) {
            this.setState(() => ({
              hidingTimoutId: setTimeout(this.handleHide, this.props.timeOut),
            }))
          }
      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 75..79

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

      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

              if (i)
                for (var s = 0; s < i.length; ++s)
                  i[s].lines.length && signal(i[s], "unhide")
      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 3085..3087

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

      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

          if (this.props.timeOut > 0) {
            this.setState(() => ({
              hidingTimoutId: setTimeout(this.handleHide, this.props.timeOut),
            }))
          }
      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 70..74

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

      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

              if (o)
                for (var a = 0; a < o.length; ++a)
                  o[a].lines.length || signal(o[a], "hide")
      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 3088..3090

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

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

            function maybeUpdateLineNumberWidth(e) {
              if (!e.options.lineNumbers) return !1
              var t = e.doc,
                n = lineNumberFor(e.options, t.first + t.size - 1),
                r = e.display
      Severity: Minor
      Found in docs/build/0.320b8cca.js - About 1 hr to fix

        Function removeLineClass has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                removeLineClass: docMethodOp(function(e, t, n) {
                  return changeLine(
                    this,
                    e,
                    "gutter" == t ? "gutter" : "class",
        Severity: Minor
        Found in docs/build/0.320b8cca.js - About 1 hr to fix

          Function triggerElectric has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                function triggerElectric(e, t) {
                  if (e.options.electricChars && e.options.smartIndent)
                    for (var n = e.doc.sel, r = n.ranges.length - 1; r >= 0; r--) {
                      var o = n.ranges[r]
                      if (
          Severity: Minor
          Found in docs/build/0.320b8cca.js - About 1 hr to fix

            Function hydrate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Function objprop has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function objprop(e, t) {
                        if ("async" == e) return (m.marked = "property"), cont(objprop)
                        if ("variable" == e || "keyword" == m.style) {
                          if (((m.marked = "property"), "get" == t || "set" == t))
                            return cont(getterSetter)
              Severity: Minor
              Found in docs/build/0.320b8cca.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                        if (
                          !t.force &&
                          t.visible.from >= n.viewFrom &&
                          t.visible.to <= n.viewTo &&
                          (null == n.updateLineNumbers || n.updateLineNumbers >= n.viewTo) &&
                Severity: Major
                Found in docs/build/0.320b8cca.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          else if ("word" == r || "group" == r)
                            for (
                              var l = null,
                                c = "group" == r,
                                u = e.cm && e.cm.getHelper(t, "wordChars"),
                  Severity: Major
                  Found in docs/build/0.320b8cca.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                            if (l)
                              for (var f = 0; f < l.length; ++f) {
                                var g = l[f]
                                null != g.to && (g.to += u),
                                  null == g.from
                    Severity: Major
                    Found in docs/build/0.320b8cca.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                              if (
                                (r &&
                                  n < o.viewTo &&
                                  (null == o.updateLineNumbers || o.updateLineNumbers > t) &&
                                  (o.updateLineNumbers = t),
                      Severity: Major
                      Found in docs/build/0.320b8cca.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if (3 == l.nodeType) {
                                  for (var p = 0; p < 4; p++) {
                                    for (; c && isExtendingChar(t.line.text.charAt(i.coverStart + c)); )
                                      --c
                                    for (
                        Severity: Major
                        Found in docs/build/0.320b8cca.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                      if (t.somethingSelected()) {
                                        this.prevInput = ""
                                        var n = t.getSelection()
                                        ;(this.textarea.value = n),
                                          t.state.focused && M(this.textarea),
                          Severity: Major
                          Found in docs/build/0.320b8cca.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                        if (
                                          r &&
                                          !eventInWidget(t, n) &&
                                          null != r.left &&
                                          !r.moved &&
                            Severity: Major
                            Found in docs/build/0.320b8cca.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language