Showing 142 of 1,394 total issues
File staking-neo.ts
has 625 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ethers, getNamedAccounts, network, deployments } from "hardhat";
import {
PNK,
RandomizerRNG,
RandomizerMock,
- Create a ticketCreate a ticket
File keeperBot.ts
has 606 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
PNK,
RandomizerRNG,
BlockHashRNG,
SortitionModule,
- Create a ticketCreate a ticket
Function main
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
async function main() {
const { core, sortition, disputeKitClassic } = await getContracts();
const getBlockTime = async () => {
return await ethers.provider.getBlock("latest").then((block) => {
- 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
File tasks.ts
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable promise/param-names */
import { toBigInt, BigNumberish, AddressLike } from "ethers";
import { ethers } from "ethers";
import { task } from "hardhat/config";
import {
- Create a ticketCreate a ticket
Function main
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function main() {
const { core, sortition, disputeKitClassic } = await getContracts();
const getBlockTime = async () => {
return await ethers.provider.getBlock("latest").then((block) => {
- Create a ticketCreate a ticket
Function handleNewPeriod
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
export function handleNewPeriod(event: NewPeriod): void {
const disputeID = event.params._disputeID;
const dispute = Dispute.load(disputeID.toString());
if (!dispute) return;
const court = Court.load(dispute.court);
- 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
File dataMappings.test.ts
has 420 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { describe, expect, it, vi } from "vitest";
import { createResultObject } from "../src/dataMappings/utils/createResultObject";
import { executeActions, populateTemplate } from "../src";
import {
AbiCallMapping,
- Create a ticketCreate a ticket
Function Stats
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Stats = () => {
const { id } = useParams();
const { data } = useCourtDetails(id);
const [selectedRange, setSelectedRange] = useState(timeRanges[0].value);
const timeframedCourtData = useHomePageExtraStats(selectedRange);
- Create a ticketCreate a ticket
File draw.ts
has 369 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { anyValue } from "@nomicfoundation/hardhat-chai-matchers/withArgs";
import { deployments, ethers, getNamedAccounts, network } from "hardhat";
import { toBigInt, ContractTransactionResponse, HDNodeWallet } from "ethers";
import {
PNK,
- Create a ticketCreate a ticket
Function CardLabel
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
const CardLabel: React.FC<ICardLabels> = ({ disputeId, round, isList }) => {
const { address } = useAccount();
const { data: labelInfo, isLoading } = useLabelInfoQuery(address?.toLowerCase(), disputeId);
const localRounds = getLocalRounds(labelInfo?.dispute?.disputeKitDispute);
const rounds = labelInfo?.dispute?.rounds;
- 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 101 lines of code (exceeds 25 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;
- Create a ticketCreate a ticket
File Stats.tsx
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useMemo, useState } from "react";
import styled, { css } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
import { responsiveSize } from "styles/responsiveSize";
- Create a ticketCreate a ticket
Function deployKlerosLiquid
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
const deployKlerosLiquid: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { ethers, deployments, getNamedAccounts, getChainId } = hre;
const { deploy, execute } = deployments;
// fallback to hardhat node signers on local network
- Create a ticketCreate a ticket
Function StakeWithdrawButton
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
const StakeWithdrawButton: React.FC<IActionButton> = ({
parsedAmount,
action,
isSending,
setIsSending,
- 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 App
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
const App: React.FC = () => {
return (
<StyledComponentsProvider>
<Web3Provider>
<QueryClientProvider>
- Create a ticketCreate a ticket
Function SubmitDisputeButton
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SubmitDisputeButton: React.FC = () => {
const publicClient = usePublicClient();
const [isPopupOpen, setIsPopupOpen] = useState(false);
const [courtId, setCourtId] = useState("");
const [disputeId, setDisputeId] = useState<number>();
- Create a ticketCreate a ticket
Function handleNewPeriod
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function handleNewPeriod(event: NewPeriod): void {
const disputeID = event.params._disputeID;
const dispute = Dispute.load(disputeID.toString());
if (!dispute) return;
const court = Court.load(dispute.court);
- Create a ticketCreate a ticket
Function deployArbitration
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { ethers, deployments, getNamedAccounts, getChainId } = hre;
const { deploy } = deployments;
const { ZeroAddress } = hre.ethers;
- Create a ticketCreate a ticket
Function MaintenanceButtons
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MaintenanceButtons: React.FC = () => {
const { id } = useParams();
const [isOpen, setIsOpen] = useState(false);
const [displayRipple, setDisplayRipple] = useState(false);
- Create a ticketCreate a ticket
Function main
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def main():
block_number = block
tasks = ["Evidence"]
contracts = get_contracts()
while True:
- 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"