RackHD/on-tasks

View on GitHub
lib/jobs/base-job.js

Summary

Maintainability
F
2 wks
Test Coverage

Function baseJobFactory has 541 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function baseJobFactory(
    eventsProtocol,
    taskProtocol,
    encryption,
    lookup,
Severity: Major
Found in lib/jobs/base-job.js - About 2 days to fix

    File base-job.js has 574 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Copyright 2015, EMC, Inc.
    
    'use strict';
    
    var di = require('di');
    Severity: Major
    Found in lib/jobs/base-job.js - About 1 day to fix

      Function baseJobFactory has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
      Open

      function baseJobFactory(
          eventsProtocol,
          taskProtocol,
          encryption,
          lookup,
      Severity: Minor
      Found in lib/jobs/base-job.js - About 1 day to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function baseJobFactory has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          eventsProtocol,
          taskProtocol,
          encryption,
          lookup,
          messenger,
      Severity: Major
      Found in lib/jobs/base-job.js - About 1 hr to fix

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

            BaseJob.prototype._runIpmiCommandCallback = function(callback, data) {
                var self = this;
        
                if (!data) {
                    return;
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 1 day to fix
        lib/jobs/base-job.js on lines 279..305

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

        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

            BaseJob.prototype._runSnmpCommandCallback = function(callback, data) {
                var self = this;
        
                if (!data) {
                    return;
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 1 day to fix
        lib/jobs/base-job.js on lines 405..431

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

        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

            BaseJob.prototype._subscribeWsmanCommandResult =
                function subscribeWsmanCommandResult(uuid, command, callback) {
                var self = this;
                var deferred = messenger.subscribe(
                    Constants.Protocol.Exchanges.Task.Name,
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 5 hrs to fix
        lib/jobs/base-job.js on lines 527..541

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

        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

            BaseJob.prototype._subscribeRedfishCommandResult =
                function subscribeRedfishCommandResult(uuid, command, callback) {
                var self = this;
                var deferred = messenger.subscribe(
                    Constants.Protocol.Exchanges.Task.Name,
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 5 hrs to fix
        lib/jobs/base-job.js on lines 627..641

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

        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

            BaseJob.prototype._subscribeRedfishCommand =
                function _subscribeRedfishCommand (uuid, callback) {
                var self = this;
                var deferred = messenger.subscribe(
                    Constants.Protocol.Exchanges.Task.Name,
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 5 hrs to fix
        lib/jobs/base-job.js on lines 593..607

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

        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

            BaseJob.prototype._subscribeWsmanCommand =
                function _subscribeWsmanCommand (uuid, callback) {
                var self = this;
                var deferred = messenger.subscribe(
                    Constants.Protocol.Exchanges.Task.Name,
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 5 hrs to fix
        lib/jobs/base-job.js on lines 560..574

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

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

            BaseJob.prototype._subscribeHttpResponse = function _subscribeHttpResponse(callback) {
                var self = this;
                assert.isMongoId(self.nodeId);
                var deferred = eventsProtocol.subscribeHttpResponse(self.nodeId, callback.bind(self));
                self.subscriptionPromises.push(deferred);
        Severity: Major
        Found in lib/jobs/base-job.js and 4 other locations - About 4 hrs to fix
        lib/jobs/base-job.js on lines 175..183
        lib/jobs/base-job.js on lines 185..193
        lib/jobs/base-job.js on lines 195..203
        lib/jobs/base-job.js on lines 205..213

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

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

            BaseJob.prototype._subscribeRespondCommands = function _subscribeRespondCommands(callback) {
                var self = this;
                assert.isMongoId(self.nodeId);
                var deferred = taskProtocol.subscribeRespondCommands(self.nodeId, callback.bind(self));
                self.subscriptionPromises.push(deferred);
        Severity: Major
        Found in lib/jobs/base-job.js and 4 other locations - About 4 hrs to fix
        lib/jobs/base-job.js on lines 175..183
        lib/jobs/base-job.js on lines 185..193
        lib/jobs/base-job.js on lines 205..213
        lib/jobs/base-job.js on lines 215..223

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

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

            BaseJob.prototype._subscribeRequestProperties = function _subscribeRequestProperties(callback) {
                var self = this;
                assert.isMongoId(self.nodeId);
                var deferred = taskProtocol.subscribeRequestProperties(self.nodeId, callback.bind(self));
                self.subscriptionPromises.push(deferred);
        Severity: Major
        Found in lib/jobs/base-job.js and 4 other locations - About 4 hrs to fix
        lib/jobs/base-job.js on lines 175..183
        lib/jobs/base-job.js on lines 195..203
        lib/jobs/base-job.js on lines 205..213
        lib/jobs/base-job.js on lines 215..223

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

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

            BaseJob.prototype._subscribeRequestProfile = function _subscribeRequestProfile(callback) {
                var self = this;
                assert.isMongoId(self.nodeId);
                var deferred = taskProtocol.subscribeRequestProfile(self.nodeId, callback.bind(self));
                self.subscriptionPromises.push(deferred);
        Severity: Major
        Found in lib/jobs/base-job.js and 4 other locations - About 4 hrs to fix
        lib/jobs/base-job.js on lines 185..193
        lib/jobs/base-job.js on lines 195..203
        lib/jobs/base-job.js on lines 205..213
        lib/jobs/base-job.js on lines 215..223

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

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

            BaseJob.prototype._subscribeRequestCommands = function _subscribeRequestCommands(callback) {
                var self = this;
                assert.isMongoId(self.nodeId);
                var deferred = taskProtocol.subscribeRequestCommands(self.nodeId, callback.bind(self));
                self.subscriptionPromises.push(deferred);
        Severity: Major
        Found in lib/jobs/base-job.js and 4 other locations - About 4 hrs to fix
        lib/jobs/base-job.js on lines 175..183
        lib/jobs/base-job.js on lines 185..193
        lib/jobs/base-job.js on lines 195..203
        lib/jobs/base-job.js on lines 215..223

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

        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

            BaseJob.prototype._subscribeSnmpCommandResult =
                function _subscribeSnmpCommandResult(uuid, callback) {
        
                var self = this;
        
        
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 3 hrs to fix
        lib/jobs/base-job.js on lines 466..477

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

        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

            BaseJob.prototype._subscribeAnsibleCommand =
                function _subscribeAnsibleCommand(uuid, callback) {
                var self = this;
        
                var deferred = taskProtocol.subscribeAnsibleCommand(uuid,
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 3 hrs to fix
        lib/jobs/base-job.js on lines 265..277

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

        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

            BaseJob.prototype._publishWsmanCommandResult = function _publishWsmanCommandResult (uuid, command, result) {
                return messenger.publish( Constants.Protocol.Exchanges.Task.Name,
                    ['wsman', 'command', command, 'result', uuid].join('.'),
                    new Result({ value: result })
                );
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 2 hrs to fix
        lib/jobs/base-job.js on lines 547..554

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

        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

            BaseJob.prototype._publishRedfishCommandResult =
                function _publishRedfishCommandResult (uuid, command, result) {
                return messenger.publish(
                    Constants.Protocol.Exchanges.Task.Name,
                    ['redfish', 'command', command, 'result', uuid].join('.'),
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 2 hrs to fix
        lib/jobs/base-job.js on lines 648..653

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

        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

            BaseJob.prototype._publishRunRedfishCommand =
                function _publishRunRedfishCommand (uuid, hostData) {
                return messenger.publish(
                    Constants.Protocol.Exchanges.Task.Name,
                    'run.redfish.command' + '.' + uuid,
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 2 hrs to fix
        lib/jobs/base-job.js on lines 613..620

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

        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

            BaseJob.prototype._publishRunWsmanCommand =
                function _publishRunWsmanCommand (uuid, hostData) {
                return messenger.publish(
                    Constants.Protocol.Exchanges.Task.Name,
                    'run.wsman.command' + '.' + uuid,
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 2 hrs to fix
        lib/jobs/base-job.js on lines 580..587

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

        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 deferred = taskProtocol.subscribeIpmiCommandResult(uuid, command, function(data) {
                    if (data && data.password) {
                        data.password = encryption.decrypt(data.password);
                    }
                    callback.call(self, data);
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 1 hr to fix
        lib/jobs/base-job.js on lines 310..315

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

        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 deferred = taskProtocol.subscribeRunSnmpCommand(uuid, function(data) {
                    if (data && data.community) {
                        data.community = encryption.decrypt(data.community);
                    }
                    callback.call(self, data);
        Severity: Major
        Found in lib/jobs/base-job.js and 1 other location - About 1 hr to fix
        lib/jobs/base-job.js on lines 342..347

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

        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 _.transform(this, function(result, v, k) {
                    if (!_.contains(redactKeys, k)) {
                        result[k] = v;
                    }
                }, {});
        Severity: Minor
        Found in lib/jobs/base-job.js and 1 other location - About 40 mins to fix
        lib/task.js on lines 444..448

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

        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

        There are no issues that match your filters.

        Category
        Status