Showing 529 of 1,757 total issues
Function getUniversesInfoWithParentContext
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getUniversesInfoWithParentContext(
account,
currentUniverseData,
parentUniverseData,
grandParentUniverseData,
Function render
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { selectedPeriod, selectedRange } = this.props;
const s = this.state;
Function render
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
isMobile,
marketId,
outcomes,
Function render
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
filteredMarkets,
history,
isLogged,
File log-handlers.js
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
import BigNumber from "bignumber.js";
import {
addNotification,
updateNotification
} from "modules/notifications/actions/notifications";
Function updateChart
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
updateChart() {
const { selectedSeriesData, graphPeriod, graphPeriodOptions } = this.state;
const { margin } = this;
const timeTickFormat = graphPeriodOptions.reduce((a, e) => {
let newFormat = a;
- 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 validateScalarNum
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
validateScalarNum(rawValue, type, limitDigits) {
const { isValid, newMarket, updateNewMarket } = this.props;
const { currentStep } = newMarket;
const { scalarType } = this.state;
- 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 getForkingInfo
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getForkingInfo(universe, callback) {
return (dispatch, getState) => {
const universePayload = { tx: { to: universe.id } };
// Getting current fork data
augur.api.Universe.getForkingMarket(
Function calculateMaxPossibleShares
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
(
loginAccount,
orders,
makerFee,
settlementFee,
Function determineDrawParams
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
function determineDrawParams(options) {
const {
sharedChartMargins,
depthChart,
marketDepth,
Function render
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { closeModal, markets } = this.props;
const { didCheck } = this.state;
const marketsRows = markets.map(market => (
Function render
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { isConnectedThroughWeb3, modal } = this.props;
const { formErrors, connectErrors, augurNode, ethereumNode } = this.state;
const AugurNodeInValid = formErrors.augurNode.length > 0;
const ethereumNodeInValid = formErrors.ethereumNode.length > 0;
Function orderValidation
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
orderValidation(order, nextProps = null) {
let errors = {
[this.INPUT_TYPES.QUANTITY]: [],
[this.INPUT_TYPES.PRICE]: [],
[this.INPUT_TYPES.MARKET_ORDER_SIZE]: [],
Function render
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { hasLoadedMarkets } = this.props;
const { width, placeholder, search } = this.state;
return (
Function render
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
isExtendedDisplay,
isMobile,
outcomeName,
Function selectMarketsAwaitingDispute
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
(markets, disputeOutcomes, universe) => {
if (isEmpty(markets)) {
return [];
}
let filteredMarkets = markets.filter(
Function loadAccountDataFromLocalStorage
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const loadAccountDataFromLocalStorage = address => (
dispatch,
getState
) => {
const localStorageRef = typeof window !== "undefined" && window.localStorage;
Function connectAugur
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function connectAugur(
history,
env,
isInitialConnection = false,
callback = logError
Function render
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
removeNotification,
toggleNotifications,
clearNotifications,
Function TimeProgressBar
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const TimeProgressBar = ({
endTime,
currentTime,
startTime,
timePeriodLabel,
- 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"