Showing 529 of 1,757 total issues
Function verifyMatchingNetworkIds
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const verifyMatchingNetworkIds = (callback = logError) => dispatch =>
dispatch(
getAugurNodeNetworkId((err, augurNodeNetworkId) => {
if (err) return callback(err);
const networkIds = {
- 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 getUniverseName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getUniverseName(parentUniverseData, universeData) {
if (!parentUniverseData.market) return "GENESIS";
if (universeData.isInvalid) return "Invalid";
- 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 createCustomPropType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function createCustomPropType(isRequired) {
// The factory returns a custom prop type
return function customPropType(props, propName, componentName) {
const prop = props[propName];
if (prop == null) {
- 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 isChecksumAddress
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function isChecksumAddress(address) {
// Check each case
const formattedAddress = address.replace("0x", "");
const addressHash = augur.rpc.sha3(formattedAddress.toLowerCase());
for (let i = 0; i < 40; i++) {
- 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 checkIfMainnet
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const checkIfMainnet = (callback = logError) => dispatch => {
dispatch(
getAugurNodeNetworkId((err, augurNodeNetworkId) => {
if (err) return callback(err);
if (augurNodeNetworkId === "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 loadBidsAsks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const loadBidsAsks = (marketId, callback = logError) => (
dispatch,
getState
) => {
const { marketsData } = 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 getOpenAskShares
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getOpenAskShares(account, outcomeId, askOrders) {
if (!account || !askOrders) return ZERO;
let order;
let askShares = ZERO;
const orderIds = Object.keys(askOrders);
- 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 callMethod
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const callMethod = (method, amount, address, estimateGas = false, callback) => (
dispatch,
getState
) => {
const { loginAccount } = 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 loginWithMetaMask
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const loginWithMetaMask = (callback = logError) => dispatch => {
const failure = () => callback("NOT_SIGNED_IN");
const success = account => {
// make sure we actually have an account before succeeding...
if (!account) return failure();
- 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 selectOpenOrdersMarkets
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
markets => {
const openOrdersMarkets = [];
if (markets) {
const numMarkets = markets.length;
for (let i = 0; i < numMarkets; ++i) {
- 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 selectPositionsPlusAsks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
(address, positions, orderBooks) => {
if (!positions) return null;
const adjustedMarkets = Object.keys(positions);
const numAdjustedMarkets = adjustedMarkets.length;
const positionsPlusAsks = {};
- 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 reduceSharesCountByPrice
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function reduceSharesCountByPrice(aggregateOrdersPerPrice, order) {
if (
order &&
!isNaN(order.fullPrecisionPrice) &&
!isNaN(order.fullPrecisionAmount)
- 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 migrateMarketThroughFork
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const migrateMarketThroughFork = (
marketId,
estimateGas = false,
callback = logError
) => (dispatch, 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 loadMarketsDisputeInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const loadMarketsDisputeInfo = (marketIds, callback = logError) => (
dispatch,
getState
) => {
dispatch(
- 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 changeMenu
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
changeMenu(nextBasePath) {
const { isLogged } = this.props;
const oldType = this.state.currentInnerNavType
? navTypes[this.state.currentBasePath]
: this.state.currentInnerNavType;
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
export default function(accountPositions = DEFAULT_STATE, { type, data }) {
switch (type) {
case UPDATE_ACCOUNT_POSITIONS_DATA: {
const { positionData, marketId } = data;
if (positionData) {
- 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 loadPriceHistory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const loadPriceHistory = (options = {}, callback = logError) => (
dispatch,
getState
) => {
augur.markets.getMarketPriceHistory(options, (err, priceHistory) => {
- 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 buildSearchString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const buildSearchString = (keywords, tags) => {
const MIN_KEYWORDS_LENGTH = 1;
const propertyTranslation = [
{ find: "title:", replace: "shortDescription:" },
{ find: "details:", replace: "longDescription:" },
- 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 mapStateToProps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const mapStateToProps = (state, ownProps) => {
const { newMarket, loginAccount } = state;
const selectedOutcome = ownProps.selectedOutcome.toString();
const orderBook = formatOrderbook(newMarket.orderBook[selectedOutcome] || []);
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(props) {
super(props);
// prioritize ethereumNode connections
let ethereumNode = "";
if (props.env["ethereum-node"]) {
- 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"