AugurProject/augur-ui

View on GitHub
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js

Summary

Maintainability
F
4 days
Test Coverage

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

  test(`get remaining rep`, () => {
    const outcome = {
      bondSizeCurrent: 12588500976562500000,
      completedStake: "0",
      stakeCurrent: "1699361165364583300",
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 60..75
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 77..92
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 94..109
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 128..143
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 145..160
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 162..177

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

  test(`big numbers account % complete, rounding up`, () => {
    const outcome = {
      bondSizeCurrent: 6294250488281250000,
      stakeCurrent: "349680582682291650",
      completedStake: "0",
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 11..26
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 77..92
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 94..109
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 128..143
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 145..160
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 162..177

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

  test(`% complete, 75 `, () => {
    const outcome = {
      bondSizeCurrent: 10,
      stakeCurrent: "7.5",
      completedStake: "0",
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 11..26
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 60..75
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 77..92
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 94..109
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 145..160
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 162..177

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

  test(`big numbers account % complete, 50 `, () => {
    const outcome = {
      bondSizeCurrent: 4000000000000000000,
      stakeCurrent: "2000000000000000000",
      completedStake: "0",
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 11..26
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 60..75
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 77..92
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 128..143
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 145..160
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 162..177

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

  test(`% complete, 50 `, () => {
    const outcome = {
      bondSizeCurrent: 10,
      stakeCurrent: "5",
      completedStake: "0",
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 11..26
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 60..75
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 77..92
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 94..109
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 128..143
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 162..177

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

  test(`big numbers account % complete, 10, total 50 complete `, () => {
    const outcome = {
      bondSizeCurrent: 20000000000000000000,
      stakeCurrent: "12000000000000000000",
      completedStake: "0",
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 11..26
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 60..75
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 94..109
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 128..143
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 145..160
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 162..177

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

  test(`all zeros`, () => {
    const outcome = {
      bondSizeCurrent: 0,
      stakeCurrent: "0",
      completedStake: "0",
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 11..26
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 60..75
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 77..92
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 94..109
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 128..143
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 145..160

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

  test(`big numbers completed % both non and account`, () => {
    const outcome = {
      bondSizeCurrent: 2098083496093750000,
      stakeCurrent: "2098083496093750000",
      accountStakeCurrent: "1098083496093750000"
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 44..58

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

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(`big numbers non account complete%`, () => {
    const outcome = {
      bondSizeCurrent: 2098083496093750000,
      stakeCurrent: "1098083496093750000",
      accountStakeCurrent: "0"
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 28..42

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

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(`empty object`, () => {
    const outcome = {};
    const disputeBond = 0;
    const actual = fillDisputeOutcomeProgess(disputeBond, outcome);
    const expected = {
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 179..188

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

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(`empty object with bond`, () => {
    const outcome = {};
    const disputeBond = 10;
    const actual = fillDisputeOutcomeProgess(disputeBond, outcome);
    const expected = {
src/modules/reports/selectors/fill-dispute-outcome-progress.test.js on lines 190..199

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

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