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 })
}),
- 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 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
- 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 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)
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),
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"))
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
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 " +
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)
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) ||
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),
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)
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,
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 &&
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(
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) {
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,
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(a, e.history) ||
(rebaseHist(e.history, o), a.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, r) {
r ||
-1 != indexOf(n, e.history) ||
(rebaseHist(e.history, t), n.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 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
}