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 this.redfish.clientRequest(rootPath)
        .then(function(root) {
            if (!_.has(root.body, redfishType)) {
                logger.warning('No ' + redfishType + ' Members Found');
                return Promise.resolve();
Severity: Major
Found in lib/jobs/dell-wsman-post-discovery.js and 1 other location - About 1 day to fix
lib/jobs/dell-wsman-discovery.js on lines 767..791

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

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

function secureEraseJobFactory(
    BaseJob,
    Logger,
    Promise,
    assert,
Severity: Major
Found in lib/jobs/secure-erase-drive.js - About 1 day to fix

    Function EmcComposeSystemJobFactory has 218 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function diagToolFactory has 216 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function diagToolFactory(Promise, _, Logger, assert) {
      
          function DiagToolFactory(settings, nodeId) {
              assert.isIP(settings.host, 4);
              this.server = "%s://%s:%s".format(
      Severity: Major
      Found in lib/utils/job-utils/diag-tool.js - About 1 day to fix

        Function runWorkItemsJobFactory has 209 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function runWorkItemsJobFactory(
            BaseJob,
            waterline,
            Logger,
            util,
        Severity: Major
        Found in lib/jobs/run-work-items.js - About 1 day to fix

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

                  return self.redfish.clientRequest(root.Systems['@odata.id'])
                  .then(function(res) {
                      assert.object(res);
                      return res.body.Members;
                  })
          Severity: Major
          Found in lib/jobs/redfish-discovery.js and 1 other location - About 1 day to fix
          lib/jobs/redfish-discovery.js on lines 142..201

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

          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[testEsesQ] = function(data) {
                  if (data.error) {
                      return Promise.resolve({ source: 'test_eses', error: data.error });
                  } else if (!data.stdout) {
                      return Promise.resolve({ source: 'test_eses', error: new Error("No data") });
          Severity: Major
          Found in lib/utils/job-utils/command-parser.js and 2 other locations - About 1 day to fix
          lib/utils/job-utils/command-parser.js on lines 845..867
          lib/utils/job-utils/command-parser.js on lines 1015..1037

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

          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

                  return self.redfish.clientRequest(root.Chassis['@odata.id'])
                  .then(function(res) {
                      assert.object(res);
                      return res.body.Members;
                  })
          Severity: Major
          Found in lib/jobs/redfish-discovery.js and 1 other location - About 1 day to fix
          lib/jobs/redfish-discovery.js on lines 216..309

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

          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[mellanoxInfo] = function(data) {
                  if (data.error) {
                      return Promise.resolve({ source: 'mellanox', error: data.error });
                  } else if (!data.stdout) {
                      return Promise.resolve({ source: 'mellanox', error: new Error("No data") });
          Severity: Major
          Found in lib/utils/job-utils/command-parser.js and 2 other locations - About 1 day to fix
          lib/utils/job-utils/command-parser.js on lines 1015..1037
          lib/utils/job-utils/command-parser.js on lines 1039..1061

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

          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[testEsesR] = function(data) {
                  if (data.error) {
                      return Promise.resolve({ source: 'test_eses', error: data.error });
                  } else if (!data.stdout) {
                      return Promise.resolve({ source: 'test_eses', error: new Error("No data") });
          Severity: Major
          Found in lib/utils/job-utils/command-parser.js and 2 other locations - About 1 day to fix
          lib/utils/job-utils/command-parser.js on lines 845..867
          lib/utils/job-utils/command-parser.js on lines 1039..1061

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

          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 baseJobFactory has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
          Open

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

          Cognitive Complexity

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

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

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

          Further reading

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

              DellWsmanImportSCPJob.prototype.importSCP = function(obm) {
                  if (!validator.isIP(this.options.serverIP) || !validator.isIP(this.options.shareAddress)) {
                      throw new Error('Invalid ServerIP/ShareAddress');
                  }
                  var self = this;
          Severity: Major
          Found in lib/jobs/dell-wsman-import-scp.js and 1 other location - About 1 day to fix
          lib/jobs/dell-wsman-export-scp.js on lines 82..100

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

          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

              DellWsmanExportSCPJob.prototype.exportSCP = function(obm) {
                  if (!validator.isIP(this.options.serverIP) || !validator.isIP(this.options.shareAddress)) {
                      throw new Error('Invalid ServerIP/ShareAddress');
                  }
          
          
          Severity: Major
          Found in lib/jobs/dell-wsman-export-scp.js and 1 other location - About 1 day to fix
          lib/jobs/dell-wsman-import-scp.js on lines 82..99

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

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

          function parseSensorsDataFactory(assert, _) {
              //UID status code, 0 = Off, 1 = Temporary On , 2 = On, 3 = reserved
              var uidStatus = ['Off', 'Temporary On', 'On', 'Reserved'];
          
              function parseSelInformationData(selData) {
          Severity: Major
          Found in lib/utils/job-utils/ipmi-parser.js - About 1 day to fix

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

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

              Function installOsJobFactory has 199 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function installOsJobFactory(
                  BaseJob,
                  Logger,
                  assert,
                  util,
              Severity: Major
              Found in lib/jobs/install-os.js - About 7 hrs to fix

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

                // Copyright 2015, EMC, Inc.
                
                'use strict';
                
                var di = require('di');
                Severity: Minor
                Found in lib/task.js - About 7 hrs to fix

                  Function commandUtilFactory has 191 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function commandUtilFactory(
                      parser,
                      Logger,
                      assert,
                      Promise,
                  Severity: Major
                  Found in lib/utils/job-utils/command-util.js - About 7 hrs to fix

                    Function DellWsmanPostDiscoveryJobFactory has 189 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      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-discovery.js and 1 other location - About 7 hrs to fix
                      lib/jobs/dell-wsman-post-discovery.js on lines 262..282

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language