Showing 529 of 1,757 total issues
Function render
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { closeModal } = this.props;
const { errors, isValid, quantity, gasEstimate, page } = this.state;
const invalidWithErrors = !isValid && errors.length > 0;
const formattedQuantity = formatRep(quantity || 0);
Function drawTicks
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawTicks(options) {
const {
drawParams,
depthChart,
orderBookKeys,
File market-outcome-charts.jsx
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import classNames from "classnames";
import ScrollSnap from "scroll-snap";
import logError from "utils/log-error";
Function transferFunds
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function transferFunds(amount, currency, toAddress) {
return (dispatch, getState) => {
const { universe, loginAccount } = getState();
const fromAddress = loginAccount.address;
const to = speedomatic.formatEthereumAddress(toAddress);
File trading.test.ts
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"use strict";
import "jest-environment-puppeteer";
import { UnlockedAccounts } from "./constants/accounts";
import { waitNextBlock } from "./helpers/wait-new-block";
File market-outcome-charts--orders.jsx
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import classNames from "classnames";
import MarketOutcomeChartHeaderOrders from "modules/market-charts/components/market-outcome-charts--header-orders/market-outcome-charts--header-orders";
Function render
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
indexArray,
addresses,
clickAction,
File market-properties.jsx
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import classNames from "classnames";
import MarketLink from "modules/market/components/market-link/market-link";
Function wrapLogHandler
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
Open
export const wrapLogHandler = (logHandler = defaultLogHandler) => (
dispatch,
getState
) => (err, log) => {
if (err) return console.error((log || {}).eventName, err, log);
- 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 loadTransactions
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function loadTransactions(dispatch, getState, options, cb) {
const allOptions = Object.assign(options, {
orderState: augur.constants.ORDER_STATE.ALL
});
dispatch(updateAppStatus(TRANSACTIONS_LOADING, true));
Function helpers
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const helpers = store => {
const { dispatch, whenever } = store;
return {
updateAccountAddress: account =>
new Promise(resolve => {
Function render
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { history, location, transactionsLoading } = this.props;
const {
lowerBound,
boundedLength,
File trading--confirm.jsx
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from "react";
import PropTypes from "prop-types";
import ValueDenomination from "modules/common/components/value-denomination/value-denomination";
import classNames from "classnames";
File init-augur.js
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as AugurJS from "services/augurjs";
import { updateEnv } from "modules/app/actions/update-env";
import {
updateConnectionStatus,
updateAugurNodeConnectionStatus,
File account-withdraw.jsx
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint jsx-a11y/label-has-for: 0 */
import React, { Component } from "react";
import PropTypes from "prop-types";
Function selectMarketsInDisputeSelector
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(markets, disputeOutcomes, universe) => {
if (isEmpty(markets)) {
return [];
}
let filteredMarkets = markets.filter(
Function addOpenOrderTransactions
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function addOpenOrderTransactions(openOrders) {
return (dispatch, getState) => {
const { marketsData, transactionsData } = getState();
// flatten open orders
const transactions = {};
File submit-new-market.test.js
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { createBigNumber } from "utils/create-big-number";
import thunk from "redux-thunk";
import configureMockStore from "redux-mock-store";
import { BUY, SELL } from "modules/transactions/constants/types";
import { buildCreateMarket } from "modules/markets/helpers/build-create-market";
Function render
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
render() {
const {
isMobile,
market,
marketQuantity,
- 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 notifications.js
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import store from "src/store";
import { augur } from "services/augurjs";
import * as notificationLevels from "modules/notifications/constants/notifications";
import setNotificationText from "modules/notifications/actions/set-notification-text";
import { createBigNumber } from "utils/create-big-number";