ember-cli/ember-twiddle

View on GitHub

Showing 34 of 52 total issues

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

import { readOnly } from '@ember/object/computed';
import Service, { inject as service } from '@ember/service';
import RSVP from 'rsvp';
import { run } from '@ember/runloop';
import $ from 'jquery';
Severity: Major
Found in app/services/ember-cli.js - About 1 day to fix

    Function processEmberShims has 212 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function processEmberShims() {
          var shims = {
            'ember': {
              'default': Ember
            },
    Severity: Major
    Found in vendor/app-shims.js - About 1 day to fix

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

      module.exports = function(defaults) {
      
        const EmberApp = require('ember-cli/lib/broccoli/ember-app');
        const funnel = require('broccoli-funnel');
        const mergeTrees = require('broccoli-merge-trees');
      Severity: Major
      Found in ember-cli-build.js - About 5 hrs to fix

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

        export default function(babel, _options) {
          var options = _options || {};
        
          function htmlbarsInlineCompilerPlugin(babel) {
            let t = babel.types;
        Severity: Minor
        Found in app/plugins/hbs-plugin.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 handleColocatedComponents has 100 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          handleColocatedComponents(gist) {
            let colocatedTemplatesRegex = /^components\/([^/]+\/)*[^/]+\.hbs$/
        
            let files = gist.get('files').toArray();
            let filePaths = files.map(file => file.get('filePath'));
        Severity: Major
        Found in app/services/ember-cli.js - About 4 hrs to fix

          Function resolveAddonsTask has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

            resolveAddonsTask: task(function *(addons, dependencies, emberVersion) {
              let done = false;
              while (!done) {
                let addonPromises = {};
                let addonNames = Object.keys(addons);
          Severity: Minor
          Found in app/services/dependency-resolver.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 buildDependencies has 84 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            buildDependencies(twiddleJSON) {
              let deps = twiddleJSON.dependencies;
              let depCssLinkTags = '';
              let depScriptTags = '';
              let testStuff = '';
          Severity: Major
          Found in app/services/ember-cli.js - About 3 hrs to fix

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

            module.exports = function(environment) {
              let deployTarget = process.env.DEPLOY_TARGET;
              let rootURL = process.env.TWIDDLE_ROOT_URL || '/';
              let host = process.env.GH_API_HOST || 'https://api.github.com';
              let toriiGHEBaseURL = process.env.TORII_GHE_OAUTH || null;
            Severity: Major
            Found in config/environment.js - About 2 hrs to fix

              `` has 24 functions (exceeds 20 allowed). Consider refactoring.
              Open

                actions: {
                  contentsChanged() {
                    this.set('unsaved', true);
                    this.rebuildApp.perform();
                  },
              Severity: Minor
              Found in app/components/main-gist.js - About 2 hrs to fix

                Function drags has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  $.fn.drags = function(opt) {
                
                    if (opt === "destroy") {
                      destroyFn(this);
                      return;
                Severity: Major
                Found in vendor/drags.js - About 2 hrs to fix

                  Function buildQUnitTree has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function buildQUnitTree(app) {
                    const funnel = require('broccoli-funnel');
                    const concat = require('broccoli-concat');
                    const replace = require('broccoli-string-replace');
                    const mergeTrees = require('broccoli-merge-trees');
                  Severity: Major
                  Found in lib/build-qunit-tree.js - About 2 hrs to fix

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

                    export default function(babel, _options) {
                      var options = _options || {};
                    
                      function htmlbarsInlineCompilerPlugin(babel) {
                        let t = babel.types;
                    Severity: Major
                    Found in app/plugins/hbs-plugin.js - About 2 hrs to fix

                      Function resolveAddonsTask has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        resolveAddonsTask: task(function *(addons, dependencies, emberVersion) {
                          let done = false;
                          while (!done) {
                            let addonPromises = {};
                            let addonNames = Object.keys(addons);
                      Severity: Major
                      Found in app/services/dependency-resolver.js - About 2 hrs to fix

                        Function htmlbarsInlineCompilerPlugin has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function htmlbarsInlineCompilerPlugin(babel) {
                            let t = babel.types;
                        
                            return {
                              visitor: {
                        Severity: Minor
                        Found in app/plugins/hbs-plugin.js - About 2 hrs to fix

                          Function testConfig has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function testConfig() {
                          
                            this.get('/gists', function(schema) {
                              return schema.gists.all();
                            });
                          Severity: Minor
                          Found in mirage/config.js - About 1 hr to fix

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

                              initializeColumns() {
                                const files = this.get('model.files');
                            
                                if (!files) {
                                  return;
                            Severity: Minor
                            Found in app/mixins/columns.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 buildTwiddleVendorTree has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function buildTwiddleVendorTree() {
                              const funnel = require('broccoli-funnel');
                              const concat = require('broccoli-concat');
                              const mergeTrees = require('broccoli-merge-trees');
                              const babelTranspiler = require('broccoli-babel-transpiler');
                            Severity: Minor
                            Found in lib/build-twiddle-ember-tree.js - About 1 hr to fix

                              Function didReceiveAttrs has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                              Open

                                didReceiveAttrs() {
                                  if(!this.element) {
                                    return;
                                  }
                              
                              
                              Severity: Minor
                              Found in app/components/dummy-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 getEmberCLIBlueprints has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function getEmberCLIBlueprints() {
                                const fs = require('fs');
                                let fileMap = {};
                              
                                let blueprintFiles = {
                              Severity: Minor
                              Found in lib/get-ember-cli-blueprints.js - About 1 hr to fix

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

                                module.exports = function(deployTarget) {
                                  var ENV = {
                                    build: {
                                      environment: 'production'
                                    },
                                Severity: Minor
                                Found in config/deploy.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language