subgraph/core/src/entities/TokenAndEthShift.ts
Function updateTokenAndEthShiftFromEvent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Identifier 'shift' is never reassigned; use 'const' instead of 'let'. Open
Open
let shift = ensureTokenAndEthShift(jurorAddress, disputeID, roundIndex, feeTokenAddress);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Rule: prefer-const
Requires that variable declarations use const
instead of let
and var
if possible.
If a variable is only assigned to once when it is declared, it should be declared using 'const'
Notes
- Has Fix
Config
An optional object containing the property "destructuring" with two possible values:
- "any" (default) - If any variable in destructuring can be const, this rule warns for those variables.
- "all" - Only warns if all variables in destructuring can be const.
Examples
"prefer-const": true
"prefer-const": true,[object Object]
Schema
{
"type": "object",
"properties": {
"destructuring": {
"type": "string",
"enum": [
"all",
"any"
]
}
}
}
For more information see this page.