fogine/json-inspector

View on GitHub

Showing 74 of 74 total issues

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

    isAlphanumeric: function() {
        try {
            this.success = stringValidator.isAlphanumeric(this.val, this.filter || undefined);
            transformErr.call(this);
        } catch (e) {
Severity: Major
Found in lib/assertions.js and 5 other locations - About 5 hrs to fix
lib/assertions.js on lines 137..154
lib/assertions.js on lines 449..466
lib/assertions.js on lines 467..484
lib/assertions.js on lines 614..631
lib/assertions.js on lines 632..649

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

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

    isBefore: function() {
        try {
            this.success = stringValidator.isBefore(this.val, this.filter || undefined);
            transformErr.call(this);
        } catch (e) {
Severity: Major
Found in lib/assertions.js and 5 other locations - About 5 hrs to fix
lib/assertions.js on lines 85..102
lib/assertions.js on lines 449..466
lib/assertions.js on lines 467..484
lib/assertions.js on lines 614..631
lib/assertions.js on lines 632..649

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

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

    isAlpha: function() {
        try {
            this.success = stringValidator.isAlpha(this.val, this.filter || undefined);
            transformErr.call(this);
        } catch (e) {
Severity: Major
Found in lib/assertions.js and 1 other location - About 5 hrs to fix
lib/assertions.js on lines 50..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 137.

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

    isAfter: function() {
        try {
            this.success = stringValidator.isAfter(this.val, this.filter || undefined);
            transformErr.call(this);
        } catch (e) {
Severity: Major
Found in lib/assertions.js and 1 other location - About 5 hrs to fix
lib/assertions.js on lines 67..84

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

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

Function build has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Validator.prototype.build = function(data, where, options, parentDataObj, parentProp, parentTreeObj) {

    var self = this;

    var pool = [];
Severity: Major
Found in lib/validator.js - About 4 hrs to fix

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

        isDecimal: function() {
            try {
                this.success = stringValidator.isDecimal(this.val + '');
                transformErr.call(this);
            } catch (e) {
    Severity: Major
    Found in lib/assertions.js and 1 other location - About 4 hrs to fix
    lib/assertions.js on lines 155..172

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

    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

        isBoolean: function() {
            try {
                this.success = stringValidator.isBoolean(this.val + '');
                transformErr.call(this);
            } catch (e) {
    Severity: Major
    Found in lib/assertions.js and 1 other location - About 4 hrs to fix
    lib/assertions.js on lines 270..286

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

    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

    Function filterData has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    Validator.prototype.filterData = function(data, filter, callback) {
    
        if (_.isPlainObject(data)) {
            var allowedKeys = Object.keys(filter);
            var dataKeys = Object.keys(data);
    Severity: Minor
    Found in lib/validator.js - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

        isCreditCard: function() {
            try {
                this.success = stringValidator.isCreditCard(this.val);
                transformErr.call(this);
            } catch (e) {
    Severity: Major
    Found in lib/assertions.js and 8 other locations - About 3 hrs to fix
    lib/assertions.js on lines 103..119
    lib/assertions.js on lines 236..252
    lib/assertions.js on lines 253..269
    lib/assertions.js on lines 381..397
    lib/assertions.js on lines 398..414
    lib/assertions.js on lines 415..431
    lib/assertions.js on lines 432..448
    lib/assertions.js on lines 518..534

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

    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

        isHexColor: function() {
            try {
                this.success = stringValidator.isHexColor(this.val );
                transformErr.call(this);
            } catch (e) {
    Severity: Major
    Found in lib/assertions.js and 8 other locations - About 3 hrs to fix
    lib/assertions.js on lines 103..119
    lib/assertions.js on lines 197..214
    lib/assertions.js on lines 236..252
    lib/assertions.js on lines 253..269
    lib/assertions.js on lines 381..397
    lib/assertions.js on lines 398..414
    lib/assertions.js on lines 432..448
    lib/assertions.js on lines 518..534

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

    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

        isDate: function() {
            try {
                this.success = stringValidator.isDate(this.val );
                transformErr.call(this);
            } catch (e) {
    Severity: Major
    Found in lib/assertions.js and 8 other locations - About 3 hrs to fix
    lib/assertions.js on lines 103..119
    lib/assertions.js on lines 197..214
    lib/assertions.js on lines 236..252
    lib/assertions.js on lines 381..397
    lib/assertions.js on lines 398..414
    lib/assertions.js on lines 415..431
    lib/assertions.js on lines 432..448
    lib/assertions.js on lines 518..534

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

    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

        isFullWidth: function() {
            try {
                this.success = stringValidator.isFullWidth(this.val );
                transformErr.call(this);
            } catch (e) {
    Severity: Major
    Found in lib/assertions.js and 8 other locations - About 3 hrs to fix
    lib/assertions.js on lines 103..119
    lib/assertions.js on lines 197..214
    lib/assertions.js on lines 236..252
    lib/assertions.js on lines 253..269
    lib/assertions.js on lines 398..414
    lib/assertions.js on lines 415..431
    lib/assertions.js on lines 432..448
    lib/assertions.js on lines 518..534

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

    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

        isHexadecimal: function() {
            try {
                this.success = stringValidator.isHexadecimal(this.val );
                transformErr.call(this);
            } catch (e) {
    Severity: Major
    Found in lib/assertions.js and 8 other locations - About 3 hrs to fix
    lib/assertions.js on lines 103..119
    lib/assertions.js on lines 197..214
    lib/assertions.js on lines 236..252
    lib/assertions.js on lines 253..269
    lib/assertions.js on lines 381..397
    lib/assertions.js on lines 398..414
    lib/assertions.js on lines 415..431
    lib/assertions.js on lines 518..534

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

    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

        isHalfWidth: function() {
            try {
                this.success = stringValidator.isHalfWidth(this.val );
                transformErr.call(this);
            } catch (e) {
    Severity: Major
    Found in lib/assertions.js and 8 other locations - About 3 hrs to fix
    lib/assertions.js on lines 103..119
    lib/assertions.js on lines 197..214
    lib/assertions.js on lines 236..252
    lib/assertions.js on lines 253..269
    lib/assertions.js on lines 381..397
    lib/assertions.js on lines 415..431
    lib/assertions.js on lines 432..448
    lib/assertions.js on lines 518..534

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

    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

        isAscii: function() {
            try {
                this.success = stringValidator.isAscii(this.val );
                transformErr.call(this);
            } catch (e) {
    Severity: Major
    Found in lib/assertions.js and 8 other locations - About 3 hrs to fix
    lib/assertions.js on lines 197..214
    lib/assertions.js on lines 236..252
    lib/assertions.js on lines 253..269
    lib/assertions.js on lines 381..397
    lib/assertions.js on lines 398..414
    lib/assertions.js on lines 415..431
    lib/assertions.js on lines 432..448
    lib/assertions.js on lines 518..534

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

    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

        isDataURI: function() {
            try {
                this.success = stringValidator.isDataURI(this.val );
                transformErr.call(this);
            } catch (e) {
    Severity: Major
    Found in lib/assertions.js and 8 other locations - About 3 hrs to fix
    lib/assertions.js on lines 103..119
    lib/assertions.js on lines 197..214
    lib/assertions.js on lines 253..269
    lib/assertions.js on lines 381..397
    lib/assertions.js on lines 398..414
    lib/assertions.js on lines 415..431
    lib/assertions.js on lines 432..448
    lib/assertions.js on lines 518..534

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

    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

        isJSON: function() {
            try {
                this.success = stringValidator.isJSON(this.val );
                transformErr.call(this);
            } catch (e) {
    Severity: Major
    Found in lib/assertions.js and 8 other locations - About 3 hrs to fix
    lib/assertions.js on lines 103..119
    lib/assertions.js on lines 197..214
    lib/assertions.js on lines 236..252
    lib/assertions.js on lines 253..269
    lib/assertions.js on lines 381..397
    lib/assertions.js on lines 398..414
    lib/assertions.js on lines 415..431
    lib/assertions.js on lines 432..448

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

    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 (assertion.hasOwnProperty('errors')) {
                        this.errors.push(assertion.errors);
                    } else {
                        this.errors.push(composeError.compose({
                            ErrorConstructor: this.options.validationError,
    Severity: Major
    Found in lib/conditions.js and 1 other location - About 3 hrs to fix
    lib/conditions.js on lines 63..72

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

    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 (assertion.hasOwnProperty('errors')) {
                        this.errors.push(assertion.errors);
                    } else {
                        this.errors.push(composeError.compose({
                            ErrorConstructor: this.options.validationError,
    Severity: Major
    Found in lib/conditions.js and 1 other location - About 3 hrs to fix
    lib/conditions.js on lines 136..145

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

    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

        ne: function() {
            var filter = inspectRef(this.filter, this.overallData, this.keywordPrefix);
            this.success = this.val != filter;
    
            transformErrMessage.call(this, function(context) {
    Severity: Major
    Found in lib/assertions.js and 1 other location - About 3 hrs to fix
    lib/assertions.js on lines 725..735

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

    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