Showing 60 of 126 total issues
Function render
has 60 lines of code (exceeds 50 allowed). Consider refactoring. Open
render() {
const { transaction } = this.props;
switch (transaction.get("txStatus")) {
case TX_STATUS_AWAITING_USER_ACCEPTANCE:
return (
- Create a ticketCreate a ticket
Function init
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
const init = networkName => {
const tokencontractsDeploymentAdressessList = config["tokens"][networkName];
const marketDeploymentAddress = config["market"][networkName]["address"];
const WETH = loadContact(
- Create a ticketCreate a ticket
Function healthCheck
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
export const healthCheck = async (
dispatch,
getState,
isInitialHealthcheck = false
) => {
- Create a ticketCreate a ticket
Function depthChartData
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
(bids, asks) => {
const askPrices = _.sortedUniq(asks.map(ask => ask.ask_price_sort));
const askGroups = groupBy(asks, ask => ask.ask_price_sort);
const askAmounts = {
quote: upSum(askGroups.map(group => bigSum(group.map(ask => ask.buyHowMuch.toString())))),
- Create a ticketCreate a ticket
Function render
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
render() {
const { baseToken, offerMakeType, sellToken } = this.props;
return (
<ReactModal
- Create a ticketCreate a ticket
Function render
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
render() {
const {
activeTradingPair: { baseToken, quoteToken },
hasSufficientTokenAmount,
// canMakeOffer,
- Create a ticketCreate a ticket
Function setMaxButton
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
setMaxButton() {
if (false === this.state.showMaxButton) {
return null;
}
- Create a ticketCreate a ticket
Function render
has 53 lines of code (exceeds 50 allowed). Consider refactoring. Open
render() {
const {
tokenTrades,
initialMarketHistoryLoaded,
activeTradingPair,
- Create a ticketCreate a ticket
Function depthChartData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
(bids, asks) => {
const askPrices = _.sortedUniq(asks.map(ask => ask.ask_price_sort));
const askGroups = groupBy(asks, ask => ask.ask_price_sort);
const askAmounts = {
quote: upSum(askGroups.map(group => bigSum(group.map(ask => ask.buyHowMuch.toString())))),
- Read upRead up
- Create a ticketCreate a ticket
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 checkAccountsEpic
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const checkAccountsEpic = () => async (dispatch, getState) => {
const userAccounts = (await dispatch(checkAccounts())).value;
const isMetamaskLocked = getState().getIn(['platform', 'accountLocked']);
const hasUserAccounts = userAccounts.length;
if(!hasUserAccounts) {
- Read upRead up
- Create a ticketCreate a ticket
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 validateEthereumAddress
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
validateEthereumAddress(value) {
const { onValidityChange } = this.props;
if (this.props.required) {
if (!value) {
return VALIDATION_VALUE_IS_REQUIRED;
- Read upRead up
- Create a ticketCreate a ticket
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 getNewOfferRankIndex
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
(
offerFormName,
currentFormValues,
currentTradingPairOffersData = fromJS({ buyOffers: [], sellOffers: [] })
) => {
- Read upRead up
- Create a ticketCreate a ticket
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 setMaxButton
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
setMaxButton() {
if (false === this.state.showMaxButton) {
return null;
}
const {
- Create a ticketCreate a ticket
Function bootstrap
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
const bootstrap = async () => {
const { dispatch, getState } = store;
period.init(getState);
conversion.init(getState);
- Create a ticketCreate a ticket
Function render
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
render() {
return (
<Line
height={CHART_HEIGHT}
data={{
- Create a ticketCreate a ticket
Function render
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
render() {
const {
activeTradingPair: { baseToken, quoteToken },
hasSufficientTokenAmount,
isTotalOverTheTokenMax,
- Create a ticketCreate a ticket
Function render
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
render() {
const {
baseToken,
quoteToken,
handleSubmit,
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (transactionActionResult) {
const txStartTimestamp = getTimestamp();
const transactionHash = transactionActionResult.value;
onTransactionPending &&
onTransactionPending({
- Create a ticketCreate a ticket
Function setActiveTradingPairEpic
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const setActiveTradingPairEpic = (args, sync = true) => (
dispatch,
getState
) => {
const previousActiveTradingPair = tokens.activeTradingPair(getState());
- Read upRead up
- Create a ticketCreate a ticket
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 parseAndSyncOffersPage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const parseAndSyncOffersPage = (
rawOffersPayload,
{ dispatch, sellToken, buyToken },
{
pageSize = PAGE_SIZE,
- Read upRead up
- Create a ticketCreate a ticket
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"