tomchentw/react-prism

View on GitHub

Showing 373 of 373 total issues

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

        (UnControlled.prototype.setCursor = function(e, t, r) {
          var n = this.editor.getDoc()
          r && this.editor.focus(),
            t ? n.setCursor(e) : n.setCursor(e, null, { scroll: !1 })
        }),
Severity: Major
Found in docs/build/0.355cdadd.js and 1 other location - About 2 hrs to fix
docs/build/0.355cdadd.js on lines 11275..11279

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

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

      ;(Ve.prototype.init = function(e) {
        var t = this,
          r = this,
          n = r.cm,
          o = (r.div = e.lineDiv)
Severity: Major
Found in docs/build/0.355cdadd.js - About 2 hrs to fix

    Function updateLineGutter has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          function updateLineGutter(e, t, r, n) {
            if (
              (t.gutter && (t.node.removeChild(t.gutter), (t.gutter = null)),
              t.gutterBackground &&
                (t.node.removeChild(t.gutterBackground),
    Severity: Major
    Found in docs/build/0.355cdadd.js - About 2 hrs to fix

      Function moveVisually has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                    ? (function moveVisually(e, t, r, n) {
                        var o = getOrder(t, e.doc.direction)
                        if (!o) return moveLogically(t, r, n)
                        r.ch >= t.text.length
                          ? ((r.ch = t.text.length), (r.sticky = "before"))
      Severity: Major
      Found in docs/build/0.355cdadd.js - About 2 hrs to fix

        Function drawForLine has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function drawForLine(t, r, n) {
                  var i,
                    s,
                    u = getLine(o, t),
                    d = u.text.length
        Severity: Major
        Found in docs/build/0.355cdadd.js - About 2 hrs to fix

          Function g has 68 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                g = (function(e) {
                  !(function _inherits(e, t) {
                    if ("function" != typeof t && null !== t)
                      throw new TypeError(
                        "Super expression must either be null or a function, not " +
          Severity: Major
          Found in docs/build/0.355cdadd.js - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                          if (g.top - f.top <= 3) {
                            var C = (c ? v : m) && b,
                              x = (c ? m : v) && y ? a : (h ? f : g).left,
                              w = C ? l : (h ? g : f).right
                            add(x, f.top, w - x, f.bottom)
            Severity: Critical
            Found in docs/build/0.355cdadd.js - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                            if (s)
                              for (var a = 0; a < s.length; a++) {
                                var l = s[a]
                                ;(null != l.to && o == e.line && e.ch >= l.to) ||
                                  (null == l.from && o != e.line) ||
              Severity: Critical
              Found in docs/build/0.355cdadd.js - About 2 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                        if (
                          (e.updatedDisplay && postUpdateDisplay(t, e.update),
                          null == r.wheelStartX ||
                            (null == e.scrollTop && null == e.scrollLeft && !e.scrollToPos) ||
                            (r.wheelStartX = r.wheelStartY = null),
                Severity: Critical
                Found in docs/build/0.355cdadd.js - About 2 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                                if (n.line >= e.display.viewFrom) {
                                  var s = i.styles,
                                    a =
                                      i.text.length > e.options.maxHighlightLength
                                        ? copyState(t.mode, n.state)
                  Severity: Critical
                  Found in docs/build/0.355cdadd.js - About 2 hrs to fix

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

                                  ? (function makeChangeSingleDocInEditor(e, t, r) {
                                      var n = e.doc,
                                        o = e.display,
                                        i = t.from,
                                        s = t.to,
                    Severity: Major
                    Found in docs/build/0.355cdadd.js - About 2 hrs to fix

                      Function componentDidMount has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              (UnControlled.prototype.componentDidMount = function() {
                                var e = this
                                if (!s) {
                                  if (
                                    (this.props.defineMode &&
                      Severity: Major
                      Found in docs/build/0.355cdadd.js - About 2 hrs to fix

                        Function expressionInner has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function expressionInner(e, t, r) {
                                  if (m.state.fatArrowAt == m.stream.start) {
                                    var n = r ? arrowBodyNoComma : arrowBody
                                    if ("(" == e)
                                      return cont(
                        Severity: Major
                        Found in docs/build/0.355cdadd.js - About 2 hrs to fix

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

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

                            Function buildLineContent has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  function buildLineContent(e, t) {
                                    var r = eltP("span", null, null, l ? "padding-right: .1px" : null),
                                      n = {
                                        pre: eltP("pre", [r], "CodeMirror-line"),
                                        content: r,
                            Severity: Major
                            Found in docs/build/0.355cdadd.js - About 2 hrs to fix

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

                                    function pageScrollX() {
                                      return u && m
                                        ? -(
                                            document.body.getBoundingClientRect().left -
                                            parseInt(getComputedStyle(document.body).marginLeft)
                              Severity: Major
                              Found in docs/build/0.355cdadd.js and 1 other location - About 2 hrs to fix
                              docs/build/0.355cdadd.js on lines 2212..2220

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

                              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

                                    function pageScrollY() {
                                      return u && m
                                        ? -(
                                            document.body.getBoundingClientRect().top -
                                            parseInt(getComputedStyle(document.body).marginTop)
                              Severity: Major
                              Found in docs/build/0.355cdadd.js and 1 other location - About 2 hrs to fix
                              docs/build/0.355cdadd.js on lines 2203..2211

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

                              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

                                                linkedDocs(e, function(e, t) {
                                                  t ||
                                                    -1 != indexOf(a, e.history) ||
                                                    (rebaseHist(e.history, o), a.push(e.history)),
                                                    makeChangeSingleDoc(e, o, null, mergeOldSpans(e, o))
                              Severity: Major
                              Found in docs/build/0.355cdadd.js and 1 other location - About 2 hrs to fix
                              docs/build/0.355cdadd.js on lines 4654..4659

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

                              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

                                        linkedDocs(e, function(e, r) {
                                          r ||
                                            -1 != indexOf(n, e.history) ||
                                            (rebaseHist(e.history, t), n.push(e.history)),
                                            makeChangeSingleDoc(e, t, null, stretchSpansOverChange(e, t))
                              Severity: Major
                              Found in docs/build/0.355cdadd.js and 1 other location - About 2 hrs to fix
                              docs/build/0.355cdadd.js on lines 4704..4709

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

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

                                    function makeChange(e, t, r) {
                                      if (e.cm) {
                                        if (!e.cm.curOp) return operation(e.cm, makeChange)(e, t, r)
                                        if (e.cm.state.suppressEdits) return
                                      }
                              Severity: Major
                              Found in docs/build/0.355cdadd.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language