Showing 529 of 1,757 total issues
Function onDerivationPathChange
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
static async onDerivationPathChange(derivationPaths, pageNumber = 1) {
const paths = [];
derivationPaths.forEach(derivationPath => {
const components = DerivationPath.parse(derivationPath);
Function render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { modal } = this.props;
const s = this.state;
const connectionStatus = getValue(this.props, "modal.connection");
let nodeTitleText = "";
Function constructor
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
// NOTE: from here to this.state was added to sort markets, this might need to be more robust in the future.
const openMarkets = [];
const reportingMarkets = [];
Function loadAccount
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadAccount(dispatch, existing, accountType, callback) {
let loggedInAccount = null;
const usingMetaMask = accountType === ACCOUNT_TYPES.META_MASK;
if (windowRef.localStorage && windowRef.localStorage.getItem) {
loggedInAccount = windowRef.localStorage.getItem("loggedInAccount");
Function default
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(callback = logError) {
return (dispatch, getState) => {
const { universe, loginAccount } = getState();
const universeID = universe.id || UNIVERSE_ID;
Function validateForm
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
validateForm(property, rawValue) {
const { updateState } = this.props;
// since the order changed by user action, make sure we can place orders.
// updateState('doNotCreateOrders', false)
let value = rawValue;
Function validateNumber
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
validateNumber(
fieldName,
rawValue,
humanName,
min,
Function componentWillMount
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillMount() {
const {
feeWindows,
forkedMarket,
nonforkedMarkets,
Function getMainMenuData
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
getMainMenuData() {
const showRepFaucet = parseInt(augur.rpc.getNetworkID(), 10) !== 1;
const { currentBasePath } = this.props;
return [
{
Function componentWillReceiveProps
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
const openMarkets = [];
const reportingMarkets = [];
const disputingMarkets = [];
const finalMarkets = [];
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { children } = this.props;
if (this.state.hasError) {
return (
<section className={Styles.MainErrorBoundary}>
Function getDerivedStateFromProps
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getDerivedStateFromProps(nextProps, prevState) {
const {
currentTimeInSeconds,
pricePrecision,
marketMax,
Function constructor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
this.INPUT_TYPES = {
QUANTITY: "orderQuantity",
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
filter,
sort,
maxFee,
Function formatGroupedTransactions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function formatGroupedTransactions(transactions) {
const formattedTransactions = transactions
.map(transaction => formatTransaction(transaction))
.sort(
(a, b) =>
- 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 selectTopAsk
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
(marketOrderBook, excludeCurrentUser) => {
let topAsk;
if (excludeCurrentUser) {
const numAsks = marketOrderBook.asks.length;
if (numAsks) {
- 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 selectTopBid
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
(marketOrderBook, excludeCurrentUser) => {
let topBid;
if (excludeCurrentUser) {
const numBids = marketOrderBook.bids.length;
if (numBids) {
- 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 getTradeStatus
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function getTradeStatus(
marketTradingHistory,
marketId,
outcomeId,
getTradeType
- 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 MarketOutcomeCandlestickHeader
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const MarketOutcomeCandlestickHeader = ({
outcomeName,
isMobile,
volume,
fixedPrecision,
- 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 validateType
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
validateType(value) {
const { isValid, newMarket, updateNewMarket } = this.props;
const updatedMarket = { ...newMarket };
const validations = updatedMarket.validations[newMarket.currentStep];
- 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"