AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

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

  render() {
    const {
      blockchain,
      coreStats,
      history,
Severity: Major
Found in src/modules/app/components/app/app.jsx - About 7 hrs to fix

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

        topPropertyRows.forEach((propertyRow, numRow) => {
          const row = [];
          propertyRow.forEach((property, numCol) => {
            if (property.value) {
              row.push(
    src/modules/market/components/core-properties/core-properties.jsx on lines 266..290

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

    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

        propertyRows.forEach((propertyRow, numRow) => {
          const row = [];
          propertyRow.forEach((property, numCol) => {
            if (property.value) {
              row.push(
    src/modules/market/components/core-properties/core-properties.jsx on lines 293..317

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

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

      render() {
        const {
          isClearable,
          isIncrementable,
          incrementAmount,
    Severity: Major
    Found in src/modules/common/components/input/input.jsx - About 7 hrs to fix

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

        render() {
          const {
            isMarketInValid,
            isOpenReporting,
            market,

        Function updateChart has 181 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          File market-portfolio-card.jsx has 460 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React, { Component } from "react";
          import classNames from "classnames";
          import PropTypes from "prop-types";
          
          import getValue from "utils/get-value";

            File reporting.test.ts has 460 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            "use strict";
            
            import "jest-environment-puppeteer";
            import Flash from "../helpers/flash";
            import { IFlash, IMarket } from "../types/types";
            Severity: Minor
            Found in integration/reporting/reporting.test.ts - About 7 hrs to fix

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

                static propTypes = {
                  accountREP: PropTypes.string.isRequired,
                  getForkMigrationTotals: PropTypes.func.isRequired,
                  history: PropTypes.object.isRequired,
                  isConnected: PropTypes.bool.isRequired,
              Severity: Major
              Found in src/modules/forking/components/migrate-rep/migrate-rep.jsx and 1 other location - About 7 hrs to fix
              src/modules/portfolio/components/markets/markets.jsx on lines 25..39

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

              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 = {
                  collectMarketCreatorFees: PropTypes.func.isRequired,
                  loadMarketsInfoIfNotLoaded: PropTypes.func.isRequired,
                  history: PropTypes.object.isRequired,
                  isLogged: PropTypes.bool.isRequired,
              Severity: Major
              Found in src/modules/portfolio/components/markets/markets.jsx and 1 other location - About 7 hrs to fix
              src/modules/forking/components/migrate-rep/migrate-rep.jsx on lines 18..32

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

              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>
                          <Checkbox
                            id="experimental-invalid"
                            type="checkbox"
                            name="experimentalInvalid"
              src/modules/filter-sort/components/filter-dropdowns/filter-dropdowns.jsx on lines 326..356

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

              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>
                          <Checkbox
                            id="insure-markets"
                            type="checkbox"
                            name="hideInsecureMarkets"
              src/modules/filter-sort/components/filter-dropdowns/filter-dropdowns.jsx on lines 293..325

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

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

              export const loadAccountDataFromLocalStorage = address => (
                dispatch,
                getState
              ) => {
                const localStorageRef = typeof window !== "undefined" && window.localStorage;
              Severity: Minor
              Found in src/modules/auth/actions/load-account-data-from-local-storage.js - About 6 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 2 locations. Consider refactoring.
              Open

                <svg width="19px" height="24px" viewBox="0 0 19 24">
                  <g
                    id="Account"
                    stroke="none"
                    strokeWidth="1"
              Severity: Major
              Found in src/modules/common/components/icons.jsx and 1 other location - About 6 hrs to fix
              src/modules/common/components/mobile-nav-hamburger-icon.jsx on lines 6..40

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

              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

                <svg
                  viewBox="0 0 16 12"
                  className={classNames("mobile-nav-hamburger-icon", {
                    [className]: className
                  })}
              Severity: Major
              Found in src/modules/common/components/mobile-nav-hamburger-icon.jsx and 1 other location - About 6 hrs to fix
              src/modules/common/components/icons.jsx on lines 769..801

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

              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

                            {item.type === WALLET_TYPE.HARDWARE &&
                              item.param === "ledger" && (
                                <Ledger
                                  dropdownItem={item}
                                  showAdvanced={
              src/modules/auth/components/connect-dropdown/connect-dropdown.jsx on lines 240..255

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

              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

                            {item.type === WALLET_TYPE.HARDWARE &&
                              item.param === "trezor" && (
                                <Trezor
                                  dropdownItem={item}
                                  showAdvanced={
              src/modules/auth/components/connect-dropdown/connect-dropdown.jsx on lines 224..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 172.

              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

                toggleConfirm() {
                  let { confirmHeight, confirmMargin } = this.state;
              
                  if (!this.state.showConfirm) {
                    confirmHeight = `${this.order.clientHeight}px`;
              src/modules/market/components/market-positions-list--order/market-positions-list--order.jsx on lines 52..69

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

              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

                toggleConfirm() {
                  let { confirmHeight, confirmMargin } = this.state;
              
                  if (!this.state.showConfirm) {
                    confirmHeight = `${this.order.clientHeight}px`;
              src/modules/market/components/market-positions-list--mobile-order/market-positions-list--mobile-order.jsx on lines 35..52

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

              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

                beforeEach(async () => {
                  await page.evaluate(
                    account => window.integrationHelpers.updateAccountAddress(account),
                    UnlockedAccounts.CONTRACT_OWNER
                  );
              Severity: Major
              Found in integration/reporting/reporting.test.ts and 1 other location - About 6 hrs to fix
              integration/reporting/reporting.test.ts on lines 481..499

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

              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