RackHD/on-taskgraph

View on GitHub

Showing 247 of 247 total issues

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

        {
            "label": "redfish-subscription",
            "taskDefinition": {
                "friendlyName": "Subscribe  To Redfish Alerting",
                "injectableName": "Task.Dell.Subscribe.Redfish.Alert",
Severity: Major
Found in lib/graphs/dell-configure-redfish-alerting-graph.js and 1 other location - About 2 hrs to fix
lib/graphs/dell-wsman-configure-redfish-alert-graph.js on lines 29..49

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

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

    function httpEventMiddleware(req, res, next) {
        req._startAt = process.hrtime();
        res.locals.ipAddress = remoteAddress(req);
        res.locals.scope = ['global'];
        res.locals.uuid = uuid.v4();
Severity: Major
Found in app.js - About 2 hrs to fix

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

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

      Function runnerFactory has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function runnerFactory(
          waterline,
          core,
          TaskScheduler,
          TaskRunner,
      Severity: Major
      Found in lib/task-graph-runner.js - About 2 hrs to fix

        Function _render has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function _render(viewName, req, res) {
                var options;
                return Promise.try(function() {
                    assert.optionalString(viewName);
                    assert.object(req);
        Severity: Major
        Found in lib/services/swagger-api-service.js - About 2 hrs to fix

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

          module.exports = {
            "friendlyName": "Docker Stop",
            "injectableName": "Graph.Docker.Stop",
            "options": {
              "docker-stop": {
          Severity: Major
          Found in lib/graphs/docker-stop-graph.js and 2 other locations - About 2 hrs to fix
          lib/graphs/docker-restart-graph.js on lines 5..22
          lib/graphs/docker-start-graph.js on lines 5..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 79.

          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

          module.exports = {
            "friendlyName": "Docker Start",
            "injectableName": "Graph.Docker.Start",
            "options": {
              "docker-start": {
          Severity: Major
          Found in lib/graphs/docker-start-graph.js and 2 other locations - About 2 hrs to fix
          lib/graphs/docker-restart-graph.js on lines 5..22
          lib/graphs/docker-stop-graph.js on lines 5..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 79.

          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

          module.exports = {
            "friendlyName": "Docker Restart",
            "injectableName": "Graph.Docker.Restart",
            "options": {
              "docker-restart": {
          Severity: Major
          Found in lib/graphs/docker-restart-graph.js and 2 other locations - About 2 hrs to fix
          lib/graphs/docker-start-graph.js on lines 5..22
          lib/graphs/docker-stop-graph.js on lines 5..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 79.

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

              ProfileApiService.prototype.runDiscovery = function(node, options) {
                  var self = this;
                  var configuration;
          
          
          
          Severity: Major
          Found in lib/services/profile-api-service.js - About 2 hrs to fix

            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 app.js and 1 other location - About 2 hrs to fix
            app.js on lines 119..126

            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 app.js and 1 other location - About 2 hrs to fix
            app.js on lines 108..115

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

                    exports.start = function(domain) {
                        var self = this;
                        domain = domain || Constants.Task.DefaultDomain;
                
                        return Promise.all([store.getGraphDefinitions(), store.getServiceGraphs()])
                Severity: Minor
                Found in lib/service-graph.js - About 2 hrs to fix

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

                  function executeTasks(data, timeout) {
                      var handleExecResult = function(_task, _done, error, stdout, stderr) {
                          _task.stdout = stdout;
                          _task.stderr = stderr;
                          _task.error = error;
                  Severity: Minor
                  Found in data/templates/bootstrap.js - About 1 hr to fix

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

                        WorkflowApiService.prototype.putWorkflowsTasksByName = function(definition, injectableName) {
                            return taskGraphStore.getTaskDefinitions(injectableName)
                                .then(function (task){
                                    if(_.isEmpty(task)){
                                        throw new Errors.NotFoundError(
                    Severity: Major
                    Found in lib/services/workflow-api-service.js and 1 other location - About 1 hr to fix
                    lib/services/workflow-api-service.js on lines 239..250

                    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

                        WorkflowApiService.prototype.deleteWorkflowsTasksByName = function(injectableName) {
                            return taskGraphStore.getTaskDefinitions(injectableName)
                                .then(function (task){
                                    if(_.isEmpty(task)){
                                        throw new Errors.NotFoundError(
                    Severity: Major
                    Found in lib/services/workflow-api-service.js and 1 other location - About 1 hr to fix
                    lib/services/workflow-api-service.js on lines 252..263

                    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

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

                        SchedulerServer.prototype.start = function() {
                            var self = this;
                    
                            return Promise.try(function() {
                                var grpc = require('grpc');
                    Severity: Minor
                    Found in api/rpc/index.js - About 1 hr to fix

                      Function runTask has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          TaskRunner.prototype.runTask = function(data) {
                              var self = this;
                              return Rx.Observable.just(data)
                                  .flatMap(function(_data) {
                                      return Task.create(
                      Severity: Minor
                      Found in lib/task-runner.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
                          Severity
                          Category
                          Status
                          Source
                          Language