Showing 113 of 1,343 total issues
Function ExecuteDelayedStakeButton
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const ExecuteDelayedStakeButton: React.FC<IExecuteStakeDelayedButton> = ({ setIsOpen }) => {
const [isSending, setIsSending] = useState(false);
const publicClient = usePublicClient();
const { data: phase } = useSortitionModulePhase();
const { data: delayedStakeWriteIndex } = useReadSortitionModuleDelayedStakeWriteIndex();
- 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 Dashboard
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Dashboard: React.FC = () => {
const { isConnected, address } = useAccount();
const { page, order, filter } = useParams();
const location = useRootPath();
const navigate = useNavigate();
- 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 PassPhaseButton
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const PassPhaseButton: React.FC<IPassPhaseButton> = ({ setIsOpen }) => {
const [isSending, setIsSending] = useState(false);
const publicClient = usePublicClient();
const { data: phase } = useSortitionModulePhase();
const { data: lastPhaseChange } = useReadSortitionModuleLastPhaseChange();
- 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 authMiddleware
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const authMiddleware = () => {
return {
before: async (request) => {
const { event } = request;
- 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
Consider simplifying this complex logical expression. Open
if (
!(
(netlifyUri && netlifyUri === siweMessage.uri) ||
(netlifyDeployUri && netlifyDeployUri === siweMessage.uri) ||
(netlifyDeployPrimeUri && netlifyDeployPrimeUri === siweMessage.uri)
- Create a ticketCreate a ticket
Function createClassicVote
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
id: string,
juror: string,
voteID: BigInt,
localRoundID: string,
coreDispute: Dispute
- Create a ticketCreate a ticket
Function handleEvidenceEvent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function handleEvidenceEvent(event: EvidenceEvent): void {
const evidenceGroupID = event.params._externalDisputeID.toString();
const evidenceGroup = ensureClassicEvidenceGroup(evidenceGroupID);
const evidenceIndex = evidenceGroup.nextEvidenceIndex;
evidenceGroup.nextEvidenceIndex = evidenceGroup.nextEvidenceIndex.plus(ONE);
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { ethers, deployments, getNamedAccounts, getChainId } = hre;
const { deploy } = deployments;
// fallback to hardhat node signers on local network
- 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 NotablePersons
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const NotablePersons: React.FC = () => {
const { disputeData, setDisputeData } = useNewDisputeContext();
//value here is the total number of fields-
const updateNumberOfAliases = (value: number) => {
- 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 DisputeContext
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const DisputeContext: React.FC<IDisputeContext> = ({ disputeDetails, isRpcError = false }) => {
const errMsg = isRpcError ? RPC_ERROR : INVALID_DISPUTE_DATA_ERROR;
return (
<>
<StyledH1>{isUndefined(disputeDetails) ? <StyledSkeleton /> : disputeDetails?.title ?? errMsg}</StyledH1>
- 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 createResultObject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const createResultObject = (sourceData, seek: string[], populate: string[]) => {
const result = {};
const getNestedValue = (obj: any, path: string) => {
return path.split(".").reduce((acc, part) => {
- 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 DesktopHeader
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const DesktopHeader: React.FC = () => {
const [isDappListOpen, toggleIsDappListOpen] = useToggle(false);
const [isHelpOpen, toggleIsHelpOpen] = useToggle(false);
const [isSettingsOpen, toggleIsSettingsOpen] = useToggle(false);
const [isJurorLevelsMiniGuideOpen, toggleIsJurorLevelsMiniGuideOpen] = useToggle(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 getPeriodLabel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getPeriodLabel = (period: Periods, isCard: boolean): string => {
switch (period) {
case Periods.evidence:
return `${isCard ? "In Progress - " : ""}Submitting Evidence`;
case Periods.commit:
- 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 DisputeInfo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const DisputeInfo: React.FC<IDisputeInfo> = ({
disputeID,
courtId,
court,
category,
- 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 NumberInputField
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const NumberInputField: React.FC<INumberInputField> = ({
placeholder,
message,
value,
onChange,
- 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
Avoid too many return
statements within this function. Open
return LabelArgs.DidNotVote; // plus rewards if execution
- 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
return false;
- 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
if (hasVotedCurrentRound) return LabelArgs.Voted; // plus rewards if execution
- Create a ticketCreate a ticket