airbug/bugcore

View on GitHub
libraries/bugcore/js/src/promise/Promise.js

Summary

Maintainability
D
2 days
Test Coverage

File Promise.js has 297 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (c) 2016 airbug Inc. http://airbug.com
 *
 * bugcore may be freely distributed under the MIT license.
 */
Severity: Minor
Found in libraries/bugcore/js/src/promise/Promise.js - About 3 hrs to fix

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

            validateIterables: function(iterables) {
                iterables.forEach(function(iterable) {
                    if (!TypeUtil.isArray(iterable) && !Class.doesImplement(iterable, IIterable)) {
                        throw Throwables.bug('TypeError', {}, 'Expecting an array or an iterable object but got ' + iterable);
                    }
    Severity: Major
    Found in libraries/bugcore/js/src/promise/Promise.js and 1 other location - About 2 hrs to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 596..602

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

    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

            validateObjects: function(objects) {
                objects.forEach(function(object) {
                    if (!TypeUtil.isObject(object) && !Class.doesImplement(object, IMap)) {
                        throw Throwables.bug('TypeError', {}, 'Expecting an object or an IMap but got ' + object);
                    }
    Severity: Major
    Found in libraries/bugcore/js/src/promise/Promise.js and 1 other location - About 2 hrs to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 583..589

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

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

            resolveProps: function(objects) {
                this.validatePromiseState();
                this.validateObjects(objects);
                this.doResolveProps(objects);
                return this;
    Severity: Minor
    Found in libraries/bugcore/js/src/promise/Promise.js and 2 other locations - About 40 mins to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 319..324
    libraries/bugcore/js/src/promise/Promise.js on lines 341..346

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

    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

            resolveRace: function(iterables) {
                this.validatePromiseState();
                this.validateIterables(iterables);
                this.doResolveRace(iterables);
                return this;
    Severity: Minor
    Found in libraries/bugcore/js/src/promise/Promise.js and 2 other locations - About 40 mins to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 319..324
    libraries/bugcore/js/src/promise/Promise.js on lines 330..335

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

    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

            catch: function(catchFunction) {
                var handler = this.generateCatchHandler(catchFunction);
                this.processHandlers();
                return handler.getForwardPromise();
            },
    Severity: Minor
    Found in libraries/bugcore/js/src/promise/Promise.js and 1 other location - About 40 mins to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 289..293

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

    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

            finally: function(finallyFunction) {
                var handler = this.generateFinallyHandler(finallyFunction);
                this.processHandlers();
                return handler.getForwardPromise();
            },
    Severity: Minor
    Found in libraries/bugcore/js/src/promise/Promise.js and 1 other location - About 40 mins to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 279..283

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

    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

            resolveAll: function(iterables) {
                this.validatePromiseState();
                this.validateIterables(iterables);
                this.doResolveAll(iterables);
                return this;
    Severity: Minor
    Found in libraries/bugcore/js/src/promise/Promise.js and 2 other locations - About 40 mins to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 330..335
    libraries/bugcore/js/src/promise/Promise.js on lines 341..346

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

    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

        Promise.reject = function(reason) {
            return Promise.promise()
                .reject(ArgUtil.toArray(arguments));
        };
    Severity: Major
    Found in libraries/bugcore/js/src/promise/Promise.js and 3 other locations - About 35 mins to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 669..672
    libraries/bugcore/js/src/promise/Promise.js on lines 679..682
    libraries/bugcore/js/src/promise/Promise.js on lines 699..702

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

    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

        Promise.resolve = function(value) {
            return Promise.promise()
                .resolve(ArgUtil.toArray(arguments));
        };
    Severity: Major
    Found in libraries/bugcore/js/src/promise/Promise.js and 3 other locations - About 35 mins to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 669..672
    libraries/bugcore/js/src/promise/Promise.js on lines 679..682
    libraries/bugcore/js/src/promise/Promise.js on lines 689..692

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

    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

        Promise.props = function(object) {
            return Promise.promise()
                .resolveProps(ArgUtil.toArray(arguments));
        };
    Severity: Major
    Found in libraries/bugcore/js/src/promise/Promise.js and 3 other locations - About 35 mins to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 679..682
    libraries/bugcore/js/src/promise/Promise.js on lines 689..692
    libraries/bugcore/js/src/promise/Promise.js on lines 699..702

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

    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

        Promise.race = function(iterable) {
            return Promise.promise()
                .resolveRace(ArgUtil.toArray(arguments));
        };
    Severity: Major
    Found in libraries/bugcore/js/src/promise/Promise.js and 3 other locations - About 35 mins to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 669..672
    libraries/bugcore/js/src/promise/Promise.js on lines 689..692
    libraries/bugcore/js/src/promise/Promise.js on lines 699..702

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

    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

            doResolveRace: function(iterables) {
                this.resolver   = Resolvers.resolveRace([this], iterables);
                this.doResolve();
            },
    Severity: Major
    Found in libraries/bugcore/js/src/promise/Promise.js and 3 other locations - About 30 mins to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 433..436
    libraries/bugcore/js/src/promise/Promise.js on lines 442..445
    libraries/bugcore/js/src/promise/Promise.js on lines 460..463

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

    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

            doResolveProps: function(objects) {
                this.resolver   = Resolvers.resolveProps([this], objects);
                this.doResolve();
            },
    Severity: Major
    Found in libraries/bugcore/js/src/promise/Promise.js and 3 other locations - About 30 mins to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 433..436
    libraries/bugcore/js/src/promise/Promise.js on lines 451..454
    libraries/bugcore/js/src/promise/Promise.js on lines 460..463

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

    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

            doResolveAll: function(iterables) {
                this.resolver   = Resolvers.resolveAll([this], iterables);
                this.doResolve();
            },
    Severity: Major
    Found in libraries/bugcore/js/src/promise/Promise.js and 3 other locations - About 30 mins to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 442..445
    libraries/bugcore/js/src/promise/Promise.js on lines 451..454
    libraries/bugcore/js/src/promise/Promise.js on lines 460..463

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

    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

            doResolveValues: function(values) {
                this.resolver   = Resolvers.resolveValues([this], values);
                this.doResolve();
            },
    Severity: Major
    Found in libraries/bugcore/js/src/promise/Promise.js and 3 other locations - About 30 mins to fix
    libraries/bugcore/js/src/promise/Promise.js on lines 433..436
    libraries/bugcore/js/src/promise/Promise.js on lines 442..445
    libraries/bugcore/js/src/promise/Promise.js on lines 451..454

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

    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