RackHD/on-http

View on GitHub

Showing 440 of 440 total issues

Function getManagerSerialInterface has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var getManagerSerialInterface = controller(function (req, res) {
    var identifier = req.swagger.params.identifier.value;
    var options = redfish.makeOptions(req, res);
    var index = req.swagger.params.index.raw;

Severity: Minor
Found in lib/api/redfish-1.0/managers.js - About 1 hr to fix

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

    module.exports = function create(__, ___, injector) {
        injector = injector || require('../../index.js').injector;
        var _ = injector.get('_');
        var swaggerService = injector.get('Http.Services.Swagger');
        var conf = injector.get('Services.Configuration');
    Severity: Minor
    Found in lib/fittings/error_handler.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 UPnPServiceFactory has 15 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            _,
            waterline,
            Logger,
            Profiles,
            Promise,
        Severity: Major
        Found in lib/services/upnp-service.js - About 1 hr to fix

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                      return nodeApi.setNodeWorkflowById({
                          name: graphName,
                          options: graphOptions
                      }, identifier)
                      .then(function(graph) {
          Severity: Major
          Found in lib/api/redfish-1.0/systems.js and 1 other location - About 1 hr to fix
          lib/api/redfish-1.0/systems.js on lines 616..666

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 72.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

              return redfish.getVendorNameById(identifier)
              .then(function(result){
                  identifier = result.node.id;
                  if (result.vendor === 'Dell') {
                      var graph = {
          Severity: Major
          Found in lib/api/redfish-1.0/systems.js and 1 other location - About 1 hr to fix
          lib/api/redfish-1.0/systems.js on lines 2289..2297

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 72.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

              StaticFilesApiService.prototype.walkDirectory = function(dir) {
                  return new Promise(function(resolve, reject) {
                      var walkResults = [];
                      if (typeof dir !== 'string') {
                          console.error("[ERROR] Object of type " + typeof dir + 
          Severity: Minor
          Found in lib/services/static-files-api-service.js - About 1 hr to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                        if(conf.taskRoot) {
                            var taskRoot = skuRoot + path.resolve('/', conf.taskRoot);
                            cleanup = unloadWorkflowItems(skuid, taskRoot, waterline.taskdefinitions);
                            promises.push(Promise.all(cleanup));
                        }
            Severity: Major
            Found in lib/services/sku-pack-service.js and 1 other location - About 1 hr to fix
            lib/services/sku-pack-service.js on lines 422..426

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 71.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                        if(conf.workflowRoot) {
                            var workflowRoot = skuRoot + path.resolve('/', conf.workflowRoot);
                            cleanup = unloadWorkflowItems(skuid, workflowRoot, waterline.graphdefinitions);
                            promises.push(Promise.all(cleanup));
                        }
            Severity: Major
            Found in lib/services/sku-pack-service.js and 1 other location - About 1 hr to fix
            lib/services/sku-pack-service.js on lines 428..432

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 71.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

            function tagApiServiceFactory(
                waterline,
                Promise,
                workflowApiService,
                Errors,
            Severity: Minor
            Found in lib/services/tags-api-service.js - About 1 hr to fix

              Function listManagerSerialInterfaces has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var listManagerSerialInterfaces = 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 doBootImage has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

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

                      configuration,
                      Logger,
                      Promise,
                      _,
                      nodeFs,
                  Severity: Major
                  Found in lib/services/redfish-api-service.js - About 1 hr to fix

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

                        eventsProtocol,
                        configuration,
                        lookupService,
                        swagger,
                        Logger,
                    Severity: Major
                    Found in lib/services/http-service.js - About 1 hr to fix

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                                          waterline.nodes.getNodeById(oldNode.id)
                                          .then(function (newNode) {
                                              return eventsProtocol.publishNodeAttrEvent(oldNode, newNode, 'obms');
                                          })
                                          .catch(function (error) {
                      Severity: Major
                      Found in lib/services/obm-api-service.js and 1 other location - About 1 hr to fix
                      lib/services/obm-api-service.js on lines 280..286

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 70.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          if (req.body.type) {
                              req.body.name = Constants.WorkItems.Pollers[req.body.type.toUpperCase()];
                              delete req.body.type;
                          }
                      Severity: Major
                      Found in lib/api/2.0/pollers.js and 1 other location - About 1 hr to fix
                      lib/api/2.0/pollers.js on lines 58..61

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 70.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          TemplateApiService.prototype.templatesLibPut = function (name, body, scope) {
                              var self = this;
                              return self.FileStreaming(name, body, scope)
                                  .then (function(data){
                                      return taskgraphService.templatesLibPut(name, data, scope);
                      Severity: Major
                      Found in lib/services/templates-api-service.js and 1 other location - About 1 hr to fix
                      lib/services/profiles-api-service.js on lines 39..45

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 70.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                                              return waterline.nodes.getNodeById(oldNode.id)
                                              .then(function(newNode) {
                                                  return eventsProtocol.publishNodeAttrEvent(oldNode, newNode, 'obms');
                                              })
                                              .catch(function (error) {
                      Severity: Major
                      Found in lib/services/obm-api-service.js and 1 other location - About 1 hr to fix
                      lib/services/obm-api-service.js on lines 308..314

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 70.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          if (req.query.type) {
                              req.query.name = Constants.WorkItems.Pollers[req.query.type.toUpperCase()];
                              delete req.query.type;
                          }
                      Severity: Major
                      Found in lib/api/2.0/pollers.js and 1 other location - About 1 hr to fix
                      lib/api/2.0/pollers.js on lines 139..142

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 70.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          ProfileApiService.prototype.profilesPutLibByName = function (name, body, scope) {
                              var self = this;
                              return self.FileStreaming(name, body, scope)
                                  .then (function(data){
                                      return taskgraphService.profilesPutLibByName(name, data, scope);
                      Severity: Major
                      Found in lib/services/profiles-api-service.js and 1 other location - About 1 hr to fix
                      lib/services/templates-api-service.js on lines 35..41

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 70.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language