RackHD/on-tasks

View on GitHub

Showing 1,093 of 1,093 total issues

Function commandParserFactory has a Cognitive Complexity of 361 (exceeds 5 allowed). Consider refactoring.
Open

function commandParserFactory(Logger, Promise, _) {
    var logger = Logger.initialize(commandParserFactory);

    function CommandParser() { }

Severity: Minor
Found in lib/utils/job-utils/command-parser.js - About 1 wk 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 commandParserFactory has 1254 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function commandParserFactory(Logger, Promise, _) {
    var logger = Logger.initialize(commandParserFactory);

    function CommandParser() { }

Severity: Major
Found in lib/utils/job-utils/command-parser.js - About 6 days to fix

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

    module.exports = {
        friendlyName: 'Catalog mgmt bmc',
        injectableName: 'Task.Catalog.Mgmt.bmc',
        implementsTask: 'Task.Base.Ipmi.Catalog',
        options: {
    Severity: Major
    Found in lib/task-data/tasks/catalog-mgmt-bmc.js and 1 other location - About 4 days to fix
    lib/task-data/tasks/catalog-bmc.js on lines 5..202

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

    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

    module.exports = {
        friendlyName: 'Catalog bmc',
        injectableName: 'Task.Catalog.bmc',
        implementsTask: 'Task.Base.Linux.Catalog',
        options: {
    Severity: Major
    Found in lib/task-data/tasks/catalog-bmc.js and 1 other location - About 4 days to fix
    lib/task-data/tasks/catalog-mgmt-bmc.js on lines 5..202

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

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

    function DellWsmanDiscoveryJobFactory(
        BaseJob,
        WsmanTool,
        Logger,
        Promise,
    Severity: Major
    Found in lib/jobs/dell-wsman-discovery.js - About 3 days to fix

      File command-parser.js has 1262 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // Copyright 2015, EMC, Inc.
      // *** KEEP ONLY THOSE THAT ARE APPLICABLE HERE AND SET TO TRUE ***
      
      'use strict';
      
      
      Severity: Major
      Found in lib/utils/job-utils/command-parser.js - About 3 days to fix

        Function RedfishDiscoveryListJobFactory has 601 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function RedfishDiscoveryListJobFactory(
            eventsProtocol,
            BaseJob,
            Logger,
            Promise,
        Severity: Major
        Found in lib/jobs/redfish-discovery-list.js - About 3 days to fix

          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

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

                    deviceList.forEach(function(entry){
                        logger.info('Processing Storage - ' + 'TYPE: ' + entry.deviceName + ' | COUNT: ' + entry.discovered);
                        entry.discoveredDeviceInfoList.forEach(function(device){
                            var newNode = {
                                    name: device.ipAddress,
            Severity: Major
            Found in lib/jobs/dell-wsman-discovery.js and 1 other location - About 2 days to fix
            lib/jobs/dell-wsman-discovery.js on lines 415..453

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

            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

                    deviceList.forEach(function(entry){
                        logger.info('Processing IOM - ' + 'TYPE: ' + entry.deviceName + ' | COUNT: ' + entry.discovered);
                        entry.discoveredDeviceInfoList.forEach(function(device){
                            var newNode = {
                                    name: device.ipAddress,
            Severity: Major
            Found in lib/jobs/dell-wsman-discovery.js and 1 other location - About 2 days to fix
            lib/jobs/dell-wsman-discovery.js on lines 367..405

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

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

            function taskGraphFactory(
                taskLibrary,
                Task,
                store,
                taskMessenger,
            Severity: Major
            Found in lib/task-graph.js - About 2 days to fix

              Function factory has 453 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function factory(
                  configuration,
                  Logger,
                  assert,
                  Errors,
              Severity: Major
              Found in lib/task.js - About 2 days to fix

                Function redfishJobFactory has 441 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function redfishJobFactory(
                    BaseJob,
                    Logger,
                    util,
                    assert,
                Severity: Major
                Found in lib/jobs/redfish-job.js - About 2 days to fix

                  File dell-wsman-discovery.js has 804 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  // Copyright 2016, DELL EMC, Inc.
                  
                  'use strict';
                  //jshint ignore: start
                  
                  
                  Severity: Major
                  Found in lib/jobs/dell-wsman-discovery.js - About 1 day to fix

                    Function factory has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function factory(
                        configuration,
                        Logger,
                        assert,
                        Errors,
                    Severity: Minor
                    Found in lib/task.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

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

                        function UcsServiceProfileDiscoveryJob(options, context, taskId) {
                            UcsServiceProfileDiscoveryJob.super_.call(this,
                                                       logger,
                                                       options,
                                                       context,
                    Severity: Major
                    Found in lib/jobs/ucs-service-profile-discovery.js and 1 other location - About 1 day to fix
                    lib/jobs/ucs-discovery.js on lines 43..70

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                        function UcsDiscoveryJob(options, context, taskId) {
                            UcsDiscoveryJob.super_.call(this,
                                                       logger,
                                                       options,
                                                       context,
                    Severity: Major
                    Found in lib/jobs/ucs-discovery.js and 1 other location - About 1 day to fix
                    lib/jobs/ucs-service-profile-discovery.js on lines 44..71

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

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

                    function GeneralRedfishCatalogJobFactory(
                        eventsProtocol,
                        BaseJob,
                        Logger,
                        Promise,
                    Severity: Major
                    Found in lib/jobs/general-redfish-catalog.js - About 1 day to fix

                      Function EmcRedfishCatalogJobFactory has 346 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function EmcRedfishCatalogJobFactory(
                          BaseJob,
                          Logger,
                          Promise,
                          assert,
                      Severity: Major
                      Found in lib/jobs/emc-redfish-catalog.js - About 1 day to fix

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

                            LocalCatalogJob.prototype.handleResponse = function(result) {
                                var self = this;
                        
                                return parser.parseTasks(result)
                                .spread(function() {
                        Severity: Major
                        Found in lib/jobs/local-catalog.js and 1 other location - About 1 day to fix
                        lib/jobs/ipmi-catalog.js on lines 157..195

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

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

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

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

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

                        Refactorings

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language