src/api/api.ts

Summary

Maintainability
F
2 wks
Test Coverage

File api.ts has 1305 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 174..189

      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 202..217

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 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

        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 805..810

      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

        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 830..835

      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 3 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 2 other locations - About 1 hr to fix
      src/api/api.ts on lines 1199..1204
      src/api/api.ts on lines 1608..1613

      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 3 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 2 other locations - About 1 hr to fix
      src/api/api.ts on lines 1199..1204
      src/api/api.ts on lines 1511..1516

      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 3 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 2 other locations - About 1 hr to fix
      src/api/api.ts on lines 1511..1516
      src/api/api.ts on lines 1608..1613

      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 1133..1138

      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 1636..1641

      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

        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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 729..734
      src/api/api.ts on lines 1300..1305

      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

        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 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 717..722
      src/api/api.ts on lines 1300..1305

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 555..560
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 227..232
      src/api/api.ts on lines 241..246
      src/api/api.ts on lines 255..260
      src/api/api.ts on lines 269..274
      src/api/api.ts on lines 283..288
      src/api/api.ts on lines 297..302
      src/api/api.ts on lines 311..316
      src/api/api.ts on lines 325..330
      src/api/api.ts on lines 339..344
      src/api/api.ts on lines 412..415
      src/api/api.ts on lines 424..429
      src/api/api.ts on lines 448..453
      src/api/api.ts on lines 460..465
      src/api/api.ts on lines 474..479
      src/api/api.ts on lines 488..493
      src/api/api.ts on lines 1184..1189
      src/api/api.ts on lines 1529..1534
      src/api/api.ts on lines 1577..1582
      src/api/api.ts on lines 1622..1627

      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 717..722
      src/api/api.ts on lines 729..734

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

        reqScannerParameters(): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.reqScannerParameters(),
          );
          return this;
      Severity: Major
      Found in src/api/api.ts and 10 other locations - About 55 mins to fix
      src/api/api.ts on lines 366..371
      src/api/api.ts on lines 436..439
      src/api/api.ts on lines 704..707
      src/api/api.ts on lines 815..818
      src/api/api.ts on lines 840..843
      src/api/api.ts on lines 1112..1115
      src/api/api.ts on lines 1261..1266
      src/api/api.ts on lines 1310..1313
      src/api/api.ts on lines 1319..1322
      src/api/api.ts on lines 1365..1368

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

        reqCurrentTime(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqCurrentTime());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 10 other locations - About 55 mins to fix
      src/api/api.ts on lines 366..371
      src/api/api.ts on lines 436..439
      src/api/api.ts on lines 704..707
      src/api/api.ts on lines 840..843
      src/api/api.ts on lines 1112..1115
      src/api/api.ts on lines 1261..1266
      src/api/api.ts on lines 1310..1313
      src/api/api.ts on lines 1319..1322
      src/api/api.ts on lines 1365..1368
      src/api/api.ts on lines 1442..1447

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

        reqOpenOrders(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqOpenOrders());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 10 other locations - About 55 mins to fix
      src/api/api.ts on lines 366..371
      src/api/api.ts on lines 436..439
      src/api/api.ts on lines 704..707
      src/api/api.ts on lines 815..818
      src/api/api.ts on lines 840..843
      src/api/api.ts on lines 1112..1115
      src/api/api.ts on lines 1261..1266
      src/api/api.ts on lines 1310..1313
      src/api/api.ts on lines 1365..1368
      src/api/api.ts on lines 1442..1447

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

        reqAllOpenOrders(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqAllOpenOrders());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 10 other locations - About 55 mins to fix
      src/api/api.ts on lines 366..371
      src/api/api.ts on lines 436..439
      src/api/api.ts on lines 815..818
      src/api/api.ts on lines 840..843
      src/api/api.ts on lines 1112..1115
      src/api/api.ts on lines 1261..1266
      src/api/api.ts on lines 1310..1313
      src/api/api.ts on lines 1319..1322
      src/api/api.ts on lines 1365..1368
      src/api/api.ts on lines 1442..1447

      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 755..760
      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 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 11 locations. Consider refactoring.
      Open

        cancelPositions(): IBApi {
          this.controller.schedule(() => this.controller.encoder.cancelPositions());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 10 other locations - About 55 mins to fix
      src/api/api.ts on lines 366..371
      src/api/api.ts on lines 704..707
      src/api/api.ts on lines 815..818
      src/api/api.ts on lines 840..843
      src/api/api.ts on lines 1112..1115
      src/api/api.ts on lines 1261..1266
      src/api/api.ts on lines 1310..1313
      src/api/api.ts on lines 1319..1322
      src/api/api.ts on lines 1365..1368
      src/api/api.ts on lines 1442..1447

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

        reqNewsProviders(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqNewsProviders());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 10 other locations - About 55 mins to fix
      src/api/api.ts on lines 366..371
      src/api/api.ts on lines 436..439
      src/api/api.ts on lines 704..707
      src/api/api.ts on lines 815..818
      src/api/api.ts on lines 840..843
      src/api/api.ts on lines 1112..1115
      src/api/api.ts on lines 1261..1266
      src/api/api.ts on lines 1319..1322
      src/api/api.ts on lines 1365..1368
      src/api/api.ts on lines 1442..1447

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

        reqManagedAccts(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqManagedAccts());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 10 other locations - About 55 mins to fix
      src/api/api.ts on lines 366..371
      src/api/api.ts on lines 436..439
      src/api/api.ts on lines 704..707
      src/api/api.ts on lines 815..818
      src/api/api.ts on lines 840..843
      src/api/api.ts on lines 1261..1266
      src/api/api.ts on lines 1310..1313
      src/api/api.ts on lines 1319..1322
      src/api/api.ts on lines 1365..1368
      src/api/api.ts on lines 1442..1447

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

        reqPositions(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqPositions());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 10 other locations - About 55 mins to fix
      src/api/api.ts on lines 366..371
      src/api/api.ts on lines 436..439
      src/api/api.ts on lines 704..707
      src/api/api.ts on lines 815..818
      src/api/api.ts on lines 840..843
      src/api/api.ts on lines 1112..1115
      src/api/api.ts on lines 1261..1266
      src/api/api.ts on lines 1310..1313
      src/api/api.ts on lines 1319..1322
      src/api/api.ts on lines 1442..1447

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

        reqFamilyCodes(): IBApi {
          this.controller.schedule(() => this.controller.encoder.reqFamilyCodes());
          return this;
        }
      Severity: Major
      Found in src/api/api.ts and 10 other locations - About 55 mins to fix
      src/api/api.ts on lines 366..371
      src/api/api.ts on lines 436..439
      src/api/api.ts on lines 704..707
      src/api/api.ts on lines 815..818
      src/api/api.ts on lines 1112..1115
      src/api/api.ts on lines 1261..1266
      src/api/api.ts on lines 1310..1313
      src/api/api.ts on lines 1319..1322
      src/api/api.ts on lines 1365..1368
      src/api/api.ts on lines 1442..1447

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

        reqMktDepthExchanges(): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.reqMktDepthExchanges(),
          );
          return this;
      Severity: Major
      Found in src/api/api.ts and 10 other locations - About 55 mins to fix
      src/api/api.ts on lines 366..371
      src/api/api.ts on lines 436..439
      src/api/api.ts on lines 704..707
      src/api/api.ts on lines 815..818
      src/api/api.ts on lines 840..843
      src/api/api.ts on lines 1112..1115
      src/api/api.ts on lines 1310..1313
      src/api/api.ts on lines 1319..1322
      src/api/api.ts on lines 1365..1368
      src/api/api.ts on lines 1442..1447

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

        cancelNewsBulletins(): IBApi {
          this.controller.schedule(() =>
            this.controller.encoder.cancelNewsBulletins(),
          );
          return this;
      Severity: Major
      Found in src/api/api.ts and 10 other locations - About 55 mins to fix
      src/api/api.ts on lines 436..439
      src/api/api.ts on lines 704..707
      src/api/api.ts on lines 815..818
      src/api/api.ts on lines 840..843
      src/api/api.ts on lines 1112..1115
      src/api/api.ts on lines 1261..1266
      src/api/api.ts on lines 1310..1313
      src/api/api.ts on lines 1319..1322
      src/api/api.ts on lines 1365..1368
      src/api/api.ts on lines 1442..1447

      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 743..748
      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 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 743..748
      src/api/api.ts on lines 755..760

      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.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 2374..2377
      src/api/api.ts on lines 2412..2419

      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 2391..2398
      src/api/api.ts on lines 2412..2419

      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.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 2374..2377
      src/api/api.ts on lines 2391..2398

      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 3132..3135

      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 3271..3274

      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.orderBound,
          listener: (permId: number, clientId: number, orderId: 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 3077..3080

      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.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 2830..2833
      src/api/api.ts on lines 2846..2849

      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 2480..2483
      src/api/api.ts on lines 2830..2833

      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 2480..2483
      src/api/api.ts on lines 2846..2849

      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 2556..2559

      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.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 2255..2258
      src/api/api.ts on lines 2973..2976
      src/api/api.ts on lines 2988..2994

      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 1827..1836

      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 2207..2213
      src/api/api.ts on lines 2255..2258
      src/api/api.ts on lines 2988..2994

      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 2207..2213
      src/api/api.ts on lines 2255..2258
      src/api/api.ts on lines 2973..2976

      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.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 2207..2213
      src/api/api.ts on lines 2973..2976
      src/api/api.ts on lines 2988..2994

      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 2336..2345

      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

        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 1156..1173
      src/api/api.ts on lines 1239..1256
      src/api/api.ts on lines 1486..1503
      src/api/api.ts on lines 1545..1562

      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 903..920
      src/api/api.ts on lines 1239..1256
      src/api/api.ts on lines 1486..1503
      src/api/api.ts on lines 1545..1562

      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 1759..1762

      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 1906..1909
      src/api/api.ts on lines 2051..2057

      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 903..920
      src/api/api.ts on lines 1156..1173
      src/api/api.ts on lines 1239..1256
      src/api/api.ts on lines 1486..1503

      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 1662..1665

      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

        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 903..920
      src/api/api.ts on lines 1156..1173
      src/api/api.ts on lines 1239..1256
      src/api/api.ts on lines 1545..1562

      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 2009..2012
      src/api/api.ts on lines 2051..2057

      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 903..920
      src/api/api.ts on lines 1156..1173
      src/api/api.ts on lines 1486..1503
      src/api/api.ts on lines 1545..1562

      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 1906..1909
      src/api/api.ts on lines 2009..2012

      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