AugurProject/augur-ui

View on GitHub
src/modules/reporting/components/reporting-report/reporting-report.jsx

Summary

Maintainability
D
2 days
Test Coverage

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

  render() {
    const {
      history,
      isLogged,
      isOpenReporting,

    File reporting-report.jsx has 273 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { Component } from "react";
    import PropTypes from "prop-types";
    import classNames from "classnames";
    import { Helmet } from "react-helmet";
    import { createBigNumber } from "utils/create-big-number";

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

        nextPage() {
          this.setState({
            currentStep: this.state.currentStep >= 1 ? 1 : this.state.currentStep + 1
          });
          this.calculateGasEstimates(this.props.gasPrice);
      src/modules/reporting/components/reporting-dispute/reporting-dispute.jsx on lines 79..84

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

      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

                    <button
                      className={classNames(FormStyles.Form__prev, {
                        [`${FormStyles["hide-button"]}`]: s.currentStep === 0
                      })}
                      onClick={this.prevPage}
      src/modules/forking/components/migrate-rep/migrate-rep.jsx on lines 162..169
      src/modules/reporting/components/reporting-dispute/reporting-dispute.jsx on lines 173..180

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

      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

        componentWillReceiveProps(nextProps) {
          if (
            this.props.gasPrice !== nextProps.gasPrice &&
            this.state.currentStep === 1
          ) {
      src/modules/reporting/components/reporting-dispute/reporting-dispute.jsx on lines 64..71

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

      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

              {isEmpty(market) && (
                <div className={Styles.NullState}>
                  <NullStateMessage
                    message="Market not found"
                    className={Styles.NullState}
      src/modules/forking/components/migrate-rep/migrate-rep.jsx on lines 209..216
      src/modules/reporting/components/reporting-dispute/reporting-dispute.jsx on lines 220..227

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

      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

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

        prevPage() {
          this.setState({
            currentStep: this.state.currentStep <= 0 ? 0 : this.state.currentStep - 1
          });
        }
      src/modules/forking/components/migrate-rep/migrate-rep.jsx on lines 63..67
      src/modules/reporting/components/reporting-dispute/reporting-dispute.jsx on lines 73..77

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

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

          const {
            history,
            isLogged,
            isOpenReporting,
            location,
      src/modules/filter-sort/components/filter-dropdowns/filter-dropdowns.jsx on lines 220..229
      src/modules/filter-sort/components/filter-dropdowns/filter-dropdowns.jsx on lines 242..251
      src/modules/forking/components/migrate-rep/migrate-rep.jsx on lines 108..117
      src/modules/market/components/core-properties/core-properties.jsx on lines 147..156
      src/modules/markets-list/components/markets-view.jsx on lines 124..133
      src/modules/portfolio/components/market-portfolio-card/market-portfolio-card.jsx on lines 93..102

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

      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

      There are no issues that match your filters.

      Category
      Status