Showing 497 of 497 total issues

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

  readETradeOnly(): void {
    if (this.version >= 9) {
      this.order.eTradeOnly = this.decoder.readBool();
    }
  }
Severity: Major
Found in src/core/io/decoder.ts and 21 other locations - About 55 mins to fix
src/core/io/decoder.ts on lines 2820..2824
src/core/io/decoder.ts on lines 2826..2830
src/core/io/decoder.ts on lines 2849..2853
src/core/io/decoder.ts on lines 2855..2859
src/core/io/decoder.ts on lines 2884..2888
src/core/io/decoder.ts on lines 2890..2894
src/core/io/decoder.ts on lines 2902..2906
src/core/io/decoder.ts on lines 2920..2924
src/core/io/decoder.ts on lines 2941..2945
src/core/io/decoder.ts on lines 2956..2960
src/core/io/decoder.ts on lines 2962..2966
src/core/io/decoder.ts on lines 2968..2972
src/core/io/decoder.ts on lines 2974..2978
src/core/io/decoder.ts on lines 2980..2984
src/core/io/decoder.ts on lines 2992..2996
src/core/io/decoder.ts on lines 2998..3002
src/core/io/decoder.ts on lines 3004..3008
src/core/io/decoder.ts on lines 3010..3014
src/core/io/decoder.ts on lines 3178..3182
src/core/io/decoder.ts on lines 3191..3195
src/core/io/decoder.ts on lines 3232..3236

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

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

  readNbboPriceCap(): void {
    if (this.version >= 9) {
      this.order.nbboPriceCap = this.decoder.readDoubleOrUndefined();
    }
  }
Severity: Major
Found in src/core/io/decoder.ts and 21 other locations - About 55 mins to fix
src/core/io/decoder.ts on lines 2820..2824
src/core/io/decoder.ts on lines 2826..2830
src/core/io/decoder.ts on lines 2849..2853
src/core/io/decoder.ts on lines 2855..2859
src/core/io/decoder.ts on lines 2884..2888
src/core/io/decoder.ts on lines 2890..2894
src/core/io/decoder.ts on lines 2902..2906
src/core/io/decoder.ts on lines 2920..2924
src/core/io/decoder.ts on lines 2941..2945
src/core/io/decoder.ts on lines 2956..2960
src/core/io/decoder.ts on lines 2962..2966
src/core/io/decoder.ts on lines 2968..2972
src/core/io/decoder.ts on lines 2974..2978
src/core/io/decoder.ts on lines 2980..2984
src/core/io/decoder.ts on lines 2986..2990
src/core/io/decoder.ts on lines 2992..2996
src/core/io/decoder.ts on lines 3004..3008
src/core/io/decoder.ts on lines 3010..3014
src/core/io/decoder.ts on lines 3178..3182
src/core/io/decoder.ts on lines 3191..3195
src/core/io/decoder.ts on lines 3232..3236

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

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

  readClientId(): void {
    if (this.version >= 3) {
      this.order.clientId = this.decoder.readInt();
    }
  }
Severity: Major
Found in src/core/io/decoder.ts and 21 other locations - About 55 mins to fix
src/core/io/decoder.ts on lines 2826..2830
src/core/io/decoder.ts on lines 2849..2853
src/core/io/decoder.ts on lines 2855..2859
src/core/io/decoder.ts on lines 2884..2888
src/core/io/decoder.ts on lines 2890..2894
src/core/io/decoder.ts on lines 2902..2906
src/core/io/decoder.ts on lines 2920..2924
src/core/io/decoder.ts on lines 2941..2945
src/core/io/decoder.ts on lines 2956..2960
src/core/io/decoder.ts on lines 2962..2966
src/core/io/decoder.ts on lines 2968..2972
src/core/io/decoder.ts on lines 2974..2978
src/core/io/decoder.ts on lines 2980..2984
src/core/io/decoder.ts on lines 2986..2990
src/core/io/decoder.ts on lines 2992..2996
src/core/io/decoder.ts on lines 2998..3002
src/core/io/decoder.ts on lines 3004..3008
src/core/io/decoder.ts on lines 3010..3014
src/core/io/decoder.ts on lines 3178..3182
src/core/io/decoder.ts on lines 3191..3195
src/core/io/decoder.ts on lines 3232..3236

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

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

  readAllOrNone(): void {
    if (this.version >= 9) {
      this.order.allOrNone = this.decoder.readBool();
    }
  }
Severity: Major
Found in src/core/io/decoder.ts and 21 other locations - About 55 mins to fix
src/core/io/decoder.ts on lines 2820..2824
src/core/io/decoder.ts on lines 2826..2830
src/core/io/decoder.ts on lines 2849..2853
src/core/io/decoder.ts on lines 2855..2859
src/core/io/decoder.ts on lines 2884..2888
src/core/io/decoder.ts on lines 2890..2894
src/core/io/decoder.ts on lines 2902..2906
src/core/io/decoder.ts on lines 2920..2924
src/core/io/decoder.ts on lines 2941..2945
src/core/io/decoder.ts on lines 2956..2960
src/core/io/decoder.ts on lines 2962..2966
src/core/io/decoder.ts on lines 2974..2978
src/core/io/decoder.ts on lines 2980..2984
src/core/io/decoder.ts on lines 2986..2990
src/core/io/decoder.ts on lines 2992..2996
src/core/io/decoder.ts on lines 2998..3002
src/core/io/decoder.ts on lines 3004..3008
src/core/io/decoder.ts on lines 3010..3014
src/core/io/decoder.ts on lines 3178..3182
src/core/io/decoder.ts on lines 3191..3195
src/core/io/decoder.ts on lines 3232..3236

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

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

  readMinQty(): void {
    if (this.version >= 9) {
      this.order.minQty = this.decoder.readIntOrUndefined();
    }
  }
Severity: Major
Found in src/core/io/decoder.ts and 21 other locations - About 55 mins to fix
src/core/io/decoder.ts on lines 2820..2824
src/core/io/decoder.ts on lines 2826..2830
src/core/io/decoder.ts on lines 2849..2853
src/core/io/decoder.ts on lines 2855..2859
src/core/io/decoder.ts on lines 2884..2888
src/core/io/decoder.ts on lines 2890..2894
src/core/io/decoder.ts on lines 2902..2906
src/core/io/decoder.ts on lines 2920..2924
src/core/io/decoder.ts on lines 2941..2945
src/core/io/decoder.ts on lines 2956..2960
src/core/io/decoder.ts on lines 2962..2966
src/core/io/decoder.ts on lines 2968..2972
src/core/io/decoder.ts on lines 2980..2984
src/core/io/decoder.ts on lines 2986..2990
src/core/io/decoder.ts on lines 2992..2996
src/core/io/decoder.ts on lines 2998..3002
src/core/io/decoder.ts on lines 3004..3008
src/core/io/decoder.ts on lines 3010..3014
src/core/io/decoder.ts on lines 3178..3182
src/core/io/decoder.ts on lines 3191..3195
src/core/io/decoder.ts on lines 3232..3236

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

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

  readParentId(): void {
    if (this.version >= 10) {
      this.order.parentId = this.decoder.readInt();
    }
  }
Severity: Major
Found in src/core/io/decoder.ts and 21 other locations - About 55 mins to fix
src/core/io/decoder.ts on lines 2820..2824
src/core/io/decoder.ts on lines 2826..2830
src/core/io/decoder.ts on lines 2849..2853
src/core/io/decoder.ts on lines 2855..2859
src/core/io/decoder.ts on lines 2884..2888
src/core/io/decoder.ts on lines 2890..2894
src/core/io/decoder.ts on lines 2902..2906
src/core/io/decoder.ts on lines 2920..2924
src/core/io/decoder.ts on lines 2941..2945
src/core/io/decoder.ts on lines 2956..2960
src/core/io/decoder.ts on lines 2962..2966
src/core/io/decoder.ts on lines 2968..2972
src/core/io/decoder.ts on lines 2974..2978
src/core/io/decoder.ts on lines 2980..2984
src/core/io/decoder.ts on lines 2986..2990
src/core/io/decoder.ts on lines 2992..2996
src/core/io/decoder.ts on lines 2998..3002
src/core/io/decoder.ts on lines 3010..3014
src/core/io/decoder.ts on lines 3178..3182
src/core/io/decoder.ts on lines 3191..3195
src/core/io/decoder.ts on lines 3232..3236

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

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

  readTriggerMethod(): void {
    if (this.version >= 10) {
      this.order.triggerMethod = this.decoder.readInt();
    }
  }
Severity: Major
Found in src/core/io/decoder.ts and 21 other locations - About 55 mins to fix
src/core/io/decoder.ts on lines 2820..2824
src/core/io/decoder.ts on lines 2826..2830
src/core/io/decoder.ts on lines 2849..2853
src/core/io/decoder.ts on lines 2855..2859
src/core/io/decoder.ts on lines 2884..2888
src/core/io/decoder.ts on lines 2890..2894
src/core/io/decoder.ts on lines 2902..2906
src/core/io/decoder.ts on lines 2920..2924
src/core/io/decoder.ts on lines 2941..2945
src/core/io/decoder.ts on lines 2956..2960
src/core/io/decoder.ts on lines 2962..2966
src/core/io/decoder.ts on lines 2968..2972
src/core/io/decoder.ts on lines 2974..2978
src/core/io/decoder.ts on lines 2980..2984
src/core/io/decoder.ts on lines 2986..2990
src/core/io/decoder.ts on lines 2992..2996
src/core/io/decoder.ts on lines 2998..3002
src/core/io/decoder.ts on lines 3004..3008
src/core/io/decoder.ts on lines 3178..3182
src/core/io/decoder.ts on lines 3191..3195
src/core/io/decoder.ts on lines 3232..3236

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

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

  readCustomerAccount() {
    if (this.serverVersion >= MIN_SERVER_VER.CUSTOMER_ACCOUNT) {
      this.order.customerAccount = this.decoder.readStr();
    }
  }
Severity: Minor
Found in src/core/io/decoder.ts and 1 other location - About 55 mins to fix
src/core/io/decoder.ts on lines 3547..3551

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

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

  readProfessionalCustomer() {
    if (this.serverVersion >= MIN_SERVER_VER.PROFESSIONAL_CUSTOMER) {
      this.order.professionalCustomer = this.decoder.readBool();
    }
  }
Severity: Minor
Found in src/core/io/decoder.ts and 1 other location - About 55 mins to fix
src/core/io/decoder.ts on lines 3541..3545

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

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 52.

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

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

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

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

Refactorings

Further Reading

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

  placeOrder(id: number, contract: Contract, order: Order): void {
    this.api.placeOrder(id, contract, order);
  }
Severity: Minor
Found in src/api-next/api-next.ts and 1 other location - About 50 mins to fix
src/api-next/api-next.ts on lines 2879..2881

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

  modifyOrder(id: number, contract: Contract, order: Order): void {
    this.api.placeOrder(id, contract, order);
  }
Severity: Minor
Found in src/api-next/api-next.ts and 1 other location - About 50 mins to fix
src/api-next/api-next.ts on lines 2854..2856

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

    if (this.serverVersion < MIN_SERVER_VER.LINKING) {
      if (!!contract.primaryExch) {
        return this.emitError(
          "It does not support primaryExchange parameter in reqContractDetails.",
          ErrorCode.UPDATE_TWS,
Severity: Major
Found in src/core/io/encoder.ts and 7 other locations - About 50 mins to fix
src/core/io/encoder.ts on lines 338..346
src/core/io/encoder.ts on lines 766..774
src/core/io/encoder.ts on lines 828..836
src/core/io/encoder.ts on lines 926..934
src/core/io/encoder.ts on lines 982..990
src/core/io/encoder.ts on lines 1953..1961
src/core/io/encoder.ts on lines 2469..2477

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

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

    if (this.serverVersion < MIN_SERVER_VER.CASH_QTY) {
      if (order.cashQty !== undefined) {
        return this.emitError(
          "It does not support cash quantity parameter",
          ErrorCode.UPDATE_TWS,
Severity: Major
Found in src/core/io/encoder.ts and 4 other locations - About 50 mins to fix
src/core/io/encoder.ts on lines 756..764
src/core/io/encoder.ts on lines 796..804
src/core/io/encoder.ts on lines 916..924
src/core/io/encoder.ts on lines 2108..2116

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

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

    if (this.serverVersion < MIN_SERVER_VER.SCALE_ORDERS2) {
      if (order.scaleSubsLevelSize !== undefined) {
        return this.emitError(
          "It does not support Subsequent Level Size for Scale orders.",
          ErrorCode.UPDATE_TWS,
Severity: Major
Found in src/core/io/encoder.ts and 4 other locations - About 50 mins to fix
src/core/io/encoder.ts on lines 796..804
src/core/io/encoder.ts on lines 916..924
src/core/io/encoder.ts on lines 1014..1022
src/core/io/encoder.ts on lines 2108..2116

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

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

    if (this.serverVersion < MIN_SERVER_VER.TRAILING_PERCENT) {
      if (order.trailingPercent !== undefined) {
        return this.emitError(
          "It does not support trailing percent parameter.",
          ErrorCode.UPDATE_TWS,
Severity: Major
Found in src/core/io/encoder.ts and 4 other locations - About 50 mins to fix
src/core/io/encoder.ts on lines 756..764
src/core/io/encoder.ts on lines 796..804
src/core/io/encoder.ts on lines 1014..1022
src/core/io/encoder.ts on lines 2108..2116

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

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

    if (this.serverVersion < MIN_SERVER_VER.TRADING_CLASS) {
      if (!!contract.tradingClass) {
        return this.emitError(
          "It does not support tradingClass parameter in calculateOptionPrice.",
          ErrorCode.UPDATE_TWS,
Severity: Major
Found in src/core/io/encoder.ts and 7 other locations - About 50 mins to fix
src/core/io/encoder.ts on lines 766..774
src/core/io/encoder.ts on lines 828..836
src/core/io/encoder.ts on lines 926..934
src/core/io/encoder.ts on lines 982..990
src/core/io/encoder.ts on lines 1953..1961
src/core/io/encoder.ts on lines 1963..1971
src/core/io/encoder.ts on lines 2469..2477

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

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

    if (this.serverVersion < MIN_SERVER_VER.TRADING_CLASS) {
      if (!!contract.tradingClass) {
        return this.emitError(
          "It does not support tradingClass parameter in reqContractDetails.",
          ErrorCode.UPDATE_TWS,
Severity: Major
Found in src/core/io/encoder.ts and 7 other locations - About 50 mins to fix
src/core/io/encoder.ts on lines 338..346
src/core/io/encoder.ts on lines 766..774
src/core/io/encoder.ts on lines 828..836
src/core/io/encoder.ts on lines 926..934
src/core/io/encoder.ts on lines 982..990
src/core/io/encoder.ts on lines 1963..1971
src/core/io/encoder.ts on lines 2469..2477

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

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