Showing 137 of 388 total issues
Function waitForDeFiD
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async waitForDeFiD (timeout = 45000): Promise<void> {
const expiredAt = Date.now() + timeout
while (expiredAt > Date.now()) {
try {
- Read upRead up
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 cycle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Interval(1000)
async cycle (): Promise<void> {
if (!this.running) {
return
}
- Read upRead up
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 findPoolSwapFromTo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function findPoolSwapFromTo (history: AccountHistory | undefined, from: boolean, displaySymbol: string): PoolSwapFromToData | undefined {
if (history?.amounts === undefined) {
return undefined
}
- Read upRead up
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
Avoid too many return
statements within this function. Open
return this.withAlive('model', details)
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return await this.getTotalLiquidityUsdByBestPath(info)
Avoid too many return
statements within this function. Open
return true
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return undefined
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return info.reserveB.multipliedBy(2).multipliedBy(USDT_PER_DFI)
Avoid too many return
statements within this function. Open
return undefined
Avoid too many return
statements within this function. Open
return true
Avoid too many return
statements within this function. Open
return dfiPair.reserveB.div(dfiPair.reserveA).times(usdPerDFI)
Avoid too many return
statements within this function. Open
return swap
Avoid too many return
statements within this function. Open
return loanEmission.multipliedBy(split)
.times(60 * 60 * 24 / 30) // 30 seconds = 1 block
.times(365) // 1 year
.times(dfiPriceUSD)
Function listAuction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async listAuction (query: PaginationQuery): Promise<ApiPagedResponse<LoanVaultLiquidated>> {
const next = query.next !== undefined ? String(query.next) : undefined
const size = query.size > 30 ? 30 : query.size
let pagination: AuctionPagination
- Read upRead up
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 createPoolPair
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async createPoolPair (options: TestingPoolPairCreateRequest): Promise<poolpair.PoolPairInfo> {
if (options.a.symbol !== 'DFI') {
await this.testing.token.create({ symbol: options.a.symbol })
}
if (options.b.symbol !== 'DFI') {
- Read upRead up
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 toObject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
toObject (): any {
function toObject (value: any): any {
if (value instanceof ComposableBuffer) {
return value.toObject()
}
- Read upRead up
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 readiness
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async readiness (): Promise<HealthIndicatorResult> {
let highest: Block
let index: number | undefined
let defid: number | undefined
- Read upRead up
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"