RackHD/on-core

View on GitHub

Showing 326 of 326 total issues

Function _require has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  function _require(requireMe, provides, injects, currentDirectory, next) {
Severity: Minor
Found in lib/di.js - About 35 mins to fix

    Function _wrapper has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      function _wrapper(originalObject, wrappedObject, provide, injects, isTransientScope) {
    Severity: Minor
    Found in lib/di.js - About 35 mins to fix

      Function ValidatableFactory has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function ValidatableFactory (Promise, _, jsonschema, Errors, assert) {
      Severity: Minor
      Found in lib/common/validatable.js - About 35 mins to fix

        Function SystemUuidFactory has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function SystemUuidFactory(uuid, nodeFs, Logger, Promise, assert) {
        Severity: Minor
        Found in lib/common/system-uuid.js - About 35 mins to fix

          Function fileLoaderFactory has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function fileLoaderFactory(assert, Promise, _, nodeFs, path) {
          Severity: Minor
          Found in lib/common/file-loader.js - About 35 mins to fix

            Function hookFactory has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                _,
                assert,
                waterline,
                HttpTool,
                Promise
            Severity: Minor
            Found in lib/common/hook.js - About 35 mins to fix

              Function profileServiceFactory has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  Constants, 
                  Promise, 
                  _, 
                  DbRenderable,
                  Util ) 
              Severity: Minor
              Found in lib/common/profile.js - About 35 mins to fix

                Function request has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    Messenger.prototype.request = function (name, routingKey, data, type, timeout) {
                Severity: Minor
                Found in lib/common/messenger.js - About 35 mins to fix

                  Function connectionFactory has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function connectionFactory (assert, amqp, Promise, util, _) {
                  Severity: Minor
                  Found in lib/common/connection.js - About 35 mins to fix

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

                    function dbRenderableContentServiceFactory(
                        FileLoader, 
                        Constants, 
                        Promise, 
                        _, 
                    Severity: Minor
                    Found in lib/common/db-renderable-content.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

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

                        function UnauthorizedError(message, context) {
                            BaseError.call(this, message, context);
                            Error.captureStackTrace(this, UnauthorizedError);
                            this.status = 401;
                        }
                    Severity: Major
                    Found in lib/common/errors.js and 6 other locations - About 35 mins to fix
                    lib/common/errors.js on lines 42..46
                    lib/common/errors.js on lines 49..53
                    lib/common/errors.js on lines 63..67
                    lib/common/errors.js on lines 70..74
                    lib/common/errors.js on lines 77..81
                    lib/common/errors.js on lines 84..88

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

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

                        function NotImplementedError(message, context) {
                            BaseError.call(this, message, context);
                            Error.captureStackTrace(this, NotImplementedError);
                            this.status = 501;
                        }
                    Severity: Major
                    Found in lib/common/errors.js and 6 other locations - About 35 mins to fix
                    lib/common/errors.js on lines 42..46
                    lib/common/errors.js on lines 49..53
                    lib/common/errors.js on lines 56..60
                    lib/common/errors.js on lines 63..67
                    lib/common/errors.js on lines 70..74
                    lib/common/errors.js on lines 77..81

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

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

                        function BadRequestError(message, context) {
                            BaseError.call(this, message, context);
                            Error.captureStackTrace(this, BadRequestError);
                            this.status = 400;
                        }
                    Severity: Major
                    Found in lib/common/errors.js and 6 other locations - About 35 mins to fix
                    lib/common/errors.js on lines 49..53
                    lib/common/errors.js on lines 56..60
                    lib/common/errors.js on lines 63..67
                    lib/common/errors.js on lines 70..74
                    lib/common/errors.js on lines 77..81
                    lib/common/errors.js on lines 84..88

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

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

                        function NotFoundError(message, context) {
                            BaseError.call(this, message, context);
                            Error.captureStackTrace(this, NotFoundError);
                            this.status = 404;
                        }
                    Severity: Major
                    Found in lib/common/errors.js and 6 other locations - About 35 mins to fix
                    lib/common/errors.js on lines 42..46
                    lib/common/errors.js on lines 49..53
                    lib/common/errors.js on lines 56..60
                    lib/common/errors.js on lines 63..67
                    lib/common/errors.js on lines 77..81
                    lib/common/errors.js on lines 84..88

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

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

                        function ForbiddenError(message, context) {
                            BaseError.call(this, message, context);
                            Error.captureStackTrace(this, ForbiddenError);
                            this.status = 403;
                        }
                    Severity: Major
                    Found in lib/common/errors.js and 6 other locations - About 35 mins to fix
                    lib/common/errors.js on lines 42..46
                    lib/common/errors.js on lines 49..53
                    lib/common/errors.js on lines 56..60
                    lib/common/errors.js on lines 70..74
                    lib/common/errors.js on lines 77..81
                    lib/common/errors.js on lines 84..88

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

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

                        function InternalServerError(message, context) {
                            BaseError.call(this, message, context);
                            Error.captureStackTrace(this, InternalServerError);
                            this.status = 500;
                        }
                    Severity: Major
                    Found in lib/common/errors.js and 6 other locations - About 35 mins to fix
                    lib/common/errors.js on lines 42..46
                    lib/common/errors.js on lines 56..60
                    lib/common/errors.js on lines 63..67
                    lib/common/errors.js on lines 70..74
                    lib/common/errors.js on lines 77..81
                    lib/common/errors.js on lines 84..88

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

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

                        function ConflictError(message, context) {
                            BaseError.call(this, message, context);
                            Error.captureStackTrace(this, ConflictError);
                            this.status = 409;
                        }
                    Severity: Major
                    Found in lib/common/errors.js and 6 other locations - About 35 mins to fix
                    lib/common/errors.js on lines 42..46
                    lib/common/errors.js on lines 49..53
                    lib/common/errors.js on lines 56..60
                    lib/common/errors.js on lines 63..67
                    lib/common/errors.js on lines 70..74
                    lib/common/errors.js on lines 84..88

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

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                                    if (!alertMessage) {
                                        newState = workItem.state;
                                    } else if (!_.isEmpty(alertMessage)){
                                        accessibleAlert(alertMessage, newState);
                                    }
                    Severity: Minor
                    Found in lib/models/work-item.js and 1 other location - About 35 mins to fix
                    lib/models/work-item.js on lines 152..156

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

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                                    if (!alertMessage) {
                                        newState = workItem.state;
                                    } else if (! _.isEmpty(alertMessage)){
                                        accessibleAlert(alertMessage, newState);
                                    }
                    Severity: Minor
                    Found in lib/models/work-item.js and 1 other location - About 35 mins to fix
                    lib/models/work-item.js on lines 181..185

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

                    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

                    Avoid too many return statements within this function.
                    Open

                            return undefined;
                    Severity: Major
                    Found in lib/services/lookup.js - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language