Showing 497 of 497 total issues

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

  private decodeMsg_CURRENT_TIME(): void {
    this.readInt(); //  version
    const time = this.readInt();

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

  private decodeMsg_SCANNER_PARAMETERS(): void {
    this.readInt(); // version
    const xml = this.readStr();

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

  private decodeMsg_ACCT_UPDATE_TIME(): void {
    this.readInt(); // version
    const timeStamp = this.readStr();

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

  private decodeMsg_ACCT_DOWNLOAD_END(): void {
    this.readInt(); // version
    const accountName = this.readStr();

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language