kleros/kleros-v2

View on GitHub
subgraph/core/src/DisputeKitClassic.ts

Summary

Maintainability
A
2 hrs
Test Coverage

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}`;
Severity: Minor
Found in subgraph/core/src/DisputeKitClassic.ts - About 1 hr to fix

Function handleChoiceFunded has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function handleChoiceFunded(event: ChoiceFunded): void {
  const coreDisputeID = event.params._coreDisputeID.toString();
  const coreRoundIndex = event.params._coreRoundID.toString();
  const choice = event.params._choice;
  const roundID = `${DISPUTEKIT_ID}-${coreDisputeID}-${coreRoundIndex}`;
Severity: Minor
Found in subgraph/core/src/DisputeKitClassic.ts - About 1 hr to fix

Expected a 'for-of' loop instead of a 'for' loop with this simple iteration
Open

  for (let i = 0; i < voteIDs.length; i++) {

Rule: prefer-for-of

Recommends a 'for-of' loop over a standard 'for' loop if the index is only used to access the array being iterated.

Rationale

A for(... of ...) loop is easier to implement and read when the index is not needed.

Config

Not configurable.

Examples
"prefer-for-of": true

For more information see this page.

Expected a 'for-of' loop instead of a 'for' loop with this simple iteration
Open

  for (let i = 0; i < voteIDs.length; i++) {

Rule: prefer-for-of

Recommends a 'for-of' loop over a standard 'for' loop if the index is only used to access the array being iterated.

Rationale

A for(... of ...) loop is easier to implement and read when the index is not needed.

Config

Not configurable.

Examples
"prefer-for-of": true

For more information see this page.

There are no issues that match your filters.

Category
Status