DeFiCh/jellyfish

View on GitHub
apps/whale-api/src/module.api/consortium.service.ts

Summary

Maintainability
A
2 hrs
Test Coverage

Function getMemberStats has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async getMemberStats (memberId: string): Promise<MemberStatsInfo> {
    const attrs: Record<string, any> = (await this.rpcClient.masternode.getGov('ATTRIBUTES')).ATTRIBUTES
    const keys: string[] = Object.keys(attrs)

    const membersKeyRegex = /^v0\/consortium\/\d+\/members$/
Severity: Minor
Found in apps/whale-api/src/module.api/consortium.service.ts - About 1 hr to fix

    Function pushToAssetBreakdownInfo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private pushToAssetBreakdownInfo (assetBreakdownInfo: AssetBreakdownInfo[], memberId: string, memberDetail: MemberDetail, tokenId: string, tokens: TokenInfoWithId[]): void {
        const backingAddresses: string[] = memberDetail.backingId.length > 0 ? memberDetail.backingId.split(',').map(a => a.trim()) : []
    
        const member: MemberWithTokenInfo = {
          id: memberId,
    Severity: Minor
    Found in apps/whale-api/src/module.api/consortium.service.ts - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status