Showing 403 of 403 total issues
Identical blocks of code found in 2 locations. Consider refactoring. Open
SELECT.$selected.sort(function(a, b) {
// sort by path length, so that deeper level items will be replaced first
// TODO: may need to look into edge cases
return b.path.length - a.path.length;
}).forEach(function(selection) {
- Read upRead up
- Create a ticketCreate a ticket
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
SELECT.$selected.sort(function(a, b) {
// sort by path length, so that deeper level items will be replaced first
// TODO: may need to look into edge cases
return b.path.length - a.path.length;
}).forEach(function(selection) {
- Read upRead up
- Create a ticketCreate a ticket
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
- Read upRead up
- Create a ticketCreate a ticket
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
- Read upRead up
- Create a ticketCreate a ticket
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (authInHost) {
result.auth = authInHost.shift();
result.host = result.hostname = authInHost.shift();
}
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
if (Helper.is_template(key)) {
fun = TRANSFORM.tokenize(key);
if (fun) {
if (fun.name === '#include') {
// this was handled above (before the for loop) so just ignore
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
} else if (Object.keys(link['@']).length === 0) { // RSS
if (!item.link) item.link = utils.get(link);
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (item) {
// only push when the result is not null
// null could mean #if clauses where nothing matched => In this case instead of rendering 'null', should just skip it completely
// Todo : Distinguish between #if arrays and ordinary arrays, and return null for ordinary arrays
result.push(item);
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (utils.get(link['@'], 'rel')) {
if (link['@']['rel'] == 'alternate') {
if (!meta.link) meta.link = link['@']['href'];
}
else if (link['@']['rel'] == 'self') {
- Create a ticketCreate a ticket
Function formatProperty
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (utils.get(el['@'], 'rel')) {
if (el['@']['rel'] == 'alternate') {
if (!meta.link) meta.link = el['@']['href'];
}
else if (el['@']['rel'] == 'self') {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (utils.get(el['@'], 'term')) item.categories.push(utils.get(el['@'], 'term'));
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (utils.get(el['@'], 'rel')) {
if (el['@']['rel'] == 'canonical') item.origlink = el['@']['href'];
if (el['@']['rel'] == 'alternate' && (!el['@']['type'] || el['@']['type'] == 'text/html') && !item.link) item.link = el['@']['href'];
if (el['@']['rel'] == 'self' && (!el['@']['type'] || el['@']['type'] == 'text/html') && !item.link) item.link = el['@']['href'];
if (el['@']['rel'] == 'replies') item.comments = el['@']['href'];
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
} else if (Object.keys(el['@']).length === 0) { // RSS
if (!meta.link) meta.link = utils.get(el);
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
else if ('category' == name && 'rss' == type) {
if ((_category = utils.safeTrim(utils.get(el)))) {
meta.categories.push(_category);
}
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (full_re.test(template)) {
return evaluated;
} else {
return template.replace(variable, '');
}
- Create a ticketCreate a ticket
Function write
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (fun.expression) {
// if #include has arguments, evaluate it before attaching
result = TRANSFORM.fillout(template[include_keys[0]], '{{' + fun.expression + '}}', true);
} else {
// no argument, simply attach the child
- Create a ticketCreate a ticket
Function checkIEEE754
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function checkIEEE754 (buf, value, offset, ext, max, min) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (full_re.test(template)) {
return evaluated;
} else {
return template.replace(variable, evaluated);
}
- Create a ticketCreate a ticket