RackHD/on-core

View on GitHub
lib/protocol/task-graph-runner.js

Summary

Maintainability
F
1 wk
Test Coverage

Function taskGraphRunnerProtocolFactory has 282 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function taskGraphRunnerProtocolFactory (
    Promise,
    messenger,
    Constants,
    assert,
Severity: Major
Found in lib/protocol/task-graph-runner.js - About 1 day to fix

    File task-graph-runner.js has 302 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Copyright 2015-2016, EMC, Inc.
    
    'use strict';
    
    module.exports = taskGraphRunnerProtocolFactory;
    Severity: Minor
    Found in lib/protocol/task-graph-runner.js - About 3 hrs to fix

      Function taskGraphRunnerProtocolFactory has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      function taskGraphRunnerProtocolFactory (
          Promise,
          messenger,
          Constants,
          assert,
      Severity: Minor
      Found in lib/protocol/task-graph-runner.js - About 1 hr 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 taskGraphRunnerProtocolFactory has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          Promise,
          messenger,
          Constants,
          assert,
          _,
      Severity: Minor
      Found in lib/protocol/task-graph-runner.js - About 45 mins to fix

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

            TaskGraphRunnerProtocol.prototype.subscribeGetTaskGraphLibrary = function (callback) {
                assert.func(callback);
        
                return messenger.subscribe(
                    Constants.Protocol.Exchanges.TaskGraphRunner.Name,
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 6 other locations - About 6 hrs to fix
        lib/protocol/dhcp.js on lines 211..229
        lib/protocol/task-graph-runner.js on lines 78..96
        lib/protocol/task-graph-runner.js on lines 113..131
        lib/protocol/task-graph-runner.js on lines 147..165
        lib/protocol/task-graph-runner.js on lines 179..197
        lib/protocol/task-graph-runner.js on lines 211..229

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

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

            TaskGraphRunnerProtocol.prototype.subscribeGetActiveTaskGraph = function (callback) {
                assert.func(callback);
        
                return messenger.subscribe(
                    Constants.Protocol.Exchanges.TaskGraphRunner.Name,
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 6 other locations - About 6 hrs to fix
        lib/protocol/dhcp.js on lines 211..229
        lib/protocol/task-graph-runner.js on lines 42..60
        lib/protocol/task-graph-runner.js on lines 78..96
        lib/protocol/task-graph-runner.js on lines 147..165
        lib/protocol/task-graph-runner.js on lines 179..197
        lib/protocol/task-graph-runner.js on lines 211..229

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

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

            TaskGraphRunnerProtocol.prototype.subscribeDefineTask = function (callback) {
                assert.func(callback);
        
                return messenger.subscribe(
                    Constants.Protocol.Exchanges.TaskGraphRunner.Name,
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 6 other locations - About 6 hrs to fix
        lib/protocol/dhcp.js on lines 211..229
        lib/protocol/task-graph-runner.js on lines 42..60
        lib/protocol/task-graph-runner.js on lines 78..96
        lib/protocol/task-graph-runner.js on lines 113..131
        lib/protocol/task-graph-runner.js on lines 147..165
        lib/protocol/task-graph-runner.js on lines 179..197

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

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

            TaskGraphRunnerProtocol.prototype.subscribeGetTaskLibrary = function (callback) {
                assert.func(callback);
        
                return messenger.subscribe(
                    Constants.Protocol.Exchanges.TaskGraphRunner.Name,
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 6 other locations - About 6 hrs to fix
        lib/protocol/dhcp.js on lines 211..229
        lib/protocol/task-graph-runner.js on lines 42..60
        lib/protocol/task-graph-runner.js on lines 113..131
        lib/protocol/task-graph-runner.js on lines 147..165
        lib/protocol/task-graph-runner.js on lines 179..197
        lib/protocol/task-graph-runner.js on lines 211..229

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

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

            TaskGraphRunnerProtocol.prototype.subscribeDefineTaskGraph = function (callback) {
                assert.func(callback);
        
                return messenger.subscribe(
                    Constants.Protocol.Exchanges.TaskGraphRunner.Name,
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 6 other locations - About 6 hrs to fix
        lib/protocol/dhcp.js on lines 211..229
        lib/protocol/task-graph-runner.js on lines 42..60
        lib/protocol/task-graph-runner.js on lines 78..96
        lib/protocol/task-graph-runner.js on lines 113..131
        lib/protocol/task-graph-runner.js on lines 147..165
        lib/protocol/task-graph-runner.js on lines 211..229

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

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

            TaskGraphRunnerProtocol.prototype.subscribeGetActiveTaskGraphs = function (callback) {
                assert.func(callback);
        
                return messenger.subscribe(
                    Constants.Protocol.Exchanges.TaskGraphRunner.Name,
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 6 other locations - About 6 hrs to fix
        lib/protocol/dhcp.js on lines 211..229
        lib/protocol/task-graph-runner.js on lines 42..60
        lib/protocol/task-graph-runner.js on lines 78..96
        lib/protocol/task-graph-runner.js on lines 113..131
        lib/protocol/task-graph-runner.js on lines 179..197
        lib/protocol/task-graph-runner.js on lines 211..229

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

        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

            TaskGraphRunnerProtocol.prototype.subscribeCancelTaskGraph = function (callback) {
                assert.func(callback);
        
                return messenger.subscribe(
                    Constants.Protocol.Exchanges.TaskGraphRunner.Name,
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 1 other location - About 6 hrs to fix
        lib/protocol/task-graph-runner.js on lines 302..320

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

        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

            TaskGraphRunnerProtocol.prototype.subscribePauseTaskGraph = function (callback) {
                assert.func(callback);
        
                return messenger.subscribe(
                    Constants.Protocol.Exchanges.TaskGraphRunner.Name,
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 1 other location - About 6 hrs to fix
        lib/protocol/task-graph-runner.js on lines 267..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 158.

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

            TaskGraphRunnerProtocol.prototype.getTaskLibrary = function (filter) {
                if (filter) {
                    assert.object(filter);
                }
        
        
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 3 other locations - About 3 hrs to fix
        lib/protocol/task-graph-runner.js on lines 28..40
        lib/protocol/task-graph-runner.js on lines 99..111
        lib/protocol/task-graph-runner.js on lines 133..145

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

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

            TaskGraphRunnerProtocol.prototype.getActiveTaskGraph = function (filter) {
                if (filter) {
                    assert.object(filter);
                }
        
        
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 3 other locations - About 3 hrs to fix
        lib/protocol/task-graph-runner.js on lines 28..40
        lib/protocol/task-graph-runner.js on lines 64..76
        lib/protocol/task-graph-runner.js on lines 133..145

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

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

            TaskGraphRunnerProtocol.prototype.getActiveTaskGraphs = function (filter) {
                if (filter) {
                    assert.object(filter);
                }
        
        
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 3 other locations - About 3 hrs to fix
        lib/protocol/task-graph-runner.js on lines 28..40
        lib/protocol/task-graph-runner.js on lines 64..76
        lib/protocol/task-graph-runner.js on lines 99..111

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

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

            TaskGraphRunnerProtocol.prototype.getTaskGraphLibrary = function (filter) {
                if (filter) {
                    assert.object(filter);
                }
        
        
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 3 other locations - About 3 hrs to fix
        lib/protocol/task-graph-runner.js on lines 64..76
        lib/protocol/task-graph-runner.js on lines 99..111
        lib/protocol/task-graph-runner.js on lines 133..145

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

        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

            TaskGraphRunnerProtocol.prototype.pauseTaskGraph = function (filter) {
                // NOTE(heckj): mandatory filter since we're passing it into messenger.request
                // without boxing it in another object
                assert.object(filter);
        
        
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 1 other location - About 2 hrs to fix
        lib/protocol/task-graph-runner.js on lines 322..334

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

        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

            TaskGraphRunnerProtocol.prototype.resumeTaskGraph = function (filter) {
                // NOTE(heckj): mandatory filter since we're passing it into messenger.request
                // without boxing it in another object
                assert.object(filter);
        
        
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 1 other location - About 2 hrs to fix
        lib/protocol/task-graph-runner.js on lines 288..300

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

        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

            TaskGraphRunnerProtocol.prototype.defineTaskGraph = function (definition) {
                // TODO: BBP what asserts to we need here?
        
                return messenger.request(
                    Constants.Protocol.Exchanges.TaskGraphRunner.Name,
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 1 other location - About 2 hrs to fix
        lib/protocol/task-graph-runner.js on lines 199..209

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

            TaskGraphRunnerProtocol.prototype.defineTask = function (definition) {
                // TODO: BBP what asserts to we need here?
        
                return messenger.request(
                    Constants.Protocol.Exchanges.TaskGraphRunner.Name,
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 1 other location - About 2 hrs to fix
        lib/protocol/task-graph-runner.js on lines 167..177

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

            TaskGraphRunnerProtocol.prototype.subscribeRunTaskGraph = function (domain, callback) {
                assert.func(callback);
        
                return messenger.subscribe(
                    Constants.Protocol.Exchanges.TaskGraphRunner.Name,
        Severity: Major
        Found in lib/protocol/task-graph-runner.js and 1 other location - About 1 hr to fix
        lib/protocol/events.js on lines 178..186

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 70.

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

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

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

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

        Refactorings

        Further Reading

        There are no issues that match your filters.

        Category
        Status