AugurProject/augur-ui

View on GitHub
src/modules/reports/actions/get-payout-numerators.test.js

Summary

Maintainability
F
6 days
Test Coverage

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

  describe("scalar 25", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketScalar, "25", false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 6 other locations - About 5 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 42..55
src/modules/reports/actions/get-payout-numerators.test.js on lines 57..70
src/modules/reports/actions/get-payout-numerators.test.js on lines 72..85
src/modules/reports/actions/get-payout-numerators.test.js on lines 87..100
src/modules/reports/actions/get-payout-numerators.test.js on lines 117..130
src/modules/reports/actions/get-payout-numerators.test.js on lines 132..145

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

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

  describe("scalar 25 sub 0 Min", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketScalarMin, "25", false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 6 other locations - About 5 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 42..55
src/modules/reports/actions/get-payout-numerators.test.js on lines 57..70
src/modules/reports/actions/get-payout-numerators.test.js on lines 87..100
src/modules/reports/actions/get-payout-numerators.test.js on lines 102..115
src/modules/reports/actions/get-payout-numerators.test.js on lines 117..130
src/modules/reports/actions/get-payout-numerators.test.js on lines 132..145

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

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

  describe("scalar invalid", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketScalar, "0", true).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 6 other locations - About 5 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 42..55
src/modules/reports/actions/get-payout-numerators.test.js on lines 57..70
src/modules/reports/actions/get-payout-numerators.test.js on lines 72..85
src/modules/reports/actions/get-payout-numerators.test.js on lines 87..100
src/modules/reports/actions/get-payout-numerators.test.js on lines 102..115
src/modules/reports/actions/get-payout-numerators.test.js on lines 117..130

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

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

  describe("scalar 75", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketScalar, "75", false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 6 other locations - About 5 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 57..70
src/modules/reports/actions/get-payout-numerators.test.js on lines 72..85
src/modules/reports/actions/get-payout-numerators.test.js on lines 87..100
src/modules/reports/actions/get-payout-numerators.test.js on lines 102..115
src/modules/reports/actions/get-payout-numerators.test.js on lines 117..130
src/modules/reports/actions/get-payout-numerators.test.js on lines 132..145

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

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

  describe("scalar 75 sub 0 Min", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketScalarMin, "75", false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 6 other locations - About 5 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 42..55
src/modules/reports/actions/get-payout-numerators.test.js on lines 72..85
src/modules/reports/actions/get-payout-numerators.test.js on lines 87..100
src/modules/reports/actions/get-payout-numerators.test.js on lines 102..115
src/modules/reports/actions/get-payout-numerators.test.js on lines 117..130
src/modules/reports/actions/get-payout-numerators.test.js on lines 132..145

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

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

  describe("scalar 50", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketScalar, "50", false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 6 other locations - About 5 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 42..55
src/modules/reports/actions/get-payout-numerators.test.js on lines 57..70
src/modules/reports/actions/get-payout-numerators.test.js on lines 72..85
src/modules/reports/actions/get-payout-numerators.test.js on lines 102..115
src/modules/reports/actions/get-payout-numerators.test.js on lines 117..130
src/modules/reports/actions/get-payout-numerators.test.js on lines 132..145

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

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

  describe("scalar 45.01", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketScalar, "45.01", false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 6 other locations - About 5 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 42..55
src/modules/reports/actions/get-payout-numerators.test.js on lines 57..70
src/modules/reports/actions/get-payout-numerators.test.js on lines 72..85
src/modules/reports/actions/get-payout-numerators.test.js on lines 87..100
src/modules/reports/actions/get-payout-numerators.test.js on lines 102..115
src/modules/reports/actions/get-payout-numerators.test.js on lines 132..145

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

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

  describe("categorical 3", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketCategorical, 3, false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 3 other locations - About 2 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 177..185
src/modules/reports/actions/get-payout-numerators.test.js on lines 197..205
src/modules/reports/actions/get-payout-numerators.test.js on lines 207..215

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

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

  describe("categorical 6", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketCategorical, 6, false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 3 other locations - About 2 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 177..185
src/modules/reports/actions/get-payout-numerators.test.js on lines 187..195
src/modules/reports/actions/get-payout-numerators.test.js on lines 207..215

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

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

  describe("categorical invalid", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketCategorical, 0, true).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 3 other locations - About 2 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 177..185
src/modules/reports/actions/get-payout-numerators.test.js on lines 187..195
src/modules/reports/actions/get-payout-numerators.test.js on lines 197..205

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

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

  describe("categorical 0", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketCategorical, 0, false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 3 other locations - About 2 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 187..195
src/modules/reports/actions/get-payout-numerators.test.js on lines 197..205
src/modules/reports/actions/get-payout-numerators.test.js on lines 207..215

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

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

  describe("yes/no invalid", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketBinary, 1, true).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 2 other locations - About 2 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 147..155
src/modules/reports/actions/get-payout-numerators.test.js on lines 157..165

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

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

  describe("yes/no YES", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketBinary, 1, false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 2 other locations - About 2 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 147..155
src/modules/reports/actions/get-payout-numerators.test.js on lines 167..175

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

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

  describe("yes/no NO", () => {
    test(`should call the expected method`, () => {
      const actual = getPayoutNumerators(marketBinary, 0, false).map(n =>
        n.toString()
      );
Severity: Major
Found in src/modules/reports/actions/get-payout-numerators.test.js and 2 other locations - About 2 hrs to fix
src/modules/reports/actions/get-payout-numerators.test.js on lines 157..165
src/modules/reports/actions/get-payout-numerators.test.js on lines 167..175

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

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