san650/ember-cli-page-object

View on GitHub
test-app/tests/unit/-private/properties/is-present-test.ts

Summary

Maintainability
D
2 days
Test Coverage

FIXME found
Open

    // FIXME the order we call createTemplate here is important! (it shouldn't, that's why there's a FIXME tag)

FIXME found
Open

    // FIXME the order we call createTemplate here is important! (it shouldn't, that's why there's a FIXME tag)

FIXME found
Open

    // FIXME the order we call createTemplate here is important! (it shouldn't, that's why there's a FIXME tag)

FIXME found
Open

    // FIXME the order we call createTemplate here is important! (it shouldn't, that's why there's a FIXME tag)

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

  test('looks for elements outside the testing container', async function (this: TestContext, assert) {
    const page = create({
      foo: isPresent('span', { testContainer: '#alternate-ember-testing' }),
    });

Severity: Major
Found in test-app/tests/unit/-private/properties/is-present-test.ts and 2 other locations - About 3 hrs to fix
test-app/tests/unit/-private/properties/is-hidden-test.ts on lines 114..126
test-app/tests/unit/-private/properties/is-visible-test.ts on lines 114..126

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

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

  test('looks for elements within test container specified at node level', async function (this: TestContext, assert) {
    const page = create({
      testContainer: '#alternate-ember-testing',
      foo: isPresent('span'),
    });
Severity: Major
Found in test-app/tests/unit/-private/properties/is-present-test.ts and 2 other locations - About 3 hrs to fix
test-app/tests/unit/-private/properties/is-hidden-test.ts on lines 128..141
test-app/tests/unit/-private/properties/is-visible-test.ts on lines 128..141

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

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

  test('resets scope', async function (this: TestContext, assert) {
    const page = create({
      scope: '.scope',

      foo: isPresent('span', { resetScope: true, at: 0 }),
Severity: Major
Found in test-app/tests/unit/-private/properties/is-present-test.ts and 2 other locations - About 2 hrs to fix
test-app/tests/unit/-private/properties/is-hidden-test.ts on lines 68..82
test-app/tests/unit/-private/properties/is-visible-test.ts on lines 66..79

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

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

  test('looks for elements inside the scope', async function (this: TestContext, assert) {
    const page = create({
      foo: isPresent('span', { scope: '.scope', at: 0 }),
    });

Severity: Major
Found in test-app/tests/unit/-private/properties/is-present-test.ts and 1 other location - About 2 hrs to fix
test-app/tests/unit/-private/properties/is-visible-test.ts on lines 38..49

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

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

  test("looks for elements inside page's scope", async function (this: TestContext, assert) {
    const page = create({
      scope: '.scope',

      foo: isPresent('span', { at: 0 }),
Severity: Major
Found in test-app/tests/unit/-private/properties/is-present-test.ts and 1 other location - About 2 hrs to fix
test-app/tests/unit/-private/properties/is-visible-test.ts on lines 51..64

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

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

  test('throws error if selector matches more than one element', async function (this: TestContext, assert) {
    const page = create({
      foo: isPresent('span'),
    });

Severity: Major
Found in test-app/tests/unit/-private/properties/is-present-test.ts and 4 other locations - About 2 hrs to fix
test-app/tests/unit/-private/properties/is-hidden-test.ts on lines 84..98
test-app/tests/unit/-private/properties/is-visible-test.ts on lines 81..96
test-app/tests/unit/-private/properties/text-test.ts on lines 174..189
test-app/tests/unit/-private/properties/value-test.ts on lines 101..115

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

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

  test("returns false when the element doesn't exist", async function (this: TestContext, assert) {
    const page = create({
      foo: isPresent('span'),
    });

Severity: Major
Found in test-app/tests/unit/-private/properties/is-present-test.ts and 3 other locations - About 1 hr to fix
test-app/tests/unit/-private/properties/is-hidden-test.ts on lines 28..36
test-app/tests/unit/-private/properties/is-visible-test.ts on lines 18..26
test-app/tests/unit/-private/properties/is-visible-test.ts on lines 28..36

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

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

  test('returns true when the element is visible', async function (this: TestContext, assert) {
    const page = create({
      foo: isPresent('span'),
    });

Severity: Major
Found in test-app/tests/unit/-private/properties/is-present-test.ts and 4 other locations - About 1 hr to fix
test-app/tests/unit/-private/properties/is-hidden-test.ts on lines 8..16
test-app/tests/unit/-private/properties/is-hidden-test.ts on lines 18..26
test-app/tests/unit/-private/properties/is-present-test.ts on lines 18..26
test-app/tests/unit/-private/properties/is-visible-test.ts on lines 8..16

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

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

  test('returns true when the element is hidden', async function (this: TestContext, assert) {
    const page = create({
      foo: isPresent('span'),
    });

Severity: Major
Found in test-app/tests/unit/-private/properties/is-present-test.ts and 4 other locations - About 1 hr to fix
test-app/tests/unit/-private/properties/is-hidden-test.ts on lines 8..16
test-app/tests/unit/-private/properties/is-hidden-test.ts on lines 18..26
test-app/tests/unit/-private/properties/is-present-test.ts on lines 8..16
test-app/tests/unit/-private/properties/is-visible-test.ts on lines 8..16

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

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