ember-cli/ember-twiddle

View on GitHub

Showing 52 of 52 total issues

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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          getModuleId(origName) {
            let i = origName.indexOf('ember-twiddle/');
            let newName = origName.substr(i + 'ember-twiddle/'.length);
            if (addonName) {
              return addonName + '/' + newName;
      Severity: Major
      Found in lib/babel-opts.js and 1 other location - About 1 hr to fix
      lib/typescript-opts.js on lines 27..34

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 68.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          getModuleId(origName) {
            let i = origName.indexOf('ember-twiddle/');
            let newName = origName.substr(i + 'ember-twiddle/'.length);
            if (addonName) {
              return addonName + '/' + newName;
      Severity: Major
      Found in lib/typescript-opts.js and 1 other location - About 1 hr to fix
      lib/babel-opts.js on lines 23..30

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 68.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          $(window).on("mousemove", function(event) {
            window.parent.postMessage({
              mousemove: {
                pageX: event.pageX,
                pageY: event.pageY
      Severity: Major
      Found in blueprints/mouse_events_initializer.js and 1 other location - About 1 hr to fix
      blueprints/mouse_events_initializer.js on lines 16..23

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 67.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

            [
              'babel-plugin-debug-macros',
              {
                flags: [
                  {
      Severity: Major
      Found in lib/babel-opts.js and 1 other location - About 1 hr to fix
      lib/typescript-opts.js on lines 46..67

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 67.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

            [
              'babel-plugin-debug-macros',
              {
                flags: [
                  {
      Severity: Major
      Found in lib/typescript-opts.js and 1 other location - About 1 hr to fix
      lib/babel-opts.js on lines 42..63

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 67.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          $(window).on("mouseup", function(event) {
            window.parent.postMessage({
              mouseup: {
                pageX: event.pageX,
                pageY: event.pageY
      Severity: Major
      Found in blueprints/mouse_events_initializer.js and 1 other location - About 1 hr to fix
      blueprints/mouse_events_initializer.js on lines 8..15

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 67.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

        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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                if (type === 'component-js') {
                  replacements.importComponent = isGlimmer ?
                    `import Component from '@glimmer/component';` :
                    `import Component from '@ember/component';`;
                  replacements.importTemplate = '';
            Severity: Major
            Found in app/mixins/files.js and 1 other location - About 1 hr to fix
            app/mixins/files.js on lines 134..140

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 60.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                  if (fileExt === 'js') {
                    replacements.importComponent = isGlimmer ?
                      `import Component from '@glimmer/component';` :
                      `import Component from '@ember/component';`;
                    replacements.importTemplate = '';
            Severity: Major
            Found in app/mixins/files.js and 1 other location - About 1 hr to fix
            app/mixins/files.js on lines 72..78

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 60.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        if (name === 'ember-data') {
                          const msg = 'It is recommended you use ember-data as an addon';
                          deprecate(msg, Ember.testing, {
                            id: 'ember-twiddle.deprecate-ember-data-as-dependency',
                            until: '0.16.0',
                    Severity: Minor
                    Found in app/services/dependency-resolver.js and 1 other location - About 55 mins to fix
                    app/services/dependency-resolver.js on lines 165..174

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 53.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        if (compareVersions(version, '2.16.0') === -1) {
                          const msg = 'Versions of Ember prior to 2.16.0 are no longer supported in Ember Twiddle';
                          deprecate(msg, Ember.testing, {
                            id: 'ember-twiddle.deprecate-ember-versions-before-2-16',
                            until: '0.17.0',
                    Severity: Minor
                    Found in app/services/dependency-resolver.js and 1 other location - About 55 mins to fix
                    app/services/dependency-resolver.js on lines 154..163

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 53.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language