Showing 529 of 1,757 total issues
Function calculatePercentage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const calculatePercentage = (numSize, numTotalStake) => {
if (numSize === null || numTotalStake === null) return 0;
if (typeof numSize === "undefined" || typeof numTotalStake === "undefined")
return 0;
- 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 getSortOrder
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getSortOrder(type) {
if (type === OPEN_ORDER) {
return 10;
}
if (type === TRADE || type === PUBLIC_TRADE) {
- 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 handleOrderCanceledLog
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const handleOrderCanceledLog = log => (dispatch, getState) => {
dispatch(loadMarketsInfoIfNotLoaded([log.marketId]));
const isStoredTransaction = log.sender === getState().loginAccount.address;
if (isStoredTransaction) {
if (!log.removed) dispatch(removeCanceledOrder(log.orderId));
- 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 splitTradesByTimeBucket
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function splitTradesByTimeBucket(priceTimeSeries, timeBuckets) {
if (!priceTimeSeries || priceTimeSeries.length === 0) return [];
if (!timeBuckets || timeBuckets.length === 0) return [];
let timeSeries = sortBy(priceTimeSeries, "timestamp").slice();
- 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 selectMarketReport
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const selectMarketReport = (marketId, universeReports) => {
if (marketId && universeReports) {
const universeReportsMarketIds = Object.keys(universeReports);
const numUniverseReports = universeReportsMarketIds.length;
for (let i = 0; i < numUniverseReports; ++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 onDerivationPathChange
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static async onDerivationPathChange(derivationPaths, pageNumber = 1) {
const paths = [];
derivationPaths.forEach(derivationPath => {
const components = DerivationPath.parse(derivationPath);
- 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 testPrice
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
testPrice(value, errors, isOrderValid, nextProps = null) {
const props = nextProps || this.props;
const { maxPrice, minPrice, market } = props;
const tickSize = createBigNumber(market.tickSize);
let errorCount = 0;
- 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 TopBar
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const TopBar = props => (
<header className={Styles.TopBar}>
{props.isLogged && (
<div className={Styles.TopBar__statsContainer}>
<div
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
currentTimestamp,
finalizeMarket,
forkedMarket,
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
headerHeight,
hoveredDepth,
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 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
isMarketInValid,
isOpenReporting,
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 validateScalar
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
validateScalar(value, humanName, min, max, tickSize, isInvalid) {
const { stakeInfo, updateState } = this.props;
const updatedValidations = { ...this.state.validations };
if (value === "") {
- 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 componentWillReceiveProps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
const { selectedOrderProperties } = this.props;
if (!nextProps.selectedOutcome || !nextProps.selectedOutcome.trade) {
this.setState({ currentPage: 0 });
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
history,
isForking,
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 validateNumber
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
validateNumber(
fieldName,
rawValue,
humanName,
min,
- 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 updateInitialLiquidityCosts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
updateInitialLiquidityCosts(order, shouldReduce) {
const { availableEth, newMarket, updateNewMarket } = this.props;
const minPrice = newMarket.type === SCALAR ? newMarket.scalarSmallNum : 0;
const maxPrice = newMarket.type === SCALAR ? newMarket.scalarBigNum : 1;
const shareBalances = newMarket.outcomes.map(outcome => 0);
- 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 too many return
statements within this function. Open
return 1000;
Avoid too many return
statements within this function. Open
return { ...pendingLiquidityOrders };
Avoid too many return
statements within this function. Open
return payout.findIndex(item => item > 0).toString();
Avoid too many return
statements within this function. Open
return {
...connection,
useWebsocketToConnectAugurNode
};