AugurProject/augur-ui

View on GitHub

Showing 529 of 1,757 total issues

Function getUniversesInfoWithParentContext has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getUniversesInfoWithParentContext(
  account,
  currentUniverseData,
  parentUniverseData,
  grandParentUniverseData,
Severity: Major
Found in src/modules/universe/actions/load-universe-info.js - About 3 hrs to fix

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

      render() {
        const { selectedPeriod, selectedRange } = this.props;
    
        const s = this.state;
    
    

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

        render() {
          const {
            isMobile,
            marketId,
            outcomes,

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

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

          File log-handlers.js has 297 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import BigNumber from "bignumber.js";
          import {
            addNotification,
            updateNotification
          } from "modules/notifications/actions/notifications";
          Severity: Minor
          Found in src/modules/events/actions/log-handlers.js - About 3 hrs to fix

            Function updateChart has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

              updateChart() {
                const { selectedSeriesData, graphPeriod, graphPeriodOptions } = this.state;
                const { margin } = this;
                const timeTickFormat = graphPeriodOptions.reduce((a, e) => {
                  let newFormat = a;

            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 validateScalarNum has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

              validateScalarNum(rawValue, type, limitDigits) {
                const { isValid, newMarket, updateNewMarket } = this.props;
                const { currentStep } = newMarket;
                const { scalarType } = this.state;
            
            

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

            export function getForkingInfo(universe, callback) {
              return (dispatch, getState) => {
                const universePayload = { tx: { to: universe.id } };
                // Getting current fork data
                augur.api.Universe.getForkingMarket(
            Severity: Major
            Found in src/modules/universe/actions/load-universe-info.js - About 3 hrs to fix

              Function calculateMaxPossibleShares has 77 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                (
                  loginAccount,
                  orders,
                  makerFee,
                  settlementFee,
              Severity: Major
              Found in src/modules/markets/helpers/calculate-max-possible-shares.js - About 3 hrs to fix

                Function determineDrawParams has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function determineDrawParams(options) {
                  const {
                    sharedChartMargins,
                    depthChart,
                    marketDepth,

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

                    render() {
                      const { closeModal, markets } = this.props;
                  
                      const { didCheck } = this.state;
                      const marketsRows = markets.map(market => (
                  Severity: Major
                  Found in src/modules/modal/components/modal-v2-markets-alert.jsx - About 3 hrs to fix

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

                      render() {
                        const { isConnectedThroughWeb3, modal } = this.props;
                        const { formErrors, connectErrors, augurNode, ethereumNode } = this.state;
                        const AugurNodeInValid = formErrors.augurNode.length > 0;
                        const ethereumNodeInValid = formErrors.ethereumNode.length > 0;
                    Severity: Major
                    Found in src/modules/modal/components/modal-network-connect.jsx - About 3 hrs to fix

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

                          render() {
                            const { hasLoadedMarkets } = this.props;
                            const { width, placeholder, search } = this.state;
                        
                            return (
                        Severity: Major
                        Found in src/modules/filter-sort/components/filter-search/filter-search.jsx - About 3 hrs to fix

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

                            render() {
                              const {
                                isExtendedDisplay,
                                isMobile,
                                outcomeName,

                            Function selectMarketsAwaitingDispute has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              (markets, disputeOutcomes, universe) => {
                                if (isEmpty(markets)) {
                                  return [];
                                }
                                let filteredMarkets = markets.filter(
                            Severity: Major
                            Found in src/modules/reports/selectors/select-awaiting-dispute-markets.js - About 2 hrs to fix

                              Function loadAccountDataFromLocalStorage has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const loadAccountDataFromLocalStorage = address => (
                                dispatch,
                                getState
                              ) => {
                                const localStorageRef = typeof window !== "undefined" && window.localStorage;
                              Severity: Major
                              Found in src/modules/auth/actions/load-account-data-from-local-storage.js - About 2 hrs to fix

                                Function connectAugur has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function connectAugur(
                                  history,
                                  env,
                                  isInitialConnection = false,
                                  callback = logError
                                Severity: Major
                                Found in src/modules/app/actions/init-augur.js - About 2 hrs to fix

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

                                    render() {
                                      const {
                                        removeNotification,
                                        toggleNotifications,
                                        clearNotifications,

                                    Function TimeProgressBar has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    const TimeProgressBar = ({
                                      endTime,
                                      currentTime,
                                      startTime,
                                      timePeriodLabel,

                                    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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language