RackHD/on-core

View on GitHub

Showing 184 of 326 total issues

Function mongoStoreFactory has 663 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function mongoStoreFactory(waterline, Promise, Constants, Errors, assert, _) {
    var exports = {};

    exports.publishRecordByGraphId = function (graphId, event) {
        return waterline.graphobjects.needOneMongo(
Severity: Major
Found in lib/workflow/stores/mongo.js - About 3 days to fix

    Function ModelFactory has 502 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function ModelFactory (
        pluralize,
        Promise,
        _,
        util,
    Severity: Major
    Found in lib/common/model.js - About 2 days to fix

      Function taskProtocolFactory has 411 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function taskProtocolFactory (Promise, assert, Constants, Errors, messenger, _, Result) {
          function TaskProtocol() {
          }
      
          TaskProtocol.prototype.run = function (domain, data) {
      Severity: Major
      Found in lib/protocol/task.js - About 2 days to fix

        Function eventsProtocolFactory has 344 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function eventsProtocolFactory (
            Constants,
            _,
            messenger,
            hook,
        Severity: Major
        Found in lib/protocol/events.js - About 1 day to fix

          Function constantsFactory has 325 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function constantsFactory (path) {
              var constants = Object.freeze({
                  WorkingDirectory: process.cwd(),
                  Name: process.cwd().split(path.sep).reverse()[0],
                  Host: require('os').hostname().split(/\./)[0],
          Severity: Major
          Found in lib/common/constants.js - About 1 day to fix

            Function setupDiHelper has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
            Open

            function setupDiHelper(di, defaultDirectory) {
              var resolve = require('resolve'),
                  _ = require('lodash'),
                  glob = require('glob');
            
            
            Severity: Minor
            Found in lib/di.js - About 1 day 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

            File mongo.js has 676 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // Copyright © 2015-2017 Dell Inc. or its subsidiaries.  All Rights Reserved.
            'use strict';
            
            module.exports = mongoStoreFactory;
            mongoStoreFactory.$provide = 'TaskGraph.Stores.Mongo';
            Severity: Major
            Found in lib/workflow/stores/mongo.js - About 1 day to fix

              Function lookupServiceFactory has 297 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function lookupServiceFactory(
                  Promise,
                  waterline,
                  configuration,
                  assert,
              Severity: Major
              Found in lib/services/lookup.js - About 1 day to fix

                Function taskGraphRunnerProtocolFactory has 282 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function taskGraphRunnerProtocolFactory (
                    Promise,
                    messenger,
                    Constants,
                    assert,
                Severity: Major
                Found in lib/protocol/task-graph-runner.js - About 1 day to fix

                  Function setupDiHelper has 273 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function setupDiHelper(di, defaultDirectory) {
                    var resolve = require('resolve'),
                        _ = require('lodash'),
                        glob = require('glob');
                  
                  
                  Severity: Major
                  Found in lib/di.js - About 1 day to fix

                    Function ModelFactory has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function ModelFactory (
                        pluralize,
                        Promise,
                        _,
                        util,
                    Severity: Minor
                    Found in lib/common/model.js - About 1 day 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 messengerFactory has 239 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function messengerFactory(
                        Constants,
                        Promise,
                        assert,
                        Connection,
                    Severity: Major
                    Found in lib/common/messenger.js - About 1 day to fix

                      Function dhcpProtocolFactory has 239 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function dhcpProtocolFactory (
                          Promise,
                          Constants,
                          messenger,
                          assert,
                      Severity: Major
                      Found in lib/protocol/dhcp.js - About 1 day to fix

                        Function WorkItemModelFactory has 228 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function WorkItemModelFactory (
                            Model,
                            _,
                            Promise,
                            assert,
                        Severity: Major
                        Found in lib/models/work-item.js - About 1 day to fix

                          File model.js has 528 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          // Copyright 2015, EMC, Inc.
                          
                          'use strict';
                          
                          module.exports = ModelFactory;
                          Severity: Major
                          Found in lib/common/model.js - About 1 day to fix

                            Function dbRenderableContentServiceFactory has 209 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function dbRenderableContentServiceFactory(
                                FileLoader, 
                                Constants, 
                                Promise, 
                                _, 
                            Severity: Major
                            Found in lib/common/db-renderable-content.js - About 1 day to fix

                              Function jsonSchemaValidatorFactory has 183 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function jsonSchemaValidatorFactory(
                                  Ajv,
                                  assert,
                                  nodeFs,
                                  path,
                              Severity: Major
                              Found in lib/common/json-schema-validator.js - About 7 hrs to fix

                                Function lookupServiceFactory has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function lookupServiceFactory(
                                    Promise,
                                    waterline,
                                    configuration,
                                    assert,
                                Severity: Minor
                                Found in lib/services/lookup.js - About 7 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 NodeModelFactory has 171 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function NodeModelFactory (
                                    Model,
                                    waterline,
                                    _,
                                    Promise,
                                Severity: Major
                                Found in lib/models/node.js - About 6 hrs to fix

                                  Function HttpFactory has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function HttpFactory(assert, Promise, _) {
                                      
                                      /**
                                      * Tool class that does HTTP methods
                                      * @constructor
                                  Severity: Minor
                                  Found in lib/common/http-tool.js - About 6 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language