ember-cli/ember-try

View on GitHub

Showing 70 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 493 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/npm-adapter-test.js - About 7 hrs to fix

      File workspace-adapter-test.js has 446 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 6 hrs to fix

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

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

          Function _install has a Cognitive Complexity of 18 (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 2 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 generateFromConfig has 48 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 _backupOriginalDependencies has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    _backupOriginalDependencies() {
                      debug('Backing up package.json and node_modules');
                  
                      let backupTasks = [
                        copy(
                  Severity: Minor
                  Found in lib/dependency-manager-adapters/npm.js - About 1 hr to fix

                    Function _install has 30 lines of code (exceeds 25 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

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

                          module.exports = function(environment) {
                            let ENV = {
                              modulePrefix: 'smoke-test-app',
                              environment,
                              rootURL: '/',
                          Severity: Minor
                          Found in smoke-test-app/config/environment.js - About 1 hr to fix

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

                              _restoreOriginalDependencies() {
                                debug('Restoring original package.json and node_modules');
                            
                                let restoreTasks = [
                                  copy(
                            Severity: Minor
                            Found in lib/dependency-manager-adapters/npm.js - About 1 hr to fix

                              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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language