Showing 142 of 1,394 total issues
Avoid too many return
statements within this function. Open
return false;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
if (period === "execution" && isDrawnInDispute && !hasVotedInDispute) return LabelArgs.DidNotVote;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
if (!isDrawnCurrentRound) return LabelArgs.NotDrawn;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return [secondsToDayHourMinute(dispute?.court.timesPerPeriod[index])];
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return value.toFixed(2);
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
if (["commit", "vote"].includes(period ?? "") && !hasVotedCurrentRound) return LabelArgs.CanVote;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return `in ${daysLeft} day${daysLeft > 1 ? "s" : ""}`;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
if (hasVotedCurrentRound) return LabelArgs.Voted; // plus rewards if execution
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
if (!decoded) return;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return commify(value.toFixed(0));
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return LabelArgs.DidNotVote; // plus rewards if execution
- Create a ticketCreate a ticket
Function SubmitEvidenceModal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
}> = ({ isOpen, evidenceGroup, close }) => {
const { data: walletClient } = useWalletClient();
const publicClient = usePublicClient();
const wagmiConfig = useConfig();
const [isSending, setIsSending] = useState(false);
- 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 getNewValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getNewValue(currentVar: string, targetVar: string, delta: BigInt, counter: Entity | null): Value {
if (currentVar === targetVar) {
return !counter ? Value.fromBigInt(delta) : Value.fromBigInt(counter.get(currentVar)!.toBigInt().plus(delta));
} else {
return !counter ? Value.fromBigInt(ZERO) : counter.get(currentVar)!;
- 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 ensureClassicContributionFromEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function ensureClassicContributionFromEvent<T>(event: T): ClassicContribution | null {
if (!(event instanceof ContributionEvent) && !(event instanceof Withdrawal)) return null;
const coreDisputeID = event.params._coreDisputeID.toString();
const coreRoundIndex = event.params._coreRoundID.toString();
const roundID = `${DISPUTEKIT_ID}-${coreDisputeID}-${coreRoundIndex}`;
- 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 VotesAccordion
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const VotesAccordion: React.FC<IVotesAccordion> = ({ drawnJurors, period, answers, isActiveRound, hiddenVotes }) => {
const accordionItems = useMemo(() => {
return drawnJurors
.map((drawnJuror) =>
!isUndefined(drawnJuror.vote?.justification?.choice)
- 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 deployArbitration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { ethers, deployments, getNamedAccounts, getChainId } = hre;
const { deploy, execute } = deployments;
const { ZeroAddress } = hre.ethers;
const RNG_LOOKAHEAD = 20;
- 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 CasesFetcher
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const CasesFetcher: React.FC = () => {
const { page, order, filter } = useParams();
const location = useRootPath();
const navigate = useNavigate();
const isDesktop = useIsDesktop();
- 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 getActivityDelta
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getActivityDelta(previousStake: BigInt, newStake: BigInt): BigInt {
if (previousStake.gt(ZERO)) {
return newStake.gt(ZERO) ? ZERO : BigInt.fromI32(-1);
} else {
return newStake.gt(ZERO) ? ONE : ZERO;
- 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 Popup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Popup: React.FC<PopupProps & IPopup> = ({
title,
icon: Icon,
popupType,
setIsOpen,
- 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"