ember-cli/ember-try

View on GitHub

Showing 22 of 70 total issues

File try-each-test.js has 637 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

const expect = require('chai').expect;
const tmp = require('tmp-sync');
const path = require('path');
Severity: Major
Found in test/tasks/try-each-test.js - About 1 day to fix

    File npm-adapter-test.js has 530 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    let expect = require('chai').expect;
    let RSVP = require('rsvp');
    let fs = require('fs-extra');
    Severity: Major
    Found in test/dependency-manager-adapters/npm-adapter-test.js - About 1 day to fix

      File pnpm-adapter-test.js has 523 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      
      let chai = require('chai');
      let chaiAsPromised = require('chai-as-promised');
      chai.use(chaiAsPromised);
      Severity: Major
      Found in test/dependency-manager-adapters/pnpm-adapter-test.js - About 1 day to fix

        File workspace-adapter-test.js has 406 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        'use strict';
        
        let expect = require('chai').expect;
        let RSVP = require('rsvp');
        let fs = require('fs-extra');
        Severity: Minor
        Found in test/dependency-manager-adapters/workspace-adapter-test.js - About 5 hrs to fix

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

          module.exports = async function () {
            return {
              scenarios: [
                {
                  name: 'ember-lts-3.28',
          Severity: Major
          Found in smoke-test-app/tests/dummy/config/ember-try.js - About 3 hrs to fix

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

              async _install(depSet) {
                let mgrOptions = this.managerOptions || [];
                let cmd = this.useYarnCommand ? 'yarn' : 'npm';
            
                // buildManagerOptions overrides all default
            Severity: Minor
            Found in lib/dependency-manager-adapters/npm.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 generateFromConfig has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              generateFromConfig(config, root) {
                let hasNpm = false;
                let hasBower = false;
                let adapters = [];
                if (!config || !config.scenarios) {
            Severity: Minor
            Found in lib/utils/dependency-manager-adapter-factory.js - About 1 hr to fix

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

                async run(scenarios, options) {
                  // Required lazily to improve startup speed.
                  let ScenarioManager = require('./../utils/scenario-manager');
                  let DependencyManagerAdapterFactory = require('./../utils/dependency-manager-adapter-factory');
                  this.ResultSummary = require('./../utils/result-summary');
              Severity: Minor
              Found in lib/tasks/try-each.js - About 1 hr to fix

                Function init has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  init() {
                    this._super.apply(this, arguments);
                    this.run = this.run || require('../utils/run');
                
                    if (!this.useYarnCommand) {
                Severity: Minor
                Found in lib/dependency-manager-adapters/workspace.js - About 1 hr to fix

                  Function _printDependencyTable has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    _printDependencyTable(dependencyStatus) {
                      if (!dependencyStatus.length) {
                        return;
                      }
                      let task = this;
                  Severity: Minor
                  Found in lib/utils/result-summary.js - About 1 hr to fix

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

                      print() {
                        let task = this;
                        let colorAndMessage;
                        let failMessage;
                        let countPassed = 0;
                    Severity: Minor
                    Found in lib/utils/result-summary.js - About 1 hr to fix

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

                        async _runCommandForThisScenario(scenario) {
                          if (this._canceling) {
                            return;
                          }
                      
                      
                      Severity: Minor
                      Found in lib/tasks/try-each.js - About 1 hr to fix

                        Function getBaseConfig has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        async function getBaseConfig(options) {
                          let relativeConfigPath = options.configPath || getConfigPath(options.project);
                          let configPath = path.join(options.project.root, relativeConfigPath);
                          let data;
                        
                        
                        Severity: Minor
                        Found in lib/utils/config.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 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          async run(commandOptions, rawArgs) {
                            let scenarioName = rawArgs[0];
                        
                            debug('Scenario argument: %s', scenarioName);
                            debug('Command options:\n', commandOptions);
                        Severity: Minor
                        Found in lib/commands/try-one.js - About 1 hr to fix

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

                          async function getBaseConfig(options) {
                            let relativeConfigPath = options.configPath || getConfigPath(options.project);
                            let configPath = path.join(options.project.root, relativeConfigPath);
                            let data;
                          
                          
                          Severity: Minor
                          Found in lib/utils/config.js - About 1 hr to fix

                            Function _install has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                              _install(depSet) {
                                let mgrOptions = this.managerOptions || [];
                            
                                // buildManagerOptions overrides all default
                                if (typeof this.buildManagerOptions === 'function') {
                            Severity: Minor
                            Found in lib/dependency-manager-adapters/workspace.js - About 45 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 _overridePackageJSONDependencies has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                              _overridePackageJSONDependencies(packageJSON, depSet, kindOfDependency) {
                                if (!depSet[kindOfDependency]) {
                                  return;
                                }
                            
                            
                            Severity: Minor
                            Found in lib/dependency-manager-adapters/pnpm.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 _install has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                              async _install(depSet) {
                                let mgrOptions = this.managerOptions || [];
                            
                                // buildManagerOptions overrides all default
                                if (typeof this.buildManagerOptions === 'function') {
                            Severity: Minor
                            Found in lib/dependency-manager-adapters/pnpm.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 init has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                              init() {
                                this._super.apply(this, arguments);
                                this.run = this.run || require('../utils/run');
                            
                                if (!this.useYarnCommand) {
                            Severity: Minor
                            Found in lib/dependency-manager-adapters/workspace.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 exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            module.exports = async function (root, commandArgs, opts) {
                              let options = Object.assign({ cwd: root }, opts);
                              let [command, ...actualArgs] = commandArgs;
                            
                              try {
                            Severity: Minor
                            Found in lib/utils/run-command.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