Showing 529 of 1,757 total issues
Function default
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function(marketsData = DEFAULT_STATE, action) {
switch (action.type) {
case UPDATE_MARKETS_DATA: // TODO -- allow for the consumption of partial market objects
return {
...marketsData,
- 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 orderValidation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
orderValidation(order, nextProps = null) {
let errors = {
[this.INPUT_TYPES.QUANTITY]: [],
[this.INPUT_TYPES.PRICE]: [],
[this.INPUT_TYPES.MARKET_ORDER_SIZE]: [],
- 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
openOrders,
positions,
numCompleteSets,
- 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 processEndTime
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static processEndTime(newMarket) {
if (!newMarket.setEndTime) {
return newMarket.endTime;
}
- 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 OutcomeTradingIndicator
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function OutcomeTradingIndicator({
tradingIndicator,
style,
location,
isMobile
- 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
clearSelectedOutcome,
description,
history,
- 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
Avoid deeply nested control flow statements. Open
if (numOrders) {
console.log(
"found open orders:",
outcome.id,
outcome.userOpenOrders
Function consoleLog
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const consoleLog = store => next => action => {
if (!action) return;
const isIgnoreFlag = action.meta != null && action.meta.ignore === true;
if (typeof action !== "function" && !isIgnoreFlag) {
// console.log(action);
- 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 getUserOpenOrders
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
marketId,
orders,
orderType,
outcomeId,
userId,
Avoid deeply nested control flow statements. Open
if (relayTransaction && !isBlacklisted) {
dispatch(updateTransactionsData(relayTransaction));
}
Function setSelectedUniverse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const setSelectedUniverse = selectedUniverseId => (
dispatch,
getState
) => {
const { loginAccount, env, connection } = 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 getOutcome
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function getOutcome(
market,
outcome,
alwaysReturnYesForBinaryMarket = true
) {
- 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 loadUniverse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const loadUniverse = (universeId, history, callback = logError) => (
dispatch,
getState
) => {
const universePayload = { tx: { to: universeId } };
- 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 default
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function() {
const positionsSummary = generateMarketsPositionsSummary(selectAllMarkets());
const marketsSummary = selectMarketsSummary();
const totalValue = formatEther(
- 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 handleMarketCreatedLog
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const handleMarketCreatedLog = log => (dispatch, getState) => {
const isStoredTransaction =
log.marketCreator === getState().loginAccount.address;
if (log.removed) {
dispatch(removeMarket(log.market));
- 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 defaultLogHandler
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const defaultLogHandler = log => (dispatch, getState) => {
if (log.transactionHash == null)
return console.error("transaction hash not found", log);
augur.rpc.eth.getTransactionByHash(
[log.transactionHash],
- 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 default
has a Cognitive Complexity of 8 (exceeds 5 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;
- 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
Avoid deeply nested control flow statements. Open
if (
transaction.meta &&
transaction.meta.txhash === notifications[i].id
) {
dispatch(
Function calcProtocol
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
calcProtocol(uri) {
const { types } = this;
if (typeof uri === "string" && uri.length && uri.includes("://")) {
if (uri.includes(types.IPC)) return types.IPC;
if (uri.includes(types.WS)) return types.WS;
- 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 loadMarketsByFilter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const loadMarketsByFilter = (filterOptions, cb = () => {}) => (
dispatch,
getState
) => {
const { universe } = 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"