ContentMine/thresher

View on GitHub

Showing 112 of 227 total issues

Similar blocks of code found in 6 locations. Consider refactoring.
Open

PlusOperation.prototype.evaluate = function(c) {
    return this.lhs.evaluate(c).number().plus(this.rhs.evaluate(c).number());
};
Severity: Major
Found in lib/xpath.js and 5 other locations - About 1 hr to fix
lib/xpath.js on lines 1532..1534
lib/xpath.js on lines 1556..1558
lib/xpath.js on lines 1580..1582
lib/xpath.js on lines 1604..1606
lib/xpath.js on lines 1628..1630

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 70.

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

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

MinusOperation.prototype.evaluate = function(c) {
    return this.lhs.evaluate(c).number().minus(this.rhs.evaluate(c).number());
};
Severity: Major
Found in lib/xpath.js and 5 other locations - About 1 hr to fix
lib/xpath.js on lines 1508..1510
lib/xpath.js on lines 1556..1558
lib/xpath.js on lines 1580..1582
lib/xpath.js on lines 1604..1606
lib/xpath.js on lines 1628..1630

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 70.

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

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

MultiplyOperation.prototype.evaluate = function(c) {
    return this.lhs.evaluate(c).number().multiply(this.rhs.evaluate(c).number());
};
Severity: Major
Found in lib/xpath.js and 5 other locations - About 1 hr to fix
lib/xpath.js on lines 1508..1510
lib/xpath.js on lines 1532..1534
lib/xpath.js on lines 1580..1582
lib/xpath.js on lines 1604..1606
lib/xpath.js on lines 1628..1630

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 70.

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

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

BarOperation.prototype.evaluate = function(c) {
    return this.lhs.evaluate(c).nodeset().union(this.rhs.evaluate(c).nodeset());
};
Severity: Major
Found in lib/xpath.js and 5 other locations - About 1 hr to fix
lib/xpath.js on lines 1508..1510
lib/xpath.js on lines 1532..1534
lib/xpath.js on lines 1556..1558
lib/xpath.js on lines 1580..1582
lib/xpath.js on lines 1604..1606

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 70.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

LessThanOperation.prototype.toString = function() {
    return "(" + this.lhs.toString() + " < " + this.rhs.toString() + ")";
};
Severity: Major
Found in lib/xpath.js and 8 other locations - About 1 hr to fix
lib/xpath.js on lines 1440..1442
lib/xpath.js on lines 1464..1466
lib/xpath.js on lines 1488..1490
lib/xpath.js on lines 1512..1514
lib/xpath.js on lines 1536..1538
lib/xpath.js on lines 1560..1562
lib/xpath.js on lines 1584..1586
lib/xpath.js on lines 1608..1610

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 63.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

MultiplyOperation.prototype.toString = function() {
    return "(" + this.lhs.toString() + " * " + this.rhs.toString() + ")";
};
Severity: Major
Found in lib/xpath.js and 8 other locations - About 1 hr to fix
lib/xpath.js on lines 1416..1418
lib/xpath.js on lines 1440..1442
lib/xpath.js on lines 1464..1466
lib/xpath.js on lines 1488..1490
lib/xpath.js on lines 1512..1514
lib/xpath.js on lines 1536..1538
lib/xpath.js on lines 1584..1586
lib/xpath.js on lines 1608..1610

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 63.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

GreaterThanOrEqualOperation.prototype.toString = function() {
    return "(" + this.lhs.toString() + " >= " + this.rhs.toString() + ")";
};
Severity: Major
Found in lib/xpath.js and 8 other locations - About 1 hr to fix
lib/xpath.js on lines 1416..1418
lib/xpath.js on lines 1440..1442
lib/xpath.js on lines 1464..1466
lib/xpath.js on lines 1512..1514
lib/xpath.js on lines 1536..1538
lib/xpath.js on lines 1560..1562
lib/xpath.js on lines 1584..1586
lib/xpath.js on lines 1608..1610

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 63.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

ModOperation.prototype.toString = function() {
    return "(" + this.lhs.toString() + " mod " + this.rhs.toString() + ")";
};
Severity: Major
Found in lib/xpath.js and 8 other locations - About 1 hr to fix
lib/xpath.js on lines 1416..1418
lib/xpath.js on lines 1440..1442
lib/xpath.js on lines 1464..1466
lib/xpath.js on lines 1488..1490
lib/xpath.js on lines 1512..1514
lib/xpath.js on lines 1536..1538
lib/xpath.js on lines 1560..1562
lib/xpath.js on lines 1584..1586

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 63.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

DivOperation.prototype.toString = function() {
    return "(" + this.lhs.toString() + " div " + this.rhs.toString() + ")";
};
Severity: Major
Found in lib/xpath.js and 8 other locations - About 1 hr to fix
lib/xpath.js on lines 1416..1418
lib/xpath.js on lines 1440..1442
lib/xpath.js on lines 1464..1466
lib/xpath.js on lines 1488..1490
lib/xpath.js on lines 1512..1514
lib/xpath.js on lines 1536..1538
lib/xpath.js on lines 1560..1562
lib/xpath.js on lines 1608..1610

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 63.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

MinusOperation.prototype.toString = function() {
    return "(" + this.lhs.toString() + " - " + this.rhs.toString() + ")";
};
Severity: Major
Found in lib/xpath.js and 8 other locations - About 1 hr to fix
lib/xpath.js on lines 1416..1418
lib/xpath.js on lines 1440..1442
lib/xpath.js on lines 1464..1466
lib/xpath.js on lines 1488..1490
lib/xpath.js on lines 1512..1514
lib/xpath.js on lines 1560..1562
lib/xpath.js on lines 1584..1586
lib/xpath.js on lines 1608..1610

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 63.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

PlusOperation.prototype.toString = function() {
    return "(" + this.lhs.toString() + " + " + this.rhs.toString() + ")";
};
Severity: Major
Found in lib/xpath.js and 8 other locations - About 1 hr to fix
lib/xpath.js on lines 1416..1418
lib/xpath.js on lines 1440..1442
lib/xpath.js on lines 1464..1466
lib/xpath.js on lines 1488..1490
lib/xpath.js on lines 1536..1538
lib/xpath.js on lines 1560..1562
lib/xpath.js on lines 1584..1586
lib/xpath.js on lines 1608..1610

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 63.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

GreaterThanOperation.prototype.toString = function() {
    return "(" + this.lhs.toString() + " > " + this.rhs.toString() + ")";
};
Severity: Major
Found in lib/xpath.js and 8 other locations - About 1 hr to fix
lib/xpath.js on lines 1416..1418
lib/xpath.js on lines 1464..1466
lib/xpath.js on lines 1488..1490
lib/xpath.js on lines 1512..1514
lib/xpath.js on lines 1536..1538
lib/xpath.js on lines 1560..1562
lib/xpath.js on lines 1584..1586
lib/xpath.js on lines 1608..1610

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 63.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

LessThanOrEqualOperation.prototype.toString = function() {
    return "(" + this.lhs.toString() + " <= " + this.rhs.toString() + ")";
};
Severity: Major
Found in lib/xpath.js and 8 other locations - About 1 hr to fix
lib/xpath.js on lines 1416..1418
lib/xpath.js on lines 1440..1442
lib/xpath.js on lines 1488..1490
lib/xpath.js on lines 1512..1514
lib/xpath.js on lines 1536..1538
lib/xpath.js on lines 1560..1562
lib/xpath.js on lines 1584..1586
lib/xpath.js on lines 1608..1610

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 63.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

EqualsOperation.prototype.toString = function() {
    return "(" + this.lhs.toString() + " = " + this.rhs.toString() + ")";
};
Severity: Major
Found in lib/xpath.js and 3 other locations - About 1 hr to fix
lib/xpath.js on lines 1308..1310
lib/xpath.js on lines 1336..1338
lib/xpath.js on lines 1388..1390

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 61.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

AndOperation.prototype.toString = function() {
    return "(" + this.lhs.toString() + " and " + this.rhs.toString() + ")";
};
Severity: Major
Found in lib/xpath.js and 3 other locations - About 1 hr to fix
lib/xpath.js on lines 1308..1310
lib/xpath.js on lines 1364..1366
lib/xpath.js on lines 1388..1390

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 61.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

NotEqualOperation.prototype.toString = function() {
    return "(" + this.lhs.toString() + " != " + this.rhs.toString() + ")";
};
Severity: Major
Found in lib/xpath.js and 3 other locations - About 1 hr to fix
lib/xpath.js on lines 1308..1310
lib/xpath.js on lines 1336..1338
lib/xpath.js on lines 1364..1366

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 61.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                        if (xpc.contextNode.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) {
                            m = this.getOwnerElement(xpc.contextNode);
                        } else {
                            m = xpc.contextNode.parentNode;
                        }
Severity: Major
Found in lib/xpath.js and 1 other location - About 1 hr to fix
lib/xpath.js on lines 1886..1890

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 61.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                            if (xpc.contextNode.nodeType == 2 /*Node.ATTRIBUTE_NODE*/) {
                                m = this.getOwnerElement(xpc.contextNode);
                            } else {
                                m = xpc.contextNode.parentNode;
                            }
Severity: Major
Found in lib/xpath.js and 1 other location - About 1 hr to fix
lib/xpath.js on lines 1724..1728

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 61.

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

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

OrOperation.prototype.toString = function() {
    return "(" + this.lhs.toString() + " or " + this.rhs.toString() + ")";
};
Severity: Major
Found in lib/xpath.js and 3 other locations - About 1 hr to fix
lib/xpath.js on lines 1336..1338
lib/xpath.js on lines 1364..1366
lib/xpath.js on lines 1388..1390

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 61.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

Functions.position = function() {
    var c = arguments[0];
    if (arguments.length != 1) {
        throw new Error("Function position expects ()");
    }
Severity: Major
Found in lib/xpath.js and 1 other location - About 1 hr to fix
lib/xpath.js on lines 3279..3285

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 60.

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

Further Reading

Severity
Category
Status
Source
Language