MiguelMadero/ember-cli-bundle-loader

View on GitHub

Showing 5 of 16 total issues

Function EmberAppWithPackages has 113 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function EmberAppWithPackages(defaults, options) {
  var isAddon = !!(defaults.project.pkg["ember-addon"] && defaults.project.pkg["ember-addon"].configPath),
    sharedBuildConfig = {
      // TODO: re-enable jshint once it's actually working fine, for now it just slows down the build
      // and running `ember test` it only jshints boot, but not the packages. We'll rely an npm script
Severity: Major
Found in lib/broccoli/ember-app-with-packages.js - About 4 hrs to fix

    Function EmberAppWithPackages has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    function EmberAppWithPackages(defaults, options) {
      var isAddon = !!(defaults.project.pkg["ember-addon"] && defaults.project.pkg["ember-addon"].configPath),
        sharedBuildConfig = {
          // TODO: re-enable jshint once it's actually working fine, for now it just slows down the build
          // and running `ember test` it only jshints boot, but not the packages. We'll rely an npm script
    Severity: Minor
    Found in lib/broccoli/ember-app-with-packages.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 packagesApplications has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      this.packagesApplications = packageNames.map(function(packageName) {
        // packages export their own js file and are intended to distribute the code-base.
        var perPackageConfig = perPackageConfigFactory(packageName);
        perPackageConfig = merge({}, perPackageConfig, {appTreesBasePath: 'packages/' + packageName});
    
    
    Severity: Minor
    Found in lib/broccoli/ember-app-with-packages.js - About 1 hr to fix

      Function _getHandlerFunction has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _getHandlerFunction: function() {
          var container = getContainer(this);
          var DefaultRoute = getFactory(this, 'route:basic');
          var LazyLoaderRoute =getFactory(this, 'route:-lazy-loader');
          var lazyLoaderService = container.lookup('service:lazy-loader');
      Severity: Minor
      Found in addon/lazy-router.js - About 1 hr to fix

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

        export default function loadAssets(urls = []) {
          urls = urls || [];
          const promises = urls.map(url=>
            url.match(/\.js$/) ?
              loadScript(url) :
        Severity: Minor
        Found in addon/utils/load-assets.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