lifeart/ember-ast-hot-load

View on GitHub
lib/ast-transform.test.js

Summary

Maintainability
C
1 day
Test Coverage

File ast-transform.test.js has 361 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

/* eslint-env jest */
const defaultConfig = {
  addonContext: {
Severity: Minor
Found in lib/ast-transform.test.js - About 4 hrs to fix

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

      Object.defineProperty(
        configForDisabledAddon.addonContext._OPTIONS,
        'initialized',
        {
          get: function () {
    Severity: Major
    Found in lib/ast-transform.test.js and 3 other locations - About 1 hr to fix
    lib/ast-transform.test.js on lines 264..275
    lib/ast-transform.test.js on lines 276..287
    lib/ast-transform.test.js on lines 314..325

    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 56.

    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 4 locations. Consider refactoring.
    Open

      Object.defineProperty(
        configForDisabledAddon.addonContext._OPTIONS,
        'enabled',
        {
          get: function () {
    Severity: Major
    Found in lib/ast-transform.test.js and 3 other locations - About 1 hr to fix
    lib/ast-transform.test.js on lines 264..275
    lib/ast-transform.test.js on lines 276..287
    lib/ast-transform.test.js on lines 326..337

    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 56.

    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 4 locations. Consider refactoring.
    Open

      Object.defineProperty(
        configForDisabledAddon.addonContext._OPTIONS,
        'enabled',
        {
          get: function () {
    Severity: Major
    Found in lib/ast-transform.test.js and 3 other locations - About 1 hr to fix
    lib/ast-transform.test.js on lines 276..287
    lib/ast-transform.test.js on lines 314..325
    lib/ast-transform.test.js on lines 326..337

    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 56.

    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 4 locations. Consider refactoring.
    Open

      Object.defineProperty(
        configForDisabledAddon.addonContext._OPTIONS,
        'initialized',
        {
          get: function () {
    Severity: Major
    Found in lib/ast-transform.test.js and 3 other locations - About 1 hr to fix
    lib/ast-transform.test.js on lines 264..275
    lib/ast-transform.test.js on lines 314..325
    lib/ast-transform.test.js on lines 326..337

    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 56.

    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 4 locations. Consider refactoring.
    Open

    it('handle hyphen helpers and components', () => {
      assert(
        `{{foo-bar}}`,
        `{{component (hot-load "foo-bar" this foo-bar "foo-bar") hotReloadCUSTOMhlContext=this hotReloadCUSTOMName="foo-bar" hotReloadCUSTOMhlProperty=foo-bar hotReloadCUSTOMHasParams=false hotReloadCUSTOMHasHash=false}}`
      );
    Severity: Major
    Found in lib/ast-transform.test.js and 3 other locations - About 40 mins to fix
    lib/ast-transform.test.js on lines 43..52
    lib/ast-transform.test.js on lines 159..162
    lib/ast-transform.test.js on lines 179..185

    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 49.

    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 4 locations. Consider refactoring.
    Open

    it('ignore addon-specific helper special names', () => {
      assert(`{{hot-load}}`, `{{hot-load}}`);
      assert(`{{component "hot-load"}}`, `{{component "hot-load"}}`);
    });
    Severity: Major
    Found in lib/ast-transform.test.js and 3 other locations - About 40 mins to fix
    lib/ast-transform.test.js on lines 21..30
    lib/ast-transform.test.js on lines 43..52
    lib/ast-transform.test.js on lines 179..185

    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 49.

    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 4 locations. Consider refactoring.
    Open

    it('handle component helper', () => {
      assert(
        `{{component "foo"}}`,
        `{{component (hot-load "foo" this "foo" "foo") hotReloadCUSTOMhlContext=this hotReloadCUSTOMName="foo" hotReloadCUSTOMhlProperty="foo" hotReloadCUSTOMHasParams=true hotReloadCUSTOMHasHash=false}}`
      );
    Severity: Major
    Found in lib/ast-transform.test.js and 3 other locations - About 40 mins to fix
    lib/ast-transform.test.js on lines 21..30
    lib/ast-transform.test.js on lines 159..162
    lib/ast-transform.test.js on lines 179..185

    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 49.

    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 4 locations. Consider refactoring.
    Open

    it('skip ...attributed components', () => {
      assert(`<FooBar ...attributes />`, `<FooBar...attributes />`);
      assert(
        `<FooBar name="foo" ...attributes />`,
        `<FooBar name="foo"...attributes />`
    Severity: Major
    Found in lib/ast-transform.test.js and 3 other locations - About 40 mins to fix
    lib/ast-transform.test.js on lines 21..30
    lib/ast-transform.test.js on lines 43..52
    lib/ast-transform.test.js on lines 159..162

    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 49.

    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

    There are no issues that match your filters.

    Category
    Status