ember-cli/ember-cli

View on GitHub

Showing 187 of 269 total issues

Function throwFormattedBroccoliError has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  throwFormattedBroccoliError(err) {
    // TODO fix ember-cli/console-ui to handle current broccoli broccoliPayload
    let broccoliPayload = err && err.broccoliPayload;
    if (broccoliPayload) {
      if (!broccoliPayload.error) {
Severity: Minor
Found in lib/models/builder.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 findPackageManager has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  async findPackageManager(packageManager = null) {
    if (packageManager === 'yarn') {
      logger.info('yarn requested -> trying yarn');
      return this.checkYarn();
    }
Severity: Minor
Found in lib/tasks/npm-task.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 _readNodeModulesList has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  _readNodeModulesList(nodeModulesDir) {
    let normalizedNodeModulesDir = path.normalize(nodeModulesDir);

    // Much of the time, normalizedNodeModulesDir is already a real path (i.e.
    // fs.realpathSync will return the same value as normalizedNodeModulesDir, if
Severity: Minor
Found in lib/models/package-info-cache/index.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 isExperimentEnabled has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function isExperimentEnabled(experimentName) {
  if (!availableExperiments.includes(experimentName)) {
    return false;
  }

Severity: Minor
Found in lib/experiments/index.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 toPNPMArgs has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  toPNPMArgs(command, options) {
    let args = [];

    if (command === 'install') {
      if (options.save) {
Severity: Minor
Found in lib/tasks/npm-task.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 _printHelp has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  _printHelp(commandOptions, rawArgs) {
    let rootCommand = new RootCommand({
      ui: this.ui,
      project: this.project,
      commands: this.commands,
Severity: Minor
Found in lib/commands/help.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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  async run(commandOptions) {
    let hasBuild = !!commandOptions.path;
    let outputPath;

    if (hasBuild) {
Severity: Minor
Found in lib/commands/test.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 findLCAHost has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  findLCAHost(engineInstance) {
    // only compute once for a given engine
    // we're using the engine name as the cache key here because regardless of its
    // version, lazy engines will always get output to: `engines-dist/${engineName}`
    let lcaHost = this._lcaHostCache.get(engineInstance.name);
Severity: Minor
Found in lib/models/host-info-cache.js - About 1 hr to fix

Function constructor has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  constructor(defaults, options) {
    if (arguments.length === 0) {
      options = {};
    } else if (arguments.length === 1) {
      options = defaults;
Severity: Minor
Found in lib/broccoli/ember-addon.js - About 1 hr to fix

Function throwFormattedBroccoliError has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  throwFormattedBroccoliError(err) {
    // TODO fix ember-cli/console-ui to handle current broccoli broccoliPayload
    let broccoliPayload = err && err.broccoliPayload;
    if (broccoliPayload) {
      if (!broccoliPayload.error) {
Severity: Minor
Found in lib/models/builder.js - About 1 hr to fix

Function _fileSystemInfo has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _fileSystemInfo() {
    if (this._cachedFileSystemInfo) {
      return this._cachedFileSystemInfo;
    }

Severity: Minor
Found in lib/models/addon.js - About 1 hr to fix

Function serverMiddleware has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  serverMiddleware(options) {
    let app = options.app;
    options = options.options;

    let broccoliMiddleware = options.middleware || require('broccoli-middleware').watcherMiddleware;
Severity: Minor
Found in lib/tasks/server/middleware/broccoli-watcher/index.js - About 1 hr to fix

Function constructor has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  constructor(options) {
    this._cachedTests = null;
    this._cachedVendor = null;
    this._cachedPublic = null;
    this._cachedConfig = null;
Severity: Minor
Found in lib/broccoli/default-packager.js - About 1 hr to fix

Function _getBundledPackageInfos has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _getBundledPackageInfos(pkgInfoToStartAt) {
    let pkgInfos = this._bundledPackageInfoCache.get(pkgInfoToStartAt);

    if (pkgInfos) {
      return pkgInfos;
Severity: Minor
Found in lib/models/host-info-cache.js - About 1 hr to fix

Function stopAndReport has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  stopAndReport(name) {
    if (!instrumentationEnabled(this.config)) {
      return;
    }

Severity: Minor
Found in lib/models/instrumentation.js - About 1 hr to fix

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

function isExperimentEnabled(experimentName) {
  if (!availableExperiments.includes(experimentName)) {
    return false;
  }

Severity: Minor
Found in lib/experiments/index.js - About 1 hr to fix

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

  constructor(options) {
    this.isVizEnabled = vizEnabled;
    this.isEnabled = instrumentationEnabled;

    this.ui = options.ui;
Severity: Minor
Found in lib/models/instrumentation.js - About 1 hr to fix

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

  treeFor(treeType) {
    let node = heimdall.start({
      name: `treeFor(${this.name} - ${treeType})`,
      addonName: this.name,
      treeType,
Severity: Minor
Found in lib/models/addon.js - About 1 hr to fix

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

  getPackageBlueprints(collection, options, singleBlueprintName) {
    let verbose = options.verbose;
    let blueprints = collection.blueprints;

    if (!verbose) {
Severity: Minor
Found in lib/commands/generate.js - About 1 hr to fix

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

  getAllBlueprints(options) {
    let lookupPaths = this.project.blueprintLookupPaths();
    let blueprintList = Blueprint.list({ paths: lookupPaths });

    let output = '';
Severity: Minor
Found in lib/commands/generate.js - About 1 hr to fix
Severity
Category
Status
Source
Language