Showing 529 of 1,757 total issues
File core-properties.jsx
has 446 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint react/no-array-index-key: 0 */
import React, { Component } from "react";
import PropTypes from "prop-types";
import classNames from "classnames";
File create-market-form-define.jsx
has 441 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint jsx-a11y/label-has-for: 0 */
/* eslint react/no-array-index-key: 0 */
import React, { Component } from "react";
import PropTypes from "prop-types";
File format-number.test.js
has 434 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as formatNumber from "utils/format-number";
describe("utils/format-number.js", () => {
const num = 1000.1;
const utils = [
Function render
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
availableFunds,
initialMessage,
isLogged,
File reporting-header.jsx
has 426 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import { formatAttoRep, formatAttoEth } from "utils/format-number";
import Styles from "modules/reporting/components/reporting-header/reporting-header.styles";
File disputing.test.ts
has 422 lines of code (exceeds 250 allowed). Consider refactoring. Open
import "jest-environment-puppeteer";
import Flash from "../helpers/flash";
import { IFlash, IMarket, Outcome } from "../types/types";
import { UnlockedAccounts } from "../constants/accounts";
import { toDisputing } from "../helpers/navigation-helper";
File create-market-form.jsx
has 422 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint react/no-array-index-key: 0 */ // It's OK in this specific instance as order remains the same
import React, { Component } from "react";
import PropTypes from "prop-types";
import classNames from "classnames";
Function render
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
pendingLiquidityOrders,
marketId,
market,
Function formatNumber
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
export function formatNumber(
num,
opts = {
decimals: 0,
decimalsRounded: 0,
- Read upRead up
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 validateForm
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
validateForm(orderQuantityRaw, orderPriceRaw) {
const { availableEth, newMarket } = this.props;
const tickSize = createBigNumber(newMarket.tickSize);
const sanitizeValue = (value, type) => {
if (value == null) {
- Read upRead up
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 validateForm
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
validateForm(orderQuantityRaw, orderPriceRaw) {
const { availableEth, newMarket } = this.props;
const tickSize = createBigNumber(newMarket.tickSize);
const sanitizeValue = (value, type) => {
if (value == null) {
Function render
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
addOrderToNewMarket,
availableEth,
availableRep,
Function render
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { newMarket, validateField, keyPressed } = this.props;
const validations = newMarket.validations[newMarket.currentStep];
const designatedReporterError =
File new-market.test.js
has 409 lines of code (exceeds 250 allowed). Consider refactoring. Open
import newMarket from "modules/markets/reducers/new-market";
import { DEFAULT_SCALAR_TICK_SIZE } from "augur.js/src/constants";
import {
ADD_ORDER_TO_NEW_MARKET,
Function render
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
accountREP,
market,
selectedOutcome,
File create-market-form-review.jsx
has 405 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import { augur } from "services/augurjs";
import { createBigNumber } from "utils/create-big-number";
import getValue from "src/utils/get-value";
File market-outcomes-chart.jsx
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import { isEqual } from "lodash";
import * as d3 from "d3";
Function validateScalarNum
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
validateScalarNum(rawValue, type, limitDigits) {
const { isValid, newMarket, updateNewMarket } = this.props;
const { currentStep } = newMarket;
const { scalarType } = this.state;
Function generateTrade
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
(market, outcome, outcomeTradeInProgress, orderBooks) => {
const { loginAccount } = store.getState();
const { settlementFee } = market;
const side =
(outcomeTradeInProgress && outcomeTradeInProgress.side) ||
- Read upRead up
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
File performance-graph.jsx
has 392 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import * as d3 from "d3";
import Dropdown from "modules/common/components/dropdown/dropdown";