DeFiCh/jellyfish

View on GitHub

Showing 358 of 388 total issues

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

export class ScriptUnspentMapper {
  public constructor (protected readonly database: Database) {
  }

  async query (hid: string, limit: number, gt?: string): Promise<ScriptUnspent[]> {
Severity: Major
Found in apps/whale-api/src/module.model/script.unspent.ts and 4 other locations - About 7 hrs to fix
apps/whale-api/src/module.model/oracle.history.ts on lines 23..43
apps/whale-api/src/module.model/oracle.price.active.ts on lines 23..43
apps/whale-api/src/module.model/oracle.price.feed.ts on lines 23..43
apps/whale-api/src/module.model/oracle.token.currency.ts on lines 23..43

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 205.

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 5 locations. Consider refactoring.
Open

export class OracleHistoryMapper {
  public constructor (protected readonly database: Database) {
  }

  async query (oracleId: string, limit: number, lt?: string): Promise<OracleHistory[]> {
Severity: Major
Found in apps/whale-api/src/module.model/oracle.history.ts and 4 other locations - About 7 hrs to fix
apps/whale-api/src/module.model/oracle.price.active.ts on lines 23..43
apps/whale-api/src/module.model/oracle.price.feed.ts on lines 23..43
apps/whale-api/src/module.model/oracle.token.currency.ts on lines 23..43
apps/whale-api/src/module.model/script.unspent.ts on lines 23..43

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 205.

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 3 locations. Consider refactoring.
Open

    expect(stats).toStrictEqual(
      {
        memberId: '01',
        memberName: 'alice',
        mintTokens: [
Severity: Major
Found in apps/whale-api/src/module.api/consortium.controller.spec.ts and 2 other locations - About 6 hrs to fix
apps/whale-api/src/module.api/consortium.controller.spec.ts on lines 227..235
apps/whale-api/src/module.api/consortium.controller.spec.ts on lines 256..264

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 188.

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 3 locations. Consider refactoring.
Open

    expect(stats).toStrictEqual(
      {
        memberId: '02',
        memberName: 'bob',
        mintTokens: [
Severity: Major
Found in apps/whale-api/src/module.api/consortium.controller.spec.ts and 2 other locations - About 6 hrs to fix
apps/whale-api/src/module.api/consortium.controller.spec.ts on lines 204..212
apps/whale-api/src/module.api/consortium.controller.spec.ts on lines 256..264

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 188.

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 3 locations. Consider refactoring.
Open

    expect(stats).toStrictEqual(
      {
        memberId: '02',
        memberName: 'bob',
        mintTokens: [
Severity: Major
Found in apps/whale-api/src/module.api/consortium.controller.spec.ts and 2 other locations - About 6 hrs to fix
apps/whale-api/src/module.api/consortium.controller.spec.ts on lines 204..212
apps/whale-api/src/module.api/consortium.controller.spec.ts on lines 227..235

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 188.

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

  static compactSizeUtf8BE (getter: () => string, setter: (data: string) => void): BufferComposer {
    return {
      fromBuffer: (buffer: SmartBuffer): void => {
        const length = readCompactSize(buffer)
        const buff = Buffer.from(buffer.readBuffer(length))
Severity: Major
Found in packages/jellyfish-buffer/src/Composer.ts and 1 other location - About 6 hrs to fix
packages/jellyfish-buffer/src/Composer.ts on lines 404..417

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 186.

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

  static compactSizeHex (getter: () => string, setter: (data: string) => void): BufferComposer {
    return {
      fromBuffer: (buffer: SmartBuffer): void => {
        const length = readCompactSize(buffer)
        const buff = Buffer.from(buffer.readBuffer(length))
Severity: Major
Found in packages/jellyfish-buffer/src/Composer.ts and 1 other location - About 6 hrs to fix
packages/jellyfish-buffer/src/Composer.ts on lines 382..395

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 186.

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

File Composer.ts has 416 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import BigNumber from 'bignumber.js'
import { SmartBuffer } from 'smart-buffer'
import { readCompactSize, writeCompactSize } from './CompactSize'
import { readVarInt, writeVarInt } from './VarInt'
import { getBitsFrom } from './BitMask'
Severity: Minor
Found in packages/jellyfish-buffer/src/Composer.ts - About 6 hrs to fix

    File poolpair.service.ts has 410 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Inject, Injectable, NotFoundException } from '@nestjs/common'
    import { JsonRpcClient } from '@defichain/jellyfish-api-jsonrpc'
    import BigNumber from 'bignumber.js'
    import { PoolPairInfo } from '@defichain/jellyfish-api-core/dist/category/poolpair'
    import { SemaphoreCache } from '@defichain-apps/libs/caches'
    Severity: Minor
    Found in apps/whale-api/src/module.api/poolpair.service.ts - About 5 hrs to fix

      Function list has 145 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        list (): TokenSetup[] {
          return [
            {
              create: {
                symbol: 'BTC',
      Severity: Major
      Found in apps/playground-api/src/setups/setup.token.ts - About 5 hrs to fix

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

        export class CDepositToVault extends ComposableBuffer<DepositToVault> {
          static OP_CODE = 0x53 // 'S'
          static OP_NAME = 'OP_DEFI_TX_DEPOSIT_TO_VAULT'
        
          composers (dtv: DepositToVault): BufferComposer[] {
        Severity: Major
        Found in packages/jellyfish-transaction/src/script/dftx/dftx_vault.ts and 1 other location - About 5 hrs to fix
        packages/jellyfish-transaction/src/script/dftx/dftx_vault.ts on lines 95..106

        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 180.

        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

        export class CWithdrawFromVault extends ComposableBuffer<WithdrawFromVault> {
          static OP_CODE = 0x4A // 'J'
          static OP_NAME = 'OP_DEFI_TX_WITHDRAW_FROM_VAULT'
        
          composers (dtv: WithdrawFromVault): BufferComposer[] {
        Severity: Major
        Found in packages/jellyfish-transaction/src/script/dftx/dftx_vault.ts and 1 other location - About 5 hrs to fix
        packages/jellyfish-transaction/src/script/dftx/dftx_vault.ts on lines 69..80

        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 180.

        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 3 locations. Consider refactoring.
        Open

          it('should get DETH by DETH numeric id', async () => {
            const data = await controller.get('2')
            expect(data).toStrictEqual({
              id: '2',
              symbol: 'DETH',
        Severity: Major
        Found in apps/whale-api/src/module.api/token.controller.spec.ts and 2 other locations - About 5 hrs to fix
        apps/whale-api/src/module.api/token.controller.spec.ts on lines 210..237
        apps/whale-api/src/module.api/token.controller.spec.ts on lines 268..295

        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 179.

        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 3 locations. Consider refactoring.
        Open

          it('should get DBTC-DETH by DBTC-DETH numeric id', async () => {
            const data = await controller.get('3')
            expect(data).toStrictEqual({
              id: '3',
              symbol: 'DBTC-DETH',
        Severity: Major
        Found in apps/whale-api/src/module.api/token.controller.spec.ts and 2 other locations - About 5 hrs to fix
        apps/whale-api/src/module.api/token.controller.spec.ts on lines 210..237
        apps/whale-api/src/module.api/token.controller.spec.ts on lines 239..266

        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 179.

        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 3 locations. Consider refactoring.
        Open

          it('should get DBTC by DBTC numeric id', async () => {
            const data = await controller.get('1')
            expect(data).toStrictEqual({
              id: '1',
              symbol: 'DBTC',
        Severity: Major
        Found in apps/whale-api/src/module.api/token.controller.spec.ts and 2 other locations - About 5 hrs to fix
        apps/whale-api/src/module.api/token.controller.spec.ts on lines 239..266
        apps/whale-api/src/module.api/token.controller.spec.ts on lines 268..295

        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 179.

        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 get from cache via batch as container RPC is killed', async () => {
            const dfiKey = `${CachePrefix.TOKEN_INFO} 0`
            const dfi = await cache.get<TokenInfo>(dfiKey)
            expect(dfi?.symbol).toStrictEqual('DFI')
            expect(dfi?.name).toStrictEqual('Default Defi token')
        Severity: Major
        Found in apps/whale-api/src/module.api/cache/defid.cache.spec.ts and 1 other location - About 5 hrs to fix
        apps/whale-api/src/module.api/cache/defid.cache.spec.ts on lines 159..170

        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 175.

        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 get from cache via get as container RPC is killed', async () => {
            const dfiKey = `${CachePrefix.TOKEN_INFO} 0`
        
            const dfi = await cache.get<TokenInfo>(dfiKey)
            expect(dfi?.symbol).toStrictEqual('DFI')
        Severity: Major
        Found in apps/whale-api/src/module.api/cache/defid.cache.spec.ts and 1 other location - About 5 hrs to fix
        apps/whale-api/src/module.api/cache/defid.cache.spec.ts on lines 107..117

        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 175.

        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

        export class CTakeLoan extends ComposableBuffer<TakeLoan> {
          static OP_CODE = 0x58 // 'X'
          static OP_NAME = 'OP_DEFI_TX_TAKE_LOAN'
        
          composers (tl: TakeLoan): BufferComposer[] {
        Severity: Major
        Found in packages/jellyfish-transaction/src/script/dftx/dftx_loans.ts and 1 other location - About 5 hrs to fix
        packages/jellyfish-transaction/src/script/dftx/dftx_loans.ts on lines 255..266

        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 174.

        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

        export class CPaybackLoanV2 extends ComposableBuffer<PaybackLoanV2> {
          static OP_CODE = 0x6B // 'k'
          static OP_NAME = 'OP_DEFI_TX_PAYBACK_LOAN_V2'
        
          composers (pl: PaybackLoanV2): BufferComposer[] {
        Severity: Major
        Found in packages/jellyfish-transaction/src/script/dftx/dftx_loans.ts and 1 other location - About 5 hrs to fix
        packages/jellyfish-transaction/src/script/dftx/dftx_loans.ts on lines 185..196

        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 174.

        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

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

        export abstract class ProbeIndicator extends HealthIndicator {
          /**
           * Check the liveness of this indicator.
           * This does not check whether the service is ready to receive connection.
           * @see https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#when-should-you-use-a-liveness-probe
        Severity: Major
        Found in apps/whale-api/src/module.health/probe.indicator.ts and 1 other location - About 5 hrs to fix
        apps/libs/actuator/src/ActuatorModule.ts on lines 48..70

        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 142.

        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