ember-cli/ember-cli

View on GitHub
lib/broccoli/default-packager.js

Summary

Maintainability
C
1 day
Test Coverage
A
100%

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 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 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 constructor has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  constructor(options) {
    this._cachedTests = null;
    this._cachedVendor = null;
    this._cachedPublic = null;
    this._cachedConfig = null;
Severity: Minor
Found in lib/broccoli/default-packager.js - About 1 hr to fix

Function processAppAndDependencies has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  processAppAndDependencies(allTrees) {
    if (this._cachedProcessedAppAndDependencies === null) {
      let config = this.packageConfig();
      let internal = this.packageEmberCliInternalFiles();
      let appContentsWithCompiledTemplates = this._debugTree(
Severity: Minor
Found in lib/broccoli/default-packager.js - About 1 hr to fix

Function packageStyles has a Cognitive Complexity of 8 (exceeds 5 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 45 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

There are no issues that match your filters.

Category
Status