Showing 497 of 497 total issues

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

        if (algoParamsCount > 0) {
          order.algoParams?.forEach((param) => {
            tokens.push(param.tag);
            tokens.push(param.value);
          });
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 1319..1324

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

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 onHeadTimestamp = (
    subscriptions: Map<number, IBApiNextSubscription<string>>,
    reqId: number,
    headTimestamp: 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 2493..2507

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

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

  setServerLogLevel(logLevel: LogLevel): IBApi {
    this.controller.schedule(() =>
      this.controller.encoder.setServerLogLevel(logLevel),
    );
    return this;
Severity: Major
Found in src/api/api.ts and 1 other location - About 1 hr to fix
src/api/api.ts on lines 1106..1111

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

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

  reqMarketDataType(marketDataType: MarketDataType): IBApi {
    this.controller.schedule(() =>
      this.controller.encoder.reqMarketDataType(marketDataType),
    );
    return this;
Severity: Major
Found in src/api/api.ts and 1 other location - About 1 hr to fix
src/api/api.ts on lines 1609..1614

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

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 onHistogramData = (
    subscriptions: Map<number, IBApiNextSubscription<HistogramEntry[]>>,
    reqId: number,
    data: HistogramEntry[],
  ): 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 1596..1610

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

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

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

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

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

Refactorings

Further Reading

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

  private decodeMsg_HEAD_TIMESTAMP(): void {
    const reqId = this.readInt();
    const headTimestamp = this.readStr();

    this.emit(EventName.headTimestamp, reqId, headTimestamp);
Severity: Major
Found in src/core/io/decoder.ts and 5 other locations - About 1 hr to fix
src/core/io/decoder.ts on lines 2277..2282
src/core/io/decoder.ts on lines 2626..2630
src/core/io/decoder.ts on lines 2635..2639
src/core/io/decoder.ts on lines 2644..2648
src/core/io/decoder.ts on lines 2686..2691

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

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

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

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

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

Refactorings

Further Reading

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

  private decodeMsg_WSH_META_DATA(): void {
    const reqId = this.readInt();
    const dataJson = this.readStr();
    this.emit(EventName.wshMetaData, reqId, dataJson);
  }
Severity: Major
Found in src/core/io/decoder.ts and 5 other locations - About 1 hr to fix
src/core/io/decoder.ts on lines 2277..2282
src/core/io/decoder.ts on lines 2287..2292
src/core/io/decoder.ts on lines 2626..2630
src/core/io/decoder.ts on lines 2644..2648
src/core/io/decoder.ts on lines 2686..2691

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

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

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

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

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

Refactorings

Further Reading

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

  private decodeMsg_USER_INFO(): void {
    const reqId = this.readInt();
    const whiteBrandingId = this.readStr();

    this.emit(EventName.userInfo, reqId, whiteBrandingId);
Severity: Major
Found in src/core/io/decoder.ts and 5 other locations - About 1 hr to fix
src/core/io/decoder.ts on lines 2277..2282
src/core/io/decoder.ts on lines 2287..2292
src/core/io/decoder.ts on lines 2626..2630
src/core/io/decoder.ts on lines 2635..2639
src/core/io/decoder.ts on lines 2644..2648

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

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

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

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

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

Refactorings

Further Reading

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

  private decodeMsg_WSH_EVENT_DATA(): void {
    const reqId = this.readInt();
    const dataJson = this.readStr();
    this.emit(EventName.wshEventData, reqId, dataJson);
  }
Severity: Major
Found in src/core/io/decoder.ts and 5 other locations - About 1 hr to fix
src/core/io/decoder.ts on lines 2277..2282
src/core/io/decoder.ts on lines 2287..2292
src/core/io/decoder.ts on lines 2626..2630
src/core/io/decoder.ts on lines 2635..2639
src/core/io/decoder.ts on lines 2686..2691

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

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

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

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

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

Refactorings

Further Reading

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

  private decodeMsg_HISTORICAL_NEWS_END(): void {
    const reqId = this.readInt();
    const hasMore = this.readBool();

    this.emit(EventName.historicalNewsEnd, reqId, hasMore);
Severity: Major
Found in src/core/io/decoder.ts and 5 other locations - About 1 hr to fix
src/core/io/decoder.ts on lines 2287..2292
src/core/io/decoder.ts on lines 2626..2630
src/core/io/decoder.ts on lines 2635..2639
src/core/io/decoder.ts on lines 2644..2648
src/core/io/decoder.ts on lines 2686..2691

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

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

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

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

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

Refactorings

Further Reading

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

  private decodeMsg_REPLACE_FA_END(): void {
    const reqId = this.readInt();
    const text = this.readStr();
    this.emit(EventName.replaceFAEnd, reqId, text);
  }
Severity: Major
Found in src/core/io/decoder.ts and 5 other locations - About 1 hr to fix
src/core/io/decoder.ts on lines 2277..2282
src/core/io/decoder.ts on lines 2287..2292
src/core/io/decoder.ts on lines 2635..2639
src/core/io/decoder.ts on lines 2644..2648
src/core/io/decoder.ts on lines 2686..2691

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

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

  private onServerVersion(tokens: string[]): void {
    this._status = ConnectionStatus.Connected;

    this._serverVersion = parseInt(tokens[0], 10);
    this._serverConnectionTime = tokens[1];
Severity: Minor
Found in src/core/io/socket.ts - About 1 hr to fix

    Function reqFundamentalData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      reqFundamentalData(
        reqId: number,
        contract: Contract,
        reportType: string,
        fundamentalDataOptions: TagValue[],
    Severity: Minor
    Found in src/core/io/encoder.ts - About 1 hr to fix

      Function send has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        send(tokens: unknown[]): void {
          // flatten arrays and convert boolean types to 0/1
      
          tokens = this.flattenDeep(tokens);
          tokens.forEach((value, i) => {
      Severity: Minor
      Found in src/core/io/socket.ts - About 1 hr to fix

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

          cancelAccountSummary(reqId: number): IBApi {
            this.controller.schedule(() =>
              this.controller.encoder.cancelAccountSummary(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 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 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 20 locations. Consider refactoring.
        Open

          cancelCalculateOptionPrice(reqId: number): IBApi {
            this.controller.schedule(() =>
              this.controller.encoder.cancelCalculateOptionPrice(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 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 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 20 locations. Consider refactoring.
        Open

          cancelHeadTimestamp(reqId: number): IBApi {
            this.controller.schedule(() =>
              this.controller.encoder.cancelHeadTimestamp(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 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 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 20 locations. Consider refactoring.
        Open

          cancelFundamentalData(reqId: number): IBApi {
            this.controller.schedule(() =>
              this.controller.encoder.cancelFundamentalData(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 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 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 20 locations. Consider refactoring.
        Open

          cancelCalculateImpliedVolatility(reqId: number): IBApi {
            this.controller.schedule(() =>
              this.controller.encoder.cancelCalculateImpliedVolatility(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 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 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 20 locations. Consider refactoring.
        Open

          cancelHistogramData(reqId: number): IBApi {
            this.controller.schedule(() =>
              this.controller.encoder.cancelHistogramData(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 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 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

        Severity
        Category
        Status
        Source
        Language