Showing 529 of 1,757 total issues
Function componentWillReceiveProps
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
const {
orderEthEstimate,
orderShareEstimate,
selectedNav,
- 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 updateTrade
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
updateTrade(updatedState, propsToUse) {
let { props } = this;
if (propsToUse) props = propsToUse;
const side = props.selectedNav;
let limitPrice = updatedState[this.INPUT_TYPES.PRICE];
- 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 constructor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
constructor(props) {
super(props);
this.state = {
outcomes: [],
- 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 MarketBasics
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const MarketBasics = ({
category,
tags = [],
location,
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 render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
isExtendedDisplay,
isMobile,
outcomeName,
- 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
Consider simplifying this complex logical expression. Open
if (
oldUniverseData.id !== universeData.id ||
oldUniverseData.isForking !== universeData.isForking ||
oldUniverseData.forkingMarket !== universeData.forkingMarket ||
oldUniverseData.forkEndTime !== universeData.forkEndTime ||
Consider simplifying this complex logical expression. Open
if (
order &&
!isNaN(order.fullPrecisionPrice) &&
!isNaN(order.fullPrecisionAmount)
) {
Consider simplifying this complex logical expression. Open
if (
!numShares ||
!sharesFilled ||
!side ||
!type ||
Consider simplifying this complex logical expression. Open
if (
notification.log &&
notifications[index].log &&
notification.log.eventName !== notifications[index].log.eventName &&
notifications[index].log.orderId &&
Consider simplifying this complex logical expression. Open
if (meta.status === "Open" || meta.status === "Canceled") {
return (
<div className={Styles.TransactionMetaContainer}>
<ul className={Styles.TransactionMeta}>
{Object.keys(meta)
Consider simplifying this complex logical expression. Open
if (
(isNaN(reportingFees.unclaimedEth.value) ||
reportingFees.unclaimedEth.formatted === "-" ||
reportingFees.unclaimedEth.formatted === "") &&
(isNaN(reportingFees.unclaimedRep.value) ||
Consider simplifying this complex logical expression. Open
if (
newMarket.type !== nextProps.newMarket.type ||
newMarket.scalarSmallNum !== nextProps.newMarket.scalarSmallNum ||
newMarket.scalarBigNum !== nextProps.newMarket.scalarBigNum ||
newMarket.orderBookSorted !== nextProps.newMarket.orderBookSorted ||
Function getUniversesInfoWithParentContext
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
account,
currentUniverseData,
parentUniverseData,
grandParentUniverseData,
callback
Function default
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
orderId,
marketId,
outcome,
orderTypeLabel,
orderBooks
Function formatTransactionFillMessage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function formatTransactionFillMessage(txType, amount, price, numTxs, outcome) {
Function warnNonExistingOrder
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
orderId,
status,
marketId,
outcome,
orderTypeLabel
Function editEndpointParams
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const editEndpointParams = (
windowRef,
{ augurNode, ethereumNodeHTTP, ethereumNodeWS }
) => {
const existingParams = parseQuery(windowRef.location.search);
- 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 default
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function(reports = DEFAULT_STATE, { type, data }) {
switch (type) {
case UPDATE_REPORTS: {
const { reportsData } = data;
const updatedReports = { ...reports };
- 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 isShallowUnEqual
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function isShallowUnEqual(obj1, obj2, log) {
// both arguments reference the same object
if (obj1 === obj2) {
return false;
}
- 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 default
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function(reportableOutcomes, forkMigrationTotals) {
const invalidMarketId = "0.5";
const topOutcomes = 8;
if (
- 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"