fogine/json-inspector

View on GitHub
lib/assertions.js

Summary

Maintainability
F
1 mo
Test Coverage

File assertions.js has 843 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var _               = require('lodash');
var stringValidator = require('validator');

ValidatorError = require('./error/validatorError.js');

Severity: Major
Found in lib/assertions.js - About 2 days to fix

    exports has 46 functions (exceeds 20 allowed). Consider refactoring.
    Open

    var assertions = module.exports = {
        is: function() {
            if (this.filter === Object || this.filter === isMap[Object]) {
                this.success = _.isPlainObject(this.val);
            } else if (this.filter === Array || this.filter === isMap[Array]) {
    Severity: Minor
    Found in lib/assertions.js - About 6 hrs to fix

      Function like has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          like: function() {
              var keywordAny = (this.keywordPrefix || '') + 'any';
      
              if (_.isPlainObject(this.filter) && this.filter[keywordAny] instanceof Array) {
                  for (var i = 0, len = this.filter[keywordAny].length; i < len; i++) {
      Severity: Minor
      Found in lib/assertions.js - About 2 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

      Function like has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          like: function() {
              var keywordAny = (this.keywordPrefix || '') + 'any';
      
              if (_.isPlainObject(this.filter) && this.filter[keywordAny] instanceof Array) {
                  for (var i = 0, len = this.filter[keywordAny].length; i < len; i++) {
      Severity: Minor
      Found in lib/assertions.js - About 1 hr to fix

        Function hasLengthOf has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            hasLengthOf: function() {
                if (this.val instanceof Array) {
                    var defaults = {
                        min: 0,
                        max: undefined
        Severity: Minor
        Found in lib/assertions.js - About 1 hr to fix

          Function is has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              is: function() {
                  if (this.filter === Object || this.filter === isMap[Object]) {
                      this.success = _.isPlainObject(this.val);
                  } else if (this.filter === Array || this.filter === isMap[Array]) {
                      this.success = this.val instanceof Array;
          Severity: Minor
          Found in lib/assertions.js - About 1 hr to fix

            Function is has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                is: function() {
                    if (this.filter === Object || this.filter === isMap[Object]) {
                        this.success = _.isPlainObject(this.val);
                    } else if (this.filter === Array || this.filter === isMap[Array]) {
                        this.success = this.val instanceof Array;
            Severity: Minor
            Found in lib/assertions.js - About 55 mins 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

            Function hasLengthOf has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                hasLengthOf: function() {
                    if (this.val instanceof Array) {
                        var defaults = {
                            min: 0,
                            max: undefined
            Severity: Minor
            Found in lib/assertions.js - About 35 mins 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

            Function minMaxOrBoth has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            function minMaxOrBoth(def, opt, context) {
                var out = def.both;
            
                if (_.isPlainObject(opt)) {
                    context.min = opt.min;
            Severity: Minor
            Found in lib/assertions.js - About 25 mins 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 2 locations. Consider refactoring.
            Open

                between: function() {
                    if (this.filter instanceof Array) {
                        this.success = isNumeric(this.val)
                            && isNumeric(this.filter[0])
                            && isNumeric(this.filter[1]);
            Severity: Major
            Found in lib/assertions.js and 1 other location - About 1 day to fix
            lib/assertions.js on lines 775..803

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

            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

                notBetween: function() {
                    if (this.filter instanceof Array) {
                        this.success = isNumeric(this.val)
                            && isNumeric(this.filter[0])
                            && isNumeric(this.filter[1]);
            Severity: Major
            Found in lib/assertions.js and 1 other location - About 1 day to fix
            lib/assertions.js on lines 747..774

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

            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

                isFloat: function() {
                    try {
                        this.success = stringValidator.isFloat(this.val + '', this.filter || undefined);
                        transformErr.call(this);
                    } catch (e) {
            Severity: Major
            Found in lib/assertions.js and 1 other location - About 1 day to fix
            lib/assertions.js on lines 486..517

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

            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

                isInt: function() {
                    try {
                        this.success = stringValidator.isInt(this.val + '', this.filter || undefined);
                        transformErr.call(this);
                    } catch (e) {
            Severity: Major
            Found in lib/assertions.js and 1 other location - About 1 day to fix
            lib/assertions.js on lines 348..380

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

            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

                notLike: function() {
                    var messageBck = this.message;
                    var keywordAny = (this.keywordPrefix || '') + 'any';
            
                    this.success = !this.assertions.like.call(this).success;
            Severity: Major
            Found in lib/assertions.js and 1 other location - About 1 day to fix
            lib/assertions.js on lines 939..959

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

            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

                notILike: function() {
                    var messageBck = this.message;
                    var keywordAny = (this.keywordPrefix || '') + 'any';
            
                    this.success = !this.assertions.iLike.call(this).success;
            Severity: Major
            Found in lib/assertions.js and 1 other location - About 1 day to fix
            lib/assertions.js on lines 877..897

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

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

                lte: function() {
                    var filter = inspectRef(this.filter, this.overallData, this.keywordPrefix);
                    this.success = isNumeric(this.val) && isNumeric(filter);
            
                    if (this.success === true) {
            Severity: Major
            Found in lib/assertions.js and 2 other locations - About 7 hrs to fix
            lib/assertions.js on lines 659..675
            lib/assertions.js on lines 691..707

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

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

                gt: function() {
                    var filter = inspectRef(this.filter, this.overallData, this.keywordPrefix);
                    this.success = isNumeric(this.val) && isNumeric(filter);
            
                    if (this.success === true) {
            Severity: Major
            Found in lib/assertions.js and 2 other locations - About 7 hrs to fix
            lib/assertions.js on lines 691..707
            lib/assertions.js on lines 708..724

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

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

                lt: function() {
                    var filter = inspectRef(this.filter, this.overallData, this.keywordPrefix);
                    this.success = isNumeric(this.val) && isNumeric(filter);
            
                    if (this.success === true) {
            Severity: Major
            Found in lib/assertions.js and 2 other locations - About 7 hrs to fix
            lib/assertions.js on lines 659..675
            lib/assertions.js on lines 708..724

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

            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

                isEmail: function() {
                    try {
                        this.success = stringValidator.isEmail(this.val, this.filter  || undefined);
                        transformErr.call(this);
                    } catch (e) {
            Severity: Major
            Found in lib/assertions.js and 3 other locations - About 6 hrs to fix
            lib/assertions.js on lines 215..235
            lib/assertions.js on lines 326..347
            lib/assertions.js on lines 593..613

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

            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

                isCurrency: function() {
                    try {
                        this.success = stringValidator.isCurrency(this.val, this.filter || undefined);
                        transformErr.call(this);
                    } catch (e) {
            Severity: Major
            Found in lib/assertions.js and 3 other locations - About 6 hrs to fix
            lib/assertions.js on lines 305..325
            lib/assertions.js on lines 326..347
            lib/assertions.js on lines 593..613

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

            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

                isURL: function() {
                    try {
                        this.success = stringValidator.isURL(this.val, this.filter || undefined);
                        transformErr.call(this);
                    } catch (e) {
            Severity: Major
            Found in lib/assertions.js and 3 other locations - About 6 hrs to fix
            lib/assertions.js on lines 215..235
            lib/assertions.js on lines 305..325
            lib/assertions.js on lines 326..347

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

            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

                isFQDN: function() {
                    try {
                        this.success = stringValidator.isFQDN(this.val, this.filter || undefined);
                        transformErr.call(this);
                    } catch (e) {
            Severity: Major
            Found in lib/assertions.js and 3 other locations - About 6 hrs to fix
            lib/assertions.js on lines 215..235
            lib/assertions.js on lines 305..325
            lib/assertions.js on lines 593..613

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

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

                isUUID: function() {
                    try {
                        this.success = stringValidator.isUUID(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 137..154
            lib/assertions.js on lines 449..466
            lib/assertions.js on lines 467..484
            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

                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

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

                matches: function() {
                    try {
                        this.success = stringValidator.matches(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 137..154
            lib/assertions.js on lines 449..466
            lib/assertions.js on lines 467..484
            lib/assertions.js on lines 614..631

            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

                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

                isIP: function() {
                    try {
                        this.success = stringValidator.isIP(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 137..154
            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

                isISBN: function() {
                    try {
                        this.success = stringValidator.isISBN(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 137..154
            lib/assertions.js on lines 449..466
            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

                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

            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

                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

                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

                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

                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

            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

                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

                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

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

                eq: 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 736..746

            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

            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

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

                    function transformErr() {
                        transformErrMessage.call(this, function(context) {
            
                            var messageType = minMaxOrBoth({
                                both: 'between.byte',
            Severity: Major
            Found in lib/assertions.js and 1 other location - About 1 hr to fix
            lib/assertions.js on lines 569..580

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

            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

                        function transformErr() {
                            transformErrMessage.call(this, function(context) {
            
                                var messageType = minMaxOrBoth({
                                    both: 'between.string',
            Severity: Major
            Found in lib/assertions.js and 1 other location - About 1 hr to fix
            lib/assertions.js on lines 184..195

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

            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

            There are no issues that match your filters.

            Category
            Status