RackHD/on-taskgraph

View on GitHub

Showing 247 of 247 total issues

Function schemaApiServiceFactory has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

function schemaApiServiceFactory(
    configuration,
    Logger,
    Promise,
    _,
Severity: Minor
Found in lib/services/schema-api-service.js - About 2 hrs 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 __run has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    def __run(self):
        """
        Get secure erase progress for secure erase task.
        """
        parser_mapper = {
Severity: Minor
Found in data/templates/secure_erase.py - About 2 hrs 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 NotificationApiServiceFactory has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function NotificationApiServiceFactory(
    eventsProtocol,
    Logger,
    waterline,
    Errors,
Severity: Major
Found in lib/services/notification-api-service.js - About 2 hrs to fix

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

        LeaseExpirationPoller.prototype.handleStreamError = function(msg, err) {
            logger.error(msg, {
                schedulerId: this.schedulerId,
                // stacks on some error objects (particularly from the assert library)
                // don't get printed if part of the error object so separate them out here.
    Severity: Major
    Found in lib/lease-expiration-poller.js and 2 other locations - About 2 hrs to fix
    lib/task-runner.js on lines 313..322
    lib/task-scheduler.js on lines 571..580

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

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

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

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

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

    Refactorings

    Further Reading

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

        TaskScheduler.prototype.handleStreamError = function(msg, err) {
            logger.error(msg, {
                schedulerId: this.schedulerId,
                // stacks on some error objects (particularly from the assert library)
                // don't get printed if part of the error object so separate them out here.
    Severity: Major
    Found in lib/task-scheduler.js and 2 other locations - About 2 hrs to fix
    lib/lease-expiration-poller.js on lines 113..122
    lib/task-runner.js on lines 313..322

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

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

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

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

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

    Refactorings

    Further Reading

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

        TaskRunner.prototype.handleStreamError = function(msg, err) {
            logger.error(msg, {
                taskRunnerId: this.taskRunnerId,
                // stacks on some error objects don't get printed if part of
                // the error object so separate them out here
    Severity: Major
    Found in lib/task-runner.js and 2 other locations - About 2 hrs to fix
    lib/lease-expiration-poller.js on lines 113..122
    lib/task-scheduler.js on lines 571..580

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

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

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

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

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

    Refactorings

    Further Reading

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

    module.exports = {
        friendlyName: 'Dell WSMAN Export SCP',
        injectableName: 'Graph.Dell.Wsman.Export.SCP',
        options: {
            defaults: {
    Severity: Major
    Found in lib/graphs/dell-wsman-export-scp-graph.js and 2 other locations - About 2 hrs to fix
    lib/graphs/dell-wsman-os-deployment-create-graph.js on lines 5..25
    lib/graphs/run-rest-command-graph.js on lines 5..25

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

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

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

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

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

    Refactorings

    Further Reading

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

    module.exports = {
        friendlyName: 'Run rest command',
        injectableName: 'Graph.Run.Rest.Command',
        options: {
            defaults: {
    Severity: Major
    Found in lib/graphs/run-rest-command-graph.js and 2 other locations - About 2 hrs to fix
    lib/graphs/dell-wsman-export-scp-graph.js on lines 5..25
    lib/graphs/dell-wsman-os-deployment-create-graph.js on lines 5..25

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

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

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

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

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

    Refactorings

    Further Reading

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

    module.exports = {
        friendlyName: 'Dell wsman OS Deployment Create ISO Graph',
        injectableName: 'Graph.Dell.Wsman.Os.Create',
        options: {
            defaults: {
    Severity: Major
    Found in lib/graphs/dell-wsman-os-deployment-create-graph.js and 2 other locations - About 2 hrs to fix
    lib/graphs/dell-wsman-export-scp-graph.js on lines 5..25
    lib/graphs/run-rest-command-graph.js on lines 5..25

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

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

    function templateApiServiceFactory(
        Promise,
        workflowApiService,
        taskProtocol,
        eventsProtocol,
    Severity: Major
    Found in lib/services/templates-api-service.js - About 2 hrs to fix

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

      // Copyright © 2016-2017 Dell Inc. or its subsidiaries.  All Rights Reserved.
      
      'use strict';
      
      var di = require('di');
      Severity: Minor
      Found in lib/task-runner.js - About 2 hrs to fix

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

        module.exports = {
            friendlyName: 'Create Emc FabricService Pollers',
            injectableName: 'Graph.Emc.Redfish.FabricService.Poller.Create',
            options: {
                defaults: {
        Severity: Major
        Found in lib/graphs/create-emc-fabric-service-poller-graph.js and 2 other locations - About 2 hrs to fix
        lib/graphs/create-redfish-managers-poller-graph.js on lines 5..28
        lib/graphs/create-redfish-systems-poller-graph.js on lines 5..28

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

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

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

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

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

        Refactorings

        Further Reading

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

        module.exports = {
            friendlyName: 'Create Redfish Managers Pollers',
            injectableName: 'Graph.Redfish.Managers.Poller.Create',
            options: {
                defaults: {
        Severity: Major
        Found in lib/graphs/create-redfish-managers-poller-graph.js and 2 other locations - About 2 hrs to fix
        lib/graphs/create-emc-fabric-service-poller-graph.js on lines 5..28
        lib/graphs/create-redfish-systems-poller-graph.js on lines 5..28

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

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

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

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

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

        Refactorings

        Further Reading

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

        module.exports = {
            friendlyName: 'Create Redfish Systems Pollers',
            injectableName: 'Graph.Redfish.Systems.Poller.Create',
            options: {
                defaults: {
        Severity: Major
        Found in lib/graphs/create-redfish-systems-poller-graph.js and 2 other locations - About 2 hrs to fix
        lib/graphs/create-emc-fabric-service-poller-graph.js on lines 5..28
        lib/graphs/create-redfish-managers-poller-graph.js on lines 5..28

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

        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

                {
                     label: 'create-wsman-pollers',
                     taskDefinition: {
                          friendlyName: 'Create Default Pollers',
                          injectableName: 'Task.Inline.Pollers.CreateDefault',
        Severity: Major
        Found in lib/graphs/dell-wsman-update-systemcomponents-graph.js and 1 other location - About 2 hrs to fix
        lib/graphs/dell-wsman-post-discovery-graph.js on lines 39..62

        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

                {
                     label: 'create-wsman-pollers',
                     taskDefinition: {
                          friendlyName: 'Create Default Pollers',
                          injectableName: 'Task.Inline.Pollers.CreateDefault',
        Severity: Major
        Found in lib/graphs/dell-wsman-post-discovery-graph.js and 1 other location - About 2 hrs to fix
        lib/graphs/dell-wsman-update-systemcomponents-graph.js on lines 42..65

        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

        Function leaseExpirationPollerFactory has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function leaseExpirationPollerFactory(
            store,
            Logger,
            assert,
            Constants,
        Severity: Major
        Found in lib/lease-expiration-poller.js - About 2 hrs to fix

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

          // Copyright © 2016-2017 Dell Inc. or its subsidiaries.  All Rights Reserved.
          
          'use strict';
          
          var di = require('di');
          Severity: Minor
          Found in lib/services/workflow-api-service.js - About 2 hrs to fix

            Function create_jbod has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

            def create_jbod(disk_arg, raid_tool):
                """
                Create JBOD for each physical disk under a virtual disk.
                :param disk_arg: a dictionary contains disk argument
                :param raid_tool: tools used for JBOD creation, storcli and perccli are supported
            Severity: Minor
            Found in data/templates/secure_erase.py - About 2 hrs 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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 83.

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

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

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

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

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language