Showing 113 of 1,343 total issues
File staking-neo.ts
has 624 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ethers, getNamedAccounts, network, deployments } from "hardhat";
const { anyValue } = require("@nomicfoundation/hardhat-chai-matchers/withArgs");
import { BigNumber } from "ethers";
import {
PNK,
- Create a ticketCreate a ticket
File keeperBot.ts
has 572 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { DisputeKitClassic, KlerosCore, PNK, RandomizerRNG, BlockHashRNG, SortitionModule } from "../typechain-types";
import request from "graphql-request";
import env from "./utils/env";
import loggerFactory from "./utils/logger";
import { BigNumber } from "ethers";
- Create a ticketCreate a ticket
Function main
has a Cognitive Complexity of 58 (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 458 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable promise/param-names */
import { BigNumber, utils } from "ethers";
import { task } from "hardhat/config";
import {
Period,
- Create a ticketCreate a ticket
Function main
has 166 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
File dataMappings.test.ts
has 378 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { describe, expect, it, vi } from "vitest";
import { populateTemplate } from "src/dataMappings/utils/populateTemplate";
import { jsonAction } from "src/dataMappings/actions/jsonAction";
import { subgraphAction } from "src/dataMappings/actions/subgraphAction";
import { callAction } from "src/dataMappings/actions/callAction";
- Create a ticketCreate a ticket
File draw.ts
has 356 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 { BigNumber, ContractReceipt, ContractTransaction, Wallet } 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 100 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 { AddressZero } = hre.ethers.constants;
const RNG_LOOKAHEAD = 20;
- 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 authUser
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
const authUser = async (event) => {
try {
if (!event.body) {
throw new Error("No body provided");
}
- Create a ticketCreate a ticket
File supabase-datalake.ts
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[];
export interface Database {
public: {
Tables: {
- Create a ticketCreate a ticket
Function App
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
const App: React.FC = () => {
return (
<StyledComponentsProvider>
<Web3Provider>
<QueryClientProvider>
- Create a ticketCreate a ticket
Function authUser
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const authUser = async (event) => {
try {
if (!event.body) {
throw new Error("No body provided");
}
- 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 70 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 { AddressZero } = hre.ethers.constants;
- 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"
Further reading
Function SubmitDisputeButton
has 63 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 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 { hexZeroPad, hexlify } = ethers.utils;
- Create a ticketCreate a ticket