Showing 142 of 1,394 total issues
Function deployArbitration
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deployments, getNamedAccounts, getChainId } = hre;
const { deploy } = deployments;
// fallback to hardhat node signers on local network
- Create a ticketCreate a ticket
Function SelectArbitrable
has a Cognitive Complexity of 13 (exceeds 5 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);
- 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 useTimeline
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const useTimeline = (dispute: DisputeDetailsQuery["dispute"], currentItemIndex: number, currentPeriodIndex: number) => {
const isDesktop = useIsDesktop();
const titles = useMemo(() => {
const titles = ["Evidence", "Voting", "Appeal", "Executed"];
if (dispute?.court.hiddenVotes) {
- 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 commify
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function commify(value: string | number): string {
const comps = String(value).split(".");
if (!String(value).match(/^-?[0-9]*\.?[0-9]*$/)) {
return "0";
- 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 CourtDetails
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CourtDetails: React.FC = () => {
const { id } = useParams();
const { data: policy } = useCourtPolicy(id);
const { data } = useCourtTree();
const [isStakingMiniGuideOpen, toggleStakingMiniGuide] = useToggle(false);
- Create a ticketCreate a ticket
Function Description
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Description: React.FC = () => {
const { id } = useParams();
const { data: policy } = useCourtPolicy(id);
const navigate = useNavigate();
const currentPathName = useLocation().pathname.split("/").at(-1);
- Create a ticketCreate a ticket
Function OptionsFields
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const OptionsFields: React.FC = () => {
const { disputeData, setDisputeData } = useNewDisputeContext();
const updateOptions = (value: number) => {
const defaultAnswer: Answer = { title: "", id: value.toString(), description: "" };
- Create a ticketCreate a ticket
Function processData
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const processData = (data: HomePageBlockQuery, allTime: boolean) => {
const presentCourts = data.presentCourts;
const pastCourts = data.pastCourts;
const processedCourts: CourtWithTree[] = Array(presentCourts.length);
const processed = new Set();
- Create a ticketCreate a ticket
Function commify
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function commify(value: string | number): string {
const comps = String(value).split(".");
if (!String(value).match(/^-?[0-9]*\.?[0-9]*$/)) {
return "0";
- Create a ticketCreate a ticket
Function CasesFetcher
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CasesFetcher: React.FC = () => {
const { page, order, filter } = useParams();
const location = useRootPath();
const navigate = useNavigate();
const isDesktop = useIsDesktop();
- Create a ticketCreate a ticket
Function Evidence
has a Cognitive Complexity of 12 (exceeds 5 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>();
- 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 FormContactDetails
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const FormContactDetails: React.FC<ISettings> = ({ toggleIsSettingsOpen }) => {
const [emailInput, setEmailInput] = useState<string>("");
const [emailIsValid, setEmailIsValid] = useState<boolean>(false);
const { address } = useAccount();
const { user, isAddingUser, isFetchingUser, addUser, updateEmail, isUpdatingUser, userExists } = useAtlasProvider();
- 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 deployForeignGateway
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const deployForeignGateway: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { ethers, deployments, getNamedAccounts, getChainId, config } = hre;
const { deploy, execute } = deployments;
// fallback to hardhat node signers on local network
- Create a ticketCreate a ticket
Function useTimeline
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useTimeline = (dispute: DisputeDetailsQuery["dispute"], currentItemIndex: number, currentPeriodIndex: number) => {
const isDesktop = useIsDesktop();
const titles = useMemo(() => {
const titles = ["Evidence", "Voting", "Appeal", "Executed"];
if (dispute?.court.hiddenVotes) {
- Create a ticketCreate a ticket
Function handleVoteCast
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function handleVoteCast(event: VoteCast): void {
const juror = event.params._juror.toHexString();
const coreDisputeID = event.params._coreDisputeID.toString();
const coreDispute = Dispute.load(coreDisputeID);
const classicDisputeID = `${DISPUTEKIT_ID}-${coreDisputeID}`;
- Create a ticketCreate a ticket
Function updateTokenAndEthShiftFromEvent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function updateTokenAndEthShiftFromEvent(event: TokenAndETHShiftEvent): void {
const jurorAddress = event.params._account;
const disputeID = event.params._disputeID;
const dispute = Dispute.load(disputeID.toString());
if (!dispute) return;
- Create a ticketCreate a ticket
Function getDispute
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getDispute = async (disputeParameters: GetDisputeParameters): Promise<DisputeDetails | undefined> => {
if (disputeParameters.options?.sdkConfig) {
configureSDK(disputeParameters.options.sdkConfig);
}
const { disputeId, dtrSubgraph, coreSubgraph, options } = disputeParameters;
- Create a ticketCreate a ticket
Function constructDisputeTemplate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const constructDisputeTemplate = (disputeData: IDisputeData) => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { courtId, numberOfJurors, arbitrationCost, ...baseTemplate } = disputeData;
if (!isUndefined(baseTemplate.aliasesArray)) {
- 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 getFundingRewards
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const getFundingRewards = (contributions: ClassicContribution[], closed: boolean) => {
if (isUndefined(contributions) || contributions.length === 0) return 0;
const contribution = contributions.reduce((acc, val) => {
if (isUndefined(val?.rewardAmount) && isUndefined(val?.amount)) return acc;
if (closed) {
- 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 updateEffectiveStake
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function updateEffectiveStake(courtID: string): void {
let court = Court.load(courtID);
if (!court) return;
while (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"