AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

Function getWinningBalance has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getWinningBalance = (marketIds = [], callback = logError) => (
  dispatch,
  getState
) => {
  const { loginAccount } = getState();
Severity: Minor
Found in src/modules/reports/actions/get-winning-balance.js - About 1 hr to fix

    Function getMainMenuData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getMainMenuData() {
        const { currentBasePath } = this.props;
        return [
          {
            label: "Dispute",
    Severity: Minor
    Found in src/modules/app/components/inner-nav/reporting-inner-nav.jsx - About 1 hr to fix

      Function insufficientFunds has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function insufficientFunds(
        validityBond,
        gasCost,
        designatedReportNoShowReputationBond,
        availableEth,
      Severity: Minor
      Found in src/modules/markets/helpers/insufficient-funds.js - About 1 hr to fix

        Function submitForm has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          submitForm(e) {
            const { submitForm, env } = this.props;
            const { ethereumNode, augurNode } = this.state;
            let ethNode = {};
            const protocol = this.calcProtocol(ethereumNode);
        Severity: Minor
        Found in src/modules/modal/components/modal-network-connect.jsx - About 1 hr to fix

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

            render() {
              const s = this.state;
              const { transaction } = this.props;
          
              return (

            Function processEndTime has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              static processEndTime(newMarket) {
                if (!newMarket.setEndTime) {
                  return newMarket.endTime;
                }
            
            

              Function dismissDisclaimerModal has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const dismissDisclaimerModal = async (page: Page) => {
                const isModalDismissed = await page.evaluate(() =>
                  window.integrationHelpers.hasDisclaimerModalBeenDismissed()
                );
                if (isModalDismissed) return;
              Severity: Minor
              Found in integration/helpers/dismiss-disclaimer-modal.ts - About 1 hr to fix

                Function spacing has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const spacing = (loc, direction) => {
                    if (direction !== NONE) {
                      switch (`${loc}|${direction}`) {
                        case "yes-no-scalar|up":
                          return { bottom: "0.975rem" };

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

                    constructor(props) {
                      super(props);
                  
                      this.state = {
                        isExpanded: false
                  src/modules/market/components/market-positions-list--orphaned-order/market-positions-list--orphaned-order.jsx on lines 30..38
                  src/modules/market/components/market-preview/market-preview.jsx on lines 60..68
                  src/modules/modal/components/modal-v2-markets-alert.jsx on lines 25..33

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

                  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

                    const marketScalar = {
                      maxPrice: 100,
                      minPrice: 0,
                      numTicks: 10000,
                      tickSize: 4,
                  src/modules/reports/selectors/select-dispute-outcomes.test.js on lines 55..63

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

                  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

                    constructor(props) {
                      super(props);
                  
                      this.state = {
                        gasEstimate: "0.0023"
                  Severity: Major
                  Found in src/modules/modal/components/modal-migrate-market.jsx and 2 other locations - About 1 hr to fix
                  src/modules/modal/components/modal-claim-reporting-fees-forked-market.jsx on lines 22..32
                  src/modules/modal/components/modal-claim-reporting-fees-nonforked-markets.jsx on lines 28..38

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

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

                        callback: (err, gasEstimateValue) => {
                          if (err) return console.error(err);
                          this.setState({
                            gasEstimate: formatGasCostToEther(
                              gasEstimateValue,
                  src/modules/forking/components/migrate-rep/migrate-rep.jsx on lines 92..102
                  src/modules/reporting/components/reporting-dispute/reporting-dispute.jsx on lines 103..113

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

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

                    constructor(props) {
                      super(props);
                  
                      this.state = {
                        didCheck: false
                  Severity: Major
                  Found in src/modules/modal/components/modal-v2-markets-alert.jsx and 3 other locations - About 1 hr to fix
                  src/modules/forking/components/forking-notification/forking-notification.jsx on lines 9..17
                  src/modules/market/components/market-positions-list--orphaned-order/market-positions-list--orphaned-order.jsx on lines 30..38
                  src/modules/market/components/market-preview/market-preview.jsx on lines 60..68

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

                  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

                        "0x1": {
                          amount: "1.1111",
                          fullPrecisionAmount: "1.1111111",
                          price: "0.7778",
                          fullPrecisionPrice: "0.7777777",
                  Severity: Major
                  Found in src/modules/orders/actions/update-order-book.test.js and 2 other locations - About 1 hr to fix
                  src/modules/orders/actions/update-order-book.test.js on lines 26..39
                  src/modules/orders/selectors/select-order.test.js on lines 13..26

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

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

                    constructor(props) {
                      super(props);
                  
                      this.state = {
                        disableCancel: false
                  src/modules/forking/components/forking-notification/forking-notification.jsx on lines 9..17
                  src/modules/market/components/market-preview/market-preview.jsx on lines 60..68
                  src/modules/modal/components/modal-v2-markets-alert.jsx on lines 25..33

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

                  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

                    const marketScalar = {
                      maxPrice: 100,
                      minPrice: 0,
                      numTicks: 10000,
                      tickSize: 4,
                  src/modules/reports/selectors/select-migrated-totals.test.js on lines 44..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 56.

                  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

                    constructor(props) {
                      super(props);
                  
                      this.state = {
                        ClaimReportingFeesNonforkedMarketsGasEstimate: "0"
                  src/modules/modal/components/modal-claim-reporting-fees-forked-market.jsx on lines 22..32
                  src/modules/modal/components/modal-migrate-market.jsx on lines 17..25

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

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

                          callback: (err, gasEstimateValue) => {
                            if (err) return console.error(err);
                  
                            this.setState({
                              gasEstimate: formatGasCostToEther(
                  src/modules/forking/components/migrate-rep/migrate-rep.jsx on lines 92..102
                  src/modules/reporting/components/reporting-report/reporting-report.jsx on lines 142..151

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

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

                          callback: (err, gasEstimateValue) => {
                            if (err) return console.error(err);
                  
                            this.setState({
                              gasEstimate: formatGasCostToEther(
                  Severity: Major
                  Found in src/modules/forking/components/migrate-rep/migrate-rep.jsx and 2 other locations - About 1 hr to fix
                  src/modules/reporting/components/reporting-dispute/reporting-dispute.jsx on lines 103..113
                  src/modules/reporting/components/reporting-report/reporting-report.jsx on lines 142..151

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

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

                    constructor(props) {
                      super(props);
                  
                      this.state = {
                        showingDetails: true
                  src/modules/forking/components/forking-notification/forking-notification.jsx on lines 9..17
                  src/modules/market/components/market-positions-list--orphaned-order/market-positions-list--orphaned-order.jsx on lines 30..38
                  src/modules/modal/components/modal-v2-markets-alert.jsx on lines 25..33

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

                  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