RackHD/on-tasks

View on GitHub

Showing 1,093 of 1,093 total issues

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

        return waterline.nodes.updateByIdentifier(
            n1.id,
            {relations: n1.relations}
        )
        .then(function(){
Severity: Major
Found in lib/jobs/dell-wsman-post-discovery.js and 1 other location - About 7 hrs to fix
lib/jobs/dell-wsman-discovery.js on lines 812..832

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

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 self.redfish.clientRequest(rootPath)
        .then(function(res) {
            assert.object(res.body);
            return _.get(res.body, 'Systems');
        })
Severity: Major
Found in lib/jobs/emc-compose-system.js and 1 other location - About 7 hrs to fix
lib/jobs/emc-compose-system.js on lines 87..116

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

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 self.redfish.clientRequest(rootPath)
        .then(function(res) {
            assert.object(res.body);
            return _.get(res.body, 'Systems');
        })
Severity: Major
Found in lib/jobs/emc-compose-system.js and 1 other location - About 7 hrs to fix
lib/jobs/emc-compose-system.js on lines 133..151

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

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

    WsmanGetComponentJob.prototype._handleSyncRequest = function() {
        var self = this;
        if(self.options.ipAddress === '' || self.options.username === '' ||
            self.options.password === ''){
                return self.checkOBM('SCP create xml for deleting volume')
Severity: Major
Found in lib/jobs/dell-wsman-getXml.js and 1 other location - About 7 hrs to fix
lib/jobs/dell-wsman-RAID.js on lines 57..75

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

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

    DellWsmanRAIDJob.prototype._handleSyncRequest = function() {
        var self = this;
        if(self.options.ipAddress === '' || self.options.username === '' ||
            self.options.password === ''){
                return self.checkOBM('SCP RAID operation')
Severity: Major
Found in lib/jobs/dell-wsman-RAID.js and 1 other location - About 7 hrs to fix
lib/jobs/dell-wsman-getXml.js on lines 64..82

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

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

    CommandParser.prototype[megaraidAdapterInfo] = function(data) {
        if (data.error) {
            return Promise.resolve({ source: 'megaraid-controllers', error: data.error });
        }
        try {
Severity: Major
Found in lib/utils/job-utils/command-parser.js and 2 other locations - About 7 hrs to fix
lib/utils/job-utils/command-parser.js on lines 732..750
lib/utils/job-utils/command-parser.js on lines 752..770

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

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

    CommandParser.prototype[megaraidVirtualDiskInfo] = function(data) {
        if (data.error) {
            return Promise.resolve({ source: 'megaraid-virtual-disks', error: data.error });
        }
        try {
Severity: Major
Found in lib/utils/job-utils/command-parser.js and 2 other locations - About 7 hrs to fix
lib/utils/job-utils/command-parser.js on lines 715..729
lib/utils/job-utils/command-parser.js on lines 752..770

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

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

    CommandParser.prototype[megaraidDriveInfo] = function(data) {
        if (data.error) {
            return Promise.resolve({ source: 'megaraid-physical-drives', error: data.error });
        }
        try {
Severity: Major
Found in lib/utils/job-utils/command-parser.js and 2 other locations - About 7 hrs to fix
lib/utils/job-utils/command-parser.js on lines 715..729
lib/utils/job-utils/command-parser.js on lines 732..750

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

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

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

// Copyright 2016, EMC, Inc.

'use strict';

var di = require('di'),
Severity: Minor
Found in lib/jobs/redfish-job.js - About 7 hrs to fix

    Function parseRacadmDataFactory has 179 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function parseRacadmDataFactory(
        assert,
        _,
        fs,
        Promise
    Severity: Major
    Found in lib/utils/job-utils/racadm-parser.js - About 7 hrs to fix

      Function UcsDiscoveryJobFactory has 178 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function UcsDiscoveryJobFactory(
          BaseJob,
          Logger,
          Promise,
          assert,
      Severity: Major
      Found in lib/jobs/ucs-discovery.js - About 7 hrs to fix

        Function taskGraphFactory has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
        Open

        function taskGraphFactory(
            taskLibrary,
            Task,
            store,
            taskMessenger,
        Severity: Minor
        Found in lib/task-graph.js - About 7 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 switchRelationsJobFactory has 173 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function switchRelationsJobFactory(
            BaseJob,
            waterline,
            catalogSearch,
            Logger,
        Severity: Major
        Found in lib/jobs/switch-node-relations.js - About 6 hrs to fix

          Function WsmanAddVolumeXmlFactory has 166 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function WsmanAddVolumeXmlFactory(
              BaseJob,
              Logger,
              assert,
              util,
          Severity: Major
          Found in lib/jobs/dell-wsman-add-volume-updateXml.js - About 6 hrs to fix

            Function UcsCatalogJobFactory has 164 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function UcsCatalogJobFactory(
                BaseJob,
                Logger,
                Promise,
                assert,
            Severity: Major
            Found in lib/jobs/ucs-catalog.js - About 6 hrs to fix

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

                          if(self.dell.shareFolder.shareType === 0) {
                              client = new NfsClient(
                                  self.dell.shareFolder.address,
                                  self.dell.shareFolder.shareName,
                                  self.context.mountDir
              Severity: Major
              Found in lib/jobs/dell-wsman-add-hotspare-updatexml.js and 2 other locations - About 6 hrs to fix
              lib/jobs/dell-wsman-add-volume-updateXml.js on lines 57..72
              lib/jobs/dell-wsman-delete-volume-updateXml.js on lines 58..73

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

              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

                      if(self.dell.shareFolder.shareType === 0){
                          client = new NfsClient(
                              self.dell.shareFolder.address,
                              self.dell.shareFolder.shareName,
                              self.context.mountDir
              Severity: Major
              Found in lib/jobs/dell-wsman-delete-volume-updateXml.js and 2 other locations - About 6 hrs to fix
              lib/jobs/dell-wsman-add-hotspare-updatexml.js on lines 61..76
              lib/jobs/dell-wsman-add-volume-updateXml.js on lines 57..72

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

              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

                      if(self.dell.shareFolder.shareType === 0){
                          client = new NfsClient(
                              self.dell.shareFolder.address,
                              self.dell.shareFolder.shareName,
                              self.context.mountDir
              Severity: Major
              Found in lib/jobs/dell-wsman-add-volume-updateXml.js and 2 other locations - About 6 hrs to fix
              lib/jobs/dell-wsman-add-hotspare-updatexml.js on lines 61..76
              lib/jobs/dell-wsman-delete-volume-updateXml.js on lines 58..73

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

              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 SshCommandJob(options, context, taskId) {
                      SshCommandJob.super_.call(this, logger, options, context, taskId);
                      assert.string(this.context.target);
                      this.nodeId = this.context.target;
                      this.commandUtil = new CommandUtil(this.nodeId);
              Severity: Major
              Found in lib/jobs/ssh-command.js and 1 other location - About 6 hrs to fix
              lib/jobs/ssh-catalog.js on lines 34..43

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

              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

                  SnmpJob.prototype.concurrentRequests = function(host, workItemId) {
                      assert.string(host);
                      assert.string(workItemId);
                      if(!_.has(this.concurrent, host)){
                          this.concurrent[host] = {};
              Severity: Major
              Found in lib/jobs/snmp-job.js and 1 other location - About 6 hrs to fix
              lib/jobs/redfish-job.js on lines 133..147

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

              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