RackHD/on-http

View on GitHub

Showing 204 of 440 total issues

Function nodeApiServiceFactory has 12 arguments (exceeds 4 allowed). Consider refactoring.
Open

    workflowApiService,
    waterline,
    Errors,
    Logger,
    _,
Severity: Major
Found in lib/services/nodes-api-service.js - About 1 hr to fix

    Function Runner has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        constants,
        HttpService,
        core,
        configuration,
        profiles,
    Severity: Major
    Found in app.js - About 1 hr to fix

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

      var getVolume = controller(function(req, res)  {
          var identifier = req.swagger.params.identifier.value;
          var index = req.swagger.params.index.value;
          var volumeIndex = req.swagger.params.volumeIndex.value;
      
      
      Severity: Minor
      Found in lib/api/redfish-1.0/systems.js - About 1 hr to fix

        Function swaggerController has 36 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 listSelLogServiceEntries has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var listSelLogServiceEntries = controller(function(req, res) {
              var identifier = req.swagger.params.identifier.value;
          
              return redfish.getVendorNameById(identifier)
              .then(function(result){
          Severity: Minor
          Found in lib/api/redfish-1.0/systems.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 taskgraphApiServiceFactory has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              function taskgraphApiServiceFactory(
                  Errors,
                  configuration,
                  Promise,
                  _
              Severity: Minor
              Found in lib/services/taskgraph-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 NodeFactory has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              function NodeFactory (
                  Promise,
                  Serializable,
                  ObmSerializable,
                  SnmpSerializable,
              Severity: Minor
              Found in lib/serializables/v1/node.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 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function start() {
                      return core.start()
                          .then(function() {
                              return Promise.all([views.load()]);
                          })
              Severity: Minor
              Found in app.js - About 1 hr to fix

                Function getLcLogServiceEntry has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var getLcLogServiceEntry = controller(function(req, res)  {
                    var identifier = req.swagger.params.identifier.value;
                    var entryId = req.swagger.params.entryId.value;
                
                    return redfish.getVendorNameById(identifier)
                Severity: Minor
                Found in lib/api/redfish-1.0/systems.js - About 1 hr to fix

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

                      return function swaggerSerdes(context, next) {
                          var serdesNameKey = fittingDef.serdesNameKey;
                          var operation = context.request.swagger.operation;
                          var serdesName;
                          var serdes;
                  Severity: Minor
                  Found in lib/fittings/swagger_serdes.js - About 1 hr to fix

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

                    module.exports = function create(fittingDef, bagpipes) {
                        injector = require('../../index.js').injector;
                        var authz = injector.get('Http.Services.Api.Account');
                        var swaggerNodeRunner = bagpipes.config.swaggerNodeRunner;
                        var ready = loadSwagger(authz, swaggerNodeRunner.swagger);
                    Severity: Minor
                    Found in lib/fittings/swagger_authz.js - About 1 hr to fix

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

                      var getLocalEthernetInterface = controller(function(req, res) {
                          var options = redfish.makeOptions(req, res);
                          var index = req.swagger.params.index.value;
                          return Promise.try(function() {
                          var net = _.get(os.networkInterfaces(), index);
                      Severity: Minor
                      Found in lib/api/redfish-1.0/managers.js - About 1 hr to fix

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

                        function generatePdf(swaggerFile) {
                            fs.readFile(swaggerFile, {encoding: 'utf8'}, function (err, swaggerData) {
                                if (err) {
                                    return console.log(err);
                                }
                        Severity: Minor
                        Found in extra/swagger-doc.js - About 1 hr to fix

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

                          function hookApiServiceFactory(
                              waterline,
                              Logger,
                              _,
                              Errors,
                          Severity: Minor
                          Found in lib/services/hooks-api-service.js - About 1 hr to fix

                            Function onHttpContextFactory has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function onHttpContextFactory(di, directory) {
                                di = di || _di;
                            
                                var core = onCore(di, directory),
                                    helper = core.helper;
                            Severity: Minor
                            Found in index.js - About 1 hr to fix

                              Function listManagerEthernetInterfaces has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              var listManagerEthernetInterfaces = controller(function(req, res) {
                                  var identifier = req.swagger.params.identifier.value;
                                  var options = redfish.makeOptions(req, res, identifier);
                              
                                  return redfish.getVendorNameById(identifier)
                              Severity: Minor
                              Found in lib/api/redfish-1.0/managers.js - About 1 hr to fix

                                Function taskApiServiceFactory has 10 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 ibmsPatchById has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  var ibmsPatchById = controller( function(req) {
                                      var ibmId = req.swagger.params.identifier.value;
                                      var values = req.swagger.params.body.value;
                                      return waterline.ibms.needByIdentifier(ibmId)
                                          .then(function(oldIbm) {
                                  Severity: Minor
                                  Found in lib/api/2.0/ibms.js - About 1 hr to fix

                                    Function createSubscription has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    var createSubscription = controller(function(req, res) {
                                        var options = redfish.makeOptions(req, res);
                                        var event = req.swagger.params.payload.value;
                                        return redfish.validateSchema(event,
                                            'EventDestination.v1_1_1.json#/definitions/EventDestination'
                                    Severity: Minor
                                    Found in lib/api/redfish-1.0/event-service.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language