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 (
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)
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 (
Consider simplifying this complex logical expression. Open
if (
(this.props.defineMode &&
this.props.defineMode.name &&
this.props.defineMode.fn &&
o.defineMode(
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,
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
) {
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()
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)
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
) {
- Read upRead up
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) {
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),
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,
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"
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 = [],
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)],
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 (
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 (
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
) {
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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
) {
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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,