Showing 142 of 1,394 total issues
Function SelectArbitrable
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SelectArbitrable: React.FC = () => {
const { arbitrable, setArbitrable, knownArbitrables } = useRulerContext();
const publicClient = usePublicClient({ chainId: 1 }) as PublicClient;
const ref = useRef<HTMLDivElement>(null);
const [isClient, setIsClient] = useState(false);
- Create a ticketCreate a ticket
Function Evidence
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Evidence: React.FC = () => {
const { id } = useParams();
const { data: disputeData } = useDisputeDetailsQuery(id);
const ref = useRef<HTMLDivElement>(null);
const [search, setSearch] = useState<string>();
- Create a ticketCreate a ticket
Function deployHomeGateway
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const deployHomeGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { ethers, deployments, getNamedAccounts } = hre;
const { deploy, execute } = deployments;
const { zeroPadValue, toBeHex } = ethers;
- Create a ticketCreate a ticket
Function Chart
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Chart: React.FC = () => {
const [chartOption, setChartOption] = useState("stakedPNK");
const { data } = useHomePageContext();
const chartData = data?.counters;
const courtsChartData = data?.courts;
- Create a ticketCreate a ticket
Function VoteStatus
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
}> = ({ choice, period, answers, isActiveRound, commited, hiddenVotes }) => {
if (hiddenVotes) {
if (!commited && (isActiveRound ? ["vote", "appeal", "execution"].includes(period) : true))
return <StyledLabel>Did not commit vote </StyledLabel>;
- 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 NextButton
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const NextButton: React.FC<INextButton> = ({ nextRoute }) => {
const navigate = useNavigate();
const { disputeData, isPolicyUploading } = useNewDisputeContext();
const location = useLocation();
- 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 calculateStats
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const calculateStats = (
isCourtFilter: boolean,
courtData: CourtDetailsQuery["court"],
counters: CounterQuery["counter"],
filter?: Dispute_Filter
- 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 ChangeDeveloper
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ChangeDeveloper: React.FC = () => {
const { isConnected, chainId } = useAccount();
const { arbitrable, currentDeveloper, refetchData } = useRulerContext();
const [newDeveloper, setNewDeveloper] = useState("");
const [isChanging, setIsChanging] = useState(false);
- Create a ticketCreate a ticket
Function PersonFields
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PersonFields: React.FC = () => {
const { disputeData, setDisputeData } = useNewDisputeContext();
const validationTimerRef = useRef<NodeJS.Timeout | null>(null);
const publicClient = usePublicClient({ chainId: 1 });
- Create a ticketCreate a ticket
Function Search
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Search: React.FC = () => {
const { page, order, filter } = useParams();
const location = useRootPath();
const decodedFilter = decodeURIFilter(filter ?? "all");
const { id: searchValue, ...filterObject } = decodedFilter;
- Create a ticketCreate a ticket
Function EmailConfirmation
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EmailConfirmation: React.FC = () => {
const { confirmEmail } = useAtlasProvider();
const [isConfirming, setIsConfirming] = useState(false);
const [isConfirmed, setIsConfirmed] = useState(false);
- Create a ticketCreate a ticket
Function updateCountsAndGetCurrentRuling
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function updateCountsAndGetCurrentRuling(id: string, choice: BigInt, delta: BigInt): CurrentRulingInfo {
const round = ClassicRound.load(id);
if (!round) return { ruling: ZERO, tied: false };
const choiceNum = choice.toI32();
const newChoiceCount = round.counts[choiceNum].plus(delta);
- 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 Chart
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const Chart: React.FC = () => {
const [chartOption, setChartOption] = useState("stakedPNK");
const { data } = useHomePageContext();
const chartData = data?.counters;
const courtsChartData = data?.courts;
- 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 DrawButton
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const DrawButton: React.FC<IDrawButton> = ({ id, numberOfVotes, setIsOpen, period }) => {
const publicClient = usePublicClient();
const { data: maintenanceData } = useDisputeMaintenanceQuery(id);
const { data: phase } = useSortitionModulePhase();
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 Dashboard
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Dashboard: React.FC = () => {
const { isConnected, address } = useAccount();
const { page, order, filter } = useParams();
const location = useRootPath();
const navigate = useNavigate();
- Create a ticketCreate a ticket
Function withdrawAppealContribution
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
const withdrawAppealContribution = async (
disputeId: string,
roundId: string,
contribution: Contribution
): Promise<boolean> => {
- Create a ticketCreate a ticket
Function handleEvidenceEvent
has 46 lines of code (exceeds 25 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);
- Create a ticketCreate a ticket
Function DisputeResolver
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DisputeResolver: React.FC = () => {
const location = useLocation();
const [isDisputeResolverMiniGuideOpen, toggleDisputeResolverMiniGuide] = useToggle(false);
const { isConnected } = useAccount();
const isPreviewPage = location.pathname.includes("/preview");
- Create a ticketCreate a ticket
Function timeLeftUntil
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function timeLeftUntil(isoString: string): string {
const targetDate = new Date(isoString);
const now = new Date();
const timeDifference = targetDate.getTime() - now.getTime();
- 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 main
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function main() {
logger.info("Starting up");
const core = (await ethers.getContract("KlerosCore")) as KlerosCore;
const resolver = (await ethers.getContract("DisputeResolver")) as DisputeResolver;
- Create a ticketCreate a ticket