Showing 114 of 365 total issues
Avoid too many return
statements within this function. Open
return false
Function resolve
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async resolve<T extends ModuleInstance = ModuleInstance>(
idOrFilter: ModuleIdentifier | ModuleFilter<T> = '*',
options?: ModuleFilterOptions<T>,
): Promise<T | T[] | undefined> {
const instance = asModuleInstance(this.mod)
- 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 listenerCount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
listenerCount(eventNames?: keyof TEventData | (keyof TEventData)[]) {
const eventNamesArray = Array.isArray(eventNames) ? eventNames : [eventNames]
let count = 0
for (const eventName of eventNamesArray) {
- 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 loadNodeFromManifest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async loadNodeFromManifest(wallet: WalletInstance, manifest: NodeManifest, path?: string, loadConfigChildren = false): Promise<MemoryNode> {
console.log('loadNodeFromManifest', manifest.config.name)
const derivedWallet = path ? await wallet.derivePath(path) : await HDWallet.random()
const node = await MemoryNode.create({ account: derivedWallet, config: manifest.config })
// Load Private Modules
- 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 determineAccount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function determineAccount(params: DetermineAccountParams, allowRandomAccount = true): Promise<AccountInstance> {
if (isDetermineAccountFromAccountParams(params)) {
if (params.account === 'random') {
assertEx(allowRandomAccount, () => 'Random address not allowed')
return await Account.random()
- 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 emitInternal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async emitInternal<TEventName extends keyof TEventData, TEventArgs extends TEventData[TEventName]>(
eventName: TEventName,
eventArgs: TEventArgs,
filter?: TEventArgs,
) {
- 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 getProvider
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async getProvider(cache = false, error?: string | boolean): Promise<Provider | undefined> {
const providers = await this.getProviders(cache)
if (providers.length === 0) {
if (error) {
throw new Error(typeof error === 'string' ? error : 'No providers available')
- 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 parseQuery
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static async parseQuery<T extends Query = Query>(obj: unknown, payloads?: Payload[]): Promise<QueryBoundWitnessWrapper<T>> {
assertEx(!Array.isArray(obj), () => 'Array can not be converted to QueryBoundWitnessWrapper')
switch (typeof obj) {
case 'object': {
const castWrapper = obj as QueryBoundWitnessWrapper<T>
- 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 hashableFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static async hashableFields<T extends Payload = Payload<AnyObject>>(
schema: string,
fields?: WithoutSchema<WithoutMeta<T>>,
$meta?: JsonObject,
$hash?: Hash,
- 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 handleMonitorResponseError
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected handleMonitorResponseError<T>(error: ApiError, trapAxiosException: boolean) {
if (!error.isError) {
throw error
}
- 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 relative
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
relative(direction: string) {
const directionConstant = assertEx(RelativeDirectionConstantLookup[direction], () => 'Invalid direction')
let quadkey = this.base4Hash
if (quadkey.length === 0) {
return this
- 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 on
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
on<TEventName extends keyof TEventData = keyof TEventData>(
eventNames: TEventName | TEventName[],
listener: EventListener<TEventData[TEventName]>,
filter?: TEventData[TEventName],
) {
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(huri: Hash | Huri | string, { archivistUri, token }: HuriOptions = {}) {
const huriString
= Huri.isHuri(huri)?.href
?? (typeof huri === 'string'
? (huri as string)
- 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 hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static async hash<T extends EmptyObject>(obj: T): Promise<Hash> {
const stringToHash = this.stringifyHashFields(obj)
if (PayloadHasher.allowSubtle) {
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"