tomchentw/react-prism

View on GitHub

Showing 373 of 373 total issues

Function updateDisplayIfNeeded has 140 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      function updateDisplayIfNeeded(e, t) {
        var r = e.display,
          n = e.doc
        if (t.editorIsHidden) return resetView(e), !1
        if (
Severity: Major
Found in docs/build/0.355cdadd.js - About 5 hrs to fix

    Function ./node_modules/codemirror/mode/jsx/jsx.js has 139 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      "./node_modules/codemirror/mode/jsx/jsx.js": function(e, t, r) {
        ;(function(e) {
          "use strict"
          function Context(e, t, r, n) {
            ;(this.state = e), (this.mode = t), (this.depth = r), (this.prev = n)
    Severity: Major
    Found in docs/build/0.355cdadd.js - About 5 hrs to fix

      Function measureCharPrepared has 137 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            function measureCharPrepared(e, t, r, n, o) {
              t.before && (r = -1)
              var i,
                l = r + (n || "")
              return (
      Severity: Major
      Found in docs/build/0.355cdadd.js - About 5 hrs to fix

        Consider simplifying this complex logical expression.
        Open

                    if (
                      (this.props.defineMode &&
                        this.props.defineMode.name &&
                        this.props.defineMode.fn &&
                        o.defineMode(
        Severity: Critical
        Found in docs/build/0.355cdadd.js - About 5 hrs to fix

          Function pollContent has 129 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  (Ve.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.355cdadd.js - About 5 hrs to fix

            Function ./node_modules/react-styleguidist/lib/rsg-components/Editor/Editor.js has 128 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              "./node_modules/react-styleguidist/lib/rsg-components/Editor/Editor.js": function(
                e,
                t,
                r
              ) {
            Severity: Major
            Found in docs/build/0.355cdadd.js - About 5 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                      if (!this.explicitlyCleared) {
                        var e = this.doc.cm,
                          t = e && !e.curOp
                        if ((t && startOperation(e), hasHandler(this, "clear"))) {
                          var r = this.find()
              Severity: Critical
              Found in docs/build/0.355cdadd.js - About 5 hrs to fix

                Function statement has 125 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function statement(e, t) {
                          return "var" == e
                            ? cont(pushlex("vardef", t.length), vardef, expect(";"), poplex)
                            : "keyword a" == e
                              ? cont(pushlex("form"), parenExpr, statement, poplex)
                Severity: Major
                Found in docs/build/0.355cdadd.js - About 5 hrs to fix

                  Function ./node_modules/react-styleguidist/lib/rsg-components/Editor/Editor.js has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                  Open

                    "./node_modules/react-styleguidist/lib/rsg-components/Editor/Editor.js": function(
                      e,
                      t,
                      r
                    ) {
                  Severity: Minor
                  Found in docs/build/0.355cdadd.js - About 4 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 findPosH has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        function findPosH(e, t, r, n, o) {
                          var i = t,
                            s = r,
                            a = getLine(e, t.line)
                          function moveOnce(n) {
                  Severity: Major
                  Found in docs/build/0.355cdadd.js - About 4 hrs to fix

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

                          function drawSelectionRange(e, t, r) {
                            var n = e.display,
                              o = e.doc,
                              i = document.createDocumentFragment(),
                              s = paddingH(e.display),
                    Severity: Major
                    Found in docs/build/0.355cdadd.js - About 4 hrs to fix

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

                            function coordsCharInner(e, t, r, n, o) {
                              o -= heightAtLine(t)
                              var i = prepareMeasureForLine(e, t),
                                s = widgetTopHeight(t),
                                a = 0,
                      Severity: Major
                      Found in docs/build/0.355cdadd.js - About 4 hrs to fix

                        Function z has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              var z = (function() {
                                var e =
                                    "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",
                                  t =
                                    "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"
                        Severity: Major
                        Found in docs/build/0.355cdadd.js - About 4 hrs to fix

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

                                                        function extendTo(t) {
                                                          if (0 != cmp(d, t))
                                                            if (((d = t), "rectangle" == n.unit)) {
                                                              for (
                                                                var o = [],
                          Severity: Major
                          Found in docs/build/0.355cdadd.js - About 4 hrs to fix

                            Function markText has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  function markText(e, t, r, n, o) {
                                    if (n && n.shared)
                                      return (function markTextShared(e, t, r, n, o) {
                                        ;(n = copyObj(n)).shared = !1
                                        var i = [markText(e, t, r, n, o)],
                            Severity: Major
                            Found in docs/build/0.355cdadd.js - About 4 hrs to fix

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

                                    function endOperation_finish(e) {
                                      var t = e.cm,
                                        r = t.display,
                                        n = t.doc
                                      if (
                              Severity: Major
                              Found in docs/build/0.355cdadd.js - About 4 hrs to fix

                                Function a has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    var a = (function() {
                                        function Shared(e, t) {
                                          ;(this.editor = e), (this.props = t), this.notifyOfDeprecation()
                                        }
                                        return (
                                Severity: Major
                                Found in docs/build/0.355cdadd.js - About 4 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/lib/codemirror.css": function(
                                      e,
                                      t,
                                      r
                                    ) {
                                  Severity: Major
                                  Found in docs/build/0.355cdadd.js and 1 other location - About 3 hrs to fix
                                  docs/build/0.355cdadd.js on lines 11774..11789

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

                                  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/theme/base16-light.css": function(
                                      e,
                                      t,
                                      r
                                    ) {
                                  Severity: Major
                                  Found in docs/build/0.355cdadd.js and 1 other location - About 3 hrs to fix
                                  docs/build/0.355cdadd.js on lines 11758..11773

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

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

                                                (i = (function measureCharInner(e, t, r, n) {
                                                  var o,
                                                    i = nodeAndOffsetInLineMap(t.map, r, n),
                                                    l = i.node,
                                                    c = i.start,
                                  Severity: Major
                                  Found in docs/build/0.355cdadd.js - About 3 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language