RackHD/on-http

View on GitHub

Showing 440 of 440 total issues

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

    UPnPService.prototype.start = function() {
        var self = this;
        var endpoint = _.first(self.northbound) || {
            httpsEnabled: false, 
            address: ip.address(), 
Severity: Major
Found in lib/services/upnp-service.js - About 2 hrs to fix

    File taskgraph-api-service.js has 253 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Copyright 2016, EMC, Inc.
    
    'use strict';
    
    var di = require('di');
    Severity: Minor
    Found in lib/services/taskgraph-api-service.js - About 2 hrs to fix

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

          FileStreamer.prototype.verify = function(uuid, backend) {
              backend = backend || this.defaultBackend;
              assert.ok(backend in this.backEnds, "fileService backend");
      
              return this.backEnds[backend].getMeta(uuid);
      Severity: Major
      Found in lib/services/file-service.js and 2 other locations - About 2 hrs to fix
      lib/services/file-service.js on lines 59..65
      lib/services/file-service.js on lines 90..95

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

      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 3 locations. Consider refactoring.
      Open

          FileStreamer.prototype.delete = function(uuid, backend) {
              backend = backend || this.defaultBackend;
              assert.ok(backend in this.backEnds, "fileService backend");
      
              return this.backEnds[backend].delete(uuid);
      Severity: Major
      Found in lib/services/file-service.js and 2 other locations - About 2 hrs to fix
      lib/services/file-service.js on lines 59..65
      lib/services/file-service.js on lines 97..102

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

      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

                          logger.error(
                              'http: ' + req.method +
                              ' ' + res.statusCode +
                              ' ' + ms.toFixed(3) +
                              ' - ' + res.locals.uuid +
      Severity: Major
      Found in lib/services/http-service.js and 1 other location - About 2 hrs to fix
      lib/services/http-service.js on lines 328..335

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

      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

                  logger.debug(
                      'http: ' + req.method +
                      ' ' + res.statusCode +
                      ' ' + ms.toFixed(3) +
                      ' - ' + res.locals.uuid +
      Severity: Major
      Found in lib/services/http-service.js and 1 other location - About 2 hrs to fix
      lib/services/http-service.js on lines 339..346

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

      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 3 locations. Consider refactoring.
      Open

          FileStreamer.prototype.get = function(uuid, backend) {
              backend = backend || this.defaultBackend;
              assert.ok(backend in this.backEnds, "fileService backend");
      
              return this.backEnds[backend].get(uuid);
      Severity: Major
      Found in lib/services/file-service.js and 2 other locations - About 2 hrs to fix
      lib/services/file-service.js on lines 90..95
      lib/services/file-service.js on lines 97..102

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

      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 _addLinksHeader has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function _addLinksHeader(req, res, count) {
              var skip = req.swagger.query.$skip;
              var top = req.swagger.query.$top;
              var uriBase = req.url.split('?')[0];
      
      
      Severity: Major
      Found in lib/services/swagger-api-service.js - About 2 hrs to fix

        Function makeRenderableOptions has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function makeRenderableOptions(req, res, context, ignoreLookup) {
                var scope = res.locals.scope;
                var apiServer = util.format('http://%s:%d',
                    config.get('apiServerAddress'),
                    config.get('apiServerPort')
        Severity: Major
        Found in lib/services/swagger-api-service.js - About 2 hrs to fix

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

          var listSystemProcessors = 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 2 hrs to fix

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

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

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

              function taskApiServiceFactory(
                  taskProtocol,
                  waterline,
                  Errors,
                  util,
              Severity: Minor
              Found in lib/services/task-api-service.js - About 2 hrs to fix

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

                function Runner(
                    constants,
                    HttpService,
                    core,
                    configuration,
                Severity: Minor
                Found in app.js - About 2 hrs to fix

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

                  function ObmFactory (
                      Promise,
                      Serializable,
                      _,
                      encryption
                  Severity: Minor
                  Found in lib/serializables/v1/obm.js - About 2 hrs to fix

                    Function skuPackServiceFactory has 16 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        _,
                        waterline,
                        Logger,
                        FileLoader,
                        Templates,
                    Severity: Major
                    Found in lib/services/sku-pack-service.js - About 2 hrs to fix

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

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

                        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, 'ibms');
                                                })
                                                .catch(function (error) {
                        Severity: Major
                        Found in lib/api/2.0/ibms.js and 1 other location - About 1 hr to fix
                        lib/api/2.0/ibms.js on lines 82..88

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

                        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

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

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

                        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

                        var getSessionService = controller(function(req, res) {
                            var options = redfish.makeOptions(req, res);
                            return redfish.render('redfish.1.0.0.sessionservice.1.0.0.json', 
                                         'SessionService.v1_1_1.json#/definitions/SessionService',
                                          options)
                        Severity: Major
                        Found in lib/api/redfish-1.0/session-service.js and 1 other location - About 1 hr to fix
                        lib/api/redfish-1.0/account-service.js on lines 15..23

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

                        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

                        var getAccountService = controller(function(req, res) {
                            var options = redfish.makeOptions(req, res);
                            return redfish.render('redfish.1.0.0.accountservice.1.0.0.json', 
                                         'AccountService.v1_1_0.json#/definitions/AccountService',
                                          options)
                        Severity: Major
                        Found in lib/api/redfish-1.0/account-service.js and 1 other location - About 1 hr to fix
                        lib/api/redfish-1.0/session-service.js on lines 14..22

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

                        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