airbug/bugcore

View on GitHub

Showing 357 of 357 total issues

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

            this.causeMap.forEach(function(cause, key) {
                count++;
                stack += _this.type + " cause mapped to '" + key + "':\n";
                stack += cause.message + "\n";
                stack += cause.stack;
libraries/bugcore/js/src/throwable/Throwable.js on lines 235..240

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

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

        toValueCollection: function() {
            var valueCollection = new Collection();
            this.hashTable.forEach(function(value) {
                valueCollection.add(value);
            });
Severity: Major
Found in libraries/bugcore/js/src/data/Map.js and 3 other locations - About 1 hr to fix
libraries/bugcore/js/src/data/BidiMap.js on lines 281..287
libraries/bugcore/js/src/data/BidiMap.js on lines 299..305
libraries/bugcore/js/src/data/DualMap.js on lines 267..273

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

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

        toValueCollection: function() {
            var valueCollection = new Collection();
            this.keyValueHashTable.forEach(function(value) {
                valueCollection.add(value);
            });
Severity: Major
Found in libraries/bugcore/js/src/data/BidiMap.js and 3 other locations - About 1 hr to fix
libraries/bugcore/js/src/data/BidiMap.js on lines 281..287
libraries/bugcore/js/src/data/DualMap.js on lines 267..273
libraries/bugcore/js/src/data/Map.js on lines 266..272

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

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

        generateCatchHandler: function(catchFunction) {
            var forwardPromise  = new Promise();
            var handler = this.factoryCatchHandler(catchFunction, forwardPromise);
            this.handlerList.add(handler);
            return handler;
Severity: Major
Found in libraries/bugcore/js/src/promise/Promise.js and 2 other locations - About 1 hr to fix
libraries/bugcore/js/src/promise/Promise.js on lines 511..516
libraries/bugcore/js/src/promise/Promise.js on lines 535..540

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

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

        generateFinallyHandler: function(finallyFunction) {
            var forwardPromise  = new Promise();
            var handler = this.factoryFinallyHandler(finallyFunction, forwardPromise);
            this.handlerList.add(handler);
            return handler;
Severity: Major
Found in libraries/bugcore/js/src/promise/Promise.js and 2 other locations - About 1 hr to fix
libraries/bugcore/js/src/promise/Promise.js on lines 511..516
libraries/bugcore/js/src/promise/Promise.js on lines 523..528

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

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

            if (nowDate.getDate() === timestampDate.getDate() && nowDate.getMonth() === timestampDate.getMonth()) {
                stamp += DateUtil.getHour12HourClock(timestampDate) + ":" +
                    StringUtil.lpad(timestampDate.getMinutes(), "0", 2) + " " + DateUtil.getAMPM(timestampDate);
            } else {
Severity: Major
Found in libraries/bugcore/js/src/util/DateUtil.js and 1 other location - About 1 hr to fix
libraries/bugcore/js/src/util/DateUtil.js on lines 177..180

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

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

        toKeyCollection: function() {
            var keyCollection = new Collection();
            this.valueKeyHashTable.forEach(function(key) {
                keyCollection.add(key);
            });
Severity: Major
Found in libraries/bugcore/js/src/data/BidiMap.js and 3 other locations - About 1 hr to fix
libraries/bugcore/js/src/data/BidiMap.js on lines 299..305
libraries/bugcore/js/src/data/DualMap.js on lines 267..273
libraries/bugcore/js/src/data/Map.js on lines 266..272

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

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

        toValueCollection: function() {
            var valueCollection = new Collection();
            this.keyValueHashTable.forEach(function(value) {
                valueCollection.add(value);
            });
Severity: Major
Found in libraries/bugcore/js/src/data/DualMap.js and 3 other locations - About 1 hr to fix
libraries/bugcore/js/src/data/BidiMap.js on lines 281..287
libraries/bugcore/js/src/data/BidiMap.js on lines 299..305
libraries/bugcore/js/src/data/Map.js on lines 266..272

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

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

        generateCallbackHandler: function(callbackFunction) {
            var forwardPromise  = new Promise();
            var handler = this.factoryCallbackHandler(callbackFunction, forwardPromise);
            this.handlerList.add(handler);
            return handler;
Severity: Major
Found in libraries/bugcore/js/src/promise/Promise.js and 2 other locations - About 1 hr to fix
libraries/bugcore/js/src/promise/Promise.js on lines 523..528
libraries/bugcore/js/src/promise/Promise.js on lines 535..540

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

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

            if (nowDate.getDate() === timestampDate.getDate() && nowDate.getMonth() === timestampDate.getMonth()) {
                howLongAgo += DateUtil.getHour12HourClock(timestampDate) + ":" +
                    StringUtil.lpad(timestampDate.getMinutes(), "0", 2) + " " + DateUtil.getAMPM(timestampDate);
            }
Severity: Major
Found in libraries/bugcore/js/src/util/DateUtil.js and 1 other location - About 1 hr to fix
libraries/bugcore/js/src/util/DateUtil.js on lines 215..218

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

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 parse has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    Url.parse = function(urlString, options) {
        if (!options) {
            options = {};
        }
        var finalOptions = {
Severity: Minor
Found in libraries/bugcore/js/src/data/Url.js - About 1 hr to fix

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

            nextIndex: function() {
                if (this.hasNext()) {
                    this.index++;
                    return this.index;
                } else {
    Severity: Major
    Found in libraries/bugcore/js/src/core/iterators/ArrayIterator.js and 1 other location - About 1 hr to fix
    libraries/bugcore/js/src/reflect/iterators/ReflectArrayIterator.js on lines 163..170

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

    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

            findFirstTrace: function(func) {
                var rootTrace = this.getRootTrace();
                if (rootTrace) {
                    return this.findRecursive(rootTrace, func);
                } else {
    Severity: Major
    Found in libraries/bugcore/js/src/trace/TraceTree.js and 1 other location - About 1 hr to fix
    libraries/bugcore/js/src/data/Tree.js on lines 97..104

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

    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

            nextIndex: function() {
                if (this.hasNext()) {
                    this.index++;
                    return this.index;
                } else {
    libraries/bugcore/js/src/core/iterators/ArrayIterator.js on lines 147..154

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

    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

                if (Class.doesImplement(items, ICollection) || TypeUtil.isArray(items)) {
                    var insertingIndex = index;
                    var _this = this;
                    items.forEach(function(value) {
                        _this.addAt(insertingIndex, value);
    Severity: Major
    Found in libraries/bugcore/js/src/observable/data/ObservableList.js and 1 other location - About 1 hr to fix
    libraries/bugcore/js/src/data/List.js on lines 231..243

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

    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

            findFirst: function(func) {
                var rootNode = this.getRootNode();
                if (rootNode) {
                    return this.findRecursive(rootNode, func);
                } else {
    Severity: Major
    Found in libraries/bugcore/js/src/data/Tree.js and 1 other location - About 1 hr to fix
    libraries/bugcore/js/src/trace/TraceTree.js on lines 96..103

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

    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

                if (Class.doesImplement(collection, ICollection) || TypeUtil.isArray(collection)) {
                    var insertingIndex = index;
                    var _this = this;
                    collection.forEach(function(value) {
                        _this.addAt(insertingIndex, value);
    Severity: Major
    Found in libraries/bugcore/js/src/data/List.js and 1 other location - About 1 hr to fix
    libraries/bugcore/js/src/observable/data/ObservableList.js on lines 127..139

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

    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 equals has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Obj.equals = function(value1, value2) {
            if (Class.doesImplement(value1, IEquals)) {
                return value1.equals(value2);
            }
            var type1 = TypeUtil.toType(value1);
    Severity: Minor
    Found in libraries/bugcore/js/src/core/Obj.js - About 1 hr to fix

      Function toString has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              toString: function() {
                  var output = "";
                  output += this.getProtocol() + "://";
                  output += this.getHost();
                  if (this.getPort() && this.getPort() !== 80) {
      Severity: Minor
      Found in libraries/bugcore/js/src/data/Url.js - About 1 hr to fix

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

            Collections.ensureMultiListMap = function(map) {
                if (!Class.doesExtend(map, MultiListMap)) {
                    return new MultiListMap(map);
                } else {
                    return /** @type {MultiListMap.<I>} */(map);
        Severity: Major
        Found in libraries/bugcore/js/src/data/Collections.js and 5 other locations - About 1 hr to fix
        libraries/bugcore/js/src/data/Collections.js on lines 92..98
        libraries/bugcore/js/src/data/Collections.js on lines 106..112
        libraries/bugcore/js/src/data/Collections.js on lines 120..126
        libraries/bugcore/js/src/data/Collections.js on lines 147..153
        libraries/bugcore/js/src/data/Collections.js on lines 161..167

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

        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