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');
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');
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');
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');
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
- Read upRead up
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) {
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');
Function _printDependencyTable
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
_printDependencyTable(dependencyStatus) {
if (!dependencyStatus.length) {
return;
}
let task = this;
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) {
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
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(
Function print
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
print() {
let task = this;
let colorAndMessage;
let failMessage;
let countPassed = 0;
Function _runCommandForThisScenario
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async _runCommandForThisScenario(scenario) {
if (this._canceling) {
return;
}
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;
- Read upRead up
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: '/',
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);
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(
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;
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') {
- Read upRead up
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;
}
- Read upRead up
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"