ember-cli/ember-cli

View on GitHub

Showing 187 of 269 total issues

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 false;
Severity: Major
Found in lib/tasks/server/middleware/history-support/index.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 'dependencies';
Severity: Major
Found in lib/utilities/format-package-list.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

          return function _originalAddonPropMethodWrapper() {
            let originalReturnValue = targetCacheEntry[TARGET_INSTANCE][property](...arguments);

            if (property === 'cacheKeyForTree') {
              const treeType = arguments[0];
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 this.checkNpmVersion();
Severity: Major
Found in lib/tasks/npm-task.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return getAddonProxy(addonCacheEntry, parent);
Severity: Major
Found in lib/models/per-bundle-addon-cache/index.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

  return class extends UnknownCommand {
    constructor(options) {
      super(options);
      this.name = commandName;
    }
Severity: Major
Found in lib/cli/lookup-command.js - About 30 mins to fix

Function findPackage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  findPackage(packageName) {
    if (!this.hasEntries) {
      return null;
    } // for speed

Severity: Minor
Found in lib/models/package-info-cache/node-modules-list.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

Function parseArgs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  parseArgs(commandArgs) {
    let knownOpts = {}; // Parse options
    let commandOptions = {};
    let parsedOptions;

Severity: Minor
Found in lib/models/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

Function setupMiddleware has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  setupMiddleware(options) {
    const tinylr = require('tiny-lr');
    const Server = tinylr.Server;

    if (options.liveReloadPrefix) {
Severity: Minor
Found in lib/tasks/server/livereload-server.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

Function shouldHandleRequest has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  shouldHandleRequest(req, options) {
    let acceptHeaders = req.headers.accept || [];
    let hasHTMLHeader = acceptHeaders.indexOf('text/html') !== -1;
    if (req.method !== 'GET') {
      return false;
Severity: Minor
Found in lib/tasks/server/middleware/history-support/index.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

Function locals has a Cognitive Complexity of 6 (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 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

Function _checkInRepoAddonExists has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _checkInRepoAddonExists(options) {
    let addon;

    if (options.inRepoAddon) {
      addon = findAddonByName(this.project, options.inRepoAddon);
Severity: Minor
Found in lib/models/blueprint.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

Function formatPackageList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function formatPackageList(packages) {
  if (Array.isArray(packages)) {
    if (packages.length === 1) {
      return packages[0];
    } else if (packages.length === 2) {
Severity: Minor
Found in lib/utilities/format-package-list.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

Function getBodyMsg has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function getBodyMsg(langArg) {
  return isValidCodeAndProg(langArg)
    ? getValidAndProgMsg(langArg)
    : isProgLang(langArg)
    ? getProgLangMsg(langArg)
Severity: Minor
Found in lib/utilities/get-lang-arg.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

Function constructor has a Cognitive Complexity of 6 (exceeds 5 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 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

Function isValidParsedOption has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function isValidParsedOption(option, parsedOption) {
  // option.name didn't parse
  if (parsedOption === undefined) {
    // no default
    if (option.default === undefined) {
Severity: Minor
Found in lib/models/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

Function confirmOverwrite has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  confirmOverwrite(path) {
    let promptOptions = {
      type: 'expand',
      name: 'answer',
      default: false,
Severity: Minor
Found in lib/models/file-info.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