Showing 529 of 1,757 total issues
Function render
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { className, label, options } = this.props;
const s = this.state;
return (
Function validateScalar
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
validateScalar(value, humanName, min, max, tickSize, isInvalid) {
const { stakeInfo, updateState } = this.props;
const updatedValidations = { ...this.state.validations };
if (value === "") {
Function formatDate
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function formatDate(d) {
const date = d instanceof Date ? d : new Date(0);
// UTC Time Formatting
const utcTime = [date.getUTCHours(), date.getUTCMinutes()];
Function collectMarketCreatorFees
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
) => (dispatch, getState) => {
const { loginAccount } = getState();
if (!loginAccount.address) return callback(null);
augur.api.Market.getMarketCreatorMailbox(
{ tx: { to: marketId } },
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
recipient,
unclaimedRep,
unclaimedEth,
Function listenToUpdates
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const listenToUpdates = history => (dispatch, getState) => {
if (!selectUseWebsocketToConnectAugurNode(getState())) return;
augur.events.stopBlockListeners();
augur.events.stopAugurNodeEventListeners();
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
recipient,
unclaimedRep,
unclaimedEth,
File disputing-markets.jsx
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import NullStateMessage from "modules/common/components/null-state-message/null-state-message";
import DisputeMarketCard from "modules/reporting/components/dispute-market-card/dispute-market-card";
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const p = this.props;
const s = this.state;
return (
Function addTransferTransactions
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function addTransferTransactions(transfers) {
return dispatch => {
const transactions = {};
each(transfers, transfer => {
const transaction = { ...transfer };
Function default
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function(
numShares,
limitPrice,
side,
minPrice,
Function componentWillMount
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
componentWillMount() {
const {
augurNode,
env,
ethereumNodeHttp,
Function MarketTradingConfirm
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
const MarketTradingConfirm = ({
trade,
isMobile,
orderType,
selectedNav,
- 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 constructTransaction
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const constructTransaction = (log, callback = logError) => (
dispatch,
getState
) => {
switch (log.eventName) {
Function loadAccountPositions
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const loadAccountPositions = (options = {}, callback = logError) => (
dispatch,
getState
) => {
const { universe, loginAccount } = getState();
Function drawLines
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawLines(options) {
const { drawParams, depthChart, marketDepth, hasOrders } = options;
// Defs
const chartDefs = depthChart.append("defs");
Function drawChart
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
drawChart({
creationTime,
currentTimestamp,
estimatedInitialPrice,
maxPrice,
Function render
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
history,
isLogged,
isMobile,
Function render
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { outcomes, isMobileSmall } = this.props;
const totalOutcomes = outcomes.length;
const numOutcomesToShow = isMobileSmall ? 2 : 3;
Function drawCrosshairs
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
drawCrosshairs(options) {
const { updateHoveredDepth, sharedChartMargins } = this.props;
if (this.depthChart) {
const {
hoveredPrice,