Showing 529 of 1,757 total issues
Consider simplifying this complex logical expression. Open
if (
!isEqual(hoveredPrice, nextProps.hoveredPrice) ||
!isEqual(marketDepth, nextProps.marketDepth) ||
!isEqual(this.state.yScale, nextState.yScale) ||
!isEqual(this.state.xScale, nextState.xScale) ||
Function loadMarketsToReportOn
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const loadMarketsToReportOn = (options, callback = logError) => (
dispatch,
getState
) => {
const { env, universe, loginAccount } = getState();
Function updateAssets
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function updateAssets(callback = logError) {
return (dispatch, getState) => {
const { loginAccount, universe } = getState();
const universeID = universe.id || UNIVERSE_ID;
const balances = { eth: undefined, rep: undefined };
Function componentWillReceiveProps
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
const { selectedOrderProperties } = this.props;
if (!nextProps.selectedOutcome || !nextProps.selectedOutcome.trade) {
this.setState({ currentPage: 0 });
Function setAccountDisputeData
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
setAccountDisputeData(accountDisputeData) {
const { stakeInfo, updateState } = this.props;
if (stakeInfo && createBigNumber(stakeInfo.repValue).gt(ZERO)) {
delete accountDisputeData.validations.stake;
}
Function verifyLiquidity
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function verifyLiquidity(
orders: Array<LiquidityOrder>,
timeoutMilliseconds = 10000
) {
for (let i = 0; i < orders.length; i++) {
Function validateOutcomes
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
validateOutcomes(value, index) {
const { isValid, newMarket, updateNewMarket } = this.props;
const { currentStep } = newMarket;
const updatedMarket = { ...newMarket };
Function processReport
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processReport(market, transaction) {
const amountStaked = formatAttoRep(transaction.amountStaked, {
decimals: 4,
roundUp: true
});
Function addCompleteSetsSoldLogs
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function addCompleteSetsSoldLogs(completeSetsSoldLogs) {
return (dispatch, getState) => {
const { marketsData } = getState();
const completeSetsData = {};
each(completeSetsSoldLogs, completeSetLog => {
Function validateAmount
has 32 lines of code (exceeds 25 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) {
Function componentWillUpdate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillUpdate(nextProps, nextState) {
const { isLoading, isClicked, showAdvanced } = this.props;
if (
nextState.walletAddresses !== this.state.walletAddresses &&
!nextState.walletAddresses.every(element => !element)
Function mergeProps
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mergeProps = (sP, dP, oP) => {
const marketId = parseQuery(oP.location.search)[MARKET_ID_PARAM_NAME];
const market = selectMarket(marketId);
return {
Function mapStateToProps
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapStateToProps = (state, ownProps) => {
const {
creationTime = {},
maxPrice = createBigNumber(1),
minPrice = createBigNumber(0),
Function sellCompleteSets
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function sellCompleteSets(
marketId,
numCompleteSets,
callback = logError
) {
Function createYesNoMarket
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createYesNoMarket = async (
address: string = "",
settlementFee: number = 0
) => {
// page.on('console', msg => console.log('PAGE LOG:', msg.text()));
Function selectTransactions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
transactionsData => {
const tradeGroups = [];
const formattedTransactions = Object.keys(transactionsData || {})
.reduce((p, id) => {
const { tradeGroupId } = transactionsData[id];
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
const { isMobile, location, universe, blockchain } = this.props;
if (isMobile !== nextProps.isMobile) {
this.setState({
mobileMenuState: mobileMenuStates.CLOSED
- 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 toggleMenuTween
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
toggleMenuTween(menuKey, forceOpen, cb) {
if (getValue(this.state[menuKey], "currentTween.stop"))
this.state[menuKey].currentTween.stop();
let nowOpen = !this.state[menuKey].open;
- 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 componentWillUpdate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
componentWillUpdate(nextProps, nextState) {
const { isLoading, isClicked, showAdvanced } = this.props;
if (
nextState.walletAddresses !== this.state.walletAddresses &&
!nextState.walletAddresses.every(element => !element)
- 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 determineDrawParams
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function determineDrawParams(options) {
const {
sharedChartMargins,
depthChart,
marketDepth,
- 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"