Showing 529 of 1,757 total issues
Function render
has 258 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { newMarket, keyPressed } = this.props;
const s = this.state;
const cleanedOutcomes = newMarket.outcomes.filter(
outcome => outcome !== ""
Function render
has 256 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
fixedPrecision,
pricePrecision,
orderBook,
Function render
has 252 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { isMobileSmall, newMarket, validateNumber, keyPressed } = this.props;
const s = this.state;
const errors = Array.from(
File create-market-form-outcome.jsx
has 580 lines of code (exceeds 250 allowed). Consider refactoring. Open
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";
Function render
has 236 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { market, stakeInfo, outcomes } = this.props;
const s = this.state;
const winner = (outcomes && outcomes.find(o => o.tentativeWinning)) || {};
const disputeRound = market.disputeInfo && market.disputeInfo.disputeRound;
File set-notification-text.js
has 533 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* @todo Update text for FINALIZE once notification triggering is moved
*/
import { augur } from "services/augurjs";
import { isEmpty } from "lodash/fp";
Function render
has 211 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const p = this.props;
const {
marketType,
openInterest,
File listen-to-updates.test.js
has 505 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { listenToUpdates } from "modules/events/actions/listen-to-updates";
import * as augurjs from "services/augurjs";
import * as loadMarketsInfoModule from "modules/markets/actions/load-markets-info";
import * as loadUnclaimedFeesModule from "modules/markets/actions/market-creator-fees-management";
import * as convertLogsToTransactionsModule from "modules/transactions/actions/convert-logs-to-transactions";
File market.js
has 504 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
This is one of the most important and sensitive selectors in the app.
It builds the fat, heavy, rigid, hierarchical market objects,
that are used to render and display many parts of the ui.
This is the point where the shallow, light, loose, flexible, independent
Function render
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { newMarket } = this.props;
const s = this.state;
return (
File add-transactions.js
has 485 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
MARKET_CREATION,
PUBLIC_TRADE,
TRANSFER,
REPORTING,
Function render
has 191 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
openOrders,
positions,
numCompleteSets,
Function render
has 185 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
blockchain,
coreStats,
history,
Function render
has 183 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
isClearable,
isIncrementable,
incrementAmount,
Function render
has 183 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
isMarketInValid,
isOpenReporting,
market,
Function updateChart
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateChart() {
const { selectedSeriesData, graphPeriod, graphPeriodOptions } = this.state;
const { margin } = this;
const timeTickFormat = graphPeriodOptions.reduce((a, e) => {
let newFormat = a;
File market-portfolio-card.jsx
has 460 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { Component } from "react";
import classNames from "classnames";
import PropTypes from "prop-types";
import getValue from "utils/get-value";
File reporting.test.ts
has 460 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"use strict";
import "jest-environment-puppeteer";
import Flash from "../helpers/flash";
import { IFlash, IMarket } from "../types/types";
Function loadAccountDataFromLocalStorage
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
Open
export const loadAccountDataFromLocalStorage = address => (
dispatch,
getState
) => {
const localStorageRef = typeof window !== "undefined" && window.localStorage;
- 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 render
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
currentTimeInSeconds,
fixedPrecision,
pricePrecision,