Showing 529 of 1,757 total issues
Function assembleMarket
has 21 arguments (exceeds 4 allowed). Consider refactoring. Open
marketId,
marketData,
marketLoading,
marketPriceHistory,
isOpen,
Function mapStateToProps
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapStateToProps = state => {
const PAGINATION_COUNT = 10;
const forkedMarket = state.universe.isForking
? selectMarket(state.universe.forkingMarket)
: null;
Function handleFilledOnly
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function handleFilledOnly(tradeInProgress = null) {
return (dispatch, getState) => {
const { notifications, transactionsData } = store.getState();
for (let i = 0; i < notifications.length; i++) {
if (notifications[i].status.toLowerCase() === PENDING) {
Function render
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { closeModal, saveModal, safeLow, average, fast } = this.props;
const { amount, showLowAlert } = this.state;
const disableButton = !amount || amount < 0;
Function render
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
headerHeight,
hoveredDepth,
isMobile,
Function constructor
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
this.periodIntervals = {
HOUR: 3600,
Function mapStateToProps
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const mapStateToProps = (
state,
{ history, location = {}, openSubMenu = noop }
) => {
const {
- 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 parseOutcomes
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseOutcomes(newMarketsData, outcomesData) {
return Object.keys(newMarketsData).reduce((p, marketId) => {
const marketData = newMarketsData[marketId];
if (
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";
Function render
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { isLogged, address, className } = this.props;
const s = this.state;
return (
File markets-list.test.ts
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
import "jest-environment-puppeteer";
import Flash from "./helpers/flash";
import { ElementHandle } from "puppeteer";
import { createYesNoMarket } from "./helpers/create-markets";
import { IFlash, IMarket } from "./types/types";
Function render
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { closeModal, modal } = this.props;
return (
<section className={Styles.ModalView}>
Function render
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
forkMigrationTotalsMap,
forkMigrationTotalWrapperHeight,
isOpen
Function updatePriceBounds
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
updatePriceBounds(
type,
selectedOutcome,
selectedSide,
orderBook,
Function default
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(newMarket = DEFAULT_STATE(), action) {
switch (action.type) {
case ADD_ORDER_TO_NEW_MARKET: {
const orderToAdd = action.data.order;
const { quantity, price, type, orderEstimate, outcome } = orderToAdd;
Function componentWillUpdate
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillUpdate(nextProps, nextState) {
const {
hoveredPrice,
marketDepth,
marketMax,
Function render
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { description, marketId, location, pricePrecision } = this.props;
const s = this.state;
return (
Function createLiquidity
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function createLiquidity(orders: Array<LiquidityOrder>) {
let askOrders: LiquidityChartRows = {};
let bidOrders: LiquidityChartRows = {};
let currentOrdersArray;
for (let order of orders) {
Function reInitAugur
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const reInitAugur = history => (dispatch, getState) => {
const debounceCall = debounce((callback = cb) => {
const { connection, env } = getState();
if (!connection.isConnected || !connection.isConnectedToAugurNode) {
dispatch(
- 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 MarketOutcomes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const MarketOutcomes = ({
outcomes,
max,
min,
type,
- 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"