ember-cli/ember-cli

View on GitHub

Showing 187 of 269 total issues

Function _initOptions has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

  _initOptions(options) {
    deprecate(
      'Using the `outputPaths` build option is deprecated, as output paths will no longer be predetermined under Embroider.',
      typeof options.outputPaths === 'undefined',
      {
Severity: Minor
Found in lib/broccoli/ember-app.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 addAddonsToProject has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

  addAddonsToProject(options) {
    let taskOptions = {
      packages: [],
      extraArgs: options.extraArgs || [],
      blueprintOptions: options.blueprintOptions || {},
Severity: Minor
Found in lib/models/blueprint.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 determineOutputs has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

async function determineOutputs(version) {
  let tag = `v${version}`;
  let latestEC = await latestVersion('ember-cli');
  let isLatest = version === latestEC;
  let repo = `https://github-actions:${GITHUB_TOKEN}@github.com/${REPO}.git`;
Severity: Minor
Found in dev/update-editor-output-repos.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 jshintAddonTree has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  jshintAddonTree() {
    let trees = [];

    let addonPath = this._treePathFor('addon');
    if (fs.existsSync(addonPath)) {
Severity: Minor
Found in lib/models/addon.js - About 1 hr to fix

Function startHttpServer has 46 lines of code (exceeds 25 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 1 hr to fix

Function _fileMapTokens has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _fileMapTokens(options) {
    let { project } = this;
    let standardTokens = {
      __name__(options) {
        if (options.pod && options.hasPathToken) {
Severity: Minor
Found in lib/models/blueprint.js - About 1 hr to fix

Function _showObjErrors has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _showObjErrors(obj) {
    let errorEntries = obj.hasErrors() ? obj.errors.getErrors() : null;

    if (!errorEntries || (errorEntries.length === 1 && errorEntries[0].type === Errors.ERROR_PACKAGE_DIR_MISSING)) {
      return;
Severity: Minor
Found in lib/models/package-info-cache/index.js - About 1 hr to fix

Function getAddonInstance has a Cognitive Complexity of 14 (exceeds 5 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: Minor
Found in lib/models/per-bundle-addon-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 exports has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in lib/cli/lookup-command.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 43 lines of code (exceeds 25 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

Function packageStyles has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  packageStyles(tree) {
    if (this._cachedProcessedStyles === null) {
      let cssMinificationEnabled = this.minifyCSS.enabled;
      let options = {
        outputPaths: this.distPaths.appCssFile,
Severity: Minor
Found in lib/broccoli/default-packager.js - About 1 hr to fix

Function addAddonsToProject has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  addAddonsToProject(options) {
    let taskOptions = {
      packages: [],
      extraArgs: options.extraArgs || [],
      blueprintOptions: options.blueprintOptions || {},
Severity: Minor
Found in lib/models/blueprint.js - About 1 hr to fix

Function validateAndRun has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  async validateAndRun(args) {
    let commandOptions = this.parseArgs(args);

    // If the `help` option was passed, resolve with `callHelp` to call the `help` command:
    if (commandOptions && (commandOptions.options.help || commandOptions.options.h)) {
Severity: Minor
Found in lib/models/command.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 main has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async function main() {
  let github = new Octokit({ version: '3.0.0', auth: process.env.GITHUB_AUTH });

  let res = await github.repos.compareCommits({
    owner: 'ember-cli',
Severity: Minor
Found in dev/changelog.js - About 1 hr to fix

Function validateAndRun has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async validateAndRun(args) {
    let commandOptions = this.parseArgs(args);

    // If the `help` option was passed, resolve with `callHelp` to call the `help` command:
    if (commandOptions && (commandOptions.options.help || commandOptions.options.h)) {
Severity: Minor
Found in lib/models/command.js - About 1 hr to fix

Function packageTestFiles has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  packageTestFiles(tree, coreTestTree) {
    let testSupportPath = this.distPaths.testSupportJsFile;

    testSupportPath = testSupportPath.testSupport || testSupportPath;

Severity: Minor
Found in lib/broccoli/default-packager.js - About 1 hr to fix

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

module.exports = async function (options) {
  // `process` should be captured before we require any libraries which
  // may use `process.exit` work arounds for async cleanup.
  willInterruptProcess.capture(options.process || process);

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

Function parseArgs has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

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

Function updateRepo has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async function updateRepo(version) {
  let repoName = APP_REPO;
  let command = 'new';
  let name = 'my-app';

Severity: Minor
Found in dev/update-output-repos.js - About 1 hr to fix
Severity
Category
Status
Source
Language