collinbrewer/predicate

View on GitHub

Showing 31 of 41 total issues

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

    context('#and', function () {
        it('should return a new and compound predicate', function () {
            var predicate = CompoundPredicate.parse('1 AND 2').and(CompoundPredicate.parse('3 and 4'));
            var subpredicates = predicate.getSubpredicates();

Severity: Major
Found in src/types/compound-predicate.test.js and 1 other location - About 6 hrs to fix
src/types/compound-predicate.test.js on lines 81..90

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

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

    context('#or', function () {
        it('should return a new or compound predicate', function () {
            var predicate = CompoundPredicate.parse('1 AND 2').or(CompoundPredicate.parse('3 and 4'));
            var subpredicates = predicate.getSubpredicates();

Severity: Major
Found in src/types/compound-predicate.test.js and 1 other location - About 6 hrs to fix
src/types/compound-predicate.test.js on lines 70..79

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

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

        it('returns a comparison predicate from arg list with selector', function () {
            var predicate = new ComparisonPredicate('left', 'right', 'operator');
            expect(predicate.left).to.exist;
            expect(predicate.right).to.exist;
            expect(predicate.operator).to.equal('operator');
Severity: Major
Found in src/types/comparison-predicate.test.js and 1 other location - About 3 hrs to fix
src/types/comparison-predicate.test.js on lines 17..23

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

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

        it('returns a comparison predicate from arg list with operator', function () {
            var predicate = new ComparisonPredicate('left', 'right', 'operator');
            expect(predicate.left).to.exist;
            expect(predicate.right).to.exist;
            expect(predicate.operator).to.equal('operator');
Severity: Major
Found in src/types/comparison-predicate.test.js and 1 other location - About 3 hrs to fix
src/types/comparison-predicate.test.js on lines 25..31

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

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

        it('returns a multiple coumpound predicates', function () {
            var predicate = Predicate.parse('(1==1 && 2==2) || (3==3 && 4==4)');

            expect(predicate).to.have.property('subpredicates');
            expect(predicate.subpredicates).to.have.length(2);
Severity: Major
Found in src/predicate.test.js and 1 other location - About 2 hrs to fix
src/predicate.test.js on lines 17..21

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

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

        it('returns a complex compound predicate', function () {
            var predicate = Predicate.parse('1==1 && 2==2 && 3==3');
            expect(predicate).to.have.property('subpredicates');
            expect(predicate.subpredicates).to.have.length(3);
        });
Severity: Major
Found in src/predicate.test.js and 1 other location - About 2 hrs to fix
src/predicate.test.js on lines 84..89

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

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

CompoundPredicate.prototype.stringify = function () {
    return this.subpredicates.map(function (predicate) {
        return predicate.stringify();
    }).join(' ' + this.gate + ' ');
};
Severity: Major
Found in src/types/compound-predicate.js and 1 other location - About 1 hr to fix
src/types/compound-predicate.js on lines 183..187

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 2 locations. Consider refactoring.
Open

CompoundPredicate.prototype.toLocaleString = function () {
    return this.subpredicates.map(function (p) {
        return p.toLocaleString();
    }).join(' ' + this.gate + ' ');
};
Severity: Major
Found in src/types/compound-predicate.js and 1 other location - About 1 hr to fix
src/types/compound-predicate.js on lines 174..178

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 2 locations. Consider refactoring.
Open

    context('#toLocaleString', function () {
        it('should return a natural language string', function () {
            var predicate = new CompoundPredicate('AND', [1, 2, 3]);

            expect(predicate.toLocaleString()).to.equal('1 and 2 and 3');
Severity: Major
Found in src/types/compound-predicate.test.js and 1 other location - About 1 hr to fix
src/types/compound-predicate.test.js on lines 54..60

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

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

    context('#stringify', function () {
        it('should return a serialized string', function () {
            var predicate = new CompoundPredicate('AND', [1, 2, 3]);

            expect(predicate.stringify()).to.equal('1 and 2 and 3');
Severity: Major
Found in src/types/compound-predicate.test.js and 1 other location - About 1 hr to fix
src/types/compound-predicate.test.js on lines 62..68

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

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

    context('#stringify', function () {
        it('should return a serialized string', function () {
            var predicate = new ComparisonPredicate(1, 2, '<');

            expect(predicate.stringify()).to.equal('1 < 2');
Severity: Major
Found in src/types/comparison-predicate.test.js and 1 other location - About 1 hr to fix
src/types/comparison-predicate.test.js on lines 68..74

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

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

    context('#toLocaleString', function () {
        it('should return a natural language string', function () {
            var predicate = new ComparisonPredicate(1, 2, '<');

            expect(predicate.toLocaleString()).to.equal('1 less than 2');
Severity: Major
Found in src/types/comparison-predicate.test.js and 1 other location - About 1 hr to fix
src/types/comparison-predicate.test.js on lines 60..66

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

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 8 locations. Consider refactoring.
Open

        it('should end with', function () {
            var predicate = ComparisonPredicate.parse('"foobar" endswith "bar"');

            expect(predicate.evaluateWithObject()).to.be.true;
        });
Severity: Major
Found in src/types/comparison-predicate.test.js and 7 other locations - About 55 mins to fix
src/types/comparison-predicate.test.js on lines 131..135
src/types/comparison-predicate.test.js on lines 143..147
src/types/comparison-predicate.test.js on lines 149..153
src/types/compound-predicate.test.js on lines 93..96
src/types/compound-predicate.test.js on lines 98..101
src/types/compound-predicate.test.js on lines 103..106
src/types/compound-predicate.test.js on lines 108..111

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

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 8 locations. Consider refactoring.
Open

        it('should begin with', function () {
            var predicate = ComparisonPredicate.parse('"foobar" beginswith "foo"');

            expect(predicate.evaluateWithObject()).to.be.true;
        });
Severity: Major
Found in src/types/comparison-predicate.test.js and 7 other locations - About 55 mins to fix
src/types/comparison-predicate.test.js on lines 137..141
src/types/comparison-predicate.test.js on lines 143..147
src/types/comparison-predicate.test.js on lines 149..153
src/types/compound-predicate.test.js on lines 93..96
src/types/compound-predicate.test.js on lines 98..101
src/types/compound-predicate.test.js on lines 103..106
src/types/compound-predicate.test.js on lines 108..111

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

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 8 locations. Consider refactoring.
Open

        it('should return false', function () {
            var predicate = CompoundPredicate.parse('false || false');
            expect(predicate.evaluateWithObject()).to.be.false;
        });
Severity: Major
Found in src/types/compound-predicate.test.js and 7 other locations - About 55 mins to fix
src/types/comparison-predicate.test.js on lines 131..135
src/types/comparison-predicate.test.js on lines 137..141
src/types/comparison-predicate.test.js on lines 143..147
src/types/comparison-predicate.test.js on lines 149..153
src/types/compound-predicate.test.js on lines 93..96
src/types/compound-predicate.test.js on lines 98..101
src/types/compound-predicate.test.js on lines 103..106

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

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 8 locations. Consider refactoring.
Open

        it('should return true', function () {
            var predicate = CompoundPredicate.parse('true && true');
            expect(predicate.evaluateWithObject()).to.be.true;
        });
Severity: Major
Found in src/types/compound-predicate.test.js and 7 other locations - About 55 mins to fix
src/types/comparison-predicate.test.js on lines 131..135
src/types/comparison-predicate.test.js on lines 137..141
src/types/comparison-predicate.test.js on lines 143..147
src/types/comparison-predicate.test.js on lines 149..153
src/types/compound-predicate.test.js on lines 98..101
src/types/compound-predicate.test.js on lines 103..106
src/types/compound-predicate.test.js on lines 108..111

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

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 8 locations. Consider refactoring.
Open

        it('should match', function () {
            var predicate = ComparisonPredicate.parse('"foobar" matches "f(.+?)ba[r]"');

            expect(predicate.evaluateWithObject()).to.be.true;
        });
Severity: Major
Found in src/types/comparison-predicate.test.js and 7 other locations - About 55 mins to fix
src/types/comparison-predicate.test.js on lines 131..135
src/types/comparison-predicate.test.js on lines 137..141
src/types/comparison-predicate.test.js on lines 143..147
src/types/compound-predicate.test.js on lines 93..96
src/types/compound-predicate.test.js on lines 98..101
src/types/compound-predicate.test.js on lines 103..106
src/types/compound-predicate.test.js on lines 108..111

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

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 8 locations. Consider refactoring.
Open

        it('should return false', function () {
            var predicate = CompoundPredicate.parse('true && false');
            expect(predicate.evaluateWithObject()).to.be.false;
        });
Severity: Major
Found in src/types/compound-predicate.test.js and 7 other locations - About 55 mins to fix
src/types/comparison-predicate.test.js on lines 131..135
src/types/comparison-predicate.test.js on lines 137..141
src/types/comparison-predicate.test.js on lines 143..147
src/types/comparison-predicate.test.js on lines 149..153
src/types/compound-predicate.test.js on lines 93..96
src/types/compound-predicate.test.js on lines 103..106
src/types/compound-predicate.test.js on lines 108..111

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

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 8 locations. Consider refactoring.
Open

        it('should be like', function () {
            var predicate = ComparisonPredicate.parse('"foobar" like "f*bar"');

            expect(predicate.evaluateWithObject()).to.be.true;
        });
Severity: Major
Found in src/types/comparison-predicate.test.js and 7 other locations - About 55 mins to fix
src/types/comparison-predicate.test.js on lines 131..135
src/types/comparison-predicate.test.js on lines 137..141
src/types/comparison-predicate.test.js on lines 149..153
src/types/compound-predicate.test.js on lines 93..96
src/types/compound-predicate.test.js on lines 98..101
src/types/compound-predicate.test.js on lines 103..106
src/types/compound-predicate.test.js on lines 108..111

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

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 8 locations. Consider refactoring.
Open

        it('should return true', function () {
            var predicate = CompoundPredicate.parse('true || false');
            expect(predicate.evaluateWithObject()).to.be.true;
        });
Severity: Major
Found in src/types/compound-predicate.test.js and 7 other locations - About 55 mins to fix
src/types/comparison-predicate.test.js on lines 131..135
src/types/comparison-predicate.test.js on lines 137..141
src/types/comparison-predicate.test.js on lines 143..147
src/types/comparison-predicate.test.js on lines 149..153
src/types/compound-predicate.test.js on lines 93..96
src/types/compound-predicate.test.js on lines 98..101
src/types/compound-predicate.test.js on lines 108..111

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

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