DeFiCh/jellyfish

View on GitHub

Showing 358 of 388 total issues

Similar blocks of code found in 8 locations. Consider refactoring.
Open

  async voteGov (data: VoteData, utxos: UTXO[] = []): Promise<string> {
    return await this.client.call('votegov', [data.proposalId, data.masternodeId, data.decision, utxos], 'number')
  }
Severity: Major
Found in packages/jellyfish-api-core/src/category/governance.ts and 7 other locations - About 40 mins to fix
packages/jellyfish-api-core/src/category/account.ts on lines 463..465
packages/jellyfish-api-core/src/category/account.ts on lines 479..481
packages/jellyfish-api-core/src/category/loan.ts on lines 47..49
packages/jellyfish-api-core/src/category/loan.ts on lines 398..400
packages/jellyfish-api-core/src/category/loan.ts on lines 415..417
packages/jellyfish-api-core/src/category/vault.ts on lines 121..123
packages/jellyfish-api-core/src/category/vault.ts on lines 137..139

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

  async depositToVault (depositVault: DepositVault, utxos: UTXO[] = []): Promise<string> {
    return await this.client.call('deposittovault', [depositVault.vaultId, depositVault.from, depositVault.amount, utxos], 'number')
  }
Severity: Major
Found in packages/jellyfish-api-core/src/category/loan.ts and 7 other locations - About 40 mins to fix
packages/jellyfish-api-core/src/category/account.ts on lines 463..465
packages/jellyfish-api-core/src/category/account.ts on lines 479..481
packages/jellyfish-api-core/src/category/governance.ts on lines 134..136
packages/jellyfish-api-core/src/category/loan.ts on lines 47..49
packages/jellyfish-api-core/src/category/loan.ts on lines 415..417
packages/jellyfish-api-core/src/category/vault.ts on lines 121..123
packages/jellyfish-api-core/src/category/vault.ts on lines 137..139

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

  async futureSwap (future: FutureSwap, utxos: UTXO[] = []): Promise<string> {
    return await this.client.call('futureswap', [future.address, future.amount, future.destination, utxos], 'number')
  }
Severity: Major
Found in packages/jellyfish-api-core/src/category/account.ts and 7 other locations - About 40 mins to fix
packages/jellyfish-api-core/src/category/account.ts on lines 479..481
packages/jellyfish-api-core/src/category/governance.ts on lines 134..136
packages/jellyfish-api-core/src/category/loan.ts on lines 47..49
packages/jellyfish-api-core/src/category/loan.ts on lines 398..400
packages/jellyfish-api-core/src/category/loan.ts on lines 415..417
packages/jellyfish-api-core/src/category/vault.ts on lines 121..123
packages/jellyfish-api-core/src/category/vault.ts on lines 137..139

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

  async withdrawFromVault (withdrawVault: WithdrawVault, utxos: UTXO[] = []): Promise<string> {
    return await this.client.call('withdrawfromvault', [withdrawVault.vaultId, withdrawVault.to, withdrawVault.amount, utxos], 'number')
  }
Severity: Major
Found in packages/jellyfish-api-core/src/category/vault.ts and 7 other locations - About 40 mins to fix
packages/jellyfish-api-core/src/category/account.ts on lines 463..465
packages/jellyfish-api-core/src/category/account.ts on lines 479..481
packages/jellyfish-api-core/src/category/governance.ts on lines 134..136
packages/jellyfish-api-core/src/category/loan.ts on lines 47..49
packages/jellyfish-api-core/src/category/loan.ts on lines 398..400
packages/jellyfish-api-core/src/category/loan.ts on lines 415..417
packages/jellyfish-api-core/src/category/vault.ts on lines 121..123

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

  async createLoanScheme (scheme: CreateLoanScheme, utxos: UTXO[] = []): Promise<string> {
    return await this.client.call('createloanscheme', [scheme.minColRatio, scheme.interestRate, scheme.id, utxos], 'number')
  }
Severity: Major
Found in packages/jellyfish-api-core/src/category/loan.ts and 7 other locations - About 40 mins to fix
packages/jellyfish-api-core/src/category/account.ts on lines 463..465
packages/jellyfish-api-core/src/category/account.ts on lines 479..481
packages/jellyfish-api-core/src/category/governance.ts on lines 134..136
packages/jellyfish-api-core/src/category/loan.ts on lines 398..400
packages/jellyfish-api-core/src/category/loan.ts on lines 415..417
packages/jellyfish-api-core/src/category/vault.ts on lines 121..123
packages/jellyfish-api-core/src/category/vault.ts on lines 137..139

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

  async withdrawFutureSwap (future: FutureSwap, utxos: UTXO[] = []): Promise<string> {
    return await this.client.call('withdrawfutureswap', [future.address, future.amount, future.destination, utxos], 'number')
  }
Severity: Major
Found in packages/jellyfish-api-core/src/category/account.ts and 7 other locations - About 40 mins to fix
packages/jellyfish-api-core/src/category/account.ts on lines 463..465
packages/jellyfish-api-core/src/category/governance.ts on lines 134..136
packages/jellyfish-api-core/src/category/loan.ts on lines 47..49
packages/jellyfish-api-core/src/category/loan.ts on lines 398..400
packages/jellyfish-api-core/src/category/loan.ts on lines 415..417
packages/jellyfish-api-core/src/category/vault.ts on lines 121..123
packages/jellyfish-api-core/src/category/vault.ts on lines 137..139

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

  async depositToVault (depositVault: DepositVault, utxos: UTXO[] = []): Promise<string> {
    return await this.client.call('deposittovault', [depositVault.vaultId, depositVault.from, depositVault.amount, utxos], 'number')
  }
Severity: Major
Found in packages/jellyfish-api-core/src/category/vault.ts and 7 other locations - About 40 mins to fix
packages/jellyfish-api-core/src/category/account.ts on lines 463..465
packages/jellyfish-api-core/src/category/account.ts on lines 479..481
packages/jellyfish-api-core/src/category/governance.ts on lines 134..136
packages/jellyfish-api-core/src/category/loan.ts on lines 47..49
packages/jellyfish-api-core/src/category/loan.ts on lines 398..400
packages/jellyfish-api-core/src/category/loan.ts on lines 415..417
packages/jellyfish-api-core/src/category/vault.ts on lines 137..139

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  async listAuctions (pagination: AuctionPagination = {}): Promise<VaultLiquidation[]> {
    const defaultPagination = {
      limit: 100
    }
    return await this.client.call('listauctions', [{ ...defaultPagination, ...pagination }], 'number')
Severity: Minor
Found in packages/jellyfish-api-core/src/category/loan.ts and 1 other location - About 40 mins to fix
packages/jellyfish-api-core/src/category/vault.ts on lines 173..178

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  async accountToAccount (from: string, payload: BalanceTransferPayload, options: BalanceTransferAccountOptions = { utxos: [] }): Promise<string> {
    return await this.client.call('accounttoaccount', [from, payload, options.utxos], 'number')
  }
Severity: Minor
Found in packages/jellyfish-api-core/src/category/account.ts and 1 other location - About 40 mins to fix
packages/jellyfish-api-core/src/category/account.ts on lines 331..333

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  async listAuctions (pagination: AuctionPagination = {}): Promise<VaultLiquidation[]> {
    const defaultPagination = {
      limit: 100
    }
    return await this.client.call('listauctions', [{ ...defaultPagination, ...pagination }], 'number')
Severity: Minor
Found in packages/jellyfish-api-core/src/category/vault.ts and 1 other location - About 40 mins to fix
packages/jellyfish-api-core/src/category/loan.ts on lines 453..458

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

  async withdrawFromVault (withdrawVault: WithdrawVault, utxos: UTXO[] = []): Promise<string> {
    return await this.client.call('withdrawfromvault', [withdrawVault.vaultId, withdrawVault.to, withdrawVault.amount, utxos], 'number')
  }
Severity: Major
Found in packages/jellyfish-api-core/src/category/loan.ts and 7 other locations - About 40 mins to fix
packages/jellyfish-api-core/src/category/account.ts on lines 463..465
packages/jellyfish-api-core/src/category/account.ts on lines 479..481
packages/jellyfish-api-core/src/category/governance.ts on lines 134..136
packages/jellyfish-api-core/src/category/loan.ts on lines 47..49
packages/jellyfish-api-core/src/category/loan.ts on lines 398..400
packages/jellyfish-api-core/src/category/vault.ts on lines 121..123
packages/jellyfish-api-core/src/category/vault.ts on lines 137..139

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  it('should return correct data - request via raw http', async () => {
    const response = await whale.get('/v0.0/regtest/tokens')

    expect(response.status).toStrictEqual(200)
    expect(await response.json()).toStrictEqual({
Severity: Minor
Found in apps/whale-api/__sanity__/WhaleSanityContainer.sanity.ts and 1 other location - About 40 mins to fix
apps/whale-api/__sanity__/WhaleSanityContainer.sanity.ts on lines 262..269

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  it('should return correct data - request via raw http', async () => {
    const response = await whale.get('/v0.0/regtest/poolpairs')
    expect(response.status).toStrictEqual(200)

    expect(await response.json()).toStrictEqual({
Severity: Minor
Found in apps/whale-api/__sanity__/WhaleSanityContainer.sanity.ts and 1 other location - About 40 mins to fix
apps/whale-api/__sanity__/WhaleSanityContainer.sanity.ts on lines 244..251

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  async accountToUtxos (from: string, payload: BalanceTransferPayload, options: BalanceTransferAccountOptions = { utxos: [] }): Promise<string> {
    return await this.client.call('accounttoutxos', [from, payload, options.utxos], 'number')
  }
Severity: Minor
Found in packages/jellyfish-api-core/src/category/account.ts and 1 other location - About 40 mins to fix
packages/jellyfish-api-core/src/category/account.ts on lines 296..298

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 79.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Consider simplifying this complex logical expression.
Open

    if (masternode !== undefined) {
      await this.masternodeMapper.put({
        ...masternode,
        ownerAddress: updates.owner ?? masternode.ownerAddress,
        operatorAddress: updates.operator ?? masternode.operatorAddress,
Severity: Major
Found in apps/whale-api/src/module.indexer/model/dftx/update.masternode.ts - About 40 mins to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      async query (limit: number, lt?: number): Promise<MasternodeStats[]> {
        return await this.database.query(MasternodeStatsMapping.index.height, {
          limit: limit,
          order: SortOrder.DESC,
          lt: lt
    Severity: Minor
    Found in apps/whale-api/src/module.model/masternode.stats.ts and 1 other location - About 40 mins to fix
    apps/whale-api/src/module.model/block.ts on lines 39..45

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 78.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 6 locations. Consider refactoring.
    Open

      async listToken (address: string, size: number = 30, next?: string): Promise<ApiPagedResponse<AddressToken>> {
        return await this.client.requestList('GET', `address/${address}/tokens`, size, next)
      }
    Severity: Major
    Found in packages/whale-api-client/src/api/address.ts and 5 other locations - About 40 mins to fix
    packages/whale-api-client/src/api/address.ts on lines 32..34
    packages/whale-api-client/src/api/address.ts on lines 89..91
    packages/whale-api-client/src/api/poolpairs.ts on lines 40..42
    packages/whale-api-client/src/api/poolpairs.ts on lines 52..54
    packages/whale-api-client/src/api/transactions.ts on lines 26..28

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 78.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 6 locations. Consider refactoring.
    Open

      async listPoolSwaps (id: string, size: number = 30, next?: string): Promise<ApiPagedResponse<PoolSwapData>> {
        return await this.client.requestList('GET', `poolpairs/${id}/swaps`, size, next)
      }
    Severity: Major
    Found in packages/whale-api-client/src/api/poolpairs.ts and 5 other locations - About 40 mins to fix
    packages/whale-api-client/src/api/address.ts on lines 32..34
    packages/whale-api-client/src/api/address.ts on lines 65..67
    packages/whale-api-client/src/api/address.ts on lines 89..91
    packages/whale-api-client/src/api/poolpairs.ts on lines 52..54
    packages/whale-api-client/src/api/transactions.ts on lines 26..28

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 78.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 6 locations. Consider refactoring.
    Open

      async listPoolSwapsVerbose (id: string, size: number = 10, next?: string): Promise<ApiPagedResponse<PoolSwapData>> {
        return await this.client.requestList('GET', `poolpairs/${id}/swaps/verbose`, size, next)
      }
    Severity: Major
    Found in packages/whale-api-client/src/api/poolpairs.ts and 5 other locations - About 40 mins to fix
    packages/whale-api-client/src/api/address.ts on lines 32..34
    packages/whale-api-client/src/api/address.ts on lines 65..67
    packages/whale-api-client/src/api/address.ts on lines 89..91
    packages/whale-api-client/src/api/poolpairs.ts on lines 40..42
    packages/whale-api-client/src/api/transactions.ts on lines 26..28

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 78.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      async queryByHeight (limit: number, lt?: number): Promise<Block[]> {
        return await this.database.query(BlockMapping.index.height, {
          limit: limit,
          order: SortOrder.DESC,
          lt: lt
    Severity: Minor
    Found in apps/whale-api/src/module.model/block.ts and 1 other location - About 40 mins to fix
    apps/whale-api/src/module.model/masternode.stats.ts on lines 32..38

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 78.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Severity
    Category
    Status
    Source
    Language