Showing 497 of 497 total issues

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

    } else if (side == 1) {
      // bid side
      cachedRows = <Map<OrderBookRowPosition, OrderBookRow>>cached.bids;
      changedRows = <Map<OrderBookRowPosition, OrderBookRow>>changed.bids;
    }
Severity: Major
Found in src/api-next/api-next.ts and 1 other location - About 1 hr to fix
src/api-next/api-next.ts on lines 2204..2212

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

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

    if (side == 0) {
      // ask side
      cachedRows = <Map<OrderBookRowPosition, OrderBookRow>>cached.asks;
      changedRows = <Map<OrderBookRowPosition, OrderBookRow>>changed.asks;
    } else if (side == 1) {
Severity: Major
Found in src/api-next/api-next.ts and 1 other location - About 1 hr to fix
src/api-next/api-next.ts on lines 2208..2212

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

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

  private stopWatchdog(): void {
    // verify state
    if (this.connectionWatchdogTimeout === undefined) {
      return;
    }
Severity: Major
Found in src/core/api-next/auto-connection.ts and 1 other location - About 1 hr to fix
src/core/api-next/auto-connection.ts on lines 207..217

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

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

  private stopReConnectTimer(): void {
    // verify state
    if (this.reconnectionTimeout === undefined) {
      return;
    }
Severity: Major
Found in src/core/api-next/auto-connection.ts and 1 other location - About 1 hr to fix
src/core/api-next/auto-connection.ts on lines 260..270

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

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

Function decodeMsg_SYMBOL_SAMPLES has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private decodeMsg_SYMBOL_SAMPLES(): void {
    const reqId = this.readInt();

    const nContractDescriptions = this.readInt();
    const contractDescriptions: ContractDescription[] = new Array(
Severity: Minor
Found in src/core/io/decoder.ts - About 1 hr to fix

    Function next has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            next: (marketData) => {
              const changedOrAddedDataWithTickNames = new Map<string, number>();
              marketData.added?.forEach((tick, type) => {
                if (type > IBApiNextTickType.API_NEXT_FIRST_TICK_ID) {
                  changedOrAddedDataWithTickNames.set(
    Severity: Minor
    Found in src/tools/market-data.ts - About 1 hr to fix

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

        readDiscretionaryUpToLimitPrice(): void {
          if (this.serverVersion >= MIN_SERVER_VER.D_PEG_ORDERS) {
            this.order.discretionaryUpToLimitPrice = this.decoder.readBool();
          }
        }
      Severity: Major
      Found in src/core/io/decoder.ts and 7 other locations - About 1 hr to fix
      src/core/io/decoder.ts on lines 2878..2882
      src/core/io/decoder.ts on lines 3443..3447
      src/core/io/decoder.ts on lines 3449..3453
      src/core/io/decoder.ts on lines 3455..3459
      src/core/io/decoder.ts on lines 3512..3516
      src/core/io/decoder.ts on lines 3518..3522
      src/core/io/decoder.ts on lines 3524..3528

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

      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

      export const isPegBestOrder = (orderType: OrderType): boolean => {
        if (orderType == OrderType.PEG_BEST || (orderType as string) == "PEGBEST")
          return true;
        else return false;
      };
      Severity: Major
      Found in src/api/order/enum/orderType.ts and 2 other locations - About 1 hr to fix
      src/api/order/enum/orderType.ts on lines 50..54
      src/api/order/enum/orderType.ts on lines 62..66

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

      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

        readIsOmsContainer(): void {
          if (this.serverVersion >= MIN_SERVER_VER.ORDER_CONTAINER) {
            this.order.isOmsContainer = this.decoder.readBool();
          }
        }
      Severity: Major
      Found in src/core/io/decoder.ts and 7 other locations - About 1 hr to fix
      src/core/io/decoder.ts on lines 2878..2882
      src/core/io/decoder.ts on lines 3443..3447
      src/core/io/decoder.ts on lines 3449..3453
      src/core/io/decoder.ts on lines 3461..3465
      src/core/io/decoder.ts on lines 3512..3516
      src/core/io/decoder.ts on lines 3518..3522
      src/core/io/decoder.ts on lines 3524..3528

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

      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

        readDuration(): void {
          if (this.serverVersion >= MIN_SERVER_VER.DURATION) {
            this.order.duration = this.decoder.readInt();
          }
        }
      Severity: Major
      Found in src/core/io/decoder.ts and 7 other locations - About 1 hr to fix
      src/core/io/decoder.ts on lines 2878..2882
      src/core/io/decoder.ts on lines 3443..3447
      src/core/io/decoder.ts on lines 3449..3453
      src/core/io/decoder.ts on lines 3455..3459
      src/core/io/decoder.ts on lines 3461..3465
      src/core/io/decoder.ts on lines 3512..3516
      src/core/io/decoder.ts on lines 3524..3528

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

      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

        readPostToAts(): void {
          if (this.serverVersion >= MIN_SERVER_VER.POST_TO_ATS) {
            this.order.postToAts = this.decoder.readIntOrUndefined();
          }
        }
      Severity: Major
      Found in src/core/io/decoder.ts and 7 other locations - About 1 hr to fix
      src/core/io/decoder.ts on lines 2878..2882
      src/core/io/decoder.ts on lines 3443..3447
      src/core/io/decoder.ts on lines 3449..3453
      src/core/io/decoder.ts on lines 3455..3459
      src/core/io/decoder.ts on lines 3461..3465
      src/core/io/decoder.ts on lines 3512..3516
      src/core/io/decoder.ts on lines 3518..3522

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

      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

        readModelCode(): void {
          if (this.version >= MIN_SERVER_VER.MODELS_SUPPORT) {
            this.order.modelCode = this.decoder.readStr();
          }
        }
      Severity: Major
      Found in src/core/io/decoder.ts and 7 other locations - About 1 hr to fix
      src/core/io/decoder.ts on lines 3443..3447
      src/core/io/decoder.ts on lines 3449..3453
      src/core/io/decoder.ts on lines 3455..3459
      src/core/io/decoder.ts on lines 3461..3465
      src/core/io/decoder.ts on lines 3512..3516
      src/core/io/decoder.ts on lines 3518..3522
      src/core/io/decoder.ts on lines 3524..3528

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

      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

      export const isPegBenchOrder = (orderType: OrderType): boolean => {
        if (orderType == OrderType.PEG_BENCH || (orderType as string) == "PEGBENCH")
          return true;
        else return false;
      };
      Severity: Major
      Found in src/api/order/enum/orderType.ts and 2 other locations - About 1 hr to fix
      src/api/order/enum/orderType.ts on lines 56..60
      src/api/order/enum/orderType.ts on lines 62..66

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

      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

        readCashQty(): void {
          if (this.serverVersion >= MIN_SERVER_VER.CASH_QTY) {
            this.order.cashQty = this.decoder.readDoubleOrUndefined();
          }
        }
      Severity: Major
      Found in src/core/io/decoder.ts and 7 other locations - About 1 hr to fix
      src/core/io/decoder.ts on lines 2878..2882
      src/core/io/decoder.ts on lines 3449..3453
      src/core/io/decoder.ts on lines 3455..3459
      src/core/io/decoder.ts on lines 3461..3465
      src/core/io/decoder.ts on lines 3512..3516
      src/core/io/decoder.ts on lines 3518..3522
      src/core/io/decoder.ts on lines 3524..3528

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

      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

        readUsePriceMgmtAlgo(): void {
          if (this.serverVersion >= MIN_SERVER_VER.PRICE_MGMT_ALGO) {
            this.order.usePriceMgmtAlgo = this.decoder.readBool();
          }
        }
      Severity: Major
      Found in src/core/io/decoder.ts and 7 other locations - About 1 hr to fix
      src/core/io/decoder.ts on lines 2878..2882
      src/core/io/decoder.ts on lines 3443..3447
      src/core/io/decoder.ts on lines 3449..3453
      src/core/io/decoder.ts on lines 3455..3459
      src/core/io/decoder.ts on lines 3461..3465
      src/core/io/decoder.ts on lines 3518..3522
      src/core/io/decoder.ts on lines 3524..3528

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

      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

        readDontUseAutoPriceForHedge(): void {
          if (this.serverVersion >= MIN_SERVER_VER.AUTO_PRICE_FOR_HEDGE) {
            this.order.dontUseAutoPriceForHedge = this.decoder.readBool();
          }
        }
      Severity: Major
      Found in src/core/io/decoder.ts and 7 other locations - About 1 hr to fix
      src/core/io/decoder.ts on lines 2878..2882
      src/core/io/decoder.ts on lines 3443..3447
      src/core/io/decoder.ts on lines 3455..3459
      src/core/io/decoder.ts on lines 3461..3465
      src/core/io/decoder.ts on lines 3512..3516
      src/core/io/decoder.ts on lines 3518..3522
      src/core/io/decoder.ts on lines 3524..3528

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

      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

      export const isPegMidOrder = (orderType: OrderType): boolean => {
        if (orderType == OrderType.PEG_MID || (orderType as string) == "PEGMID")
          return true;
        else return false;
      };
      Severity: Major
      Found in src/api/order/enum/orderType.ts and 2 other locations - About 1 hr to fix
      src/api/order/enum/orderType.ts on lines 50..54
      src/api/order/enum/orderType.ts on lines 56..60

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

      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

        private readonly onSymbolSamples = (
          subscriptions: Map<number, IBApiNextSubscription<ContractDescription[]>>,
          reqId: number,
          contractDescriptions: ContractDescription[],
        ): void => {
      Severity: Major
      Found in src/api-next/api-next.ts and 1 other location - About 1 hr to fix
      src/api-next/api-next.ts on lines 3047..3058

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

      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

        private readonly onUserInfo = (
          subscriptions: Map<number, IBApiNextSubscription<string>>,
          reqId: number,
          whiteBrandingId: string,
        ): void => {
      Severity: Major
      Found in src/api-next/api-next.ts and 1 other location - About 1 hr to fix
      src/api-next/api-next.ts on lines 3012..3023

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

      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

              while (secIdListCount--) {
                const tagValue: TagValue = {
                  tag: this.readStr(),
                  value: this.readStr(),
                };
      Severity: Major
      Found in src/core/io/decoder.ts and 1 other location - About 1 hr to fix
      src/core/io/decoder.ts on lines 1012..1018

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

      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