Showing 529 of 1,757 total issues
Function drawSeries
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawSeries(options) {
const {
creationTime,
drawParams,
estimatedInitialPrice,
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
this.state = {
outcomes: [],
Function validateSavedValues
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
validateSavedValues() {
const { market, outcomes } = this.props;
const {
validations,
selectedOutcome,
Function checkStake
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
checkStake(stakeValue, updatedValidations, maxRepObject) {
if (
stakeValue === "" ||
stakeValue == null ||
stakeValue === 0 ||
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
this.state = {
// marketType: false,
outcomeFieldCount: CreateMarketOutcome.calculateOutcomeFieldCount(
Consider simplifying this complex logical expression. Open
if (
transactionsData[key].transactions &&
transactionsData[key].transactions.length &&
transactionsData[key].transactions[0].tradeGroupId ===
tradeGroupId &&
Function insufficientFunds
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
validityBond,
gasCost,
designatedReportNoShowReputationBond,
availableEth,
availableRep,
Consider simplifying this complex logical expression. Open
if (
transactionsData[key].transactions &&
transactionsData[key].transactions.length &&
transactionsData[key].transactions[0].tradeGroupId ===
tradeGroupId &&
Consider simplifying this complex logical expression. Open
if (
type === SCALAR &&
(!minPrice ||
(!BigNumber.isBigNumber(minPrice) && isNaN(minPrice)) ||
!maxPrice ||
Consider simplifying this complex logical expression. Open
if (!isEqual(newOrderInfo, currentOrderInfo)) {
// trade has changed, lets update trade.
this.updateTrade(newStateInfo, nextProps);
const nextTradePrice = nextProps.selectedOutcome.trade.limitPrice;
Consider simplifying this complex logical expression. Open
if (orderType === LIMIT) {
return (
<div>
<ul className={Styles["TradingForm__form-body"]}>
{!isMobile &&
Consider simplifying this complex logical expression. Open
if (
(isConnected !== nextProps.isConnected ||
loadingState !== nextProps.loadingState) &&
(nextProps.isConnected &&
nextProps.loadingState === null &&
Function toggleTag
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const toggleTag = (tag, location, history) => () => {
let searchParams = parseQuery(location.search);
if (
searchParams[TAGS_PARAM_NAME] == 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 default
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function(
market,
disputeStakes,
newOutcomeDisputeBond,
forkThreshold
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
export default function(filterSortOptions = DEFAULT_STATE, { type, data }) {
switch (type) {
case UPDATE_FILTER_SORT_OPTIONS: {
const { optionKey, optionValue } = data;
if (optionKey === MARKET_MAX_SPREAD) {
- 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 loadMarketsToReportOn
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const loadMarketsToReportOn = (options, callback = logError) => (
dispatch,
getState
) => {
const { env, universe, 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 validateAmount
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
validateAmount(amount, callback) {
const { eth } = this.props;
const { selectedAsset, repGasCost, upperBound, etherGasCost } = this.state;
let gasValue = etherGasCost.value;
if (selectedAsset !== ETH) {
- 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 processFavorites
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const processFavorites = (
stateFavsIn,
storedFavsIn,
networkId,
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 onDerivationPathChange
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static async onDerivationPathChange(derivationPaths, pageNumber = 1) {
const transport = await TransportU2F.create();
const ledgerEthereum = new Eth(transport);
const appConfiguration = await ledgerEthereum.getAppConfiguration();
if (!appConfiguration.arbitraryDataEnabled) {
- 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 orderAndAssignCumulativeShares
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
(orderBook, userOpenOrders, loginAccount) => {
const rawBids = ((orderBook || {})[BIDS] || []).slice();
const bids = rawBids.sort((a, b) => b.price.value - a.price.value).reduce(
(p, order, i, orders) => [
...p,
- 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"