AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

Function componentWillMount has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  componentWillMount() {
    const {
      augurNode,
      env,
      ethereumNodeHttp,
Severity: Major
Found in src/modules/app/components/app/app.jsx - About 2 hrs to fix

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

        if (value === EXPIRY_SOURCE_SPECIFIC) {
          updatedMarket.validations[currentStep].expirySource = updatedMarket
            .validations[currentStep].expirySource
            ? updatedMarket.validations[currentStep].expirySource
            : null;
    src/modules/create-market/components/create-market-form-resolution/create-market-form-resolution.jsx on lines 38..47

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

    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

            "0xTRANS2": {
              data: {
                id: "0xMARKETID",
                outcomeName: "test outcome"
              },
    Severity: Major
    Found in src/modules/transactions/selectors/transactions.test.js and 1 other location - About 2 hrs to fix
    src/modules/transactions/selectors/transactions.test.js on lines 28..42

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 81.

    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

        if (value === DESIGNATED_REPORTER_SPECIFIC) {
          updatedMarket.validations[
            currentStep
          ].designatedReporterAddress = updatedMarket.validations[currentStep]
            .designatedReporterAddress
    src/modules/create-market/components/create-market-form-resolution/create-market-form-resolution.jsx on lines 79..86

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

    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

            "0xTRANS0": {
              data: {
                id: "0xMARKETID",
                outcomeName: "test outcome"
              },
    Severity: Major
    Found in src/modules/transactions/selectors/transactions.test.js and 1 other location - About 2 hrs to fix
    src/modules/transactions/selectors/transactions.test.js on lines 59..73

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

    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

    Function MarketTradingConfirm has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    const MarketTradingConfirm = ({
      trade,
      isMobile,
      orderType,
      selectedNav,
    Severity: Minor
    Found in src/modules/trading/components/trading--confirm/trading--confirm.jsx - About 2 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

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

      test(`should return the expected object for 'addOrderToNewMarket'`, () => {
        const actions = addOrderToNewMarket({ test: "test" });
    
        const expected = {
          type: ADD_ORDER_TO_NEW_MARKET,
    Severity: Major
    Found in src/modules/markets/actions/update-new-market.test.js and 2 other locations - About 2 hrs to fix
    src/modules/markets/actions/update-new-market.test.js on lines 51..62
    src/modules/markets/actions/update-new-market.test.js on lines 64..75

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

      test(`should return the expected object for 'updateNewMarket'`, () => {
        const actions = updateNewMarket({ test: "test" });
    
        const expected = {
          type: UPDATE_NEW_MARKET,
    Severity: Major
    Found in src/modules/markets/actions/update-new-market.test.js and 2 other locations - About 2 hrs to fix
    src/modules/markets/actions/update-new-market.test.js on lines 38..49
    src/modules/markets/actions/update-new-market.test.js on lines 51..62

    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

      static propTypes = {
        itemsLength: PropTypes.number.isRequired,
        itemsPerPage: PropTypes.number.isRequired,
        location: PropTypes.object.isRequired,
        history: PropTypes.object.isRequired,
    Severity: Major
    Found in src/modules/common/components/paginator/paginator.jsx and 1 other location - About 2 hrs to fix
    src/modules/modal/components/modal-gas-price.jsx on lines 12..19

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

      test(`should return the expected object for 'removeOrderFromNewMarket'`, () => {
        const actions = removeOrderFromNewMarket({ test: "test" });
    
        const expected = {
          type: REMOVE_ORDER_FROM_NEW_MARKET,
    Severity: Major
    Found in src/modules/markets/actions/update-new-market.test.js and 2 other locations - About 2 hrs to fix
    src/modules/markets/actions/update-new-market.test.js on lines 38..49
    src/modules/markets/actions/update-new-market.test.js on lines 64..75

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

      static propTypes = {
        closeModal: PropTypes.func.isRequired,
        saveModal: PropTypes.func.isRequired,
        safeLow: PropTypes.number.isRequired,
        average: PropTypes.number.isRequired,
    Severity: Major
    Found in src/modules/modal/components/modal-gas-price.jsx and 1 other location - About 2 hrs to fix
    src/modules/common/components/paginator/paginator.jsx on lines 13..20

    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

    Function constructTransaction has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const constructTransaction = (log, callback = logError) => (
      dispatch,
      getState
    ) => {
      switch (log.eventName) {
    Severity: Major
    Found in src/modules/transactions/actions/construct-transaction.js - About 2 hrs to fix

      Function loadAccountPositions has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const loadAccountPositions = (options = {}, callback = logError) => (
        dispatch,
        getState
      ) => {
        const { universe, loginAccount } = getState();
      Severity: Major
      Found in src/modules/positions/actions/load-account-positions.js - About 2 hrs to fix

        Function drawLines has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function drawLines(options) {
          const { drawParams, depthChart, marketDepth, hasOrders } = options;
        
          // Defs
          const chartDefs = depthChart.append("defs");

          Function drawChart has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            drawChart({
              creationTime,
              currentTimestamp,
              estimatedInitialPrice,
              maxPrice,

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

              render() {
                const {
                  history,
                  isLogged,
                  isMobile,
            Severity: Major
            Found in src/modules/markets-list/components/markets-view.jsx - About 2 hrs to fix

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

                render() {
                  const { outcomes, isMobileSmall } = this.props;
                  const totalOutcomes = outcomes.length;
              
                  const numOutcomesToShow = isMobileSmall ? 2 : 3;

                Function drawCrosshairs has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  drawCrosshairs(options) {
                    const { updateHoveredDepth, sharedChartMargins } = this.props;
                    if (this.depthChart) {
                      const {
                        hoveredPrice,
                  Severity
                  Category
                  Status
                  Source
                  Language