ember-cli/ember-cli

View on GitHub

Showing 187 of 269 total issues

Function insertIntoFile has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async function insertIntoFile(fullPath, contentsToInsert, providedOptions) {
  let options = providedOptions || {};

  let returnValue = {
    path: fullPath,
Severity: Major
Found in lib/utilities/insert-into-file.js - About 2 hrs to fix

Function createBlueprints has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

  async createBlueprints(options) {
    let name = options.args[0];
    let noAddonBlueprint = ['mixin', 'blueprint-test'];

    let entity = {
Severity: Minor
Found in lib/tasks/generate-from-blueprint.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 getAddonInstance has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  getAddonInstance(parent, addonPkgInfo) {
    // If the new addon is itself a bundle host (i.e. lazy engine), there is only one
    // instance of the bundle host, and it's in the entries of the bundleHostCache, outside
    // of the 'regular' addon caches. Because 'setupBundleHostCache' ran during construction,
    // we know that an entry is in the cache with this engine name.
Severity: Major
Found in lib/models/per-bundle-addon-cache/index.js - About 2 hrs to fix

Function run has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    if (hasBuild) {
      if (!fs.existsSync(options.path)) {
Severity: Major
Found in lib/tasks/serve.js - About 2 hrs to fix

Function locals has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  locals(options) {
    let entity = { name: 'dummy' };
    let rawName = entity.name;
    let name = stringUtil.dasherize(rawName);
    let namespace = stringUtil.classify(rawName);
Severity: Major
Found in blueprints/addon/index.js - About 2 hrs to fix

Function getAddonProxy has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getAddonProxy(targetCacheEntry, parent) {
  let _app;

  // handle `preprocessJs` separately for Embroider
  //
Severity: Major
Found in lib/models/per-bundle-addon-cache/addon-proxy.js - About 2 hrs to fix

exports has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

module.exports = class DefaultPackager {
  constructor(options) {
    this._cachedTests = null;
    this._cachedVendor = null;
    this._cachedPublic = null;
Severity: Minor
Found in lib/broccoli/default-packager.js - About 2 hrs to fix

Function locals has 54 lines of code (exceeds 25 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: Major
Found in blueprints/app/index.js - About 2 hrs to fix

Function _buildSummary has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _buildSummary(tree, result, resultAnnotation) {
    let buildSteps = 0;
    let totalTime = 0;

    let node;
Severity: Major
Found in lib/models/instrumentation.js - About 2 hrs to fix

Function exports has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (commands, commandName, commandArgs, optionHash) {
  let options = optionHash || {};
  let project = options.project;
  let ui = options.ui;

Severity: Major
Found in lib/cli/lookup-command.js - About 2 hrs to fix

Function toYarnArgs has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

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

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

  _buildSummary(tree, result, resultAnnotation) {
    let buildSteps = 0;
    let totalTime = 0;

    let node;
Severity: Minor
Found in lib/models/instrumentation.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 run has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  async run(commandOptions, rawArgs) {
    if (commandOptions.dryRun) {
      commandOptions.skipNpm = true;
    }

Severity: Minor
Found in lib/commands/init.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 run has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  async run(commandOptions, rawArgs) {
    let projectName = rawArgs[0],
      message;

    commandOptions.name = rawArgs.shift();
Severity: Minor
Found in lib/commands/new.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 run has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    if (hasBuild) {
Severity: Major
Found in lib/commands/test.js - About 2 hrs to fix

Function getHostAddonInfo has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  getHostAddonInfo(packageInfoForLazyEngine) {
    const cacheKey = `${this.project._packageInfo.realPath}-${packageInfoForLazyEngine.realPath}`;

    let hostInfoCacheEntry = this._hostAddonInfoCache.get(cacheKey);

Severity: Major
Found in lib/models/host-info-cache.js - About 2 hrs to fix

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

Function instantiateAddons has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function instantiateAddons(parent, project, addonPackages) {
  // depending on whether this is really a project or an addon, the 'name' property may be a getter.
  let parentName = typeof parent.name === 'function' ? parent.name() : parent.name;

  logger.info('instantiateAddons for: ', parentName);
Severity: Minor
Found in lib/models/instantiate-addons.js - About 1 hr to fix

Function build has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async build(addWatchDirCallback, resultAnnotation) {
    await this.ensureBroccoliBuilder();

    let buildResults, uiProgressIntervalID;

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

Function run has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async run(commandOptions, rawArgs) {
    let projectName = rawArgs[0],
      message;

    commandOptions.name = rawArgs.shift();
Severity: Minor
Found in lib/commands/new.js - About 1 hr to fix
Severity
Category
Status
Source
Language