Showing 529 of 1,757 total issues
Function orderForMarketDepth
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const orderForMarketDepth = orderBook => {
const rawBids = ((orderBook || {})[BIDS] || []).slice();
const bids = rawBids.reduce(
(p, order) => [
...p,
Function submitNewMarket
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function submitNewMarket(newMarket, history, callback = noop) {
return (dispatch, getState) => {
const { universe, loginAccount, contractAddresses } = getState();
const { createMarket, formattedNewMarket } = buildCreateMarket(
newMarket,
Function createReducer
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createReducer() {
return {
accountDisputes,
accountPositions,
accountTrades,
Function constructor
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
let selectedOutcome = props.newMarket.type === CATEGORICAL ? "" : 1;
if (
Function verifyLiquidityOrderBook
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function verifyLiquidityOrderBook(
askOrders: LiquidityChartRows,
bidOrders: LiquidityChartRows,
timeoutMilliseconds = 10000
) {
Function default
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export default function(
numShares,
limitPrice,
side,
minPrice,
- 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 handleMarketFinalizedLog
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const handleMarketFinalizedLog = log => (dispatch, getState) =>
dispatch(
loadMarketsInfo([log.market], err => {
if (err) return console.error(err);
const { author } = getState().marketsData[log.market];
- 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 calculateMaxPossibleShares
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
(
loginAccount,
orders,
makerFee,
settlementFee,
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
blockchain,
coreStats,
history,
- 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 drawCrosshairs
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
drawCrosshairs(options) {
const { updateHoveredDepth, sharedChartMargins } = this.props;
if (this.depthChart) {
const {
hoveredPrice,
- 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 createLiquidity
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export async function createLiquidity(orders: Array<LiquidityOrder>) {
let askOrders: LiquidityChartRows = {};
let bidOrders: LiquidityChartRows = {};
let currentOrdersArray;
for (let order of orders) {
- 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 getBulkWalletAddressesWithBalances
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
async getBulkWalletAddressesWithBalances(
paths,
pageNumber,
sortAndfilterBalances = true
) {
Function selectMarket
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const selectMarket = marketId => {
const {
marketsData,
marketLoading,
favorites,
Function render
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { isMobile, mobileMenuState, subMenuScalar } = this.props;
const showMainMenu = mobileMenuState >= mobileMenuStates.FIRSTMENU_OPEN;
const showSubMenu = mobileMenuState === mobileMenuStates.SUBMENU_OPEN;
Function buildCreateMarket
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const buildCreateMarket = (
newMarket,
isEstimate,
universe,
loginAccount,
Function componentWillUpdate
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillUpdate(nextProps, nextState) {
if (this.props.isConnected !== nextProps.isConnected)
this.props.loadMarkets();
if (
this.state.lowerBound !== nextState.lowerBound ||
Function validateStake
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
validateStake(rawStakeObj) {
const { updateState } = this.props;
const updatedValidations = { ...this.state.validations };
let completeStakeObj = rawStakeObj;
const maxInfo = this.calculateMaxRep(this.state.selectedOutcome);
Function default
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(authForm) {
expect(authForm).toBeDefined();
expect(typeof authForm).toBe("object");
expect(authForm.closeLink).toBeDefined();
Function assertAccountReport
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function assertAccountReport(report) {
describe(`report's shape`, () => {
test("id", () => {
expect(report.id).toBeDefined();
expect(typeof report.id).toBe("string");
Function mousemove
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mousemove() {
const { data } = selectedSeriesData[0];
const v2 = x.invert(d3.mouse(this)[0]);
const biSect = d3.bisector(d => d[0]).left;
let i = biSect(data, v2, 0);