ember-cli/ember-twiddle

View on GitHub

Showing 34 of 52 total issues

Function fileTreeHash has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  fileTreeHash: computed('model.files.@each.filePath', function() {
    const files = this.get('model.files') || [];

    return files.reduce((accumulator, file) => {
      if (!file) {
Severity: Minor
Found in app/components/file-tree.js - About 1 hr to fix

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

      didReceiveAttrs() {
        if(!this.element) {
          return;
        }
    
    
    Severity: Minor
    Found in app/components/dummy-app.js - About 1 hr to fix

      Function compileGist has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        compileGist(gist) {
          let errors = [];
          let out = [];
          let cssOut = [];
      
      
      Severity: Minor
      Found in app/services/ember-cli.js - About 1 hr to fix

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

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

          function babelOpts(moduleName) {
          
            return {
              presets: [['env', {
                targets: {
          Severity: Minor
          Found in app/services/ember-cli.js - About 1 hr to fix

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

              fileTreeData: computed('fileTreeHash', function() {
                const fileTreeHash = this.fileTreeHash;
                const fileTreeKeys = Object.keys(fileTreeHash);
                const fileTreeObjects = fileTreeKeys.map(key => fileTreeHash[key]);
            
            
            Severity: Minor
            Found in app/components/file-tree.js - About 1 hr to fix

              Avoid deeply nested control flow statements.
              Open

                          if (addon.error_log) {
                            console.error(addon.error_log);
                          }
              Severity: Major
              Found in app/services/dependency-resolver.js - About 45 mins to fix

                Function exports has a Cognitive Complexity of 8 (exceeds 5 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: Minor
                Found in config/environment.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

                Function buildDependencies has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  buildDependencies(twiddleJSON) {
                    let deps = twiddleJSON.dependencies;
                    let depCssLinkTags = '';
                    let depScriptTags = '';
                    let testStuff = '';
                Severity: Minor
                Found in app/services/ember-cli.js - About 35 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

                Function error has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    error(error) {
                      if (error && error.errors && error.errors.length > 0) {
                        let error1 = error.errors[0];
                        if (error1.status === "404") {
                          if (alert) {
                Severity: Minor
                Found in app/routes/gist/edit.js - About 35 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

                Function serializeHasMany has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  serializeHasMany(snapshot, json, relationship) {
                    if (relationship.key === 'files') {
                      this.serializeFiles(snapshot, json, relationship);
                    }
                    else {
                Severity: Minor
                Found in app/serializers/gist.js - About 35 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

                Function addFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  async addFile(type) {
                    let replacements = {};
                    let isGlimmer = await this.emberCli.twiddleJson.hasAddon(this.model, '@glimmer/component');
                
                    if (type === 'component-js') {
                Severity: Minor
                Found in app/mixins/files.js - About 35 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

                Function exports has a Cognitive Complexity of 7 (exceeds 5 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: Minor
                Found in ember-cli-build.js - About 35 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

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

                  buildProperties(type, replacements) {
                    if (type in availableBlueprints) {
                      let blueprint = availableBlueprints[type];
                      let content = blueprints[blueprint.blueprint];
                
                
                Severity: Minor
                Found in app/services/ember-cli.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