Showing 219 of 219 total issues
Consider simplifying this complex logical expression. Open
if ((sp.from == null || sp.from < ch) &&
(sp.to == null || sp.to > ch) &&
(!found || found.width < sp.marker.width))
found = sp.marker;
Consider simplifying this complex logical expression. Open
if (!cm.options.lineNumbers && !markers && !line.bgClass && !line.wrapClass &&
(!line.widgets || !line.widgets.length)) return lineElement;
Consider simplifying this complex logical expression. Open
if (cur &&
(history.lastOp == cm.curOp.id ||
history.lastOrigin == origin && (origin == "input" || origin == "delete") &&
history.lastTime > time - 600)) {
// Merge this change into the last event
Function parseJS
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function parseJS(state, style, type, content, stream) {
Function setSelection
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function setSelection(cm, anchor, head, bias, checkAtomic) {
Function buildToken
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function buildToken(builder, text, style, startStyle, endStyle) {
Function cursorCoords
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function cursorCoords(cm, pos, context, lineObj, measurement) {
Function runMode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function runMode(cm, text, mode, state, f) {
Function patchDisplay
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function patchDisplay(cm, from, to, intact, updateNumbersFrom) {
Function addWidget
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
addWidget: function(pos, node, scroll, vert, horiz) {
Function updateMarkedSpans
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function updateMarkedSpans(oldFirst, oldLast, startCh, endCh, newText) {
Function replaceRange
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function replaceRange(cm, code, from, to, origin) {
Function calculateScrollPos
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function calculateScrollPos(cm, x1, y1, x2, y2) {
Function markText
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function markText(cm, from, to, options, type) {
Function coordsCharInner
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function coordsCharInner(cm, lineObj, lineNo, x, y) {
Function scrollIntoView
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function scrollIntoView(cm, x1, y1, x2, y2) {
Function buildTokenMeasure
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function buildTokenMeasure(builder, text, style, startStyle, endStyle) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 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 47.
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
else if (/^style$/i.test(state.htmlState.context.tagName)) {
state.token = css;
state.localState = cssMode.startState(htmlMode.indent(state.htmlState, ""));
}
- 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 47.
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
state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 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 47.
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