feat(subgraph/web): time travel query refactor #1939
fix/time-travel-query-refactor
into dev
Showing 20 of 20 total issues
File KlerosCore.ts
has 254 lines of code (exceeds 250 allowed). Consider refactoring. New
import { KlerosCore, AppealDecision, DisputeCreation, DisputeKitCreated,
- Create a ticketCreate a ticket
Function updateCourtCumulativeMetric
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. New
export function updateCourtCumulativeMetric(courtId: string, delta: BigInt, timestamp: BigInt, metric: string): void { // Load or create the current CourtCounter (ID: courtId-0) let currentCounter = CourtCounter.load(courtId + "-0"); if (!currentCounter) { currentCounter = new CourtCounter(courtId + "-0");
- Read upRead up
- Create a ticketCreate a ticket
Function updateCourtStateVariable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. New
export function updateCourtStateVariable(courtId: string, newValue: BigInt, timestamp: BigInt, variable: string): void { // Load or create the current CourtCounter (ID: courtId-0) let currentCounter = CourtCounter.load(courtId + "-0"); if (!currentCounter) { currentCounter = new CourtCounter(courtId + "-0");
- Read upRead up
- Create a ticketCreate a ticket
Function updateCourtCumulativeMetric
has 32 lines of code (exceeds 25 allowed). Consider refactoring. New
export function updateCourtCumulativeMetric(courtId: string, delta: BigInt, timestamp: BigInt, metric: string): void { // Load or create the current CourtCounter (ID: courtId-0) let currentCounter = CourtCounter.load(courtId + "-0"); if (!currentCounter) { currentCounter = new CourtCounter(courtId + "-0");
- Create a ticketCreate a ticket
Function updateCourtStateVariable
has 30 lines of code (exceeds 25 allowed). Consider refactoring. New
export function updateCourtStateVariable(courtId: string, newValue: BigInt, timestamp: BigInt, variable: string): void { // Load or create the current CourtCounter (ID: courtId-0) let currentCounter = CourtCounter.load(courtId + "-0"); if (!currentCounter) { currentCounter = new CourtCounter(courtId + "-0");
- Create a ticketCreate a ticket
Function addTreeValuesWithDiff
has 35 lines of code (exceeds 25 allowed). Consider refactoring. New
const addTreeValuesWithDiff = (presentCourt: Court, pastCourt: CourtCounter | undefined): CourtWithTree => { const presentCourtWithTree = addTreeValues(presentCourt); if (!pastCourt) { console.warn(`Missing snapshot for court ${presentCourt.id}, falling back to live`);
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. New
if (!currentCounter) { currentCounter = new CourtCounter(courtId + "-0"); currentCounter.court = courtId; currentCounter.numberDisputes = ZERO; currentCounter.numberVotes = ZERO;
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. New
if (!currentCounter) { currentCounter = new CourtCounter(courtId + "-0"); currentCounter.court = courtId; currentCounter.numberDisputes = ZERO; currentCounter.numberVotes = ZERO;
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. New
if (metric === "numberDisputes") { currentCounter.numberDisputes = currentCounter.numberDisputes.plus(delta); } else if (metric === "numberVotes") { currentCounter.numberVotes = currentCounter.numberVotes.plus(delta); }
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. New
if (metric === "numberDisputes") { dailyCounter.numberDisputes = dailyCounter.numberDisputes.plus(delta); } else if (metric === "numberVotes") { dailyCounter.numberVotes = dailyCounter.numberVotes.plus(delta); }
- Read upRead up
- Create a ticketCreate a ticket
Identifier 'dayID' is never reassigned; use 'const' instead of 'let'. New
let dayID = timestamp.toI32() / 86400; // Seconds to days
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Identifier 'dayStartTimestamp' is never reassigned; use 'const' instead of 'let'. New
let dayStartTimestamp = dayID * 86400;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Identifier 'dayID' is never reassigned; use 'const' instead of 'let'. New
let dayID = timestamp.toI32() / 86400;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Identifier 'dayStartTimestamp' is never reassigned; use 'const' instead of 'let'. New
let dayStartTimestamp = dayID * 86400;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
unused expression, expected an assignment or function call Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
statements are not aligned Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Missing semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Missing semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Unnecessary semicolon Fixed
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Category
Status
File | Maintainability |
subgraph/core/src/datapoint.ts | |
web/src/hooks/queries/useHomePageBlockQuery.ts |