ember-cli/ember-cli

View on GitHub

Showing 177 of 291 total issues

File blueprint-test.js has 1299 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

const fs = require('fs-extra');
const Task = require('../../../lib/models/task');
const MockProject = require('../../helpers/mock-project');
Severity: Major
Found in tests/integration/models/blueprint-test.js - About 3 days to fix

File ember-app.js has 1146 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* global require, module */
'use strict';

/**
@module ember-cli
Severity: Major
Found in lib/broccoli/ember-app.js - About 2 days to fix

File addon.js has 782 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

/**
@module ember-cli
*/
Severity: Major
Found in lib/models/addon.js - About 1 day to fix

File blueprint.js has 684 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

/**
@module ember-cli
*/
Severity: Major
Found in lib/models/blueprint.js - About 1 day to fix

File default-packager.js has 572 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

const p = require('ember-cli-preprocess-registry/preprocessors');
const path = require('path');
const concat = require('broccoli-concat');
Severity: Major
Found in lib/broccoli/default-packager.js - About 1 day to fix

EmberApp has 56 functions (exceeds 20 allowed). Consider refactoring.
Open

class EmberApp {
  /**
   EmberApp is the main class Ember CLI uses to manage the Broccoli trees
   for your application. It is very tightly integrated with Broccoli and has
   a `toTree()` method you can use to get the entire tree for your application.
Severity: Major
Found in lib/broccoli/ember-app.js - About 1 day to fix

addonProto has 51 functions (exceeds 20 allowed). Consider refactoring.
Open

let addonProto = {
  /**
    The name of this addon.

    @public
Severity: Major
Found in lib/models/addon.js - About 7 hrs to fix

Blueprint has 48 functions (exceeds 20 allowed). Consider refactoring.
Open

let Blueprint = CoreObject.extend({
  availableOptions: [],
  anonymousOptions: ['name'],

  _printableProperties: ['name', 'description', 'availableOptions', 'anonymousOptions', 'overridden'],
Severity: Minor
Found in lib/models/blueprint.js - About 6 hrs to fix

Function insertIntoFile has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

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

  let returnValue = {
    path: fullPath,
Severity: Minor
Found in lib/utilities/insert-into-file.js - About 5 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 _readPackage has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

  _readPackage(packageDir, pkg, isRoot) {
    let normalizedPackageDir = path.normalize(packageDir);

    // Most of the time, normalizedPackageDir is already a real path (i.e. fs.realpathSync
    // will return the same value as normalizedPackageDir if the dir actually exists).
Severity: Minor
Found in lib/models/package-info-cache/index.js - About 5 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

File project.js has 406 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

/**
@module ember-cli
*/
Severity: Minor
Found in lib/models/project.js - About 5 hrs to fix

File command.js has 385 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

const nopt = require('nopt');
const chalk = require('chalk');
const path = require('path');
Severity: Minor
Found in lib/models/command.js - About 5 hrs to fix

Function _import has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

  _import(assetPath, options, directory, subdirectory, extension) {
    // TODO: refactor, this has gotten very messy. Relevant tests: tests/unit/broccoli/ember-app-test.js
    let basename = path.basename(assetPath);

    if (isType(assetPath, 'js', { registry: this.registry })) {
Severity: Minor
Found in lib/broccoli/ember-app.js - About 4 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 _initOptions has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _initOptions(options) {
    let resolvePathFor = (defaultPath, specified) => {
      let path = defaultPath;
      if (specified && typeof specified === 'string') {
        path = specified;
Severity: Major
Found in lib/broccoli/ember-app.js - About 4 hrs to fix

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

  run(environment) {
    let shutdownOnExit = null;

    return RSVP.hash(environment)
      .then(environment => {
Severity: Major
Found in lib/cli/cli.js - About 4 hrs to fix

Project has 33 functions (exceeds 20 allowed). Consider refactoring.
Open

class Project {
  /**
    The Project model is tied to your package.json. It is instantiated
    by giving {{#crossLink "Project/closestSync:method"}}{{/crossLink}}
    the path to your project.
Severity: Minor
Found in lib/models/project.js - About 4 hrs to fix

Function _removeLinks has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

  _removeLinks(label, type) {
    let cachedManifest = this._readManifest(label, type);
    if (!cachedManifest) {
      return;
    }
Severity: Minor
Found in tests/helpers/package-cache.js - About 3 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 _readPackage has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  _readPackage(packageDir, pkg, isRoot) {
    let normalizedPackageDir = path.normalize(packageDir);

    // Most of the time, normalizedPackageDir is already a real path (i.e. fs.realpathSync
    // will return the same value as normalizedPackageDir if the dir actually exists).
Severity: Major
Found in lib/models/package-info-cache/index.js - About 3 hrs to fix

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

  _initOptions(options) {
    let resolvePathFor = (defaultPath, specified) => {
      let path = defaultPath;
      if (specified && typeof specified === 'string') {
        path = specified;
Severity: Minor
Found in lib/broccoli/ember-app.js - About 3 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

File index.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

/*
 * Performance cache for information about packages (projects/addons/"apps"/modules)
 * under an initial root directory and resolving addon/dependency links to other packages.
Severity: Minor
Found in lib/models/package-info-cache/index.js - About 3 hrs to fix
Severity
Category
Status
Source
Language