AugurProject/augur-ui

View on GitHub
src/utils/calculate-payout-numerators-value.test.js

Summary

Maintainability
D
3 days
Test Coverage

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

  describe("categorical 3", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketCategorical,
        [0, 0, 0, 10003, 0, 0, 0],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 2 other locations - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 173..183
src/utils/calculate-payout-numerators-value.test.js on lines 197..207

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

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("categorical 6", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketCategorical,
        [0, 0, 0, 0, 0, 0, 10003],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 2 other locations - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 173..183
src/utils/calculate-payout-numerators-value.test.js on lines 185..195

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

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("categorical 0", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketCategorical,
        [10003, 0, 0, 0, 0, 0, 0],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 2 other locations - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 185..195
src/utils/calculate-payout-numerators-value.test.js on lines 197..207

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

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

  describe("scalar 75", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketScalar,
        [2500, 7500],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 53..63
src/utils/calculate-payout-numerators-value.test.js on lines 65..75
src/utils/calculate-payout-numerators-value.test.js on lines 77..87
src/utils/calculate-payout-numerators-value.test.js on lines 89..99
src/utils/calculate-payout-numerators-value.test.js on lines 101..111
src/utils/calculate-payout-numerators-value.test.js on lines 113..123
src/utils/calculate-payout-numerators-value.test.js on lines 137..147
src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

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

  describe("scalar sub 0 Min 73", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketScalarMin,
        [470, 830],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 41..51
src/utils/calculate-payout-numerators-value.test.js on lines 53..63
src/utils/calculate-payout-numerators-value.test.js on lines 77..87
src/utils/calculate-payout-numerators-value.test.js on lines 89..99
src/utils/calculate-payout-numerators-value.test.js on lines 101..111
src/utils/calculate-payout-numerators-value.test.js on lines 113..123
src/utils/calculate-payout-numerators-value.test.js on lines 137..147
src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

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

  describe("scalar sub 0 Min 25", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketScalarMin,
        [950, 350],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 41..51
src/utils/calculate-payout-numerators-value.test.js on lines 53..63
src/utils/calculate-payout-numerators-value.test.js on lines 65..75
src/utils/calculate-payout-numerators-value.test.js on lines 89..99
src/utils/calculate-payout-numerators-value.test.js on lines 101..111
src/utils/calculate-payout-numerators-value.test.js on lines 113..123
src/utils/calculate-payout-numerators-value.test.js on lines 137..147
src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

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

  describe("yes/no YES", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketBinary,
        [0, 10000],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 41..51
src/utils/calculate-payout-numerators-value.test.js on lines 53..63
src/utils/calculate-payout-numerators-value.test.js on lines 65..75
src/utils/calculate-payout-numerators-value.test.js on lines 77..87
src/utils/calculate-payout-numerators-value.test.js on lines 89..99
src/utils/calculate-payout-numerators-value.test.js on lines 101..111
src/utils/calculate-payout-numerators-value.test.js on lines 113..123
src/utils/calculate-payout-numerators-value.test.js on lines 137..147

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

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

  describe("scalar sub 0 Min 75", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketScalarMin,
        [450, 850],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 41..51
src/utils/calculate-payout-numerators-value.test.js on lines 65..75
src/utils/calculate-payout-numerators-value.test.js on lines 77..87
src/utils/calculate-payout-numerators-value.test.js on lines 89..99
src/utils/calculate-payout-numerators-value.test.js on lines 101..111
src/utils/calculate-payout-numerators-value.test.js on lines 113..123
src/utils/calculate-payout-numerators-value.test.js on lines 137..147
src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

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

  describe("scalar 25", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketScalar,
        [7500, 2500],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 41..51
src/utils/calculate-payout-numerators-value.test.js on lines 53..63
src/utils/calculate-payout-numerators-value.test.js on lines 65..75
src/utils/calculate-payout-numerators-value.test.js on lines 77..87
src/utils/calculate-payout-numerators-value.test.js on lines 89..99
src/utils/calculate-payout-numerators-value.test.js on lines 113..123
src/utils/calculate-payout-numerators-value.test.js on lines 137..147
src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

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

  describe("scalar 50", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketScalar,
        [5000, 5000],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 41..51
src/utils/calculate-payout-numerators-value.test.js on lines 53..63
src/utils/calculate-payout-numerators-value.test.js on lines 65..75
src/utils/calculate-payout-numerators-value.test.js on lines 77..87
src/utils/calculate-payout-numerators-value.test.js on lines 101..111
src/utils/calculate-payout-numerators-value.test.js on lines 113..123
src/utils/calculate-payout-numerators-value.test.js on lines 137..147
src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

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

  describe("yes/no NO", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketBinary,
        [10000, 0],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 41..51
src/utils/calculate-payout-numerators-value.test.js on lines 53..63
src/utils/calculate-payout-numerators-value.test.js on lines 65..75
src/utils/calculate-payout-numerators-value.test.js on lines 77..87
src/utils/calculate-payout-numerators-value.test.js on lines 89..99
src/utils/calculate-payout-numerators-value.test.js on lines 101..111
src/utils/calculate-payout-numerators-value.test.js on lines 113..123
src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

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

  describe("scalar 45.01", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketScalar,
        [5499, 4501],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 8 other locations - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 41..51
src/utils/calculate-payout-numerators-value.test.js on lines 53..63
src/utils/calculate-payout-numerators-value.test.js on lines 65..75
src/utils/calculate-payout-numerators-value.test.js on lines 77..87
src/utils/calculate-payout-numerators-value.test.js on lines 89..99
src/utils/calculate-payout-numerators-value.test.js on lines 101..111
src/utils/calculate-payout-numerators-value.test.js on lines 137..147
src/utils/calculate-payout-numerators-value.test.js on lines 149..159

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

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

  describe("yes/no invalid", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketBinary,
        [5000, 5000],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 1 other location - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 125..135

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

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

  describe("scalar invalid", () => {
    test(`should call the expected method`, () => {
      const actual = calculatePayoutNumeratorsValue(
        marketScalar,
        [5000, 5000],
Severity: Major
Found in src/utils/calculate-payout-numerators-value.test.js and 1 other location - About 1 hr to fix
src/utils/calculate-payout-numerators-value.test.js on lines 161..171

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

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