Showing 497 of 497 total issues

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

    if (this.serverVersion < MIN_SERVER_VER.HEDGE_ORDERS) {
      if (!!order.hedgeType) {
        return this.emitError(
          "It does not support hedge orders.",
          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 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 parameters in placeOrder.",
          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 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 5 locations. Consider refactoring.
Open

    if (this.serverVersion < MIN_SERVER_VER.PLACE_ORDER_CONID) {
      if (contract.conId != undefined) {
        return this.emitError(
          "It does not support conId 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 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 8 locations. Consider refactoring.
Open

    if (this.serverVersion < MIN_SERVER_VER.MODELS_SUPPORT) {
      if (!!order.modelCode) {
        return this.emitError(
          "It does not support model code parameter.",
          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 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 reqMarketData.",
          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 1963..1971

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.ALGO_ORDERS) {
      if (!!order.algoStrategy) {
        return this.emitError(
          "It does not support algo orders.",
          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 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 5 locations. Consider refactoring.
Open

    if (this.serverVersion < MIN_SERVER_VER.TRADING_CLASS) {
      if (contract.conId != undefined) {
        return this.emitError(
          "It does not support conId parameter in reqFundamentalData.",
          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 1014..1022

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

Function start has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  start(): void {
    super.start();

    if (!this.cmdLineArgs.conid) {
      this.error("-conid argument missing.");
Severity: Minor
Found in src/tools/historical-ticks-mid.ts - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function onMessage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  private onMessage(data: string): void {
    // tokenize

    const dataWithFragment = this.dataFragment + data;

Severity: Minor
Found in src/core/io/socket.ts - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function start has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  start(): void {
    super.start();

    if (!this.cmdLineArgs.conid) {
      this.error("-conid argument missing.");
Severity: Minor
Found in src/tools/historical-ticks-bid-ask.ts - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function start has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  start(): void {
    super.start();

    if (!this.cmdLineArgs.conid) {
      this.error("-conid argument missing.");
Severity: Minor
Found in src/tools/historical-ticks-last.ts - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function reqRealTimeBars has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  reqRealTimeBars(
    tickerId: number,
    contract: Contract,
    barSize: number,
    whatToShow: WhatToShow,
Severity: Minor
Found in src/core/io/encoder.ts - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function startAPI has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  private startAPI(): void {
    // start API

    const VERSION = 2;
    if (this.serverVersion >= 3) {
Severity: Minor
Found in src/core/io/socket.ts - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function reqScannerSubscription has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  reqScannerSubscription(
    reqId: number,
    subscription: ScannerSubscription,
    scannerSubscriptionOptions: TagValue[],
    scannerSubscriptionFilterOptions?: TagValue[],
Severity: Minor
Found in src/core/io/encoder.ts - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function reqWshEventData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  reqWshEventData(reqId: number, wshEventData: WshEventData): void {
    if (this.serverVersion < MIN_SERVER_VER.WSHE_CALENDAR) {
      return this.emitError(
        "It does not support WSHE Calendar API.",
        ErrorCode.UPDATE_TWS,
Severity: Minor
Found in src/core/io/encoder.ts - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

    if (this.serverVersion >= MIN_SERVER_VER.PTA_ORDERS) {
      tokens.push(order.clearingAccount);
      tokens.push(order.clearingIntent);
    }
Severity: Major
Found in src/core/io/encoder.ts and 5 other locations - About 40 mins to fix
src/core/io/encoder.ts on lines 1285..1288
src/core/io/encoder.ts on lines 1555..1558
src/core/io/encoder.ts on lines 1667..1670
src/core/io/encoder.ts on lines 1672..1675
src/core/io/encoder.ts on lines 2032..2035

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

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

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

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

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

Refactorings

Further Reading

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

    if (this.serverVersion >= MIN_SERVER_VER.DECISION_MAKER) {
      tokens.push(order.mifid2DecisionMaker);
      tokens.push(order.mifid2DecisionAlgo);
    }
Severity: Major
Found in src/core/io/encoder.ts and 5 other locations - About 40 mins to fix
src/core/io/encoder.ts on lines 1285..1288
src/core/io/encoder.ts on lines 1502..1505
src/core/io/encoder.ts on lines 1555..1558
src/core/io/encoder.ts on lines 1672..1675
src/core/io/encoder.ts on lines 2032..2035

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

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

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

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

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

Refactorings

Further Reading

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

          if (this.serverVersion >= MIN_SERVER_VER.SSHORT_COMBO_LEGS) {
            tokens.push(comboLeg.shortSaleSlot);
            tokens.push(comboLeg.designatedLocation);
          }
Severity: Major
Found in src/core/io/encoder.ts and 5 other locations - About 40 mins to fix
src/core/io/encoder.ts on lines 1502..1505
src/core/io/encoder.ts on lines 1555..1558
src/core/io/encoder.ts on lines 1667..1670
src/core/io/encoder.ts on lines 1672..1675
src/core/io/encoder.ts on lines 2032..2035

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

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