Function diff_cleanupMerge
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_cleanupMerge = function (diffs) {
// Add a dummy entry at the end.
diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ''))
var pointer = 0
var count_delete = 0
Function diff_cleanupSemantic
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_cleanupSemantic = function (diffs) {
var changes = false
var equalities = [] // Stack of indices where equalities are found.
var equalitiesLength = 0 // Keeping our own length var is faster in JS.
/** @type {?string} */
Function patch_make
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.patch_make = function (a, opt_b, opt_c) {
var text1, diffs
if (
typeof a == 'string' &&
typeof opt_b == 'string' &&
Function diff_bisect_
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_bisect_ = function (text1, text2, deadline) {
// Cache the text lengths to prevent multiple calls.
var text1_length = text1.length
var text2_length = text2.length
var max_d = Math.ceil((text1_length + text2_length) / 2)
Function diff_cleanupSemanticLossless
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_cleanupSemanticLossless = function (diffs) {
/**
* Given two strings, compute a score representing whether the internal
* boundary falls on logical boundaries.
* Scores range from 6 (best) to 0 (worst).
Function patch_apply
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.patch_apply = function (patches, text) {
if (patches.length == 0) {
return [text, []]
}
// Deep copy the patches so that no changes are made to originals.
Function patch_splitMax
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.patch_splitMax = function (patches) {
var patch_size = this.Match_MaxBits
for (var x = 0; x < patches.length; x++) {
if (patches[x].length1 <= patch_size) {
continue
Function diff_halfMatch_
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_halfMatch_ = function (text1, text2) {
if (this.Diff_Timeout <= 0) {
// Don't risk returning a non-optimal diff if we have unlimited time.
return null
}
Function match_bitap_
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.match_bitap_ = function (text, pattern, loc) {
if (pattern.length > this.Match_MaxBits) {
throw new Error('Pattern too long for this browser.')
}
Function decodeURI
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.decodeURI = function (text) {
try {
return decodeURI(text)
} catch (e) {
var i = 0
Function diff_cleanupEfficiency
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_cleanupEfficiency = function (diffs) {
var changes = false
var equalities = [] // Stack of indices where equalities are found.
var equalitiesLength = 0 // Keeping our own length var is faster in JS.
/** @type {?string} */
Function patch_fromText
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.patch_fromText = function (textline) {
var patches = []
if (!textline) {
return patches
}
Function diff_lineMode_
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_lineMode_ = function (text1, text2, deadline) {
// Scan the text on a line-by-line basis first.
var a = this.diff_linesToChars_(text1, text2)
text1 = a.chars1
text2 = a.chars2
Function diff_fromDelta
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_fromDelta = function (text1, delta) {
var diffs = []
var diffsLength = 0 // Keeping our own length var is faster in JS.
var pointer = 0 // Cursor in text1
var tokens = delta.split(/\t/g)
Function patch_addContext_
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.patch_addContext_ = function (patch, text) {
if (text.length == 0) {
return
}
if (patch.start2 === null) {
Function digit16
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.digit16 = function (c) {
switch (c) {
case '0':
return 0
case '1':
Function patch_addPadding
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.patch_addPadding = function (patches) {
var paddingLength = this.Patch_Margin
var nullPadding = ''
for (var x = 1; x <= paddingLength; x++) {
nullPadding += String.fromCharCode(x)
Function diff_linesToChars_
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_linesToChars_ = function (text1, text2) {
var lineArray = [] // e.g. lineArray[4] == 'Hello\n'
var lineHash = {} // e.g. lineHash['Hello\n'] == 4
// '\x00' is a valid character, but various debuggers don't like it.
Function diff_main
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_main = function (
text1,
text2,
opt_checklines,
opt_deadline,
Function diff_compute_
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_compute_ = function (
text1,
text2,
checklines,
deadline,
Function diff_halfMatchI_
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function diff_halfMatchI_(longtext, shorttext, i) {
// Start with a 1/4 length substring at position i as a seed.
var seed = longtext.substring(i, i + Math.floor(longtext.length / 4))
var j = -1
var best_common = ''
Function toString
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.patch_obj.prototype.toString = function () {
var coords1, coords2
if (this.length1 === 0) {
coords1 = this.start1 + ',0'
} else if (this.length1 == 1) {
Function diff_cleanupSemanticScore_
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function diff_cleanupSemanticScore_(one, two) {
if (!one || !two) {
// Edges are the best.
return 6
}
Function diff_commonOverlap_
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_commonOverlap_ = function (text1, text2) {
// Cache the text lengths to prevent multiple calls.
var text1_length = text1.length
var text2_length = text2.length
// Eliminate the null case.
Function diff_linesToCharsMunge_
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function diff_linesToCharsMunge_(text) {
var chars = ''
// Walk the text, pulling out a substring for each line.
// text.split('\n') would would temporarily double our memory footprint.
// Modifying text would create many large strings to garbage collect.
Function diff_cleanupSplitSurrogates
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_cleanupSplitSurrogates = function (diffs) {
var lastEnd
for (var x = 0; x < diffs.length; x++) {
var thisDiff = diffs[x]
var thisTop = thisDiff[1][0]
Function diff_prettyHtml
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_prettyHtml = function (diffs) {
diffs = this.diff_cleanupSplitSurrogates(diffs)
var html = []
var pattern_amp = /&/g
var pattern_lt = /</g
Consider simplifying this complex logical expression. Open
if (
lastEquality &&
((pre_ins && pre_del && post_ins && post_del) ||
(lastEquality.length < this.Diff_EditCost / 2 &&
pre_ins + pre_del + post_ins + post_del == 3))
Avoid deeply nested control flow statements. Open
for (var y = 0; y < patches[x].diffs.length; y++) {
var mod = patches[x].diffs[y]
if (mod[0] !== DIFF_EQUAL) {
index2 = this.diff_xIndex(diffs, index1)
}
Avoid deeply nested control flow statements. Open
if (commonlength !== 0) {
if (
pointer - count_delete - count_insert > 0 &&
diffs[pointer - count_delete - count_insert - 1][0] ==
DIFF_EQUAL
Avoid deeply nested control flow statements. Open
if (x1 >= x2) {
// Overlap detected.
return this.diff_bisectSplit_(text1, text2, x1, y1, deadline)
}
Avoid deeply nested control flow statements. Open
if (commonlength !== 0) {
diffs[pointer][1] =
text_insert.substring(text_insert.length - commonlength) +
diffs[pointer][1]
text_insert = text_insert.substring(
Avoid deeply nested control flow statements. Open
if (best_loc > loc) {
// When passing loc, don't exceed our current distance from loc.
start = Math.max(1, 2 * loc - best_loc)
} else {
// Already passed loc, downhill from here on in.
Avoid deeply nested control flow statements. Open
if (diff_text == bigpatch.diffs[0][1]) {
bigpatch.diffs.shift()
} else {
bigpatch.diffs[0][1] = bigpatch.diffs[0][1].substring(
diff_text.length,
Avoid deeply nested control flow statements. Open
if (x1 >= x2) {
// Overlap detected.
return this.diff_bisectSplit_(text1, text2, x1, y1, deadline)
}
Avoid deeply nested control flow statements. Open
if (diff_type === DIFF_EQUAL) {
patch.length2 += diff_text.length
start2 += diff_text.length
} else {
empty = false
Function diff_bisectSplit_
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
text1,
text2,
x,
y,
deadline,
Avoid too many return
statements within this function. Open
return 1
Avoid too many return
statements within this function. Open
return this.diff_lineMode_(text1, text2, deadline)
Avoid too many return
statements within this function. Open
return this.diff_bisect_(text1, text2, deadline)
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return 2
Similar blocks of code found in 2 locations. Consider refactoring. Open
diff_match_patch.prototype.diff_text2 = function (diffs) {
var text = []
for (var x = 0; x < diffs.length; x++) {
if (diffs[x][0] !== DIFF_DELETE) {
text[x] = diffs[x][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 109.
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
diff_match_patch.prototype.diff_text1 = function (diffs) {
var text = []
for (var x = 0; x < diffs.length; x++) {
if (diffs[x][0] !== DIFF_INSERT) {
text[x] = diffs[x][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 109.
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 (m[2] === '') {
patch.start1--
patch.length1 = 1
} else if (m[2] == '0') {
patch.length1 = 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 95.
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 (m[4] === '') {
patch.start2--
patch.length2 = 1
} else if (m[4] == '0') {
patch.length2 = 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 95.
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.length2 === 0) {
coords2 = this.start2 + ',0'
} else if (this.length2 == 1) {
coords2 = this.start2 + 1
} else {
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (this.length1 === 0) {
coords1 = this.start1 + ',0'
} else if (this.length1 == 1) {
coords1 = this.start1 + 1
} else {
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {
x1 = v1[k1_offset + 1]
} else {
x1 = v1[k1_offset - 1] + 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 83.
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 (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {
x2 = v2[k2_offset + 1]
} else {
x2 = v2[k2_offset - 1] + 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 83.
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
diff_match_patch.prototype.isHighSurrogate = function (c) {
var v = c.charCodeAt(0)
return v >= 0xd800 && v <= 0xdbff
}
- 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 51.
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
diff_match_patch.prototype.isLowSurrogate = function (c) {
var v = c.charCodeAt(0)
return v >= 0xdc00 && v <= 0xdfff
}
- 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 51.
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 {
text2_a = hm[0]
text2_b = hm[1]
text1_a = hm[2]
text1_b = hm[3]
- 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 3 locations. Consider refactoring. Open
var byte4 = (this.digit16(text[i + 10]) << 4) + this.digit16(text[i + 11])
- 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 3 locations. Consider refactoring. Open
var byte2 = (this.digit16(text[i + 4]) << 4) + this.digit16(text[i + 5])
- 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 3 locations. Consider refactoring. Open
var byte3 = (this.digit16(text[i + 7]) << 4) + this.digit16(text[i + 8])
- 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
if (text1.length > text2.length) {
text1_a = hm[0]
text1_b = hm[1]
text2_a = hm[2]
text2_b = hm[3]
- 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