RackHD/on-taskgraph

View on GitHub

Showing 100 of 247 total issues

Function getTasks has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getTasks(timeout) {
    http.request({
        hostname: server,
        port: port,
        path: tasksPath,
Severity: Minor
Found in data/templates/bootstrap.js - About 1 hr to fix

    Function swaggerController has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function swaggerController(options, callback) {
            if (typeof options === 'function') {
                callback = options;
                options = {};
            }
    Severity: Minor
    Found in lib/services/swagger-api-service.js - About 1 hr to fix

      Function validate has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          SchemaApiService.prototype.validate = function(obj, schemaName)  {
              return Promise.resolve().then(function() {
                  var basename;
      
                  // If a schemaName is specified, then validate against that
      Severity: Minor
      Found in lib/services/schema-api-service.js - About 1 hr to fix

        Function parse_snmp_host has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        def parse_snmp_host(snmpString):
            i = 0
            parsedString = ""
        
            # Replace multiple spaces with a new line
        Severity: Minor
        Found in data/templates/arista-catalog-snmp-settings.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 taskRunnerFactory has 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            Logger,
            Promise,
            graphProgressService,
            Constants,
            assert,
        Severity: Major
        Found in lib/task-runner.js - About 1 hr to fix

          Function run has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function run(done) {
              var wwidData, vdData, scsiData;
              try {
                  exec(cmdDriveWwid, options, function (err0, stdout0) {
                      if (err0) {
          Severity: Minor
          Found in data/templates/get_driveid.js - About 1 hr to fix

            Function failGraph has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                TaskScheduler.prototype.failGraph = function(data, graphState) {
                    var self = this;
                    var graphToBePublished;
                    return Rx.Observable.just(data.graphId)
                    .flatMap(store.getActiveGraphById)
            Severity: Minor
            Found in lib/task-scheduler.js - About 1 hr to fix

              Function getSwitchDiscoveryConfiguration has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  ProfileApiService.prototype.getSwitchDiscoveryConfiguration = function(node, vendor) {
                      var configuration = {
                          name: 'Graph.SKU.Switch.Discovery.Active',
                          options: {
                              defaults: {
              Severity: Minor
              Found in lib/services/profile-api-service.js - About 1 hr to fix

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

                    function start() {
                        var app = require('express')();
                        var http = require('http');
                        var swaggerTools = require('swagger-tools');
                        var rewriter = require('express-urlrewrite');
                Severity: Minor
                Found in app.js - About 1 hr to fix

                  Function load has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      Loader.prototype.load = function() {
                          var self = this;
                  
                          return Promise.all([
                              store.getTaskDefinitions(),
                  Severity: Minor
                  Found in lib/loader.js - About 1 hr to fix

                    Function completedTaskPollerFactory has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function completedTaskPollerFactory(
                        store,
                        graphProgressService,
                        eventsProtocol,
                        Logger,
                    Severity: Minor
                    Found in lib/completed-task-poller.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 eachSeries has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function eachSeries(arr, iterator, callback) {
                        callback = callback || function () {};
                    
                        if (!arr.length) {
                            return callback();
                    Severity: Minor
                    Found in data/templates/bootstrap.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 start has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        Runner.prototype.start = function(options) {
                            var self = this;
                    
                            return core.start()
                            // Remove profiles and templates from db to force reload and update file
                    Severity: Minor
                    Found in lib/task-graph-runner.js - About 1 hr to fix

                      Function subscribeCancelGraph has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          TaskScheduler.prototype.subscribeCancelGraph = function() {
                              var self = this;
                              return taskMessenger.subscribeCancelGraph(
                                  function(data) {
                                      var resolve;
                      Severity: Minor
                      Found in lib/task-scheduler.js - About 1 hr to fix

                        Function publishTaskProgress has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            NotificationApiService.prototype.publishTaskProgress = function(message) {
                                var progressData;
                                return Promise.try(function() {
                                        message.value = parseInt(message.value);
                                        message.maximum = parseInt(message.maximum);
                        Severity: Minor
                        Found in lib/services/notification-api-service.js - About 1 hr to fix

                          Function completedTaskPollerFactory has 9 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              store,
                              graphProgressService,
                              eventsProtocol,
                              Logger,
                              assert,
                          Severity: Major
                          Found in lib/completed-task-poller.js - About 1 hr to fix

                            Function taskApiServiceFactory has 9 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                taskProtocol,
                                waterline,
                                Errors,
                                util,
                                configuration,
                            Severity: Major
                            Found in lib/services/task-api-service.js - About 1 hr to fix

                              Function Runner has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function Runner(configureFile, Logger, uuid, constants,
                                              eventsProtocol, lookupService, Errors, events) {
                                  var logger = Logger.initialize('TaskGraph');
                                  var server;
                                  function start() {
                              Severity: Minor
                              Found in app.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 NotificationApiServiceFactory has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function NotificationApiServiceFactory(
                                  eventsProtocol,
                                  Logger,
                                  waterline,
                                  Errors,
                              Severity: Minor
                              Found in lib/services/notification-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 initializePipeline has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  TaskScheduler.prototype.initializePipeline = function() {
                                      /*
                                       * Before setting up the stream, make sure it is running, otherwise
                                       * this will create a stream that will never run and immediately complete.
                                       * This is basically defensive programming to try to prevent accidents where the
                              Severity: Minor
                              Found in lib/task-scheduler.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language