src/api/api.ts

Summary

Maintainability
F
2 wks
Test Coverage

File api.ts has 1282 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Typescript implementation of the Interactive Brokers TWS (or IB Gateway) API.
 */
/* eslint @typescript-eslint/no-unsafe-declaration-merging:warn */
import { EventEmitter } from "eventemitter3";
Severity: Major
Found in src/api/api.ts - About 3 days to fix

    IBApi has 81 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class IBApi extends EventEmitter {
      /**
       * Create a IB API object.
       *
       * @param options Creation options.
    Severity: Major
    Found in src/api/api.ts - About 1 day to fix

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

        calculateOptionPrice(
          reqId: number,
          contract: Contract,
          volatility: number,
          underPrice: number,
      Severity: Major
      Found in src/api/api.ts and 1 other location - About 2 hrs to fix
      src/api/api.ts on lines 169..184

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

      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

        calculateImpliedVolatility(
          reqId: number,
          contract: Contract,
          optionPrice: number,
          underPrice: number,
      Severity: Major
      Found in src/api/api.ts and 1 other location - About 2 hrs to fix
      src/api/api.ts on lines 197..212

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

      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

        reqContractDetails(reqId: number, contract: Contract): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.reqContractDetails(reqId, contract),
          );
          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 811..816

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

      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

        reqExecutions(reqId: number, filter: ExecutionFilter): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.reqExecutions(reqId, filter),
          );
          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 786..791

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

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

        reqSmartComponents(reqId: number, bboExchange: string): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.reqSmartComponents(reqId, bboExchange),
          );
          return this;
      Severity: Major
      Found in src/api/api.ts and 3 other locations - About 1 hr to fix
      src/api/api.ts on lines 379..384
      src/api/api.ts on lines 1172..1177
      src/api/api.ts on lines 1581..1586

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

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

        reqMatchingSymbols(reqId: number, pattern: string): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.reqMatchingSymbols(reqId, pattern),
          );
          return this;
      Severity: Major
      Found in src/api/api.ts and 3 other locations - About 1 hr to fix
      src/api/api.ts on lines 379..384
      src/api/api.ts on lines 1484..1489
      src/api/api.ts on lines 1581..1586

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

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

        cancelOrder(orderId: number, manualOrderCancelTime?: string): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.cancelOrder(orderId, manualOrderCancelTime),
          );
          return this;
      Severity: Major
      Found in src/api/api.ts and 3 other locations - About 1 hr to fix
      src/api/api.ts on lines 1172..1177
      src/api/api.ts on lines 1484..1489
      src/api/api.ts on lines 1581..1586

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

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

        updateDisplayGroup(reqId: number, contractInfo: string): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.updateDisplayGroup(reqId, contractInfo),
          );
          return this;
      Severity: Major
      Found in src/api/api.ts and 3 other locations - About 1 hr to fix
      src/api/api.ts on lines 379..384
      src/api/api.ts on lines 1172..1177
      src/api/api.ts on lines 1484..1489

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

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

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

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

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

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

        reqCompletedOrders(apiOnly: boolean): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.reqCompletedOrders(apiOnly),
          );
          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 698..703
      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

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

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

        reqNewsBulletins(allMsgs: boolean): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.reqNewsBulletins(allMsgs),
          );
          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 698..703
      src/api/api.ts on lines 710..715

      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

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

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

        unsubscribeFromGroupEvents(reqId: number): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.unsubscribeToGroupEvents(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 1502..1507
      src/api/api.ts on lines 1550..1555

      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

        requestFA(faDataType: number): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.requestFA(faDataType),
          );
          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 1502..1507
      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

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

        reqMarketRule(marketRuleId: number): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.reqMarketRule(marketRuleId),
          );
          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 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 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 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 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

        reqMktDepthExchanges(): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.reqMktDepthExchanges(),
          );
          return this;
      Severity: Major
      Found in src/api/api.ts and 11 other locations - About 55 mins to fix
      src/api/api.ts on lines 361..366
      src/api/api.ts on lines 417..420
      src/api/api.ts on lines 685..688
      src/api/api.ts on lines 796..799
      src/api/api.ts on lines 821..824
      src/api/api.ts on lines 861..864
      src/api/api.ts on lines 1085..1088
      src/api/api.ts on lines 1283..1286
      src/api/api.ts on lines 1292..1295
      src/api/api.ts on lines 1338..1341
      src/api/api.ts on lines 1415..1420

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

      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

        cancelNewsBulletins(): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.cancelNewsBulletins(),
          );
          return this;
      Severity: Major
      Found in src/api/api.ts and 11 other locations - About 55 mins to fix
      src/api/api.ts on lines 417..420
      src/api/api.ts on lines 685..688
      src/api/api.ts on lines 796..799
      src/api/api.ts on lines 821..824
      src/api/api.ts on lines 861..864
      src/api/api.ts on lines 1085..1088
      src/api/api.ts on lines 1234..1239
      src/api/api.ts on lines 1283..1286
      src/api/api.ts on lines 1292..1295
      src/api/api.ts on lines 1338..1341
      src/api/api.ts on lines 1415..1420

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

      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

        reqCurrentTime(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqCurrentTime());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 11 other locations - About 55 mins to fix
      src/api/api.ts on lines 361..366
      src/api/api.ts on lines 417..420
      src/api/api.ts on lines 685..688
      src/api/api.ts on lines 821..824
      src/api/api.ts on lines 861..864
      src/api/api.ts on lines 1085..1088
      src/api/api.ts on lines 1234..1239
      src/api/api.ts on lines 1283..1286
      src/api/api.ts on lines 1292..1295
      src/api/api.ts on lines 1338..1341
      src/api/api.ts on lines 1415..1420

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

      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

        reqAllOpenOrders(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqAllOpenOrders());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 11 other locations - About 55 mins to fix
      src/api/api.ts on lines 361..366
      src/api/api.ts on lines 417..420
      src/api/api.ts on lines 796..799
      src/api/api.ts on lines 821..824
      src/api/api.ts on lines 861..864
      src/api/api.ts on lines 1085..1088
      src/api/api.ts on lines 1234..1239
      src/api/api.ts on lines 1283..1286
      src/api/api.ts on lines 1292..1295
      src/api/api.ts on lines 1338..1341
      src/api/api.ts on lines 1415..1420

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

      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

        reqOpenOrders(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqOpenOrders());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 11 other locations - About 55 mins to fix
      src/api/api.ts on lines 361..366
      src/api/api.ts on lines 417..420
      src/api/api.ts on lines 685..688
      src/api/api.ts on lines 796..799
      src/api/api.ts on lines 821..824
      src/api/api.ts on lines 861..864
      src/api/api.ts on lines 1085..1088
      src/api/api.ts on lines 1234..1239
      src/api/api.ts on lines 1283..1286
      src/api/api.ts on lines 1338..1341
      src/api/api.ts on lines 1415..1420

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

      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

        cancelPositions(): IBApi {
          this.controller.schedule(() => this.controller.encoder.cancelPositions());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 11 other locations - About 55 mins to fix
      src/api/api.ts on lines 361..366
      src/api/api.ts on lines 685..688
      src/api/api.ts on lines 796..799
      src/api/api.ts on lines 821..824
      src/api/api.ts on lines 861..864
      src/api/api.ts on lines 1085..1088
      src/api/api.ts on lines 1234..1239
      src/api/api.ts on lines 1283..1286
      src/api/api.ts on lines 1292..1295
      src/api/api.ts on lines 1338..1341
      src/api/api.ts on lines 1415..1420

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

      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

        reqGlobalCancel(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqGlobalCancel());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 11 other locations - About 55 mins to fix
      src/api/api.ts on lines 361..366
      src/api/api.ts on lines 417..420
      src/api/api.ts on lines 685..688
      src/api/api.ts on lines 796..799
      src/api/api.ts on lines 821..824
      src/api/api.ts on lines 1085..1088
      src/api/api.ts on lines 1234..1239
      src/api/api.ts on lines 1283..1286
      src/api/api.ts on lines 1292..1295
      src/api/api.ts on lines 1338..1341
      src/api/api.ts on lines 1415..1420

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

      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

        reqCancelWshMetaData(reqId: number) {
          this.controller.schedule(() =>
            this.controller.encoder.reqCancelWshMetaData(reqId),
          );
          return this;
      Severity: Major
      Found in src/api/api.ts and 2 other locations - About 55 mins to fix
      src/api/api.ts on lines 724..729
      src/api/api.ts on lines 767..772

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

      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

        reqManagedAccts(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqManagedAccts());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 11 other locations - About 55 mins to fix
      src/api/api.ts on lines 361..366
      src/api/api.ts on lines 417..420
      src/api/api.ts on lines 685..688
      src/api/api.ts on lines 796..799
      src/api/api.ts on lines 821..824
      src/api/api.ts on lines 861..864
      src/api/api.ts on lines 1234..1239
      src/api/api.ts on lines 1283..1286
      src/api/api.ts on lines 1292..1295
      src/api/api.ts on lines 1338..1341
      src/api/api.ts on lines 1415..1420

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

      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

        reqNewsProviders(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqNewsProviders());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 11 other locations - About 55 mins to fix
      src/api/api.ts on lines 361..366
      src/api/api.ts on lines 417..420
      src/api/api.ts on lines 685..688
      src/api/api.ts on lines 796..799
      src/api/api.ts on lines 821..824
      src/api/api.ts on lines 861..864
      src/api/api.ts on lines 1085..1088
      src/api/api.ts on lines 1234..1239
      src/api/api.ts on lines 1292..1295
      src/api/api.ts on lines 1338..1341
      src/api/api.ts on lines 1415..1420

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

      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

        reqScannerParameters(): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.reqScannerParameters(),
          );
          return this;
      Severity: Major
      Found in src/api/api.ts and 11 other locations - About 55 mins to fix
      src/api/api.ts on lines 361..366
      src/api/api.ts on lines 417..420
      src/api/api.ts on lines 685..688
      src/api/api.ts on lines 796..799
      src/api/api.ts on lines 821..824
      src/api/api.ts on lines 861..864
      src/api/api.ts on lines 1085..1088
      src/api/api.ts on lines 1234..1239
      src/api/api.ts on lines 1283..1286
      src/api/api.ts on lines 1292..1295
      src/api/api.ts on lines 1338..1341

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

      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

        reqFamilyCodes(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqFamilyCodes());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 11 other locations - About 55 mins to fix
      src/api/api.ts on lines 361..366
      src/api/api.ts on lines 417..420
      src/api/api.ts on lines 685..688
      src/api/api.ts on lines 796..799
      src/api/api.ts on lines 861..864
      src/api/api.ts on lines 1085..1088
      src/api/api.ts on lines 1234..1239
      src/api/api.ts on lines 1283..1286
      src/api/api.ts on lines 1292..1295
      src/api/api.ts on lines 1338..1341
      src/api/api.ts on lines 1415..1420

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

      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

        reqWshMetaData(reqId: number) {
          this.controller.schedule(() =>
            this.controller.encoder.reqWshMetaData(reqId),
          );
          return this;
      Severity: Major
      Found in src/api/api.ts and 2 other locations - About 55 mins to fix
      src/api/api.ts on lines 736..741
      src/api/api.ts on lines 767..772

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

      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

        reqPositions(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqPositions());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 11 other locations - About 55 mins to fix
      src/api/api.ts on lines 361..366
      src/api/api.ts on lines 417..420
      src/api/api.ts on lines 685..688
      src/api/api.ts on lines 796..799
      src/api/api.ts on lines 821..824
      src/api/api.ts on lines 861..864
      src/api/api.ts on lines 1085..1088
      src/api/api.ts on lines 1234..1239
      src/api/api.ts on lines 1283..1286
      src/api/api.ts on lines 1292..1295
      src/api/api.ts on lines 1415..1420

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

      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

        reqCancelWshEventData(reqId: number) {
          this.controller.schedule(() =>
            this.controller.encoder.reqCancelWshEventData(reqId),
          );
          return this;
      Severity: Major
      Found in src/api/api.ts and 2 other locations - About 55 mins to fix
      src/api/api.ts on lines 724..729
      src/api/api.ts on lines 736..741

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

      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

        on(
          event: EventName.historicalTicksLast,
          listener: (
            reqId: number,
            ticks: HistoricalTickLast[],
      Severity: Major
      Found in src/api/api.ts and 2 other locations - About 50 mins to fix
      src/api/api.ts on lines 2347..2350
      src/api/api.ts on lines 2364..2371

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

      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

        on(
          event: EventName.historicalTicks,
          listener: (reqId: number, ticks: HistoricalTick[], done: boolean) => void,
        ): this;
      Severity: Major
      Found in src/api/api.ts and 2 other locations - About 50 mins to fix
      src/api/api.ts on lines 2364..2371
      src/api/api.ts on lines 2385..2392

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

      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

        on(
          event: EventName.historicalTicksBidAsk,
          listener: (
            reqId: number,
            ticks: HistoricalTickBidAsk[],
      Severity: Major
      Found in src/api/api.ts and 2 other locations - About 50 mins to fix
      src/api/api.ts on lines 2347..2350
      src/api/api.ts on lines 2385..2392

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

      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

        on(
          event: EventName.tickSize,
          listener: (reqId: number, field?: TickType, value?: number) => void,
        ): this;
      Severity: Minor
      Found in src/api/api.ts and 1 other location - About 45 mins to fix
      src/api/api.ts on lines 3109..3112

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

      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

        on(
          event: EventName.tickGeneric,
          listener: (reqId: number, field: TickType, value: number) => void,
        ): this;
      Severity: Minor
      Found in src/api/api.ts and 1 other location - About 45 mins to fix
      src/api/api.ts on lines 3248..3251

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

      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

        on(
          event: EventName.newsArticle,
          listener: (reqId: number, articleType: number, articleText: string) => void,
        ): this;
      Severity: Minor
      Found in src/api/api.ts and 2 other locations - About 40 mins to fix
      src/api/api.ts on lines 2807..2810
      src/api/api.ts on lines 2823..2826

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

      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

        on(
          event: EventName.rerouteMktDataReq,
          listener: (reqId: number, conId: number, exchange: string) => void,
        ): this;
      Severity: Minor
      Found in src/api/api.ts and 2 other locations - About 40 mins to fix
      src/api/api.ts on lines 2453..2456
      src/api/api.ts on lines 2823..2826

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

      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

        on(
          event: EventName.rerouteMktDepthReq,
          listener: (reqId: number, conId: number, exchange: string) => void,
        ): this;
      Severity: Minor
      Found in src/api/api.ts and 2 other locations - About 40 mins to fix
      src/api/api.ts on lines 2453..2456
      src/api/api.ts on lines 2807..2810

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

      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

        on(
          event: EventName.tickByTickMidPoint,
          listener: (reqId: number, time: number, midPoint: number) => void,
        ): this;
      Severity: Minor
      Found in src/api/api.ts and 1 other location - About 40 mins to fix
      src/api/api.ts on lines 2529..2536

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

      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

        on(
          event: EventName.orderBound,
          listener: (
            orderId: number,
            apiClientId: number,
      Severity: Minor
      Found in src/api/api.ts and 1 other location - About 40 mins to fix
      src/api/api.ts on lines 3054..3057

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

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

        on(
          event: EventName.histogramData,
          listener: (reqId: number, data: HistogramEntry[]) => void,
        ): this;
      Severity: Major
      Found in src/api/api.ts and 3 other locations - About 35 mins to fix
      src/api/api.ts on lines 2180..2186
      src/api/api.ts on lines 2950..2953
      src/api/api.ts on lines 2965..2971

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

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

        on(
          event: EventName.softDollarTiers,
          listener: (reqId: number, tiers: SoftDollarTier[]) => void,
        ): this;
      Severity: Major
      Found in src/api/api.ts and 3 other locations - About 35 mins to fix
      src/api/api.ts on lines 2180..2186
      src/api/api.ts on lines 2228..2231
      src/api/api.ts on lines 2965..2971

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

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

        on(
          event: EventName.contractDescriptions,
          listener: (
            reqId: number,
            contractDescriptions: ContractDescription[],
      Severity: Major
      Found in src/api/api.ts and 3 other locations - About 35 mins to fix
      src/api/api.ts on lines 2228..2231
      src/api/api.ts on lines 2950..2953
      src/api/api.ts on lines 2965..2971

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

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

        on(
          event: EventName.symbolSamples,
          listener: (
            reqId: number,
            contractDescriptions: ContractDescription[],
      Severity: Major
      Found in src/api/api.ts and 3 other locations - About 35 mins to fix
      src/api/api.ts on lines 2180..2186
      src/api/api.ts on lines 2228..2231
      src/api/api.ts on lines 2950..2953

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

      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

        on(
          event: EventName.historicalNews,
          listener: (
            reqId: number,
            time: string,
      Severity: Minor
      Found in src/api/api.ts and 1 other location - About 35 mins to fix
      src/api/api.ts on lines 1800..1809

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

      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

        on(
          event: EventName.accountSummary,
          listener: (
            reqId: number,
            account: string,
      Severity: Minor
      Found in src/api/api.ts and 1 other location - About 35 mins to fix
      src/api/api.ts on lines 2309..2318

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

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

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

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

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

      Refactorings

      Further Reading

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

        reqSecDefOptParams(
          reqId: number,
          underlyingSymbol: string,
          futFopExchange: string,
          underlyingSecType: string,
      Severity: Major
      Found in src/api/api.ts and 4 other locations - About 30 mins to fix
      src/api/api.ts on lines 876..893
      src/api/api.ts on lines 1129..1146
      src/api/api.ts on lines 1212..1229
      src/api/api.ts on lines 1518..1535

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

      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

        on(
          event: EventName.deltaNeutralValidation,
          listener: (
            reqId: number,
            deltaNeutralContract: DeltaNeutralContract,
      Severity: Minor
      Found in src/api/api.ts and 2 other locations - About 30 mins to fix
      src/api/api.ts on lines 1879..1882
      src/api/api.ts on lines 1982..1985

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

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

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

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

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

      Refactorings

      Further Reading

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

        reqHeadTimestamp(
          reqId: number,
          contract: Contract,
          whatToShow: WhatToShow,
          useRTH: boolean,
      Severity: Major
      Found in src/api/api.ts and 4 other locations - About 30 mins to fix
      src/api/api.ts on lines 1129..1146
      src/api/api.ts on lines 1212..1229
      src/api/api.ts on lines 1459..1476
      src/api/api.ts on lines 1518..1535

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

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

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

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

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

      Refactorings

      Further Reading

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

        reqMktDepth(
          reqId: number,
          contract: Contract,
          numRows: number,
          isSmartDepth: boolean,
      Severity: Major
      Found in src/api/api.ts and 4 other locations - About 30 mins to fix
      src/api/api.ts on lines 876..893
      src/api/api.ts on lines 1212..1229
      src/api/api.ts on lines 1459..1476
      src/api/api.ts on lines 1518..1535

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

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

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

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

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

      Refactorings

      Further Reading

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

        reqMktData(
          reqId: number,
          contract: Contract,
          genericTickList: string,
          snapshot: boolean,
      Severity: Major
      Found in src/api/api.ts and 4 other locations - About 30 mins to fix
      src/api/api.ts on lines 876..893
      src/api/api.ts on lines 1129..1146
      src/api/api.ts on lines 1459..1476
      src/api/api.ts on lines 1518..1535

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

      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

        on(
          event: EventName.contractDetails,
          listener: (reqId: number, contractDetails: ContractDetails) => void,
        ): this;
      Severity: Minor
      Found in src/api/api.ts and 2 other locations - About 30 mins to fix
      src/api/api.ts on lines 1879..1882
      src/api/api.ts on lines 2024..2030

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

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

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

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

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

      Refactorings

      Further Reading

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

        reqTickByTickData(
          reqId: number,
          contract: Contract,
          tickType: TickByTickDataType,
          numberOfTicks: number,
      Severity: Major
      Found in src/api/api.ts and 4 other locations - About 30 mins to fix
      src/api/api.ts on lines 876..893
      src/api/api.ts on lines 1129..1146
      src/api/api.ts on lines 1212..1229
      src/api/api.ts on lines 1459..1476

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

      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

        on(
          event: EventName.bondContractDetails,
          listener: (reqId: number, contract: Contract) => void,
        ): this;
      Severity: Minor
      Found in src/api/api.ts and 2 other locations - About 30 mins to fix
      src/api/api.ts on lines 1982..1985
      src/api/api.ts on lines 2024..2030

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

      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

        on(
          event: EventName.all,
          listener: (event: string, arguments: string[]) => void,
        ): this;
      Severity: Minor
      Found in src/api/api.ts and 1 other location - About 30 mins to fix
      src/api/api.ts on lines 1732..1735

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

      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

        on(
          event: EventName.result,
          listener: (event: string, arguments: string[]) => void,
        ): this;
      Severity: Minor
      Found in src/api/api.ts and 1 other location - About 30 mins to fix
      src/api/api.ts on lines 1635..1638

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

      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

      There are no issues that match your filters.

      Category
      Status