LevelbossMike/ember-deploy

View on GitHub

Showing 13 of 70 total issues

File plugin-registry-test.js has 566 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var expect         = require('../../helpers/expect');
var PluginRegistry = require('../../../lib/models/plugin-registry');

var logOutput, mockUi;

Severity: Major
Found in node-tests/unit/models/plugin-registry-test.js - About 1 day to fix

    Function _buildDisabledMap has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

      _buildDisabledMap: function(aliasMap, config) {
        var aliases = this._flattenAliasMap(aliasMap);
        var allExcept = null;
    
        if (typeof config.allExcept !== 'undefined') {
    Severity: Minor
    Found in lib/models/plugin-registry.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 run has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      run: function(commandOptions, rawArgs) {
        commandOptions.deployTarget = rawArgs.shift();
    
        this.ui.verbose = chooseOptionValue(commandOptions.verbose, this.settings, 'verbose');
        this.ui.logInfoColor = chooseOptionValue(commandOptions.logInfoColor, this.settings, 'logInfoColor', 'blue');
    Severity: Minor
    Found in lib/commands/activate.js - About 1 hr to fix

      Function run has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        run: function(commandOptions, rawArgs) {
          commandOptions.deployTarget = rawArgs.shift();
      
          commandOptions.deployConfigFile = chooseOptionValue(commandOptions.deployConfigFile, this.settings, 'deploy-config-file', 'config/deploy.js');
          this.ui.verbose = chooseOptionValue(commandOptions.verbose, this.settings, 'verbose');
      Severity: Minor
      Found in lib/commands/list.js - About 1 hr to fix

        Function _buildRunOrderMap has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _buildRunOrderMap: function(config, aliasMap, pluginInstances) {
            var self = this;
        
            pluginInstances.forEach(function(instance) {
              if (instance.runBefore) {
        Severity: Minor
        Found in lib/models/plugin-registry.js - About 1 hr to fix

          Function _buildDisabledMap has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            _buildDisabledMap: function(aliasMap, config) {
              var aliases = this._flattenAliasMap(aliasMap);
              var allExcept = null;
          
              if (typeof config.allExcept !== 'undefined') {
          Severity: Minor
          Found in lib/models/plugin-registry.js - About 1 hr to fix

            Function postBuild has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              postBuild: function(result) {
                var _this = this;
                if (!this.app) {
                  // You will need ember-cli >= 1.13 to use ember-cli-deploy's postBuild integration.
                  // This is because prior to 1.13, `this.app` is not available in the postBuild hook.
            Severity: Minor
            Found in index.js - About 1 hr to fix

              Function run has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                run: function(commandOptions, rawArgs) {
                  commandOptions.deployTarget = rawArgs.shift();
              
                  commandOptions.deployConfigFile = chooseOptionValue(commandOptions.deployConfigFile, this.settings, 'deploy-config-file', 'config/deploy.js');
                  commandOptions.activate = chooseOptionValue(commandOptions.activate, this.settings, 'activate');
              Severity: Minor
              Found in lib/commands/deploy.js - About 1 hr to fix

                Function _mergeAuthorProvidedOrderWithConfigOrder has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  _mergeAuthorProvidedOrderWithConfigOrder: function(type, instanceName, names, config, aliasMap) {
                Severity: Minor
                Found in lib/models/plugin-registry.js - About 35 mins to fix

                  Function _addPluginHookExecutionPromiseToHookPromiseChain has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  Pipeline.prototype._addPluginHookExecutionPromiseToHookPromiseChain = function(ui, context, hookName, promise, fnObject) {
                  Severity: Minor
                  Found in lib/models/pipeline.js - About 35 mins to fix

                    Function init has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                      init: function() {
                        if (this._super.init) {
                          this._super.init.apply(this, arguments);
                        }
                    
                    
                    Severity: Minor
                    Found in lib/tasks/pipeline.js - About 35 mins 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 _registerPipelineHooks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      _registerPipelineHooks: function(deployPlugin) {
                        this._pipeline.hookNames().forEach(function(hookName) {
                          var fn = deployPlugin[hookName];
                          if (typeof fn !== 'function') {
                            return;
                    Severity: Minor
                    Found in lib/tasks/pipeline.js - About 25 mins 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 init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      init: function(project, ui, config) {
                        this._super();
                        this._project        = project;
                        this._ui             = ui;
                        this._aliasConfig    = (config.pipeline && config.pipeline.alias) || {};
                    Severity: Minor
                    Found in lib/models/plugin-registry.js - About 25 mins 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

                    Severity
                    Category
                    Status
                    Source
                    Language