tomchentw/react-prism

View on GitHub

Showing 373 of 373 total issues

Function makeChangeFromHistory has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      function makeChangeFromHistory(e, t, r) {
        if (!e.cm || !e.cm.state.suppressEdits || r) {
          for (
            var n,
              o = e.history,
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

            (ce.prototype.setScrollLeft = function(e) {
              this.horiz.scrollLeft != e && (this.horiz.scrollLeft = e),
                this.disableHoriz &&
                  this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz")
            }),
    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 3133..3137

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

    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

            (ce.prototype.setScrollTop = function(e) {
              this.vert.scrollTop != e && (this.vert.scrollTop = e),
                this.disableVert &&
                  this.enableZeroWidthBar(this.vert, this.disableVert, "vert")
            }),
    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 3128..3132

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

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

          function highlightLine(e, t, r, n) {
            var o = [e.state.modeGen],
              i = {}
            runMode(
              e,
    Severity: Major
    Found in docs/build/0.355cdadd.js - About 2 hrs to fix

      Function showPrimarySelection has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              (Ve.prototype.showPrimarySelection = function() {
                var e = window.getSelection(),
                  t = this.cm,
                  n = t.doc.sel.primary(),
                  o = n.from(),
      Severity: Major
      Found in docs/build/0.355cdadd.js - About 2 hrs to fix

        Function inText has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function inText(e, t) {
                  function chain(r) {
                    return (t.tokenize = r), r(e, t)
                  }
                  var r = e.next()
        Severity: Major
        Found in docs/build/0.355cdadd.js - About 2 hrs to fix

          Function init has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

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

                            (this.props.defineMode &&
                              this.props.defineMode.name &&
                              this.props.defineMode.fn &&
                              o.defineMode(
                                this.props.defineMode.name,
            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 11504..11510

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

            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

                          (this.props.defineMode &&
                            this.props.defineMode.name &&
                            this.props.defineMode.fn &&
                            o.defineMode(
                              this.props.defineMode.name,
            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 11344..11350

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

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

                  function highlightWorker(e) {
                    var t = e.doc
                    if (!(t.highlightFrontier >= e.display.viewTo)) {
                      var r = +new Date() + e.options.workTime,
                        n = getContextBefore(e, t.highlightFrontier),
            Severity: Major
            Found in docs/build/0.355cdadd.js - About 2 hrs to fix

              Function c has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                        c = (function() {
                          function kw(e) {
                            return { type: e, style: "keyword" }
                          }
                          var e = kw("keyword a"),
              Severity: Major
              Found in docs/build/0.355cdadd.js - About 2 hrs to fix

                Function xmlToken has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                              ? (function xmlToken(r, i, s) {
                                  if (2 == s.depth)
                                    return (
                                      r.match(/^.*?\*\//) ? (s.depth = 1) : r.skipToEnd(),
                                      "comment"
                Severity: Major
                Found in docs/build/0.355cdadd.js - About 2 hrs to fix

                  Function poll has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          (_e.prototype.poll = function() {
                            var e = this,
                              t = this.cm,
                              r = this.textarea,
                              n = this.prevInput
                  Severity: Major
                  Found in docs/build/0.355cdadd.js - About 2 hrs to fix

                    Function applyTextInput has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          function applyTextInput(e, t, r, n, o) {
                            var i = e.doc
                            ;(e.display.shift = !1), n || (n = i.sel)
                            var s = e.state.pasteIncoming || "paste" == o,
                              a = G(t),
                    Severity: Major
                    Found in docs/build/0.355cdadd.js - About 2 hrs to fix

                      Consider simplifying this complex logical expression.
                      Open

                                    if (
                                      !((u >= 0 && d <= 0) || (u <= 0 && d >= 0)) &&
                                      ((u <= 0 &&
                                        (l.marker.inclusiveRight && o.inclusiveLeft
                                          ? cmp(c.to, r) >= 0
                      Severity: Critical
                      Found in docs/build/0.355cdadd.js - About 2 hrs to fix

                        Function onScrollWheel has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              function onScrollWheel(e, t) {
                                var n = wheelEventDelta(t),
                                  o = n.x,
                                  i = n.y,
                                  s = e.display,
                        Severity: Minor
                        Found in docs/build/0.355cdadd.js - About 2 hrs to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  else if (!(t.from.line > e.lastLine())) {
                                    if (t.from.line < e.first) {
                                      var o = t.text.length - 1 - (e.first - t.from.line)
                                      shiftDoc(e, o),
                                        (t = {
                          Severity: Critical
                          Found in docs/build/0.355cdadd.js - About 2 hrs to fix

                            Function indent has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                      indent: function(t, i) {
                                        if (t.tokenize == tokenComment) return e.Pass
                                        if (t.tokenize != tokenBase) return 0
                                        var s,
                                          a = i && i.charAt(0),
                            Severity: Minor
                            Found in docs/build/0.355cdadd.js - About 1 hr to fix

                              Function leftButtonStartDrag has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                                        ? (function leftButtonStartDrag(e, t, r, n) {
                                                            var o = e.display,
                                                              i = !1,
                                                              c = operation(e, function(t) {
                                                                l && (o.scroller.draggable = !1),
                              Severity: Minor
                              Found in docs/build/0.355cdadd.js - About 1 hr to fix

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

                                        (UnControlled.prototype.moveCursor = function(e, t) {
                                          var r = this.editor.getDoc()
                                          t ? r.setCursor(e) : r.setCursor(e, null, { scroll: !1 })
                                        }),
                                Severity: Major
                                Found in docs/build/0.355cdadd.js and 1 other location - About 1 hr to fix
                                docs/build/0.355cdadd.js on lines 11280..11283

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

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language