Showing 529 of 1,757 total issues
File hardware-wallet.jsx
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import { createBigNumber } from "utils/create-big-number";
import DerivationPath, {
DEFAULT_DERIVATION_PATH,
Function render
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { closeModal } = this.props;
const { didScroll, didCheck } = this.state;
return (
Function render
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
history,
isLogged,
isOpenReporting,
File init-augur.test.js
has 388 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import thunk from "redux-thunk";
import configureMockStore from "redux-mock-store";
import realStore from "src/store";
import * as augur from "services/augurjs";
Function render
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
currentTimestamp,
finalizeMarket,
forkedMarket,
Function render
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
isLoading,
error,
walletName,
File select-migrated-totals.test.js
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import immutableDelete from "immutable-delete";
import {
CATEGORICAL,
SCALAR,
YES_NO
Function generateTrade
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(market, outcome, outcomeTradeInProgress, orderBooks) => {
const { loginAccount } = store.getState();
const { settlementFee } = market;
const side =
(outcomeTradeInProgress && outcomeTradeInProgress.side) ||
Function render
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
currentTimeInSeconds,
outcomeName,
hasOrders,
Function handleRelayTransaction
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
Open
export const handleRelayTransaction = tx => (dispatch, getState) => {
if (tx && tx.response && tx.data) {
const { hash, type } = tx;
if (!hash) return console.error("uncaught relayed transaction", tx);
const { loginAccount, transactionsData } = getState();
- 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 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { isLogged, edgeLoading } = this.props;
const s = this.state;
return (
Function render
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
collectMarketCreatorFees,
loadMarketsInfoIfNotLoaded,
history,
Function startOrderSending
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const startOrderSending = options => (dispatch, getState) => {
const { marketId } = options;
const { loginAccount, marketsData, pendingLiquidityOrders } = getState();
const bnAllowance = createBigNumber(loginAccount.allowance, 10);
const market = marketsData[marketId];
Function render
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
clearSelectedOutcome,
description,
history,
Function render
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
history,
isForking,
isMobile,
File load-universe-info.js
has 360 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { augur } from "services/augurjs";
import { UNIVERSE_ID } from "modules/app/constants/network";
import logError from "utils/log-error";
import async from "async";
import { createBigNumber } from "utils/create-big-number";
File market.js
has 360 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import assertFormattedNumber from "src/assertions/common/formatted-number";
import assertFormattedDate from "src/assertions/common/formatted-date";
import assertReportableOutcomes from "src/assertions/reportable-outcomes";
export default function(market) {
Function outcomes
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
.map(outcomeId => {
const outcomeData = marketOutcomesData[outcomeId];
const outcomeTradeInProgress =
marketTradeInProgress && marketTradeInProgress[outcomeId];
const volume = createBigNumber(outcomeData.volume);
Function setCurrentSegment
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
Open
setCurrentSegment(options) {
if (!options.itemsLength) return options.setSegment([]);
const currentPage = parseInt(
parseQuery(options.location.search)[options.pageParam] || 1,
- 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 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
isMobile,
isLogged,
defaultMobileClick,