RackHD/on-taskgraph

View on GitHub

Showing 247 of 247 total issues

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

module.exports = {
    "friendlyName": "Quanta storcli Catalog",
    "injectableName": "Graph.Quanta.storcli.Catalog",
    "options": {
        "bootstrap-rancher": {
Severity: Major
Found in lib/graphs/quanta-storcli-megaraid-catalog-graph.js and 1 other location - About 6 hrs to fix
lib/graphs/dell-perccli-megaraid-catalog-graph.js on lines 5..49

Duplicated Code

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

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

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

Tuning

This issue has a mass of 159.

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 profile-api-service.js has 416 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright © 2017 Dell Inc. or its subsidiaries. All Rights Reserved.

'use strict';

var di = require('di'),
Severity: Minor
Found in lib/services/profile-api-service.js - About 6 hrs to fix

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

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

      Function completedTaskPollerFactory has 139 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function completedTaskPollerFactory(
          store,
          graphProgressService,
          eventsProtocol,
          Logger,
      Severity: Major
      Found in lib/completed-task-poller.js - About 5 hrs to fix

        Function taskSchedulerFactory has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

        function taskSchedulerFactory(
            eventsProtocol,
            store,
            LeaseExpirationPoller,
            Constants,
        Severity: Minor
        Found in lib/task-scheduler.js - About 4 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 Runner has 120 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Runner(configureFile, Logger, uuid, constants,
                        eventsProtocol, lookupService, Errors, events) {
            var logger = Logger.initialize('TaskGraph');
            var server;
            function start() {
        Severity: Major
        Found in app.js - About 4 hrs to fix

          Function rxMixins has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

          function rxMixins(
              Rx,
              assert
          ) {
          
          
          Severity: Minor
          Found in lib/rx-mixins.js - About 4 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              TaskScheduler.prototype._publishGraphFinished = function(graph) {
                  return eventsProtocol.publishGraphFinished(graph.instanceId, {
                      graphId: graph.instanceId,
                      graphName: graph.name,
                      status: graph._status
          Severity: Major
          Found in lib/task-scheduler.js and 1 other location - About 4 hrs to fix
          lib/completed-task-poller.js on lines 307..320

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

          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

              CompletedTaskPoller.prototype._publishGraphFinished = function(graph) {
                  return eventsProtocol.publishGraphFinished(graph.instanceId, {
                      graphId: graph.instanceId,
                      graphName: graph.name,
                      status: graph._status
          Severity: Major
          Found in lib/completed-task-poller.js and 1 other location - About 4 hrs to fix
          lib/task-scheduler.js on lines 811..824

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

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

          function schemaApiServiceFactory(
              configuration,
              Logger,
              Promise,
              _,
          Severity: Major
          Found in lib/services/schema-api-service.js - About 3 hrs to fix

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

            module.exports = {
                friendlyName: 'Get Switch Version Graph',
                injectableName: 'Graph.Get.Switch.Version',
                options: {
                    defaults: {
            Severity: Major
            Found in lib/graphs/get-switch-version-graph.js and 1 other location - About 3 hrs to fix
            lib/graphs/get-switch-config-graph.js on lines 4..33

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

            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

            module.exports = {
                friendlyName: 'Get Switch Config Graph',
                injectableName: 'Graph.Get.Switch.Config',
                options: {
                    defaults: {
            Severity: Major
            Found in lib/graphs/get-switch-config-graph.js and 1 other location - About 3 hrs to fix
            lib/graphs/get-switch-version-graph.js on lines 4..34

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

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

            function rxMixins(
                Rx,
                assert
            ) {
            
            
            Severity: Major
            Found in lib/rx-mixins.js - About 3 hrs to fix

              Function prepareGrunt has 93 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function prepareGrunt(grunt) {
                  var allFiles = [
                      'package.json',
                      'Gruntfile.js',
                      'lib/**/*.js',
              Severity: Major
              Found in Gruntfile.js - About 3 hrs to fix

                Function getProfileFromTaskOrNode has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    ProfileApiService.prototype.getProfileFromTaskOrNode = function(node, vendor) {
                        var self = this;
                        var defaultProfile;
                
                        if (node.type === 'switch') {
                Severity: Major
                Found in lib/services/profile-api-service.js - About 3 hrs to fix

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

                  module.exports = {
                      friendlyName: 'DEBUG Bootstrap Ubuntu Mocks',
                      injectableName: 'Graph.BootstrapUbuntuMocks',
                      tasks: [
                          {
                  Severity: Major
                  Found in lib/graphs/examples/bootstrap-ubuntu-mocks-graph.js and 1 other location - About 3 hrs to fix
                  lib/graphs/examples/bootstrap-ubuntu-overrides-graph-example.js on lines 5..32

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

                  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

                  module.exports = {
                      friendlyName: 'Bootstrap Ubuntu',
                      injectableName: 'Graph.BootstrapUbuntu',
                      tasks: [
                          {
                  lib/graphs/examples/bootstrap-ubuntu-mocks-graph.js on lines 5..32

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

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

                  function schedulerServerFactory(
                      assert,
                      _,
                      Promise,
                      Logger
                  Severity: Major
                  Found in api/rpc/index.js - About 3 hrs to fix

                    Function loaderFactory has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function loaderFactory(store, taskLibrary, Logger, assert, Promise, _) {
                        var logger = Logger.initialize(loaderFactory);
                    
                        /**
                         * File loader class for loading graph definitions off disk, and persisting
                    Severity: Major
                    Found in lib/loader.js - About 3 hrs to fix

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

                      module.exports = {
                          "friendlyName": "Dell Switch Onie Discovery",
                          "injectableName": "Graph.Switch.Discovery.Dell.Onie",
                          "tasks": [
                              {
                      Severity: Major
                      Found in lib/graphs/dell-onie-switch-discovery-graph.js and 4 other locations - About 3 hrs to fix
                      lib/graphs/arista-switch-discovery-graph.js on lines 5..27
                      lib/graphs/brocade-switch-discovery-graph.js on lines 6..28
                      lib/graphs/cisco-switch-discovery-graph.js on lines 5..27
                      lib/graphs/dell-switch-discovery-graph.js on lines 5..27

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

                      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