Showing 529 of 1,757 total issues
Function determineDrawParams
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function determineDrawParams({
containerHeight,
containerWidth,
currentTimeInSeconds,
marketMax,
- 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, nextState) {
const { newMarket, gasPrice } = this.props;
if (
newMarket.initialLiquidityEth !== nextProps.newMarket.initialLiquidityEth
)
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
render() {
const p = this.props;
const {
marketType,
openInterest,
- 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 MarketPreviewRange
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const MarketPreviewRange = ({ newMarket }) => {
let minValue = "0%";
let maxValue = "100%";
const { scalarSmallNum, scalarBigNum, type } = newMarket;
- 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 handleRelayTransaction
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const handleRelayTransaction = tx => (dispatch, getState) => {
if (tx && tx.response && tx.data) {
const { hash, type } = tx;
if (!hash) return console.error("uncaught relayed transaction", tx);
const { loginAccount, transactionsData } = getState();
Function toggleTag
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const toggleTag = (tag, location, history) => () => {
let searchParams = parseQuery(location.search);
if (
searchParams[TAGS_PARAM_NAME] == null ||
Function formatGroupedTransactions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function formatGroupedTransactions(transactions) {
const formattedTransactions = transactions
.map(transaction => formatTransaction(transaction))
.sort(
(a, b) =>
Function default
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(outcomesData = DEFAULT_STATE, action) {
switch (action.type) {
case UPDATE_MARKETS_DATA:
return {
...outcomesData,
Function onDerivationPathChange
has 31 lines of code (exceeds 25 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) {
Function constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
const { transactionPeriod } = props;
this.state = {
lowerBound: null,
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { userDefinedGasPrice, gasPriceSpeed, className } = this.props;
return (
<div className={classNames(Styles.GasPriceEdit, className)}>
Function constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
this.snapConfig = {
scrollSnapDestination: "100% 0%",
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { id, unclaimedCreatorFees, collectMarketCreatorFees } = this.props;
return (
<div className={Styles.MarketOutstandingReturns}>
Function createScalarMarket
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createScalarMarket = async () => {
// page.on('console', msg => console.log('PAGE LOG:', msg.text()));
const currentTimestamp: number = await page.evaluate(() =>
window.integrationHelpers.getCurrentTimestamp()
);
Function createPeriodPLSelector
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
(accountTrades, blockchain, outcomesData, currentTimestamp) => {
if (!accountTrades || !blockchain) return null;
const periodDate = new Date(
currentTimestamp - period * 24 * 60 * 60 * 1000
Function RewriteUrlParams
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const RewriteUrlParams = windowRef => BaseCmp => {
const WrapperCmp = props => {
const { location } = props;
const searchValues = parseQuery(location.search);
Function componentWillReceiveProps
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
const { isMobile, location, universe, blockchain } = this.props;
if (isMobile !== nextProps.isMobile) {
this.setState({
mobileMenuState: mobileMenuStates.CLOSED
Function getFundsString
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
getFundsString(testWithLiquidity = false) {
const { availableEth, availableRep } = this.props;
const s = this.state;
let insufficientFundsString = "";
Function reduceSharesCountByPrice
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function reduceSharesCountByPrice(aggregateOrdersPerPrice, order) {
if (
order &&
!isNaN(order.fullPrecisionPrice) &&
!isNaN(order.fullPrecisionAmount)
Function selectTransactionsTotalsCreator
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
createSelector(selectTransactions, transactions => {
const o = {
numWorking: 0,
numPending: 0,
numComplete: 0,