tomchentw/react-prism

View on GitHub

Showing 373 of 373 total issues

Function ./node_modules/codemirror/lib/codemirror.js has 9515 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  "./node_modules/codemirror/lib/codemirror.js": function(e, t, r) {
    ;(n = function() {
      "use strict"
      var e = navigator.userAgent,
        t = navigator.platform,
Severity: Major
Found in docs/build/0.355cdadd.js - About 1 mo to fix

    Function ./node_modules/codemirror/mode/javascript/javascript.js has a Cognitive Complexity of 1776 (exceeds 5 allowed). Consider refactoring.
    Open

      "./node_modules/codemirror/mode/javascript/javascript.js": function(e, t, r) {
        ;(function(e) {
          "use strict"
          e.defineMode("javascript", function(t, r) {
            var n = t.indentUnit,
    Severity: Minor
    Found in docs/build/0.355cdadd.js - About 1 mo 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

    File 0.355cdadd.js has 11763 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    webpackJsonp([0], {
      "./node_modules/codemirror/lib/codemirror.js": function(e, t, r) {
        ;(n = function() {
          "use strict"
          var e = navigator.userAgent,
    Severity: Major
    Found in docs/build/0.355cdadd.js - About 1 mo to fix

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

        "./node_modules/codemirror/mode/javascript/javascript.js": function(e, t, r) {
          ;(function(e) {
            "use strict"
            e.defineMode("javascript", function(t, r) {
              var n = t.indentUnit,
      Severity: Major
      Found in docs/build/0.355cdadd.js - About 5 days to fix

        Function ./node_modules/react-codemirror2/index.js has 475 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          "./node_modules/react-codemirror2/index.js": function(e, t, r) {
            "use strict"
            var n =
              (this && this.__extends) ||
              (function() {
        Severity: Major
        Found in docs/build/0.355cdadd.js - About 2 days to fix

          Function ./node_modules/react-codemirror2/index.js has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring.
          Open

            "./node_modules/react-codemirror2/index.js": function(e, t, r) {
              "use strict"
              var n =
                (this && this.__extends) ||
                (function() {
          Severity: Minor
          Found in docs/build/0.355cdadd.js - About 1 day 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 onMouseDown has 372 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                function onMouseDown(e) {
                  var t = this.display
                  if (
                    !(
                      signalDOMEvent(this, e) ||
          Severity: Major
          Found in docs/build/0.355cdadd.js - About 1 day to fix

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

              "./node_modules/codemirror/mode/xml/xml.js": function(e, t, r) {
                ;(function(e) {
                  "use strict"
                  var t = {
                      autoSelfClosers: {
            Severity: Major
            Found in docs/build/0.355cdadd.js - About 1 day to fix

              Function CodeMirror$1 has 324 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    function CodeMirror$1(e, t) {
                      var n = this
                      if (!(this instanceof CodeMirror$1)) return new CodeMirror$1(e, t)
                      ;(this.options = t = t ? copyObj(t) : {}),
                        copyObj(Be, t, !1),
              Severity: Major
              Found in docs/build/0.355cdadd.js - About 1 day to fix

                Function leftButtonDown has 301 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                    ? (function leftButtonDown(e, t, r, n) {
                                        s
                                          ? setTimeout(bind(ensureFocus, e), 0)
                                          : (e.curOp.focus = activeElt())
                                        var o,
                Severity: Major
                Found in docs/build/0.355cdadd.js - About 1 day to fix

                  Consider simplifying this complex logical expression.
                  Open

                            else if (!clickInGutter(this, e)) {
                              var r = posFromMouse(this, e),
                                n = e_button(e),
                                o = r
                                  ? (function clickRepeat(e, t) {
                  Severity: Critical
                  Found in docs/build/0.355cdadd.js - About 1 day to fix

                    Function defineOptions has 221 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          !(function defineOptions(e) {
                            var t = e.optionHandlers
                            function option(r, n, o, i) {
                              ;(e.defaults[r] = n),
                                o &&
                    Severity: Major
                    Found in docs/build/0.355cdadd.js - About 1 day to fix

                      Function leftButtonSelect has 218 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                                : (function leftButtonSelect(e, t, r, n) {
                                                    var o = e.display,
                                                      i = e.doc
                                                    e_preventDefault(t)
                                                    var s,
                      Severity: Major
                      Found in docs/build/0.355cdadd.js - About 1 day to fix

                        Function l has 191 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              l = (function(e) {
                                n(Controlled, e)
                                function Controlled(t) {
                                  var r = e.call(this, t) || this
                                  return s
                        Severity: Major
                        Found in docs/build/0.355cdadd.js - About 7 hrs to fix

                          Function registerEventHandlers has 181 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                    (function registerEventHandlers(e) {
                                      var t = e.display
                                      j(t.scroller, "mousedown", operation(e, onMouseDown)),
                                        j(
                                          t.scroller,
                          Severity: Major
                          Found in docs/build/0.355cdadd.js - About 7 hrs to fix

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

                                      (Controlled.prototype.componentWillReceiveProps = function(e) {
                                        if (!s) {
                                          var t
                                          e.value !== this.props.value && (this.hydrated = !1),
                                            this.props.autoCursor ||
                            Severity: Major
                            Found in docs/build/0.355cdadd.js and 1 other location - About 7 hrs to fix
                            docs/build/0.355cdadd.js on lines 11564..11576

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

                            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

                                    (UnControlled.prototype.componentWillReceiveProps = function(e) {
                                      if (!s) {
                                        var t
                                        e.value !== this.props.value && (this.hydrated = !1),
                                          this.props.autoCursor ||
                            Severity: Major
                            Found in docs/build/0.355cdadd.js and 1 other location - About 7 hrs to fix
                            docs/build/0.355cdadd.js on lines 11415..11427

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

                            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

                            Consider simplifying this complex logical expression.
                            Open

                                        if (v == f) {
                                          ;(l = c = u = d = a = ""), (p = null), (v = 1 / 0)
                                          for (var y = [], b = void 0, C = 0; C < n.length; ++C) {
                                            var x = n[C],
                                              w = x.marker
                            Severity: Critical
                            Found in docs/build/0.355cdadd.js - About 7 hrs to fix

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

                                  var c = (function(e) {
                                    n(UnControlled, e)
                                    function UnControlled(t) {
                                      var r = e.call(this, t) || this
                                      return s
                              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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language