tomchentw/react-toastr

View on GitHub

Showing 289 of 289 total issues

Function j has 116 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        j = (function() {
          function charType(n) {
            return n <= 247
              ? e.charAt(n)
              : 1424 <= n && n <= 1524
Severity: Major
Found in docs/build/0.320b8cca.js - About 4 hrs to fix

    Function drawSelectionRange has 108 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          function drawSelectionRange(e, t, n) {
            function add(e, t, n, r) {
              t < 0 && (t = 0),
                (t = Math.round(t)),
                (r = Math.round(r)),
    Severity: Major
    Found in docs/build/0.320b8cca.js - About 4 hrs to fix

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

        handleMouseLeave = () => {
          this.setState(state => {
            const timeOut =
              this.props.extendedTimeOut !== 0
                ? this.props.extendedTimeOut
      Severity: Major
      Found in src/components/ToastMessage/ToastMessagejQuery.jsx and 1 other location - About 4 hrs to fix
      src/components/ToastMessage/ToastMessageAnimated.jsx on lines 100..113

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

      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

        handleMouseLeave = () => {
          this.setState(state => {
            const timeOut =
              this.props.extendedTimeOut !== 0
                ? this.props.extendedTimeOut
      Severity: Major
      Found in src/components/ToastMessage/ToastMessageAnimated.jsx and 1 other location - About 4 hrs to fix
      src/components/ToastMessage/ToastMessagejQuery.jsx on lines 103..116

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

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

                    value: function componentDidMount() {
                      var e = this
                      this.props.defineMode &&
                        this.props.defineMode.name &&
                        this.props.defineMode.fn &&
      Severity: Major
      Found in docs/build/0.320b8cca.js - About 3 hrs to fix

        Consider simplifying this complex logical expression.
        Open

                if (
                  (e.iter(l, n.line + 1, function(e) {
                    c &&
                      i.collapsed &&
                      !c.options.lineWrapping &&
        Severity: Critical
        Found in docs/build/0.320b8cca.js - About 3 hrs to fix

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

            "./node_modules/react-styleguidist/loaders/style-loader.js!./node_modules/react-styleguidist/loaders/css-loader.js!./node_modules/codemirror/theme/base16-light.css": function(
              e,
              t,
              n
            ) {
          Severity: Major
          Found in docs/build/0.320b8cca.js and 1 other location - About 3 hrs to fix
          docs/build/0.320b8cca.js on lines 11395..11408

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

          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

            "./node_modules/react-styleguidist/loaders/style-loader.js!./node_modules/react-styleguidist/loaders/css-loader.js!./node_modules/codemirror/lib/codemirror.css": function(
              e,
              t,
              n
            ) {
          Severity: Major
          Found in docs/build/0.320b8cca.js and 1 other location - About 3 hrs to fix
          docs/build/0.320b8cca.js on lines 11409..11422

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

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

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

                          var o = calculateScrollPos(e, {
                            left: Math.min(t.left, n.left),
                            top: Math.min(t.top, n.top) - r,
                            right: Math.max(t.right, n.right),
                            bottom: Math.max(t.bottom, n.bottom) + r,
                  Severity: Major
                  Found in docs/build/0.320b8cca.js and 1 other location - About 3 hrs to fix
                  docs/build/0.320b8cca.js on lines 2742..2747

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

                  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

                                (o = {
                                  left: Math.min(s.left, l.left),
                                  top: Math.min(s.top, l.top) - r,
                                  right: Math.max(s.left, l.left),
                                  bottom: Math.max(s.bottom, l.bottom) + r,
                  Severity: Major
                  Found in docs/build/0.320b8cca.js and 1 other location - About 3 hrs to fix
                  docs/build/0.320b8cca.js on lines 2843..2848

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

                  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 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 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 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 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
                            Severity
                            Category
                            Status
                            Source
                            Language