AugurProject/augur-ui

View on GitHub
src/modules/trading/components/trading--form/trading--form.jsx

Summary

Maintainability
F
1 wk
Test Coverage

File trading--form.jsx has 624 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint jsx-a11y/label-has-for: 0 */
import { augur } from "services/augurjs";
import React, { Component } from "react";
import PropTypes from "prop-types";
import classNames from "classnames";
Severity: Major
Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 day to fix

    Function render has 268 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        const {
          isMobile,
          market,
          marketQuantity,
    Severity: Major
    Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 day to fix

      Function render has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

        render() {
          const {
            isMobile,
            market,
            marketQuantity,
      Severity: Minor
      Found in src/modules/trading/components/trading--form/trading--form.jsx - About 3 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function orderValidation has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        orderValidation(order, nextProps = null) {
          let errors = {
            [this.INPUT_TYPES.QUANTITY]: [],
            [this.INPUT_TYPES.PRICE]: [],
            [this.INPUT_TYPES.MARKET_ORDER_SIZE]: [],
      Severity: Major
      Found in src/modules/trading/components/trading--form/trading--form.jsx - About 3 hrs to fix

        Function componentWillReceiveProps has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          componentWillReceiveProps(nextProps) {
            const {
              orderEthEstimate,
              orderShareEstimate,
              selectedNav,
        Severity: Major
        Found in src/modules/trading/components/trading--form/trading--form.jsx - About 2 hrs to fix

          Function validateForm has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            validateForm(property, rawValue) {
              const { updateState } = this.props;
              // since the order changed by user action, make sure we can place orders.
              // updateState('doNotCreateOrders', false)
              let value = rawValue;
          Severity: Minor
          Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 hr to fix

            Function constructor has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              constructor(props) {
                super(props);
            
                this.INPUT_TYPES = {
                  QUANTITY: "orderQuantity",
            Severity: Minor
            Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 hr to fix

              Function testPrice has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                testPrice(value, errors, isOrderValid, nextProps = null) {
                  const props = nextProps || this.props;
                  const { maxPrice, minPrice, market } = props;
                  const tickSize = createBigNumber(market.tickSize);
                  let errorCount = 0;
              Severity: Minor
              Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                    if (!isEqual(newOrderInfo, currentOrderInfo)) {
                      // trade has changed, lets update trade.
                      this.updateTrade(newStateInfo, nextProps);
                
                      const nextTradePrice = nextProps.selectedOutcome.trade.limitPrice;
                Severity: Major
                Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if (orderType === LIMIT) {
                        return (
                          <div>
                            <ul className={Styles["TradingForm__form-body"]}>
                              {!isMobile &&
                  Severity: Major
                  Found in src/modules/trading/components/trading--form/trading--form.jsx - About 1 hr to fix

                    Function orderValidation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                      orderValidation(order, nextProps = null) {
                        let errors = {
                          [this.INPUT_TYPES.QUANTITY]: [],
                          [this.INPUT_TYPES.PRICE]: [],
                          [this.INPUT_TYPES.MARKET_ORDER_SIZE]: [],
                    Severity: Minor
                    Found in src/modules/trading/components/trading--form/trading--form.jsx - About 55 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function componentWillReceiveProps has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      componentWillReceiveProps(nextProps) {
                        const {
                          orderEthEstimate,
                          orderShareEstimate,
                          selectedNav,
                    Severity: Minor
                    Found in src/modules/trading/components/trading--form/trading--form.jsx - About 45 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function updateTrade has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      updateTrade(updatedState, propsToUse) {
                        let { props } = this;
                        if (propsToUse) props = propsToUse;
                        const side = props.selectedNav;
                        let limitPrice = updatedState[this.INPUT_TYPES.PRICE];
                    Severity: Minor
                    Found in src/modules/trading/components/trading--form/trading--form.jsx - About 45 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function testPrice has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                      testPrice(value, errors, isOrderValid, nextProps = null) {
                        const props = nextProps || this.props;
                        const { maxPrice, minPrice, market } = props;
                        const tickSize = createBigNumber(market.tickSize);
                        let errorCount = 0;
                    Severity: Minor
                    Found in src/modules/trading/components/trading--form/trading--form.jsx - About 35 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function validateForm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      validateForm(property, rawValue) {
                        const { updateState } = this.props;
                        // since the order changed by user action, make sure we can place orders.
                        // updateState('doNotCreateOrders', false)
                        let value = rawValue;
                    Severity: Minor
                    Found in src/modules/trading/components/trading--form/trading--form.jsx - About 25 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

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

                              <li
                                className={
                                  marketType === YES_NO
                                    ? Styles["TradingForm__button__yes_no--review"]
                                    : Styles["TradingForm__button--review"]
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 619..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 196.

                    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

                                <li
                                  className={
                                    marketType === YES_NO
                                      ? Styles["TradingForm__button__yes_no--review"]
                                      : Styles["TradingForm__button--review"]
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 475..511

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

                    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

                                {errors.length > 0 && (
                                  <li className={Styles["TradingForm__error-message"]}>
                                    {InputErrorIcon}{" "}
                                    {errors.map(error => (
                                      <p key={error}>{error}</p>
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 467..474

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

                    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

                              {errors.length > 0 && (
                                <li className={Styles["TradingForm__error-message"]}>
                                  {InputErrorIcon}{" "}
                                  {errors.map(error => (
                                    <p key={error}>{error}</p>
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 611..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 80.

                    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

                                {!isMobile &&
                                  market.marketType === CATEGORICAL && (
                                    <li>
                                      <label>Outcome</label>
                                      <div className={Styles["TradingForm__static-field"]}>
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 427..435

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

                              {!isMobile &&
                                market.marketType === CATEGORICAL && (
                                  <li>
                                    <label>Outcome</label>
                                    <div className={Styles["TradingForm__static-field"]}>
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 520..528

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

                        const {
                          isMobile,
                          market,
                          marketQuantity,
                          marketType,
                    src/modules/portfolio/components/positions-markets-list/positions-markets-list.jsx on lines 81..94
                    src/modules/trading/components/trading/trading.jsx on lines 95..108

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 72.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                                  value={
                                    BigNumber.isBigNumber(s[this.INPUT_TYPES.MARKET_ORDER_SIZE])
                                      ? s[this.INPUT_TYPES.MARKET_ORDER_SIZE].toNumber()
                                      : s[this.INPUT_TYPES.MARKET_ORDER_SIZE]
                                  }
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 563..567

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

                    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

                                    value={
                                      BigNumber.isBigNumber(s[this.INPUT_TYPES.PRICE])
                                        ? s[this.INPUT_TYPES.PRICE].toNumber()
                                        : s[this.INPUT_TYPES.PRICE]
                                    }
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 448..452

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

                    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

                                  className={classNames(FormStyles.Form__input, {
                                    [`${Styles.error}`]: s.errors[
                                      this.INPUT_TYPES.MARKET_ORDER_SIZE
                                    ].length
                                  })}
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 532..535
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 552..554

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

                    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

                                    className={classNames(FormStyles.Form__input, {
                                      [`${Styles.error}`]: s.errors[this.INPUT_TYPES.QUANTITY]
                                        .length
                                    })}
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 439..443
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 552..554

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

                    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

                                    className={classNames(FormStyles.Form__input, {
                                      [`${Styles.error}`]: s.errors[this.INPUT_TYPES.PRICE].length
                                    })}
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 439..443
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 532..535

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

                    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

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                        let errors = {
                          [this.INPUT_TYPES.QUANTITY]: [],
                          [this.INPUT_TYPES.PRICE]: [],
                          [this.INPUT_TYPES.MARKET_ORDER_SIZE]: [],
                          [this.TRADE_MAX_COST]: []
                    Severity: Minor
                    Found in src/modules/trading/components/trading--form/trading--form.jsx and 1 other location - About 55 mins to fix
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 88..93

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

                    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

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                          errors: {
                            [this.INPUT_TYPES.QUANTITY]: [],
                            [this.INPUT_TYPES.PRICE]: [],
                            [this.INPUT_TYPES.MARKET_ORDER_SIZE]: [],
                            [this.TRADE_MAX_COST]: []
                    Severity: Minor
                    Found in src/modules/trading/components/trading--form/trading--form.jsx and 1 other location - About 55 mins to fix
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 234..239

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

                    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

                                  <span>
                                    {orderShareEstimate &&
                                      `${formatShares(orderShareEstimate).fullPrecision}${
                                        formatShares(orderShareEstimate).denomination
                                      }`}
                    Severity: Minor
                    Found in src/modules/trading/components/trading--form/trading--form.jsx and 1 other location - About 40 mins to fix
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 596..601

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

                    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

                                  <span>
                                    {orderEthEstimate &&
                                      `${formatEther(orderEthEstimate).fullPrecision}${
                                        formatEther(orderEthEstimate).denomination
                                      }`}
                    Severity: Minor
                    Found in src/modules/trading/components/trading--form/trading--form.jsx and 1 other location - About 40 mins to fix
                    src/modules/trading/components/trading--form/trading--form.jsx on lines 602..607

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

                    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