RackHD/on-tasks

View on GitHub
lib/jobs/emc-redfish-catalog.js

Summary

Maintainability
F
1 wk
Test Coverage

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

    File emc-redfish-catalog.js has 373 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    
    // Copyright 2016, EMC, Inc.
    
    'use strict';
    
    
    Severity: Minor
    Found in lib/jobs/emc-redfish-catalog.js - About 4 hrs to fix

      Function catalogElements has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          EmcRedfishCatalogJob.prototype.catalogElements = Promise.method(function(nodeId) {
              var self = this;
              return self.redfish.setup(nodeId)
              .then(function() {
                  return self.redfish.clientRequest(self.redfish.settings.root);
      Severity: Major
      Found in lib/jobs/emc-redfish-catalog.js - About 3 hrs to fix

        Function catalogSpine has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            EmcRedfishCatalogJob.prototype.catalogSpine = Promise.method(function(nodeId) {
                var self = this;
                var catalogData = [];
                return self.redfish.setup(nodeId)
                .then(function() {
        Severity: Major
        Found in lib/jobs/emc-redfish-catalog.js - About 3 hrs to fix

          Function catalogAggregators has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              EmcRedfishCatalogJob.prototype.catalogAggregators = Promise.method(function(nodeId) {
                  var self = this;
                  var catalogData = [];
                  return self.redfish.setup(nodeId)
                  .then(function() {
          Severity: Major
          Found in lib/jobs/emc-redfish-catalog.js - About 2 hrs to fix

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

                EmcRedfishCatalogJob.prototype.catalogHbas = Promise.method(function(nodeId) {
                    var self = this;
                    var catalogData = [];
                    return self.redfish.setup(nodeId)
                    .then(function() {
            Severity: Major
            Found in lib/jobs/emc-redfish-catalog.js - About 2 hrs to fix

              Function EmcRedfishCatalogJobFactory has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  BaseJob,
                  Logger,
                  Promise,
                  assert,
                  util,
              Severity: Major
              Found in lib/jobs/emc-redfish-catalog.js - About 1 hr to fix

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

                        return self.redfish.setup(nodeId)
                        .then(function() {
                            return self.redfish.clientRequest(self.redfish.settings.root);
                        })
                        .then(function(res) {
                Severity: Major
                Found in lib/jobs/emc-redfish-catalog.js and 1 other location - About 1 day to fix
                lib/jobs/emc-redfish-catalog.js on lines 220..266

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

                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.setup(nodeId)
                        .then(function() {
                            return self.redfish.clientRequest(self.redfish.settings.root);
                        })
                        .then(function(res) {
                Severity: Major
                Found in lib/jobs/emc-redfish-catalog.js and 1 other location - About 1 day to fix
                lib/jobs/emc-redfish-catalog.js on lines 155..197

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 232.

                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

                        var subElement = _(element[property]).map(function(arr){
                            return self.redfish.clientRequest(arr['@odata.id'])
                                .then(function(res){
                                    return res.body;
                                });
                Severity: Major
                Found in lib/jobs/emc-redfish-catalog.js and 1 other location - About 2 hrs to fix
                lib/jobs/emc-redfish-catalog.js on lines 375..380

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

                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

                                    var subElement = _(element.Members).map(function(arr){
                                        return self.redfish.clientRequest(arr['@odata.id'])
                                            .then(function(res){
                                                return res.body;
                                            });
                Severity: Major
                Found in lib/jobs/emc-redfish-catalog.js and 1 other location - About 2 hrs to fix
                lib/jobs/emc-redfish-catalog.js on lines 391..396

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

                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 Promise.each([
                                self.redfish.clientRequest(_.get(res.body, 'Controllers', {})['@odata.id']),
                                self.redfish.clientRequest(_.get(res.body, 'Switches', {})['@odata.id'])
                            ], function(aggRes) {   
                Severity: Major
                Found in lib/jobs/emc-redfish-catalog.js and 1 other location - About 1 hr to fix
                lib/jobs/emc-redfish-catalog.js on lines 111..114

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

                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 Promise.each([
                                self.redfish.clientRequest(_.get(res.body, 'Controllers', {})['@odata.id']),
                                self.redfish.clientRequest(_.get(res.body, 'Switches', {})['@odata.id'])
                            ], function(resList) {
                Severity: Major
                Found in lib/jobs/emc-redfish-catalog.js and 1 other location - About 1 hr to fix
                lib/jobs/emc-redfish-catalog.js on lines 253..256

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

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

                        return self.redfish.setup(nodeId)
                        .then(function() {
                            return self.redfish.clientRequest(self.redfish.settings.root);
                        })
                        .then(function(res) {
                Severity: Major
                Found in lib/jobs/emc-redfish-catalog.js and 5 other locations - About 1 hr to fix
                lib/jobs/general-redfish-catalog.js on lines 327..345
                lib/jobs/general-redfish-catalog.js on lines 367..384
                lib/jobs/general-redfish-catalog.js on lines 356..397
                lib/jobs/general-redfish-catalog.js on lines 413..429
                lib/jobs/general-redfish-catalog.js on lines 403..442

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

                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.setup(nodeId)
                        .then(function() {
                            return self.redfish.clientRequest(self.redfish.settings.root);
                        })
                        .then(function(res) {
                Severity: Minor
                Found in lib/jobs/emc-redfish-catalog.js and 1 other location - About 40 mins to fix
                lib/jobs/ucs-catalog.js on lines 198..238

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

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

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

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

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

                Refactorings

                Further Reading

                There are no issues that match your filters.

                Category
                Status