RackHD/on-taskgraph

View on GitHub

Showing 100 of 247 total issues

Function start has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    exports.start = function(domain) {
        var self = this;
        domain = domain || Constants.Task.DefaultDomain;

        return Promise.all([store.getGraphDefinitions(), store.getServiceGraphs()])
Severity: Minor
Found in lib/service-graph.js - About 2 hrs to fix

    Function executeTasks has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function executeTasks(data, timeout) {
        var handleExecResult = function(_task, _done, error, stdout, stderr) {
            _task.stdout = stdout;
            _task.stderr = stderr;
            _task.error = error;
    Severity: Minor
    Found in data/templates/bootstrap.js - About 1 hr to fix

      Function start has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          SchedulerServer.prototype.start = function() {
              var self = this;
      
              return Promise.try(function() {
                  var grpc = require('grpc');
      Severity: Minor
      Found in api/rpc/index.js - About 1 hr to fix

        Function runTask has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            TaskRunner.prototype.runTask = function(data) {
                var self = this;
                return Rx.Observable.just(data)
                    .flatMap(function(_data) {
                        return Task.create(
        Severity: Minor
        Found in lib/task-runner.js - About 1 hr to fix

          Function taskSchedulerFactory has 15 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              eventsProtocol,
              store,
              LeaseExpirationPoller,
              Constants,
              Logger,
          Severity: Major
          Found in lib/task-scheduler.js - About 1 hr to fix

            Function profileApiServiceFactory has 15 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                Promise,
                workflowApiService,
                taskProtocol,
                eventsProtocol,
                waterline,
            Severity: Major
            Found in lib/services/profile-api-service.js - About 1 hr to fix

              Function swaggerFactory has 15 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  Promise,
                  Errors,
                  _,
                  injector,
                  views,
              Severity: Major
              Found in lib/services/swagger-api-service.js - About 1 hr to fix

                Function parseDriveWwid has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function parseDriveWwid(idList) {
                    //idList example
                    //"lrwxrwxrwx. 1 root root  9 Nov 18 20:30 ata-SATADOM-SV_3SE_20150522AA9992050085 -> ../../sdb"
                    //returned string example
                    // "ata-SATADOM-SV_3SE_20150522AA9992050085->../../sdb"
                Severity: Minor
                Found in data/templates/get_driveid.js - About 1 hr to fix

                  Function start has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      TaskScheduler.prototype.start = function() {
                          var self = this;
                          return Promise.resolve()
                          .then(function() {
                              self.running = true;
                  Severity: Minor
                  Found in lib/task-scheduler.js - About 1 hr to fix

                    Function templateApiServiceFactory has 14 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        Promise,
                        workflowApiService,
                        taskProtocol,
                        eventsProtocol,
                        waterline,
                    Severity: Major
                    Found in lib/services/templates-api-service.js - About 1 hr to fix

                      Function workflowApiServiceFactory has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function workflowApiServiceFactory(
                          taskGraphProtocol,
                          taskGraphStore,
                          waterline,
                          TaskGraph,
                      Severity: Minor
                      Found in lib/services/workflow-api-service.js - About 1 hr 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 parse_version has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def parse_version(versionString):
                          i = 0
                          parsedString = ""
                      
                          # Remove blank lines and spaces
                      Severity: Minor
                      Found in data/templates/arista-catalog-version.py - About 1 hr 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 runnerFactory has 14 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          waterline,
                          core,
                          TaskScheduler,
                          TaskRunner,
                          LeaseExpirationPoller,
                      Severity: Major
                      Found in lib/task-graph-runner.js - About 1 hr to fix

                        Function templateApiServiceFactory has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function templateApiServiceFactory(
                            Promise,
                            workflowApiService,
                            taskProtocol,
                            eventsProtocol,
                        Severity: Minor
                        Found in lib/services/templates-api-service.js - About 1 hr 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 buildDriveMap has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function buildDriveMap(wwidData, vdData, scsiData) {
                            var parsedWwids = parseDriveWwid(wwidData),
                                scsiList = parseScsiInfo(scsiData),
                                vdList = parseVdInfo(vdData);
                            var linuxWwids = parsedWwids.linuxDriveIds, esxiWwids = parsedWwids.esxiDriveIds;
                        Severity: Minor
                        Found in data/templates/get_driveid.js - About 1 hr to fix

                          Function updateTasks has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function updateTasks(data, timeout, retry, retries) {
                          
                              var request = http.request({
                                  hostname: server,
                                  port: port,
                          Severity: Minor
                          Found in data/templates/bootstrap.js - About 1 hr to fix

                            Function workflowApiServiceFactory has 13 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                taskGraphProtocol,
                                taskGraphStore,
                                waterline,
                                TaskGraph,
                                eventsProtocol,
                            Severity: Major
                            Found in lib/services/workflow-api-service.js - About 1 hr to fix

                              Function handlePotentialFinishedGraph has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  CompletedTaskPoller.prototype.handlePotentialFinishedGraph = function(data) {
                                      var self = this;
                                      assert.object(data, 'data');
                                      assert.string(data.state, 'data.state');
                              
                              
                              Severity: Minor
                              Found in lib/completed-task-poller.js - About 1 hr to fix

                                Function templatesGetByName has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    TemplateApiService.prototype.templatesGetByName = function(req, res) {
                                        return Promise.resolve()
                                            .then(function() {
                                                var nodeId = req.query.nodeId;
                                                var macs = req.query.macs;
                                Severity: Minor
                                Found in lib/services/templates-api-service.js - About 1 hr to fix

                                  Function getProfiles has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      ProfileApiService.prototype.getProfiles = function(req, query, res) {
                                          var self = this;
                                          var ipAddress = res.locals.ipAddress;
                                          return self.getMacAddressInRequest(query, ipAddress)
                                          .then(function(macAddress) {
                                  Severity: Minor
                                  Found in lib/services/profile-api-service.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language