AugurProject/augur-ui

View on GitHub
src/modules/trades/actions/update-trades-in-progress.test.js

Summary

Maintainability
F
3 wks
Test Coverage

File update-trades-in-progress.test.js has 949 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import configureMockStore from "redux-mock-store";
import thunk from "redux-thunk";
import testState from "test/testState";
import { BUY, SELL, tradeTestState } from "test/tradeTestState";
import { loadUsershareBalances } from "modules/positions/actions/load-user-share-balances";
Severity: Major
Found in src/modules/trades/actions/update-trades-in-progress.test.js - About 2 days to fix

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

        test("should handle the tradeDetails object if limitPrice is unchanged but share number changes", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testCategoricalMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 379..414
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 430..465
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 620..655

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

    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("should handle the tradeDetails object if limitPrice is unchanged but share number changes to negative (should default to the positive version of the numShares: -25 becomes 25.)", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testCategoricalMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 379..414
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 430..465
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 583..618

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

    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("should pass calculation tests for selling 10 shares of Outcome 1 at the default limitPrice", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testCategoricalMarketId",
              outcomeId: 1,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 379..414
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 583..618
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 620..655

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

    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("should pass calculation tests for buying 10 shares of Outcome 1 at the default limitPrice", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testCategoricalMarketId",
              outcomeId: 1,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 430..465
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 583..618
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 620..655

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

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

        test("should pass calculation tests for buying 10 shares of outcome 1 at the default limitPrice", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testScalarMarketId",
              outcomeId: 1,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 76..111
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 127..162
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 269..304
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 306..341
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 744..779
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 885..920
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 922..957

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

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

        test("should handle the tradeDetails object if limitPrice is unchanged but share number changes", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testYesNoMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 76..111
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 127..162
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 306..341
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 693..728
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 744..779
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 885..920
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 922..957

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

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

        test("should pass calculation tests for selling 10 shares of YES at the default limitPrice", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testYesNoMarketId",
              outcomeId: 1,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 76..111
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 269..304
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 306..341
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 693..728
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 744..779
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 885..920
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 922..957

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

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

        test("should pass calculation tests for selling 10 shares of outcome1 at the default limitPrice", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testScalarMarketId",
              outcomeId: 1,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 76..111
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 127..162
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 269..304
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 306..341
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 693..728
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 885..920
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 922..957

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

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

        test("should handle the tradeDetails object if limitPrice is unchanged but share number changes to negative (should default to the positive version of the numShares: -25 becomes 25.)", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testScalarMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 76..111
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 127..162
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 269..304
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 306..341
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 693..728
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 744..779
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 885..920

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

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

        test("should pass calculation tests for buying 10 shares of YES at the default limitPrice", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testYesNoMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 127..162
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 269..304
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 306..341
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 693..728
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 744..779
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 885..920
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 922..957

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

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

        test("should handle the tradeDetails object if limitPrice is unchanged but share number changes to negative (should default to the positive version of the numShares: -25 becomes 25.)", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testYesNoMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 76..111
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 127..162
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 269..304
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 693..728
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 744..779
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 885..920
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 922..957

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

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

        test("should handle the tradeDetails object if limitPrice is unchanged but share number changes", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testScalarMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 76..111
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 127..162
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 269..304
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 306..341
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 693..728
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 744..779
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 922..957

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

    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("should handle the tradeDetails object if no shares are passed in as a buy but a limitPrice is set.", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testScalarMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 191..216
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 494..519

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

        test("should reset the tradeDetails object if 0 shares are passed in as a buy", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testScalarMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 164..189
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 467..492

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

        test("should reset the tradeDetails object if 0 shares are passed in as a buy", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testYesNoMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 467..492
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 781..806

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

        test("should handle the tradeDetails object if no shares are passed in as a buy but a limitPrice is set.", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testCategoricalMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 191..216
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 808..833

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

        test("should handle the tradeDetails object if no shares are passed in as a buy but a limitPrice is set.", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testYesNoMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 494..519
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 808..833

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

        test("should reset the tradeDetails object if 0 shares are passed in as a buy", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testCategoricalMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 164..189
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 781..806

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

        test("should pass shape tests for Selling 10 shares of Outcome 0 at the default limitPrice", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testCategoricalMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 62..74
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 113..125
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 365..377
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 679..691
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 730..742

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

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

        test("should pass shape tests for Selling 10 shares of outcome 1 at the default limitPrice", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testScalarMarketId",
              outcomeId: 1,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 62..74
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 113..125
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 365..377
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 416..428
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 679..691

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

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

        test("should pass shape tests for buying 10 shares of YES at the default limitPrice", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testYesNoMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 113..125
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 365..377
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 416..428
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 679..691
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 730..742

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

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

        test("should pass shape tests for Selling 10 shares of YES at the default limitPrice", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testYesNoMarketId",
              outcomeId: 1,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 62..74
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 365..377
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 416..428
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 679..691
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 730..742

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

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

        test("should pass shape tests for buying 10 shares of outcome1 at the default limitPrice", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testScalarMarketId",
              outcomeId: 1,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 62..74
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 113..125
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 365..377
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 416..428
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 730..742

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

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

        test("should pass shape tests for buying 10 shares of Outcome 0 at the default limitPrice", () => {
          store.dispatch(
            updateTradesInProgress({
              marketId: "testCategoricalMarketId",
              outcomeId: 0,
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 62..74
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 113..125
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 416..428
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 679..691
    src/modules/trades/actions/update-trades-in-progress.test.js on lines 730..742

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

    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