AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

File icons.jsx has 1783 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from "react";

export const AlertIcon = (
  <svg
    width="20"
Severity: Major
Found in src/modules/common/components/icons.jsx - About 4 days to fix

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

                  <div
                    key={order.cumulativeShares}
                    className={classNames(Styles.MarketOutcomeOrderBook__row, {
                      [Styles["MarketOutcomeOrderBook__row--head-bid"]]:
                        i === orderBook.asks.length - 1,
    src/modules/market-charts/components/market-outcome-charts--orders/market-outcome-charts--orders.jsx on lines 209..284

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

    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

                  <div
                    key={order.cumulativeShares}
                    className={classNames(Styles.MarketOutcomeOrderBook__row, {
                      [Styles["MarketOutcomeOrderBook__row--head-ask"]]: i === 0,
                      [Styles["MarketOutcomeOrderBook__row--hover"]]:
    src/modules/market-charts/components/market-outcome-charts--orders/market-outcome-charts--orders.jsx on lines 109..185

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

    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

    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

      File create-market.test.ts has 930 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      "use strict";
      
      import "jest-environment-puppeteer";
      import Flash from "./helpers/flash";
      import { IFlash, IMarket, MarketCosts } from "./types/types";
      Severity: Major
      Found in integration/create-market.test.ts - About 2 days to fix

        Function setNotificationText has 445 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function setNotificationText(notification, callback) {
          return (dispatch, getState) => {
            if (!notification || isEmpty(notification)) {
              return dispatch(callback(notification));
            }
        Severity: Major
        Found in src/modules/notifications/actions/set-notification-text.js - About 2 days to fix

          Function assembleMarket has a Cognitive Complexity of 108 (exceeds 5 allowed). Consider refactoring.
          Open

          export function assembleMarket(
            marketId,
            marketData,
            marketLoading,
            marketPriceHistory,
          Severity: Minor
          Found in src/modules/markets/selectors/market.js - About 2 days 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 render has 376 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              const {
                currentTimestamp,
                isMobile,
                linkType,

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

            export const CheckboxOn = (
              <svg
                id="9777b652-807f-44b2-b0f5-08d8f20182df"
                data-name="Layer 1"
                xmlns="http://www.w3.org/2000/svg"
            Severity: Major
            Found in src/modules/common/components/icons.jsx and 2 other locations - About 1 day to fix
            src/modules/common/components/icons.jsx on lines 267..323
            src/modules/common/components/icons.jsx on lines 325..381

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

            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

            export const Keystore = (
              <svg
                id="d7c32dda-f36e-456a-9079-f98a93957648"
                data-name="Layer 1"
                xmlns="http://www.w3.org/2000/svg"
            Severity: Major
            Found in src/modules/common/components/icons.jsx and 2 other locations - About 1 day to fix
            src/modules/common/components/icons.jsx on lines 325..381
            src/modules/common/components/icons.jsx on lines 591..651

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

            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

            export const Key = (
              <svg
                id="986dc871-bd7c-4cd5-a999-a53f5690d6ab"
                data-name="Layer 1"
                xmlns="http://www.w3.org/2000/svg"
            Severity: Major
            Found in src/modules/common/components/icons.jsx and 2 other locations - About 1 day to fix
            src/modules/common/components/icons.jsx on lines 267..323
            src/modules/common/components/icons.jsx on lines 591..651

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

            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 default has 355 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function(market) {
              // market can be undefined
              if (!market.id) {
                return;
              }
            Severity: Major
            Found in src/assertions/market.js - About 1 day to fix

              Function assembleMarket has 354 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function assembleMarket(
                marketId,
                marketData,
                marketLoading,
                marketPriceHistory,
              Severity: Major
              Found in src/modules/markets/selectors/market.js - About 1 day to fix

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

                  render() {
                    const {
                      currentTime,
                      forkEndTime,
                      forkingMarket,

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

                            orderBook: {
                              one: [
                                {
                                  type: BUY,
                                  price: createBigNumber("0.1"),
                  Severity: Major
                  Found in src/modules/markets/actions/submit-new-market.test.js and 1 other location - About 1 day to fix
                  src/modules/markets/actions/submit-new-market.test.js on lines 171..236

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

                  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

                            liquidityOrders: {
                              one: [
                                {
                                  type: SELL,
                                  price: createBigNumber("0.8"),
                  Severity: Major
                  Found in src/modules/markets/actions/submit-new-market.test.js and 1 other location - About 1 day to fix
                  src/modules/markets/actions/submit-new-market.test.js on lines 94..159

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 318.

                  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

                  File select-dispute-outcomes.test.js has 732 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import sinon from "sinon";
                  import {
                    CATEGORICAL,
                    SCALAR,
                    YES_NO
                  Severity: Major
                  Found in src/modules/reports/selectors/select-dispute-outcomes.test.js - About 1 day to fix

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

                      render() {
                        const {
                          recipient,
                          unclaimedRep,
                          unclaimedEth,
                    src/modules/modal/components/modal-claim-reporting-fees-nonforked-markets.jsx on lines 106..169

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                      describe("selectTopBid", () => {
                        const marketOrderBook = {
                          bids: [
                            {
                              isOfCurrentUser: true,
                    Severity: Major
                    Found in src/modules/orders/helpers/select-order-book.test.js and 1 other location - About 1 day to fix
                    src/modules/orders/helpers/select-order-book.test.js on lines 89..136

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                      describe("selectTopAsk", () => {
                        const marketOrderBook = {
                          asks: [
                            {
                              isOfCurrentUser: true,
                    Severity: Major
                    Found in src/modules/orders/helpers/select-order-book.test.js and 1 other location - About 1 day to fix
                    src/modules/orders/helpers/select-order-book.test.js on lines 40..87

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language