RackHD/on-taskgraph

View on GitHub

Showing 100 of 247 total issues

Function loaderFactory has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function loaderFactory(store, taskLibrary, Logger, assert, Promise, _) {
    var logger = Logger.initialize(loaderFactory);

    /**
     * File loader class for loading graph definitions off disk, and persisting
Severity: Major
Found in lib/loader.js - About 3 hrs to fix

    Function ServiceGraph has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function ServiceGraph(TaskGraph, store, taskGraphProtocol, Constants, Promise, _) {
        var exports = {
            // Set cancelTaskGraph default timeout
            timeout: 5000
        };
    Severity: Major
    Found in lib/service-graph.js - About 3 hrs to fix

      Function MergeLossyObserver has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var MergeLossyObserver = (function () {
              function MergeLossyObserver(o, concurrentCounter, g) {
                  this.o = o;
                  this.g = g;
                  this.done = false;
      Severity: Major
      Found in lib/rx-mixins.js - About 3 hrs to fix

        Function parse_snmp_show has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

        def parse_snmp_show(snmpString):
            i = 0
            nestedArray = 0
            parsedString = ""
        
        
        Severity: Minor
        Found in data/templates/arista-catalog-snmp-settings.py - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function createAndRunGraph has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            WorkflowApiService.prototype.createAndRunGraph = function(configuration, nodeId) {
                var self = this;
                return Promise.try(function() {
                    if (!configuration.name || !_.isString(configuration.name)) {
                        throw new Errors.BadRequestError('Graph name is missing or in wrong format');
        Severity: Major
        Found in lib/services/workflow-api-service.js - About 2 hrs to fix

          Function __run has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

              def __run(self):
                  """
                  Get secure erase progress for secure erase task.
                  """
                  parser_mapper = {
          Severity: Minor
          Found in data/templates/secure_erase.py - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function schemaApiServiceFactory has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          function schemaApiServiceFactory(
              configuration,
              Logger,
              Promise,
              _,
          Severity: Minor
          Found in lib/services/schema-api-service.js - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function NotificationApiServiceFactory has 68 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function NotificationApiServiceFactory(
              eventsProtocol,
              Logger,
              waterline,
              Errors,
          Severity: Major
          Found in lib/services/notification-api-service.js - About 2 hrs to fix

            Function templateApiServiceFactory has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function templateApiServiceFactory(
                Promise,
                workflowApiService,
                taskProtocol,
                eventsProtocol,
            Severity: Major
            Found in lib/services/templates-api-service.js - About 2 hrs to fix

              File task-runner.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              // Copyright © 2016-2017 Dell Inc. or its subsidiaries.  All Rights Reserved.
              
              'use strict';
              
              var di = require('di');
              Severity: Minor
              Found in lib/task-runner.js - About 2 hrs to fix

                File workflow-api-service.js has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // Copyright © 2016-2017 Dell Inc. or its subsidiaries.  All Rights Reserved.
                
                'use strict';
                
                var di = require('di');
                Severity: Minor
                Found in lib/services/workflow-api-service.js - About 2 hrs to fix

                  Function leaseExpirationPollerFactory has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function leaseExpirationPollerFactory(
                      store,
                      Logger,
                      assert,
                      Constants,
                  Severity: Major
                  Found in lib/lease-expiration-poller.js - About 2 hrs to fix

                    Function create_jbod has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def create_jbod(disk_arg, raid_tool):
                        """
                        Create JBOD for each physical disk under a virtual disk.
                        :param disk_arg: a dictionary contains disk argument
                        :param raid_tool: tools used for JBOD creation, storcli and perccli are supported
                    Severity: Minor
                    Found in data/templates/secure_erase.py - About 2 hrs to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function httpEventMiddleware has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function httpEventMiddleware(req, res, next) {
                            req._startAt = process.hrtime();
                            res.locals.ipAddress = remoteAddress(req);
                            res.locals.scope = ['global'];
                            res.locals.uuid = uuid.v4();
                    Severity: Major
                    Found in app.js - About 2 hrs to fix

                      Function taskApiServiceFactory has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function taskApiServiceFactory(
                          taskProtocol,
                          waterline,
                          Errors,
                          util,
                      Severity: Major
                      Found in lib/services/task-api-service.js - About 2 hrs to fix

                        Function runnerFactory has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function runnerFactory(
                            waterline,
                            core,
                            TaskScheduler,
                            TaskRunner,
                        Severity: Major
                        Found in lib/task-graph-runner.js - About 2 hrs to fix

                          Function _render has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function _render(viewName, req, res) {
                                  var options;
                                  return Promise.try(function() {
                                      assert.optionalString(viewName);
                                      assert.object(req);
                          Severity: Major
                          Found in lib/services/swagger-api-service.js - About 2 hrs to fix

                            Function runDiscovery has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                ProfileApiService.prototype.runDiscovery = function(node, options) {
                                    var self = this;
                                    var configuration;
                            
                            
                            
                            Severity: Major
                            Found in lib/services/profile-api-service.js - About 2 hrs to fix

                              Function makeRenderableOptions has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function makeRenderableOptions(req, res, context, ignoreLookup) {
                                      var scope = res.locals.scope;
                                      var apiServer = util.format('http://%s:%d',
                                          config.get('apiServerAddress'),
                                          config.get('apiServerPort')
                              Severity: Major
                              Found in lib/services/swagger-api-service.js - About 2 hrs to fix

                                Function _addLinksHeader has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function _addLinksHeader(req, res, count) {
                                        var skip = req.swagger.query.$skip;
                                        var top = req.swagger.query.$top;
                                        var uriBase = req.url.split('?')[0];
                                
                                
                                Severity: Major
                                Found in lib/services/swagger-api-service.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language