Showing 289 of 289 total issues
Function updateLineGutter
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateLineGutter(e, t, n, r) {
if (
(t.gutter && (t.node.removeChild(t.gutter), (t.gutter = null)),
t.gutterBackground &&
(t.node.removeChild(t.gutterBackground),
Similar blocks of code found in 2 locations. Consider refactoring. Open
this.props.onScroll &&
this.editor.on("scroll", function(t) {
var n = e.editor.getScrollInfo()
e.props.onScroll(e.editor, { x: n.left, y: n.top })
}),
- 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 89.
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
this.props.onCursor &&
this.editor.on("cursorActivity", function(t) {
var n = e.editor.getCursor()
e.props.onCursor(e.editor, { line: n.line, ch: n.ch })
}),
- 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 89.
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
Consider simplifying this complex logical expression. Open
if (a)
for (var s = 0; s < a.length; s++) {
var l = a[s]
;(null != l.to && o == e.line && e.ch >= l.to) ||
(null == l.from && o != e.line) ||
Consider simplifying this complex logical expression. Open
if (((t.curOp.focus = activeElt()), !signalDOMEvent(t, e))) {
a && s < 11 && 27 == e.keyCode && (e.returnValue = !1)
var n = e.keyCode
t.display.shift = 16 == n || e.shiftKey
var r = handleKeyBinding(t, e)
Consider simplifying this complex logical expression. Open
if (g.top - f.top <= 3) {
var x = (c ? v : m) && b,
C = (c ? m : v) && y ? s : (h ? f : g).left,
w = x ? l : (h ? g : f).right
add(C, f.top, w - C, f.bottom)
Consider simplifying this complex logical expression. Open
if (
(o.lastOp == r ||
(o.lastOrigin == t.origin &&
t.origin &&
(("+" == t.origin.charAt(0) &&
Consider simplifying this complex logical expression. Open
if (r.line >= e.display.viewFrom) {
var a = i.styles,
s =
i.text.length > e.options.maxHighlightLength
? copyState(t.mode, r.state)
Function buildToken
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildToken(e, t, n, r, o, i, l) {
if (t) {
var c,
u = e.splitSpaces ? splitSpaces(t, e.trailingSpace) : t,
d = e.cm.state.specialChars,
Function moveVisually
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function moveVisually(e, t, n, r) {
var o = getOrder(t, e.doc.direction)
if (!o) return moveLogically(t, n, r)
n.ch >= t.text.length
? ((n.ch = t.text.length), (n.sticky = "before"))
Function buildLineContent
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildLineContent(e, t) {
var n = eltP("span", null, null, l ? "padding-right: .1px" : null),
r = {
pre: eltP("pre", [n], "CodeMirror-line"),
content: n,
Function drawForLine
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawForLine(t, n, r) {
function coords(n, r) {
return charCoords(e, Pos(t, n), "div", u, r)
}
function wrapX(t, n, r) {
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)
- 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 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
- 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
function pageScrollY() {
return u && m
? -(
document.body.getBoundingClientRect().top -
parseInt(getComputedStyle(document.body).marginTop)
- 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 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
- 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
linkedDocs(e, function(e, t) {
t ||
-1 != indexOf(s, e.history) ||
(rebaseHist(e.history, o), s.push(e.history)),
makeChangeSingleDoc(e, o, null, mergeOldSpans(e, o))
- 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 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
- 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
linkedDocs(e, function(e, n) {
n ||
-1 != indexOf(r, e.history) ||
(rebaseHist(e.history, t), r.push(e.history)),
makeChangeSingleDoc(e, t, null, stretchSpansOverChange(e, t))
- 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 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
- 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 coordsCharInner
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function coordsCharInner(e, t, n, r, o) {
o -= heightAtLine(t)
var i = prepareMeasureForLine(e, t),
a = widgetTopHeight(t),
s = 0,
Function updateDisplayIfNeeded
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateDisplayIfNeeded(e, t) {
var n = e.display,
r = e.doc
if (t.editorIsHidden) return resetView(e), !1
if (
Function makeChangeFromHistory
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeChangeFromHistory(e, t, n) {
if (!e.cm || !e.cm.state.suppressEdits || n) {
for (
var r,
o = e.history,
Function CodeMirror$1
has 55 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),