RackHD/on-taskgraph

View on GitHub

Showing 247 of 247 total issues

Function profileApiServiceFactory has 15 arguments (exceeds 4 allowed). Consider refactoring.
Open

    Promise,
    workflowApiService,
    taskProtocol,
    eventsProtocol,
    waterline,
Severity: Major
Found in lib/services/profile-api-service.js - About 1 hr to fix

    Function taskSchedulerFactory has 15 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        eventsProtocol,
        store,
        LeaseExpirationPoller,
        Constants,
        Logger,
    Severity: Major
    Found in lib/task-scheduler.js - About 1 hr to fix

      Function parseDriveWwid has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function parseDriveWwid(idList) {
          //idList example
          //"lrwxrwxrwx. 1 root root  9 Nov 18 20:30 ata-SATADOM-SV_3SE_20150522AA9992050085 -> ../../sdb"
          //returned string example
          // "ata-SATADOM-SV_3SE_20150522AA9992050085->../../sdb"
      Severity: Minor
      Found in data/templates/get_driveid.js - About 1 hr to fix

        Function start has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            TaskScheduler.prototype.start = function() {
                var self = this;
                return Promise.resolve()
                .then(function() {
                    self.running = true;
        Severity: Minor
        Found in lib/task-scheduler.js - About 1 hr to fix

          Function workflowApiServiceFactory has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          function workflowApiServiceFactory(
              taskGraphProtocol,
              taskGraphStore,
              waterline,
              TaskGraph,
          Severity: Minor
          Found in lib/services/workflow-api-service.js - About 1 hr 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 templateApiServiceFactory has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          function templateApiServiceFactory(
              Promise,
              workflowApiService,
              taskProtocol,
              eventsProtocol,
          Severity: Minor
          Found in lib/services/templates-api-service.js - About 1 hr 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

          def main():
              data = {}
          
              try:
                  cmd = "Cli -c 'show version'"
          Severity: Major
          Found in data/templates/arista-catalog-version.py and 1 other location - About 1 hr to fix
          data/templates/arista-catalog-ip.py on lines 21..31

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

          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 14 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              Promise,
              workflowApiService,
              taskProtocol,
              eventsProtocol,
              waterline,
          Severity: Major
          Found in lib/services/templates-api-service.js - About 1 hr to fix

            Function parse_version has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            def parse_version(versionString):
                i = 0
                parsedString = ""
            
                # Remove blank lines and spaces
            Severity: Minor
            Found in data/templates/arista-catalog-version.py - About 1 hr 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

            def main():
                data = {}
            
                try:
                    cmd = "Cli -c 'show ip interface'"
            Severity: Major
            Found in data/templates/arista-catalog-ip.py and 1 other location - About 1 hr to fix
            data/templates/arista-catalog-version.py on lines 53..63

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

            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 runnerFactory has 14 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                waterline,
                core,
                TaskScheduler,
                TaskRunner,
                LeaseExpirationPoller,
            Severity: Major
            Found in lib/task-graph-runner.js - About 1 hr to fix

              Function updateTasks has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function updateTasks(data, timeout, retry, retries) {
              
                  var request = http.request({
                      hostname: server,
                      port: port,
              Severity: Minor
              Found in data/templates/bootstrap.js - About 1 hr to fix

                Function buildDriveMap has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function buildDriveMap(wwidData, vdData, scsiData) {
                    var parsedWwids = parseDriveWwid(wwidData),
                        scsiList = parseScsiInfo(scsiData),
                        vdList = parseVdInfo(vdData);
                    var linuxWwids = parsedWwids.linuxDriveIds, esxiWwids = parsedWwids.esxiDriveIds;
                Severity: Minor
                Found in data/templates/get_driveid.js - About 1 hr to fix

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

                      TaskApiService.prototype.getTasksById = function (identifier) {
                          return Promise.try(function () {
                              if ( !identifier ) {
                                  throw new Errors.BadRequestError('Task id missing or undefined');
                              }
                  Severity: Major
                  Found in lib/services/task-api-service.js and 1 other location - About 1 hr to fix
                  lib/services/task-api-service.js on lines 61..68

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

                  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

                      TaskApiService.prototype.activeTaskExists = function (identifier) {
                          return Promise.try(function() {
                              if ( !identifier ) {
                                  throw new Errors.BadRequestError('Task id missing or undefined');
                              }
                  Severity: Major
                  Found in lib/services/task-api-service.js and 1 other location - About 1 hr to fix
                  lib/services/task-api-service.js on lines 52..59

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

                  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 workflowApiServiceFactory has 13 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      taskGraphProtocol,
                      taskGraphStore,
                      waterline,
                      TaskGraph,
                      eventsProtocol,
                  Severity: Major
                  Found in lib/services/workflow-api-service.js - About 1 hr to fix

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

                    module.exports = {
                        friendlyName: 'Dell Racadm Set BIOS Graph',
                        injectableName: 'Graph.Dell.Racadm.SetBIOS',
                        options: {
                            defaults: {
                    Severity: Major
                    Found in lib/graphs/dell-racadm-set-bios-graph.js and 3 other locations - About 1 hr to fix
                    lib/graphs/dell-racadm-get-bios-graph.js on lines 5..21
                    lib/graphs/dell-wsman-create-repo-graph.js on lines 5..21
                    lib/graphs/dell-wsman-download-catalog-graph.js on lines 5..21

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

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

                    module.exports = {
                        friendlyName: 'Dell WSMAN Create Firmware Repo Graph',
                        injectableName: 'Graph.Dell.Wsman.Create.Repo',
                        options: {
                            defaults: {
                    Severity: Major
                    Found in lib/graphs/dell-wsman-create-repo-graph.js and 3 other locations - About 1 hr to fix
                    lib/graphs/dell-racadm-get-bios-graph.js on lines 5..21
                    lib/graphs/dell-racadm-set-bios-graph.js on lines 5..21
                    lib/graphs/dell-wsman-download-catalog-graph.js on lines 5..21

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

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

                    module.exports = {
                        friendlyName: 'Dell Racadm Get BIOS Graph',
                        injectableName: 'Graph.Dell.Racadm.GetBIOS',
                        options: {
                            defaults: {
                    Severity: Major
                    Found in lib/graphs/dell-racadm-get-bios-graph.js and 3 other locations - About 1 hr to fix
                    lib/graphs/dell-racadm-set-bios-graph.js on lines 5..21
                    lib/graphs/dell-wsman-create-repo-graph.js on lines 5..21
                    lib/graphs/dell-wsman-download-catalog-graph.js on lines 5..21

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

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

                    module.exports = {
                        friendlyName: 'Dell WSMAN Downlaod Catalog Graph',
                        injectableName: 'Graph.Dell.Wsman.Download.Catalog',
                        options: {
                            defaults: {
                    Severity: Major
                    Found in lib/graphs/dell-wsman-download-catalog-graph.js and 3 other locations - About 1 hr to fix
                    lib/graphs/dell-racadm-get-bios-graph.js on lines 5..21
                    lib/graphs/dell-racadm-set-bios-graph.js on lines 5..21
                    lib/graphs/dell-wsman-create-repo-graph.js on lines 5..21

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

                    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