Showing 497 of 497 total issues

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

  private decodeMsg_CONTRACT_DATA_END(): void {
    this.readInt(); // version
    const reqId = this.readInt();

    this.emit(EventName.contractDetailsEnd, reqId);
Severity: Major
Found in src/core/io/decoder.ts and 11 other locations - About 1 hr to fix
src/core/io/decoder.ts on lines 916..921
src/core/io/decoder.ts on lines 926..931
src/core/io/decoder.ts on lines 1252..1257
src/core/io/decoder.ts on lines 1502..1507
src/core/io/decoder.ts on lines 1716..1721
src/core/io/decoder.ts on lines 1785..1790
src/core/io/decoder.ts on lines 1795..1800
src/core/io/decoder.ts on lines 1820..1825
src/core/io/decoder.ts on lines 1913..1918
src/core/io/decoder.ts on lines 1980..1985
src/core/io/decoder.ts on lines 2013..2018

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

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

  private decodeMsg_EXECUTION_DATA_END(): void {
    this.readInt(); // version
    const reqId = this.readInt();

    this.emit(EventName.execDetailsEnd, reqId);
Severity: Major
Found in src/core/io/decoder.ts and 11 other locations - About 1 hr to fix
src/core/io/decoder.ts on lines 916..921
src/core/io/decoder.ts on lines 926..931
src/core/io/decoder.ts on lines 1252..1257
src/core/io/decoder.ts on lines 1502..1507
src/core/io/decoder.ts on lines 1716..1721
src/core/io/decoder.ts on lines 1766..1771
src/core/io/decoder.ts on lines 1785..1790
src/core/io/decoder.ts on lines 1820..1825
src/core/io/decoder.ts on lines 1913..1918
src/core/io/decoder.ts on lines 1980..1985
src/core/io/decoder.ts on lines 2013..2018

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

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

  reqAutoOpenOrders(bAutoBind: boolean): IBApi {
    this.controller.schedule(() =>
      this.controller.encoder.reqAutoOpenOrders(bAutoBind),
    );
    return this;
Severity: Major
Found in src/api/api.ts and 2 other locations - About 1 hr to fix
src/api/api.ts on lines 710..715
src/api/api.ts on lines 1273..1278

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

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

  cancelScannerSubscription(reqId: number): IBApi {
    this.controller.schedule(() =>
      this.controller.encoder.cancelScannerSubscription(reqId),
    );
    return this;
Severity: Major
Found in src/api/api.ts and 19 other locations - About 1 hr to fix
src/api/api.ts on lines 222..227
src/api/api.ts on lines 236..241
src/api/api.ts on lines 250..255
src/api/api.ts on lines 264..269
src/api/api.ts on lines 278..283
src/api/api.ts on lines 292..297
src/api/api.ts on lines 306..311
src/api/api.ts on lines 320..325
src/api/api.ts on lines 334..339
src/api/api.ts on lines 393..396
src/api/api.ts on lines 405..410
src/api/api.ts on lines 429..434
src/api/api.ts on lines 441..446
src/api/api.ts on lines 469..474
src/api/api.ts on lines 536..541
src/api/api.ts on lines 1157..1162
src/api/api.ts on lines 1502..1507
src/api/api.ts on lines 1550..1555
src/api/api.ts on lines 1595..1600

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

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

  private decodeMsg_MANAGED_ACCTS(): void {
    this.readInt(); // version
    const accountsList = this.readStr();

    this.emit(EventName.managedAccounts, accountsList);
Severity: Major
Found in src/core/io/decoder.ts and 11 other locations - About 1 hr to fix
src/core/io/decoder.ts on lines 916..921
src/core/io/decoder.ts on lines 926..931
src/core/io/decoder.ts on lines 1502..1507
src/core/io/decoder.ts on lines 1716..1721
src/core/io/decoder.ts on lines 1766..1771
src/core/io/decoder.ts on lines 1785..1790
src/core/io/decoder.ts on lines 1795..1800
src/core/io/decoder.ts on lines 1820..1825
src/core/io/decoder.ts on lines 1913..1918
src/core/io/decoder.ts on lines 1980..1985
src/core/io/decoder.ts on lines 2013..2018

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

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

  cancelPnL(reqId: number): IBApi {
    this.controller.schedule(() => this.controller.encoder.cancelPnL(reqId));
    return this;
  }
Severity: Major
Found in src/api/api.ts and 19 other locations - About 1 hr to fix
src/api/api.ts on lines 222..227
src/api/api.ts on lines 236..241
src/api/api.ts on lines 250..255
src/api/api.ts on lines 264..269
src/api/api.ts on lines 278..283
src/api/api.ts on lines 292..297
src/api/api.ts on lines 306..311
src/api/api.ts on lines 320..325
src/api/api.ts on lines 334..339
src/api/api.ts on lines 405..410
src/api/api.ts on lines 429..434
src/api/api.ts on lines 441..446
src/api/api.ts on lines 455..460
src/api/api.ts on lines 469..474
src/api/api.ts on lines 536..541
src/api/api.ts on lines 1157..1162
src/api/api.ts on lines 1502..1507
src/api/api.ts on lines 1550..1555
src/api/api.ts on lines 1595..1600

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

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

  private decodeMsg_NEXT_VALID_ID(): void {
    this.readInt(); // version
    const orderId = this.readInt();

    this.emit(EventName.nextValidId, orderId);
Severity: Major
Found in src/core/io/decoder.ts and 11 other locations - About 1 hr to fix
src/core/io/decoder.ts on lines 916..921
src/core/io/decoder.ts on lines 1252..1257
src/core/io/decoder.ts on lines 1502..1507
src/core/io/decoder.ts on lines 1716..1721
src/core/io/decoder.ts on lines 1766..1771
src/core/io/decoder.ts on lines 1785..1790
src/core/io/decoder.ts on lines 1795..1800
src/core/io/decoder.ts on lines 1820..1825
src/core/io/decoder.ts on lines 1913..1918
src/core/io/decoder.ts on lines 1980..1985
src/core/io/decoder.ts on lines 2013..2018

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

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

  reqSoftDollarTiers(reqId: number): IBApi {
    this.controller.schedule(() =>
      this.controller.encoder.reqSoftDollarTiers(reqId),
    );
    return this;
Severity: Major
Found in src/api/api.ts and 19 other locations - About 1 hr to fix
src/api/api.ts on lines 222..227
src/api/api.ts on lines 236..241
src/api/api.ts on lines 250..255
src/api/api.ts on lines 264..269
src/api/api.ts on lines 278..283
src/api/api.ts on lines 292..297
src/api/api.ts on lines 306..311
src/api/api.ts on lines 320..325
src/api/api.ts on lines 334..339
src/api/api.ts on lines 393..396
src/api/api.ts on lines 405..410
src/api/api.ts on lines 429..434
src/api/api.ts on lines 441..446
src/api/api.ts on lines 455..460
src/api/api.ts on lines 469..474
src/api/api.ts on lines 536..541
src/api/api.ts on lines 1157..1162
src/api/api.ts on lines 1550..1555
src/api/api.ts on lines 1595..1600

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

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

  private decodeMsg_POSITION_MULTI_END(): void {
    this.readInt(); // version
    const reqId = this.readInt();

    this.emit(EventName.positionMultiEnd, reqId);
Severity: Major
Found in src/core/io/decoder.ts and 11 other locations - About 1 hr to fix
src/core/io/decoder.ts on lines 916..921
src/core/io/decoder.ts on lines 926..931
src/core/io/decoder.ts on lines 1252..1257
src/core/io/decoder.ts on lines 1502..1507
src/core/io/decoder.ts on lines 1716..1721
src/core/io/decoder.ts on lines 1766..1771
src/core/io/decoder.ts on lines 1785..1790
src/core/io/decoder.ts on lines 1795..1800
src/core/io/decoder.ts on lines 1820..1825
src/core/io/decoder.ts on lines 1913..1918
src/core/io/decoder.ts on lines 2013..2018

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

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 (
      this.serverVersion < MIN_SERVER_VER.DECISION_MAKER &&
      (!!order.mifid2DecisionMaker || !!order.mifid2DecisionAlgo)
    ) {
      return this.emitError(
Severity: Major
Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
src/core/io/encoder.ts on lines 1035..1044

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

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 (
      this.serverVersion < MIN_SERVER_VER.MIFID_EXECUTION &&
      (!!order.mifid2ExecutionTrader || !!order.mifid2ExecutionAlgo)
    ) {
      return this.emitError(
Severity: Major
Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
src/core/io/encoder.ts on lines 1024..1033

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

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 getSecDefOptParams has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  getSecDefOptParams(
    underlyingSymbol: string,
    futFopExchange: string,
    underlyingSecType: SecType,
    underlyingConId: number,
Severity: Minor
Found in src/api-next/api-next.ts - About 1 hr to fix

    Function createObservable has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      createObservable(): Observable<ItemListUpdate<T>> {
        return new Observable<ItemListUpdate<T>>((subscriber) => {
          // create new subject and reqId if there is an has error
    
          if (this.hasError) {
    Severity: Minor
    Found in src/core/api-next/subscription.ts - About 1 hr to fix

      Function start has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        start(): void {
          super.start();
      
          if (!this.cmdLineArgs.conid) {
            this.error("-conid argument missing.");
      Severity: Minor
      Found in src/tools/historical-data-updates.ts - About 1 hr to fix

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

          private readonly onSecurityDefinitionOptionParameterEnd = (
            subscriptions: Map<
              number,
              IBApiNextSubscription<SecurityDefinitionOptionParameterType[]>
            >,
        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 896..901

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

        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

                    case OrderConditionType.Margin: {
                      const marginCond = cond as MarginCondition;
                      // OperatorCondition
                      tokens.push(marginCond.isMore);
                      tokens.push(marginCond.strValue);
        Severity: Major
        Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
        src/core/io/encoder.ts on lines 1618..1624

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

        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

                    case OrderConditionType.Time: {
                      const timeConditionCond = cond as TimeCondition;
                      // OperatorCondition
                      tokens.push(timeConditionCond.isMore);
                      tokens.push(timeConditionCond.strValue);
        Severity: Major
        Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
        src/core/io/encoder.ts on lines 1586..1592

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

        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 onContractDetailsEnd = (
            subscriptions: Map<number, IBApiNextSubscription<ContractDetails[]>>,
            reqId: number,
          ) => {
            subscriptions.get(reqId)?.complete();
        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 976..984

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

        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 start has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          start(): void {
            super.start();
        
            if (!this.cmdLineArgs.conid) {
              this.error("-conid argument missing.");
        Severity: Minor
        Found in src/tools/market-depth.ts - About 1 hr to fix

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

            constructor(
              appDescription: string,
              usageDescription: string,
              optionArgumentDescriptions: [string, string][],
              usageExample: string,
          Severity: Minor
          Found in src/tools/common/ib-api-next-app.ts - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language