ember-cli/ember-cli

View on GitHub

Showing 187 of 269 total issues

Consider simplifying this complex logical expression.
Open

      if (!broccoliPayload.error) {
        let originalError = broccoliPayload.originalError || {};
        let location = broccoliPayload.location || originalError.location;
        broccoliPayload.error = {
          message: originalError.message,
Severity: Major
Found in lib/models/builder.js - About 40 mins to fix

Consider simplifying this complex logical expression.
Open

    if (hasOptions) {
      let indent = `\n            `;
      let outdent = `\n          `;

      blueprintOptions =
Severity: Major
Found in blueprints/addon/index.js - About 40 mins to fix

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

Blueprint.load = function (blueprintPath, blueprintOptions) {
  if (fs.lstatSync(blueprintPath).isDirectory()) {
    let Constructor = Blueprint;

    let constructorPath = path.resolve(blueprintPath, 'index.js');
Severity: Minor
Found in lib/models/blueprint.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 locals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  locals(options) {
    let entity = options.entity;
    let rawName = entity.name;
    let name = stringUtil.dasherize(rawName);
    let namespace = stringUtil.classify(rawName);
Severity: Minor
Found in blueprints/app/index.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 checkYarn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  async checkYarn() {
    try {
      let result = await this.yarn(['--version']);
      let version = result.stdout;

Severity: Minor
Found in lib/tasks/npm-task.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 hasDependencies has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  hasDependencies() {
    if (this.cli.disableDependencyChecker) {
      // Blueprint tests set this flag.
      return true;
    }
Severity: Minor
Found in lib/models/project.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 dumpInvalidAddonPackages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  dumpInvalidAddonPackages(addonPackageList) {
    if (this._hasDumpedInvalidAddonPackages) {
      return;
    }
    this._hasDumpedInvalidAddonPackages = true;
Severity: Minor
Found in lib/models/package-info-cache/package-info.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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

    if (hasBuild) {
      if (!fs.existsSync(options.path)) {
Severity: Minor
Found in lib/tasks/serve.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 startHttpServer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  async startHttpServer() {
    this.app = this.express();
    const compression = require('compression');
    this.app.use(
      compression({
Severity: Minor
Found in lib/tasks/server/express-server.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 _generateTestPortNumber has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  async _generateTestPortNumber(options, ui) {
    if (options.testPort === defaultPort && !options.port) {
      let foundPort = await getPort({ port: options.testPort });

      if (options.testPort !== foundPort) {
Severity: Minor
Found in lib/commands/test.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 _generateCustomConfigs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  _generateCustomConfigs(options) {
    let config = {};
    if (!options.filter && !options.module && !options.launch && !options.query && !options['test-page']) {
      return config;
    }
Severity: Minor
Found in lib/commands/test.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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  run(commandOptions, rawArgs) {
    let blueprintName = rawArgs[0];
    let entityName = rawArgs[1];

    if (!blueprintName) {
Severity: Minor
Found in lib/commands/destroy.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

Avoid too many return statements within this function.
Open

        return 'app';
Severity: Major
Found in lib/models/blueprint.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

  return false;
Severity: Major
Found in lib/utilities/is-lazy-engine.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return experimentValue !== 'false';
Severity: Major
Found in lib/experiments/index.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return experimentValue !== undefined && experimentValue !== 'false';
Severity: Major
Found in lib/experiments/index.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return Reflect.get(targetCacheEntry[TARGET_INSTANCE], property);
Severity: Major
Found in lib/models/per-bundle-addon-cache/addon-proxy.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return !!(
        addonCtorOrInstance.prototype.options.lazyLoading &&
        addonCtorOrInstance.prototype.options.lazyLoading.enabled === true
      );
Severity: Major
Found in lib/utilities/is-lazy-engine.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return Reflect.get(targetCacheEntry, property);
Severity: Major
Found in lib/models/per-bundle-addon-cache/addon-proxy.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return addonInstance;
Severity: Major
Found in lib/models/per-bundle-addon-cache/index.js - About 30 mins to fix
Severity
Category
Status
Source
Language