Showing 289 of 289 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
(u >= 0 &&
(l.marker.inclusiveRight && o.inclusiveLeft
? cmp(c.from, r) <= 0
: cmp(c.from, r) < 0)))
- 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 57.
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
((u <= 0 &&
(l.marker.inclusiveRight && o.inclusiveLeft
? cmp(c.to, n) >= 0
: cmp(c.to, n) > 0)) ||
- 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 57.
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 cursorCoords
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function cursorCoords(e, t, n, r, o, i) {
function get(t, a) {
var s = measureCharPrepared(e, o, t, a ? "right" : "left", i)
return (
a ? (s.left = s.right) : (s.right = s.left),
Function updateHeightsInViewport
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateHeightsInViewport(e) {
for (
var t = e.display, n = t.lineDiv.offsetTop, r = 0;
r < t.view.length;
r++
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (this.props.timeOut > 0) {
this.setState(() => ({
hidingTimoutId: setTimeout(this.handleHide, this.props.timeOut),
}))
}
- 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 56.
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
if (i)
for (var s = 0; s < i.length; ++s)
i[s].lines.length && signal(i[s], "unhide")
- 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 56.
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
if (this.props.timeOut > 0) {
this.setState(() => ({
hidingTimoutId: setTimeout(this.handleHide, this.props.timeOut),
}))
}
- 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 56.
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
if (o)
for (var a = 0; a < o.length; ++a)
o[a].lines.length || signal(o[a], "hide")
- 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 56.
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 maybeUpdateLineNumberWidth
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function maybeUpdateLineNumberWidth(e) {
if (!e.options.lineNumbers) return !1
var t = e.doc,
n = lineNumberFor(e.options, t.first + t.size - 1),
r = e.display
Function removeLineClass
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
removeLineClass: docMethodOp(function(e, t, n) {
return changeLine(
this,
e,
"gutter" == t ? "gutter" : "class",
Function triggerElectric
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function triggerElectric(e, t) {
if (e.options.electricChars && e.options.smartIndent)
for (var n = e.doc.sel, r = n.ranges.length - 1; r >= 0; r--) {
var o = n.ranges[r]
if (
Function hydrate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function hydrate(e) {
var t = this
if (
(Object.keys(e.options || {}).forEach(function(n) {
return t.editor.setOption(n, e.options[n])
Function objprop
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function objprop(e, t) {
if ("async" == e) return (m.marked = "property"), cont(objprop)
if ("variable" == e || "keyword" == m.style) {
if (((m.marked = "property"), "get" == t || "set" == t))
return cont(getterSetter)
Consider simplifying this complex logical expression. Open
if (
!t.force &&
t.visible.from >= n.viewFrom &&
t.visible.to <= n.viewTo &&
(null == n.updateLineNumbers || n.updateLineNumbers >= n.viewTo) &&
Consider simplifying this complex logical expression. Open
else if ("word" == r || "group" == r)
for (
var l = null,
c = "group" == r,
u = e.cm && e.cm.getHelper(t, "wordChars"),
Consider simplifying this complex logical expression. Open
if (l)
for (var f = 0; f < l.length; ++f) {
var g = l[f]
null != g.to && (g.to += u),
null == g.from
Consider simplifying this complex logical expression. Open
if (
(r &&
n < o.viewTo &&
(null == o.updateLineNumbers || o.updateLineNumbers > t) &&
(o.updateLineNumbers = t),
Consider simplifying this complex logical expression. Open
if (3 == l.nodeType) {
for (var p = 0; p < 4; p++) {
for (; c && isExtendingChar(t.line.text.charAt(i.coverStart + c)); )
--c
for (
Consider simplifying this complex logical expression. Open
if (t.somethingSelected()) {
this.prevInput = ""
var n = t.getSelection()
;(this.textarea.value = n),
t.state.focused && M(this.textarea),
Consider simplifying this complex logical expression. Open
if (
r &&
!eventInWidget(t, n) &&
null != r.left &&
!r.moved &&