RackHD/on-http

View on GitHub

Showing 440 of 440 total issues

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

var listSystemBiosSettings = 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 listSystemEthernetInterfaces has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var listSystemEthernetInterfaces = 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 listSystemBios has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

            function getClient() {
                return Promise.try(function() {
                    if (consul) { return consul.agent.service.list(); }
        
                    var taskGraphUrl = url.parse(
        Severity: Minor
        Found in lib/services/taskgraph-api-service.js - About 1 hr to fix

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

          function SnmpFactory (Promise, Serializable, encryption) {
          
              function Snmp (defaults) {
                  Serializable.call(this, Snmp.schema, defaults);
              }
          Severity: Minor
          Found in lib/serializables/v1/snmp.js - About 1 hr to fix

            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

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

                            return waterline.nodes.findByIdentifier(objId)
                            .then(function(obj) {
                                return env.get('config.redfish.computeType', 'Other', obj && obj.sku ? [ obj.sku ] : null );
                            })
                            .then(function(val) {
                Severity: Major
                Found in lib/api/redfish-1.0/chassis.js and 1 other location - About 1 hr to fix
                lib/api/redfish-1.0/chassis.js on lines 275..285

                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 65.

                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

                    function _alertGone(key, data) {
                        assert.equal(key, data.headers.USN);
                        var message = _.merge({}, { type: 'missing' }, data);
                        this.sendSSDPAlert(message);
                    };
                Severity: Major
                Found in lib/services/upnp-service.js and 1 other location - About 1 hr to fix
                lib/services/upnp-service.js on lines 125..129

                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 65.

                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.findByIdentifier(objId)
                                                .then(function (obj) {
                                                    return env.get('config.redfish.computeType', 'Other', obj && obj.sku ? [obj.sku] : null);
                                                })
                                                .then(function (val) {
                Severity: Major
                Found in lib/api/redfish-1.0/chassis.js and 1 other location - About 1 hr to fix
                lib/api/redfish-1.0/chassis.js on lines 210..219

                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 65.

                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

                    function _alertNew(key, data) {
                        assert.equal(key, data.headers.USN);
                        var message = _.merge({}, { type: 'present' }, data);
                        this.sendSSDPAlert(message);
                    };
                Severity: Major
                Found in lib/services/upnp-service.js and 1 other location - About 1 hr to fix
                lib/services/upnp-service.js on lines 131..135

                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 65.

                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 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

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

                          {
                              name: 'redfish',
                              config: [
                                  {
                                      key: 'uri',
                  Severity: Major
                  Found in lib/services/pollers-api-service.js and 1 other location - About 1 hr to fix
                  lib/services/pollers-api-service.js on lines 104..124

                  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 64.

                  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

                          return Promise.try(function() {
                              assert.string(name);
                          })
                          .then(function() {
                              return waterline.localusers.findOne({username: name});
                  Severity: Major
                  Found in lib/services/account-api-service.js and 1 other location - About 1 hr to fix
                  lib/services/account-api-service.js on lines 256..270

                  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 64.

                  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

                          _.forEach(obj_, function(v) {
                              if (typeof v === "object" && (v = getObjectsWithKey(v, keys)).length) {
                                  res.push.apply(res, v);
                              }
                          });
                  Severity: Major
                  Found in lib/services/schema-api-service.js and 1 other location - About 1 hr to fix
                  lib/services/sku-pack-service.js on lines 621..625

                  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 64.

                  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

                          return Promise.try(function () {
                              assert.string(name);
                          })
                          .then(function () {
                              return waterline.roles.findOne({ role: name });
                  Severity: Major
                  Found in lib/services/account-api-service.js and 1 other location - About 1 hr to fix
                  lib/services/account-api-service.js on lines 180..194

                  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 64.

                  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

                          {
                              name: 'wsman',
                              config: [
                                  {
                                      key: 'host',
                  Severity: Major
                  Found in lib/services/pollers-api-service.js and 1 other location - About 1 hr to fix
                  lib/services/pollers-api-service.js on lines 82..101

                  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 64.

                  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

                          _.forEach(obj, function(v) {
                              if (typeof v === "object" && (v = getObjectsWithKey(v, key)).length) {
                                  res.push.apply(res, v);
                              }
                          });
                  Severity: Major
                  Found in lib/services/sku-pack-service.js and 1 other location - About 1 hr to fix
                  lib/services/schema-api-service.js on lines 132..136

                  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 64.

                  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 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
                      Severity
                      Category
                      Status
                      Source
                      Language