src/core/io/encoder.ts

Summary

Maintainability
F
1 mo
Test Coverage

File encoder.ts has 2648 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { MarketDataType, OrderCancel, WhatToShow } from "../..";
import { ScanCode } from "../../api-next/market-scanner/market-scanner";
import { Contract } from "../../api/contract/contract";
import WshEventData from "../../api/contract/wsh";
import TagValue from "../../api/data/container/tag-value";
Severity: Major
Found in src/core/io/encoder.ts - About 1 wk to fix

    Function placeOrder has a Cognitive Complexity of 257 (exceeds 5 allowed). Consider refactoring.
    Open

      placeOrder(id: number, contract: Contract, order: Order): void {
        if (this.serverVersion < MIN_SERVER_VER.SCALE_ORDERS) {
          if (
            order.scaleInitLevelSize !== undefined ||
            order.scalePriceIncrement !== undefined
    Severity: Minor
    Found in src/core/io/encoder.ts - About 5 days 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 placeOrder has 915 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      placeOrder(id: number, contract: Contract, order: Order): void {
        if (this.serverVersion < MIN_SERVER_VER.SCALE_ORDERS) {
          if (
            order.scaleInitLevelSize !== undefined ||
            order.scalePriceIncrement !== undefined
    Severity: Major
    Found in src/core/io/encoder.ts - About 4 days to fix

      Encoder has 82 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export class Encoder {
        /**
         * Create an [[Encoder]] object for encoding messages to token data.
         *
         * @param callback A [[EncoderCallbacks]] implementation.
      Severity: Major
      Found in src/core/io/encoder.ts - About 1 day to fix

        Function reqContractDetails has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

          reqContractDetails(reqId: number, contract: Contract): void {
            if (this.serverVersion < 4) {
              return this.emitError(
                "This feature is only available for versions of TWS >=4",
                ErrorCode.UPDATE_TWS,
        Severity: Minor
        Found in src/core/io/encoder.ts - About 4 hrs 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 reqMktData has 93 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          reqMktData(
            tickerId: number,
            contract: Contract,
            genericTickList: string,
            snapshot: boolean,
        Severity: Major
        Found in src/core/io/encoder.ts - About 3 hrs to fix

          Function reqContractDetails has 87 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            reqContractDetails(reqId: number, contract: Contract): void {
              if (this.serverVersion < 4) {
                return this.emitError(
                  "This feature is only available for versions of TWS >=4",
                  ErrorCode.UPDATE_TWS,
          Severity: Major
          Found in src/core/io/encoder.ts - About 3 hrs to fix

            Function reqMktData has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

              reqMktData(
                tickerId: number,
                contract: Contract,
                genericTickList: string,
                snapshot: boolean,
            Severity: Minor
            Found in src/core/io/encoder.ts - About 3 hrs 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 reqHistoricalData has 83 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              reqHistoricalData(
                tickerId: number,
                contract: Contract,
                endDateTime: string,
                durationStr: string,
            Severity: Major
            Found in src/core/io/encoder.ts - About 3 hrs to fix

              Function exerciseOptions has 77 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                exerciseOptions(
                  tickerId: number,
                  contract: Contract,
                  exerciseAction: OptionExerciseAction,
                  exerciseQuantity: number,
              Severity: Major
              Found in src/core/io/encoder.ts - About 3 hrs to fix

                Function reqHistoricalData has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                  reqHistoricalData(
                    tickerId: number,
                    contract: Contract,
                    endDateTime: string,
                    durationStr: string,
                Severity: Minor
                Found in src/core/io/encoder.ts - About 2 hrs 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 reqMktDepth has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  reqMktDepth(
                    tickerId: number,
                    contract: Contract,
                    numRows: number,
                    isSmartDepth: boolean,
                Severity: Major
                Found in src/core/io/encoder.ts - About 2 hrs to fix

                  Function exerciseOptions has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                    exerciseOptions(
                      tickerId: number,
                      contract: Contract,
                      exerciseAction: OptionExerciseAction,
                      exerciseQuantity: number,
                  Severity: Minor
                  Found in src/core/io/encoder.ts - About 2 hrs 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 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Function reqWshEventData has 49 lines of code (exceeds 25 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 1 hr to fix

                      Function reqMktDepth has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                        reqMktDepth(
                          tickerId: number,
                          contract: Contract,
                          numRows: number,
                          isSmartDepth: boolean,
                      Severity: Minor
                      Found in src/core/io/encoder.ts - About 1 hr 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 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Function calculateOptionPrice has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          calculateOptionPrice(
                            reqId: number,
                            contract: Contract,
                            volatility: number,
                            underPrice: number,
                        Severity: Minor
                        Found in src/core/io/encoder.ts - About 1 hr to fix

                          Function calculateImpliedVolatility has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            calculateImpliedVolatility(
                              reqId: number,
                              contract: Contract,
                              optionPrice: number,
                              underPrice: number,
                          Severity: Minor
                          Found in src/core/io/encoder.ts - About 1 hr to fix

                            Function cancelOrder has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              cancelOrder(orderId: number, orderCancel: OrderCancel): void {
                                if (
                                  this.serverVersion < MIN_SERVER_VER.MANUAL_ORDER_TIME &&
                                  orderCancel.manualOrderCancelTime?.length
                                ) {
                            Severity: Minor
                            Found in src/core/io/encoder.ts - About 1 hr to fix

                              Function reqFundamentalData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                reqFundamentalData(
                                  reqId: number,
                                  contract: Contract,
                                  reportType: string,
                                  fundamentalDataOptions: TagValue[],
                              Severity: Minor
                              Found in src/core/io/encoder.ts - About 1 hr to fix

                                Function cancelOrder has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  cancelOrder(orderId: number, orderCancel: OrderCancel): void {
                                    if (
                                      this.serverVersion < MIN_SERVER_VER.MANUAL_ORDER_TIME &&
                                      orderCancel.manualOrderCancelTime?.length
                                    ) {
                                Severity: Minor
                                Found in src/core/io/encoder.ts - About 1 hr 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 reqGlobalCancel has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  reqGlobalCancel(orderCancel: OrderCancel): void {
                                    if (this.serverVersion < MIN_SERVER_VER.REQ_GLOBAL_CANCEL) {
                                      return this.emitError(
                                        "It does not support globalCancel requests.",
                                        ErrorCode.UPDATE_TWS,
                                Severity: Minor
                                Found in src/core/io/encoder.ts - About 1 hr to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                          if (
                                            order.scalePriceAdjustValue !== undefined ||
                                            order.scalePriceAdjustInterval !== undefined ||
                                            order.scaleProfitOffset !== undefined ||
                                            order.scaleAutoReset ||
                                  Severity: Major
                                  Found in src/core/io/encoder.ts - About 1 hr to fix

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

                                    Consider simplifying this complex logical expression.
                                    Open

                                        if (
                                          this.serverVersion < MIN_SERVER_VER.PEGBEST_PEGMID_OFFSETS &&
                                          (order.minTradeQty !== undefined ||
                                            order.minCompeteSize !== undefined ||
                                            order.competeAgainstBestOffset !== undefined ||
                                    Severity: Major
                                    Found in src/core/io/encoder.ts - About 40 mins to fix

                                      Function calculateImpliedVolatility has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        calculateImpliedVolatility(
                                          reqId: number,
                                          contract: Contract,
                                          optionPrice: number,
                                          underPrice: number,
                                      Severity: Minor
                                      Found in src/core/io/encoder.ts - About 35 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 reqGlobalCancel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                        reqGlobalCancel(orderCancel: OrderCancel): void {
                                          if (this.serverVersion < MIN_SERVER_VER.REQ_GLOBAL_CANCEL) {
                                            return this.emitError(
                                              "It does not support globalCancel requests.",
                                              ErrorCode.UPDATE_TWS,
                                      Severity: Minor
                                      Found in src/core/io/encoder.ts - About 35 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

                                      Avoid too many return statements within this function.
                                      Open

                                              return this.emitError(
                                                "It does not support model code parameter.",
                                                ErrorCode.UPDATE_TWS,
                                                id,
                                              );
                                      Severity: Major
                                      Found in src/core/io/encoder.ts - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                              return this.emitError(
                                                "It does not support soft dollar tier",
                                                ErrorCode.UPDATE_TWS,
                                                id,
                                              );
                                        Severity: Major
                                        Found in src/core/io/encoder.ts - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                return this.emitError(
                                                  "It does not support PEG BEST / PEG MID order parameters: minTradeQty, minCompeteSize, competeAgainstBestOffset, midOffsetAtWhole and midOffsetAtHalf",
                                                  ErrorCode.UPDATE_TWS,
                                                  id,
                                                );
                                          Severity: Major
                                          Found in src/core/io/encoder.ts - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                    return this.emitError(
                                                      "It does not support professional customer parameter in exerciseOptions.",
                                                      ErrorCode.UPDATE_TWS,
                                                      tickerId,
                                                    );
                                            Severity: Major
                                            Found in src/core/io/encoder.ts - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                      return this.emitError(
                                                        "It does not support trailing percent parameter.",
                                                        ErrorCode.UPDATE_TWS,
                                                        id,
                                                      );
                                              Severity: Major
                                              Found in src/core/io/encoder.ts - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                      return this.emitError(
                                                        "It does not support D-Peg orders.",
                                                        ErrorCode.UPDATE_TWS,
                                                        id,
                                                      );
                                                Severity: Major
                                                Found in src/core/io/encoder.ts - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                        return this.emitError(
                                                          "It does not support don't use auto price for hedge parameter.",
                                                          ErrorCode.UPDATE_TWS,
                                                          id,
                                                        );
                                                  Severity: Major
                                                  Found in src/core/io/encoder.ts - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                            return this.emitError(
                                                              "It does not support notHeld parameter.",
                                                              ErrorCode.UPDATE_TWS,
                                                              id,
                                                            );
                                                    Severity: Major
                                                    Found in src/core/io/encoder.ts - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                            return this.emitError(
                                                              "It does not support postToAts attribute",
                                                              ErrorCode.UPDATE_TWS,
                                                              id,
                                                            );
                                                      Severity: Major
                                                      Found in src/core/io/encoder.ts - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                  return this.emitError(
                                                                    "It does not support Scale order parameters: PriceAdjustValue, PriceAdjustInterval, ProfitOffset, AutoReset, InitPosition, InitFillQty and RandomPercent",
                                                                    ErrorCode.UPDATE_TWS,
                                                                    id,
                                                                  );
                                                        Severity: Major
                                                        Found in src/core/io/encoder.ts - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                return this.emitError(
                                                                  "It does not support algoId parameter",
                                                                  ErrorCode.UPDATE_TWS,
                                                                  id,
                                                                );
                                                          Severity: Major
                                                          Found in src/core/io/encoder.ts - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                  return this.emitError(
                                                                    "It does not support MIFID II execution parameters",
                                                                    ErrorCode.UPDATE_TWS,
                                                                    id,
                                                                  );
                                                            Severity: Major
                                                            Found in src/core/io/encoder.ts - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                      return this.emitError(
                                                                        "It does not support secIdType and secId parameters.",
                                                                        ErrorCode.UPDATE_TWS,
                                                                        id,
                                                                      );
                                                              Severity: Major
                                                              Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                        return this.emitError(
                                                                          "It does not support hedge orders.",
                                                                          ErrorCode.UPDATE_TWS,
                                                                          id,
                                                                        );
                                                                Severity: Major
                                                                Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                          return this.emitError(
                                                                            "It does not support cash quantity parameter",
                                                                            ErrorCode.UPDATE_TWS,
                                                                            id,
                                                                          );
                                                                  Severity: Major
                                                                  Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                          return this.emitError(
                                                                            "It does not support duration attribute",
                                                                            ErrorCode.UPDATE_TWS,
                                                                            id,
                                                                          );
                                                                    Severity: Major
                                                                    Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

                                                                            return this.emitError(
                                                                              "It does not support manual order time attribute",
                                                                              ErrorCode.UPDATE_TWS,
                                                                              id,
                                                                            );
                                                                      Severity: Major
                                                                      Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                        Avoid too many return statements within this function.
                                                                        Open

                                                                                return this.emitError(
                                                                                  "It does not support customer account parameter",
                                                                                  ErrorCode.UPDATE_TWS,
                                                                                  id,
                                                                                );
                                                                        Severity: Major
                                                                        Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                          Avoid too many return statements within this function.
                                                                          Open

                                                                                return this.emitError(
                                                                                  "It does not support advanced error override attribute",
                                                                                  ErrorCode.UPDATE_TWS,
                                                                                  id,
                                                                                );
                                                                          Severity: Major
                                                                          Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                                    return this.emitError(
                                                                                      "It does not support scaleTable, activeStartTime and activeStopTime parameters.",
                                                                                      ErrorCode.UPDATE_TWS,
                                                                                      id,
                                                                                    );
                                                                            Severity: Major
                                                                            Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                    return this.emitError(
                                                                                      "It does not support autoCancelParent attribute",
                                                                                      ErrorCode.UPDATE_TWS,
                                                                                      id,
                                                                                    );
                                                                              Severity: Major
                                                                              Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                        return this.emitError(
                                                                                          "It does not support algo orders.",
                                                                                          ErrorCode.UPDATE_TWS,
                                                                                          id,
                                                                                        );
                                                                                Severity: Major
                                                                                Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

                                                                                        return this.emitError(
                                                                                          "It does not support oms container parameter.",
                                                                                          ErrorCode.UPDATE_TWS,
                                                                                          id,
                                                                                        );
                                                                                  Severity: Major
                                                                                  Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                            return this.emitError(
                                                                                              "It does not support deltaNeutral parameters: OpenClose, ShortSale, ShortSaleSlot, DesignatedLocation.",
                                                                                              ErrorCode.UPDATE_TWS,
                                                                                              id,
                                                                                            );
                                                                                    Severity: Major
                                                                                    Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                            return this.emitError(
                                                                                              "It does not support ext operator",
                                                                                              ErrorCode.UPDATE_TWS,
                                                                                              id,
                                                                                            );
                                                                                      Severity: Major
                                                                                      Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                return this.emitError(
                                                                                                  "It does not support tradingClass parameters in placeOrder.",
                                                                                                  ErrorCode.UPDATE_TWS,
                                                                                                  id,
                                                                                                );
                                                                                        Severity: Major
                                                                                        Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                                  return this.emitError(
                                                                                                    "It does not support issuerId parameter in reqContractDetails.",
                                                                                                    ErrorCode.UPDATE_TWS,
                                                                                                    reqId,
                                                                                                  );
                                                                                          Severity: Major
                                                                                          Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                    return this.emitError(
                                                                                                      "It does not support conId parameter.",
                                                                                                      ErrorCode.UPDATE_TWS,
                                                                                                      id,
                                                                                                    );
                                                                                            Severity: Major
                                                                                            Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                      return this.emitError(
                                                                                                        "It does not support include overnight parameter",
                                                                                                        ErrorCode.UPDATE_TWS,
                                                                                                        id,
                                                                                                      );
                                                                                              Severity: Major
                                                                                              Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                        return this.emitError(
                                                                                                          "It does not support optOutSmartRouting parameter.",
                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                          id,
                                                                                                        );
                                                                                                Severity: Major
                                                                                                Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                          return this.emitError(
                                                                                                            "It does not support order solicited parameter.",
                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                            id,
                                                                                                          );
                                                                                                  Severity: Major
                                                                                                  Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                            return this.emitError(
                                                                                                              "It does not support manual order indicator parameter",
                                                                                                              ErrorCode.UPDATE_TWS,
                                                                                                              id,
                                                                                                            );
                                                                                                    Severity: Major
                                                                                                    Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

                                                                                                              return this.emitError(
                                                                                                                "It does not support exemptCode parameter.",
                                                                                                                ErrorCode.UPDATE_TWS,
                                                                                                                id,
                                                                                                              );
                                                                                                      Severity: Major
                                                                                                      Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                                        Avoid too many return statements within this function.
                                                                                                        Open

                                                                                                                return this.emitError(
                                                                                                                  "It does not support deltaNeutral parameters: ConId, SettlingFirm, ClearingAccount, ClearingIntent.",
                                                                                                                  ErrorCode.UPDATE_TWS,
                                                                                                                  id,
                                                                                                                );
                                                                                                        Severity: Major
                                                                                                        Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                                          Avoid too many return statements within this function.
                                                                                                          Open

                                                                                                                  return this.emitError(
                                                                                                                    "It does not support scaleTable, activeStartTime and activeStopTime parameters.",
                                                                                                                    ErrorCode.UPDATE_TWS,
                                                                                                                    id,
                                                                                                                  );
                                                                                                          Severity: Major
                                                                                                          Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

                                                                                                                  return this.emitError(
                                                                                                                    "It does not support MIFID II decision maker parameters",
                                                                                                                    ErrorCode.UPDATE_TWS,
                                                                                                                    id,
                                                                                                                  );
                                                                                                            Severity: Major
                                                                                                            Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

                                                                                                                    return this.emitError(
                                                                                                                      "It does not support price management algo parameter",
                                                                                                                      ErrorCode.UPDATE_TWS,
                                                                                                                      id,
                                                                                                                    );
                                                                                                              Severity: Major
                                                                                                              Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                        return this.emitError(
                                                                                                                          "It does not support professional customer parameter",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                          id,
                                                                                                                        );
                                                                                                                Severity: Major
                                                                                                                Found in src/core/io/encoder.ts - About 30 mins to fix

                                                                                                                  Function reqFundamentalData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                  Open

                                                                                                                    reqFundamentalData(
                                                                                                                      reqId: number,
                                                                                                                      contract: Contract,
                                                                                                                      reportType: string,
                                                                                                                      fundamentalDataOptions: TagValue[],
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts - About 25 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 calculateOptionPrice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                  Open

                                                                                                                    calculateOptionPrice(
                                                                                                                      reqId: number,
                                                                                                                      contract: Contract,
                                                                                                                      volatility: number,
                                                                                                                      underPrice: number,
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts - About 25 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

                                                                                                                      if (SecType.BAG === contract.secType?.toUpperCase()) {
                                                                                                                        if (!contract.comboLegs) {
                                                                                                                          tokens.push(0);
                                                                                                                        } else {
                                                                                                                          tokens.push(contract.comboLegs.length);
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 4 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 2613..2628

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

                                                                                                                  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

                                                                                                                      if (
                                                                                                                        this.serverVersion >= 8 &&
                                                                                                                        SecType.BAG === contract.secType?.toUpperCase()
                                                                                                                      ) {
                                                                                                                        if (!contract.comboLegs) {
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 4 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 2354..2366

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

                                                                                                                  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

                                                                                                                      if (this.serverVersion >= MIN_SERVER_VER.DELTA_NEUTRAL) {
                                                                                                                        if (contract.deltaNeutralContract) {
                                                                                                                          tokens.push(true);
                                                                                                                          tokens.push(contract.deltaNeutralContract.conId);
                                                                                                                          tokens.push(contract.deltaNeutralContract.delta);
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 3 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 2630..2639

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

                                                                                                                  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

                                                                                                                      if (this.serverVersion >= MIN_SERVER_VER.DELTA_NEUTRAL) {
                                                                                                                        if (contract.deltaNeutralContract) {
                                                                                                                          args.push(true);
                                                                                                                          args.push(contract.deltaNeutralContract.conId);
                                                                                                                          args.push(contract.deltaNeutralContract.delta);
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 3 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 1570..1579

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

                                                                                                                  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

                                                                                                                              case OrderConditionType.PercentChange: {
                                                                                                                                const percentChangeCond = cond as PercentChangeCondition;
                                                                                                                                // OperatorCondition
                                                                                                                                tokens.push(percentChangeCond.isMore);
                                                                                                                                tokens.push(percentChangeCond.strValue);
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 1685..1694

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

                                                                                                                  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

                                                                                                                              case OrderConditionType.Volume: {
                                                                                                                                const timeConditionCond = cond as VolumeCondition;
                                                                                                                                // OperatorCondition
                                                                                                                                tokens.push(timeConditionCond.isMore);
                                                                                                                                tokens.push(timeConditionCond.strValue);
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 1653..1662

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

                                                                                                                  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

                                                                                                                          if (
                                                                                                                            this.serverVersion >= MIN_SERVER_VER.DELTA_NEUTRAL_OPEN_CLOSE &&
                                                                                                                            !!order.deltaNeutralOrderType
                                                                                                                          ) {
                                                                                                                            tokens.push(order.deltaNeutralOpenClose);
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 1473..1481

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

                                                                                                                  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

                                                                                                                          if (
                                                                                                                            this.serverVersion >= MIN_SERVER_VER.DELTA_NEUTRAL_CONID &&
                                                                                                                            !!order.deltaNeutralOrderType
                                                                                                                          ) {
                                                                                                                            tokens.push(order.deltaNeutralConId);
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 1483..1491

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

                                                                                                                  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

                                                                                                                    cancelCalculateImpliedVolatility(reqId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.CANCEL_CALC_IMPLIED_VOLAT) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support calculate implied volatility cancellation.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 5 other locations - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 392..404
                                                                                                                  src/core/io/encoder.ts on lines 435..447
                                                                                                                  src/core/io/encoder.ts on lines 452..464
                                                                                                                  src/core/io/encoder.ts on lines 610..622
                                                                                                                  src/core/io/encoder.ts on lines 2827..2839

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

                                                                                                                  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

                                                                                                                    cancelFundamentalData(reqId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.FUNDAMENTAL_DATA) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support fundamental data requests.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 5 other locations - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 392..404
                                                                                                                  src/core/io/encoder.ts on lines 418..430
                                                                                                                  src/core/io/encoder.ts on lines 435..447
                                                                                                                  src/core/io/encoder.ts on lines 610..622
                                                                                                                  src/core/io/encoder.ts on lines 2827..2839

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

                                                                                                                  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

                                                                                                                    cancelRealTimeBars(tickerId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.REAL_TIME_BARS) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support realtime bar data query cancellation.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 5 other locations - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 392..404
                                                                                                                  src/core/io/encoder.ts on lines 418..430
                                                                                                                  src/core/io/encoder.ts on lines 435..447
                                                                                                                  src/core/io/encoder.ts on lines 452..464
                                                                                                                  src/core/io/encoder.ts on lines 2827..2839

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

                                                                                                                  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

                                                                                                                    cancelPositionsMulti(reqId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.MODELS_SUPPORT) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support positions multi cancellation.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 5 other locations - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 392..404
                                                                                                                  src/core/io/encoder.ts on lines 418..430
                                                                                                                  src/core/io/encoder.ts on lines 435..447
                                                                                                                  src/core/io/encoder.ts on lines 452..464
                                                                                                                  src/core/io/encoder.ts on lines 610..622

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

                                                                                                                  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

                                                                                                                    cancelAccountSummary(reqId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.ACCT_SUMMARY) {
                                                                                                                        return this.emitError(
                                                                                                                          "It not support account summary cancellation.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 5 other locations - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 418..430
                                                                                                                  src/core/io/encoder.ts on lines 435..447
                                                                                                                  src/core/io/encoder.ts on lines 452..464
                                                                                                                  src/core/io/encoder.ts on lines 610..622
                                                                                                                  src/core/io/encoder.ts on lines 2827..2839

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

                                                                                                                  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

                                                                                                                    cancelCalculateOptionPrice(reqId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.CANCEL_CALC_OPTION_PRICE) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support calculate option price cancellation.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 5 other locations - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 392..404
                                                                                                                  src/core/io/encoder.ts on lines 418..430
                                                                                                                  src/core/io/encoder.ts on lines 452..464
                                                                                                                  src/core/io/encoder.ts on lines 610..622
                                                                                                                  src/core/io/encoder.ts on lines 2827..2839

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

                                                                                                                  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

                                                                                                                    reqMatchingSymbols(reqId: number, pattern: string): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.REQ_MATCHING_SYMBOLS) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support matching symbols request.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 3161..3171

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

                                                                                                                  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

                                                                                                                    reqSmartComponents(reqId: number, bboExchange: string): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.REQ_SMART_COMPONENTS) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support smart components request.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 3131..3141

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

                                                                                                                  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

                                                                                                                    cancelHistoricalData(tickerId: number): void {
                                                                                                                      if (this.serverVersion < 24) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support historical data query cancellation.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 627..639

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

                                                                                                                  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

                                                                                                                    cancelScannerSubscription(tickerId: number): void {
                                                                                                                      if (this.serverVersion < 24) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support API scanner subscription.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 2 hrs to fix
                                                                                                                  src/core/io/encoder.ts on lines 469..481

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

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

                                                                                                                    reqMarketRule(marketRuleId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.MARKET_RULES) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support market rule requests.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 6 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1876..1886
                                                                                                                  src/core/io/encoder.ts on lines 1911..1921
                                                                                                                  src/core/io/encoder.ts on lines 2488..2498
                                                                                                                  src/core/io/encoder.ts on lines 3101..3111
                                                                                                                  src/core/io/encoder.ts on lines 3287..3297
                                                                                                                  src/core/io/encoder.ts on lines 3302..3312

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

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

                                                                                                                    cancelPnLSingle(reqId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.PNL) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support pnl requests.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 6 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1876..1886
                                                                                                                  src/core/io/encoder.ts on lines 2488..2498
                                                                                                                  src/core/io/encoder.ts on lines 3101..3111
                                                                                                                  src/core/io/encoder.ts on lines 3287..3297
                                                                                                                  src/core/io/encoder.ts on lines 3302..3312
                                                                                                                  src/core/io/encoder.ts on lines 3317..3327

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

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

                                                                                                                    reqSoftDollarTiers(reqId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.SOFT_DOLLAR_TIER) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support soft dollar tier requests.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 6 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1876..1886
                                                                                                                  src/core/io/encoder.ts on lines 1911..1921
                                                                                                                  src/core/io/encoder.ts on lines 2488..2498
                                                                                                                  src/core/io/encoder.ts on lines 3287..3297
                                                                                                                  src/core/io/encoder.ts on lines 3302..3312
                                                                                                                  src/core/io/encoder.ts on lines 3317..3327

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

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

                                                                                                                    cancelPnL(reqId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.PNL) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support pnl requests.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 6 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1911..1921
                                                                                                                  src/core/io/encoder.ts on lines 2488..2498
                                                                                                                  src/core/io/encoder.ts on lines 3101..3111
                                                                                                                  src/core/io/encoder.ts on lines 3287..3297
                                                                                                                  src/core/io/encoder.ts on lines 3302..3312
                                                                                                                  src/core/io/encoder.ts on lines 3317..3327

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

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

                                                                                                                    cancelHistogramData(tickerId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.REQ_HISTOGRAM) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support head time stamp requests.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 6 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1876..1886
                                                                                                                  src/core/io/encoder.ts on lines 1911..1921
                                                                                                                  src/core/io/encoder.ts on lines 2488..2498
                                                                                                                  src/core/io/encoder.ts on lines 3101..3111
                                                                                                                  src/core/io/encoder.ts on lines 3302..3312
                                                                                                                  src/core/io/encoder.ts on lines 3317..3327

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

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

                                                                                                                    cancelHeadTimestamp(tickerId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.CANCEL_HEADTIMESTAMP) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support head time stamp requests canceling.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 6 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1876..1886
                                                                                                                  src/core/io/encoder.ts on lines 1911..1921
                                                                                                                  src/core/io/encoder.ts on lines 2488..2498
                                                                                                                  src/core/io/encoder.ts on lines 3101..3111
                                                                                                                  src/core/io/encoder.ts on lines 3287..3297
                                                                                                                  src/core/io/encoder.ts on lines 3317..3327

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

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

                                                                                                                    cancelTickByTickData(reqId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.TICK_BY_TICK) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support tick-by-tick data cancels.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 6 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1876..1886
                                                                                                                  src/core/io/encoder.ts on lines 1911..1921
                                                                                                                  src/core/io/encoder.ts on lines 3101..3111
                                                                                                                  src/core/io/encoder.ts on lines 3287..3297
                                                                                                                  src/core/io/encoder.ts on lines 3302..3312
                                                                                                                  src/core/io/encoder.ts on lines 3317..3327

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

                                                                                                                  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

                                                                                                                    reqMktDepthExchanges(): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.REQ_MKT_DEPTH_EXCHANGES) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support market depth exchanges request.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 2 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 3116..3126
                                                                                                                  src/core/io/encoder.ts on lines 3207..3217

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

                                                                                                                  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

                                                                                                                    reqFamilyCodes(): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.REQ_FAMILY_CODES) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support family codes request.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 2 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 3146..3156
                                                                                                                  src/core/io/encoder.ts on lines 3207..3217

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

                                                                                                                  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

                                                                                                                    reqNewsProviders(): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.REQ_SMART_COMPONENTS) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support smart components request.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 2 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 3116..3126
                                                                                                                  src/core/io/encoder.ts on lines 3146..3156

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

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                    reqWshMetaData(reqId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.WSHE_CALENDAR) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support WSHE Calendar API.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 3 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 3356..3366
                                                                                                                  src/core/io/encoder.ts on lines 3424..3434
                                                                                                                  src/core/io/encoder.ts on lines 3436..3446

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

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                    reqUserInfo(reqId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.USER_INFO) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support user info requests.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 3 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 3344..3354
                                                                                                                  src/core/io/encoder.ts on lines 3356..3366
                                                                                                                  src/core/io/encoder.ts on lines 3424..3434

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

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                    reqCancelWshMetaData(reqId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.WSHE_CALENDAR) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support WSHE Calendar API.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 3 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 3344..3354
                                                                                                                  src/core/io/encoder.ts on lines 3424..3434
                                                                                                                  src/core/io/encoder.ts on lines 3436..3446

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

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                    reqCancelWshEventData(reqId: number): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.WSHE_CALENDAR) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support WSHE Calendar API.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 3 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 3344..3354
                                                                                                                  src/core/io/encoder.ts on lines 3356..3366
                                                                                                                  src/core/io/encoder.ts on lines 3436..3446

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

                                                                                                                  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

                                                                                                                    reqAccountSummary(reqId: number, group: string, tags: string): void {
                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.ACCT_SUMMARY) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support account summary requests.",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 2800..2822

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 66.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                    reqPositionsMulti(
                                                                                                                      reqId: number,
                                                                                                                      account: string,
                                                                                                                      modelCode: string | null,
                                                                                                                    ): void {
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1844..1856

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 66.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion >= MIN_SERVER_VER.SCALE_TABLE) {
                                                                                                                        tokens.push(order.scaleTable);
                                                                                                                        tokens.push(order.activeStartTime);
                                                                                                                        tokens.push(order.activeStopTime);
                                                                                                                      }
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 3415..3419

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

                                                                                                                  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

                                                                                                                      if (this.serverVersion >= MIN_SERVER_VER.WSH_EVENT_DATA_FILTERS_DATE) {
                                                                                                                        tokens.push(wshEventData.startDate);
                                                                                                                        tokens.push(wshEventData.endDate);
                                                                                                                        tokens.push(wshEventData.totalLimit);
                                                                                                                      }
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1544..1548

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

                                                                                                                  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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.SEC_ID_TYPE) {
                                                                                                                        if (!!contract.secIdType || !!contract.secId) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support secIdType and secId parameters.",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 825..833

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

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.TRADING_CLASS) {
                                                                                                                        if (!!contract.tradingClass || contract.conId != undefined) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support conId and tradingClass parameters in reqHistoricalData.",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 3 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 665..673
                                                                                                                  src/core/io/encoder.ts on lines 2685..2693
                                                                                                                  src/core/io/encoder.ts on lines 2860..2868

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

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.TRADING_CLASS) {
                                                                                                                        if (!!contract.tradingClass || contract.conId != undefined) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support conId and tradingClass parameters in reqMktDepth.",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 3 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 665..673
                                                                                                                  src/core/io/encoder.ts on lines 2286..2294
                                                                                                                  src/core/io/encoder.ts on lines 2860..2868

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

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.TRADING_CLASS) {
                                                                                                                        if (!!contract.tradingClass || contract.conId != undefined) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support conId and tradingClass parameters in exerciseOptions.",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 3 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 2286..2294
                                                                                                                  src/core/io/encoder.ts on lines 2685..2693
                                                                                                                  src/core/io/encoder.ts on lines 2860..2868

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

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.TRADING_CLASS) {
                                                                                                                        if (!!contract.tradingClass || contract.conId != undefined) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support conId and tradingClass parameters in reqRealTimeBars.",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 3 other locations - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 665..673
                                                                                                                  src/core/io/encoder.ts on lines 2286..2294
                                                                                                                  src/core/io/encoder.ts on lines 2685..2693

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

                                                                                                                  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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.SEC_ID_TYPE) {
                                                                                                                        if (!!contract.secIdType || !!contract.secId) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support secIdType and secId parameters.",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 2018..2026

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

                                                                                                                  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

                                                                                                                        if (smartComboRoutingParamsCount > 0) {
                                                                                                                          order.smartComboRoutingParams?.forEach((param) => {
                                                                                                                            tokens.push(param.tag);
                                                                                                                            tokens.push(param.value);
                                                                                                                          });
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1588..1593

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 62.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                          if (algoParamsCount > 0) {
                                                                                                                            order.algoParams?.forEach((param) => {
                                                                                                                              tokens.push(param.tag);
                                                                                                                              tokens.push(param.value);
                                                                                                                            });
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1378..1383

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 62.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (
                                                                                                                        this.serverVersion < MIN_SERVER_VER.DECISION_MAKER &&
                                                                                                                        (!!order.mifid2DecisionMaker || !!order.mifid2DecisionAlgo)
                                                                                                                      ) {
                                                                                                                        return this.emitError(
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1074..1083

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

                                                                                                                      if (
                                                                                                                        this.serverVersion < MIN_SERVER_VER.MIFID_EXECUTION &&
                                                                                                                        (!!order.mifid2ExecutionTrader || !!order.mifid2ExecutionAlgo)
                                                                                                                      ) {
                                                                                                                        return this.emitError(
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1063..1072

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

                                                                                                                              case OrderConditionType.Time: {
                                                                                                                                const timeConditionCond = cond as TimeCondition;
                                                                                                                                // OperatorCondition
                                                                                                                                tokens.push(timeConditionCond.isMore);
                                                                                                                                tokens.push(timeConditionCond.strValue);
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1645..1651

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

                                                                                                                  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

                                                                                                                              case OrderConditionType.Margin: {
                                                                                                                                const marginCond = cond as MarginCondition;
                                                                                                                                // OperatorCondition
                                                                                                                                tokens.push(marginCond.isMore);
                                                                                                                                tokens.push(marginCond.strValue);
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 1 hr to fix
                                                                                                                  src/core/io/encoder.ts on lines 1677..1683

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

                                                                                                                  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

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

                                                                                                                      if (this.serverVersion >= MIN_SERVER_VER.CME_TAGGING_FIELDS) {
                                                                                                                        tokens.push(orderCancel.extOperator);
                                                                                                                        tokens.push(orderCancel.manualOrderIndicator ?? Integer_MAX_VALUE);
                                                                                                                      }
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 55 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 582..585

                                                                                                                  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

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

                                                                                                                      if (this.serverVersion >= MIN_SERVER_VER.CME_TAGGING_FIELDS) {
                                                                                                                        tokens.push(orderCancel.extOperator);
                                                                                                                        tokens.push(orderCancel.manualOrderIndicator ?? Integer_MAX_VALUE);
                                                                                                                      }
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 55 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 2253..2256

                                                                                                                  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 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 344..352
                                                                                                                  src/core/io/encoder.ts on lines 805..813
                                                                                                                  src/core/io/encoder.ts on lines 867..875
                                                                                                                  src/core/io/encoder.ts on lines 965..973
                                                                                                                  src/core/io/encoder.ts on lines 1021..1029
                                                                                                                  src/core/io/encoder.ts on lines 2028..2036
                                                                                                                  src/core/io/encoder.ts on lines 2569..2577

                                                                                                                  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 344..352
                                                                                                                  src/core/io/encoder.ts on lines 805..813
                                                                                                                  src/core/io/encoder.ts on lines 867..875
                                                                                                                  src/core/io/encoder.ts on lines 965..973
                                                                                                                  src/core/io/encoder.ts on lines 1021..1029
                                                                                                                  src/core/io/encoder.ts on lines 2028..2036
                                                                                                                  src/core/io/encoder.ts on lines 2038..2046

                                                                                                                  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 344..352
                                                                                                                  src/core/io/encoder.ts on lines 805..813
                                                                                                                  src/core/io/encoder.ts on lines 867..875
                                                                                                                  src/core/io/encoder.ts on lines 1021..1029
                                                                                                                  src/core/io/encoder.ts on lines 2028..2036
                                                                                                                  src/core/io/encoder.ts on lines 2038..2046
                                                                                                                  src/core/io/encoder.ts on lines 2569..2577

                                                                                                                  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 805..813
                                                                                                                  src/core/io/encoder.ts on lines 867..875
                                                                                                                  src/core/io/encoder.ts on lines 965..973
                                                                                                                  src/core/io/encoder.ts on lines 1021..1029
                                                                                                                  src/core/io/encoder.ts on lines 2028..2036
                                                                                                                  src/core/io/encoder.ts on lines 2038..2046
                                                                                                                  src/core/io/encoder.ts on lines 2569..2577

                                                                                                                  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 344..352
                                                                                                                  src/core/io/encoder.ts on lines 867..875
                                                                                                                  src/core/io/encoder.ts on lines 965..973
                                                                                                                  src/core/io/encoder.ts on lines 1021..1029
                                                                                                                  src/core/io/encoder.ts on lines 2028..2036
                                                                                                                  src/core/io/encoder.ts on lines 2038..2046
                                                                                                                  src/core/io/encoder.ts on lines 2569..2577

                                                                                                                  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.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 344..352
                                                                                                                  src/core/io/encoder.ts on lines 805..813
                                                                                                                  src/core/io/encoder.ts on lines 965..973
                                                                                                                  src/core/io/encoder.ts on lines 1021..1029
                                                                                                                  src/core/io/encoder.ts on lines 2028..2036
                                                                                                                  src/core/io/encoder.ts on lines 2038..2046
                                                                                                                  src/core/io/encoder.ts on lines 2569..2577

                                                                                                                  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 344..352
                                                                                                                  src/core/io/encoder.ts on lines 805..813
                                                                                                                  src/core/io/encoder.ts on lines 867..875
                                                                                                                  src/core/io/encoder.ts on lines 965..973
                                                                                                                  src/core/io/encoder.ts on lines 1021..1029
                                                                                                                  src/core/io/encoder.ts on lines 2038..2046
                                                                                                                  src/core/io/encoder.ts on lines 2569..2577

                                                                                                                  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 344..352
                                                                                                                  src/core/io/encoder.ts on lines 805..813
                                                                                                                  src/core/io/encoder.ts on lines 867..875
                                                                                                                  src/core/io/encoder.ts on lines 965..973
                                                                                                                  src/core/io/encoder.ts on lines 2028..2036
                                                                                                                  src/core/io/encoder.ts on lines 2038..2046
                                                                                                                  src/core/io/encoder.ts on lines 2569..2577

                                                                                                                  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 835..843
                                                                                                                  src/core/io/encoder.ts on lines 955..963
                                                                                                                  src/core/io/encoder.ts on lines 1053..1061
                                                                                                                  src/core/io/encoder.ts on lines 2183..2191

                                                                                                                  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 795..803
                                                                                                                  src/core/io/encoder.ts on lines 835..843
                                                                                                                  src/core/io/encoder.ts on lines 955..963
                                                                                                                  src/core/io/encoder.ts on lines 2183..2191

                                                                                                                  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 795..803
                                                                                                                  src/core/io/encoder.ts on lines 835..843
                                                                                                                  src/core/io/encoder.ts on lines 1053..1061
                                                                                                                  src/core/io/encoder.ts on lines 2183..2191

                                                                                                                  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 795..803
                                                                                                                  src/core/io/encoder.ts on lines 835..843
                                                                                                                  src/core/io/encoder.ts on lines 955..963
                                                                                                                  src/core/io/encoder.ts on lines 1053..1061

                                                                                                                  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 795..803
                                                                                                                  src/core/io/encoder.ts on lines 955..963
                                                                                                                  src/core/io/encoder.ts on lines 1053..1061
                                                                                                                  src/core/io/encoder.ts on lines 2183..2191

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

                                                                                                                      if (this.serverVersion >= MIN_SERVER_VER.SEC_ID_TYPE) {
                                                                                                                        args.push(contract.secIdType);
                                                                                                                        args.push(contract.secId);
                                                                                                                      }
                                                                                                                  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 1344..1347
                                                                                                                  src/core/io/encoder.ts on lines 1561..1564
                                                                                                                  src/core/io/encoder.ts on lines 1614..1617
                                                                                                                  src/core/io/encoder.ts on lines 1726..1729
                                                                                                                  src/core/io/encoder.ts on lines 1731..1734

                                                                                                                  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 1561..1564
                                                                                                                  src/core/io/encoder.ts on lines 1614..1617
                                                                                                                  src/core/io/encoder.ts on lines 1726..1729
                                                                                                                  src/core/io/encoder.ts on lines 1731..1734
                                                                                                                  src/core/io/encoder.ts on lines 2107..2110

                                                                                                                  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.MIFID_EXECUTION) {
                                                                                                                        tokens.push(order.mifid2ExecutionTrader);
                                                                                                                        tokens.push(order.mifid2ExecutionAlgo);
                                                                                                                      }
                                                                                                                  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 1344..1347
                                                                                                                  src/core/io/encoder.ts on lines 1561..1564
                                                                                                                  src/core/io/encoder.ts on lines 1614..1617
                                                                                                                  src/core/io/encoder.ts on lines 1726..1729
                                                                                                                  src/core/io/encoder.ts on lines 2107..2110

                                                                                                                  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 1344..1347
                                                                                                                  src/core/io/encoder.ts on lines 1561..1564
                                                                                                                  src/core/io/encoder.ts on lines 1614..1617
                                                                                                                  src/core/io/encoder.ts on lines 1731..1734
                                                                                                                  src/core/io/encoder.ts on lines 2107..2110

                                                                                                                  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.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 1344..1347
                                                                                                                  src/core/io/encoder.ts on lines 1614..1617
                                                                                                                  src/core/io/encoder.ts on lines 1726..1729
                                                                                                                  src/core/io/encoder.ts on lines 1731..1734
                                                                                                                  src/core/io/encoder.ts on lines 2107..2110

                                                                                                                  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.RANDOMIZE_SIZE_AND_PRICE) {
                                                                                                                        tokens.push(order.randomizeSize);
                                                                                                                        tokens.push(order.randomizePrice);
                                                                                                                      }
                                                                                                                  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 1344..1347
                                                                                                                  src/core/io/encoder.ts on lines 1561..1564
                                                                                                                  src/core/io/encoder.ts on lines 1726..1729
                                                                                                                  src/core/io/encoder.ts on lines 1731..1734
                                                                                                                  src/core/io/encoder.ts on lines 2107..2110

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

                                                                                                                      if (
                                                                                                                        this.serverVersion < MIN_SERVER_VER.DURATION &&
                                                                                                                        order.duration != undefined
                                                                                                                      ) {
                                                                                                                        return this.emitError(
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 2 other locations - About 40 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 1140..1149
                                                                                                                  src/core/io/encoder.ts on lines 1162..1171

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 48.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (
                                                                                                                        this.serverVersion < MIN_SERVER_VER.ADVANCED_ORDER_REJECT &&
                                                                                                                        order.advancedErrorOverride != undefined
                                                                                                                      ) {
                                                                                                                        return this.emitError(
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 2 other locations - About 40 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 1129..1138
                                                                                                                  src/core/io/encoder.ts on lines 1140..1149

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 48.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (
                                                                                                                        this.serverVersion < MIN_SERVER_VER.EXT_OPERATOR &&
                                                                                                                        !!order.extOperator
                                                                                                                      ) {
                                                                                                                        return this.emitError(
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 2 other locations - About 40 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 989..995
                                                                                                                  src/core/io/encoder.ts on lines 2703..2712

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 48.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (
                                                                                                                        this.serverVersion < MIN_SERVER_VER.POST_TO_ATS &&
                                                                                                                        order.postToAts != undefined
                                                                                                                      ) {
                                                                                                                        return this.emitError(
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 2 other locations - About 40 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 1129..1138
                                                                                                                  src/core/io/encoder.ts on lines 1162..1171

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 48.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (
                                                                                                                        this.serverVersion < MIN_SERVER_VER.MKT_DEPTH_PRIM_EXCHANGE &&
                                                                                                                        !!contract.primaryExch
                                                                                                                      ) {
                                                                                                                        return this.emitError(
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 2 other locations - About 40 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 989..995
                                                                                                                  src/core/io/encoder.ts on lines 1031..1040

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 48.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.ALGO_ID && !!order.algoId) {
                                                                                                                        return this.emitError(
                                                                                                                          "It does not support algoId parameter",
                                                                                                                          ErrorCode.UPDATE_TWS,
                                                                                                                          id,
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 2 other locations - About 40 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 1031..1040
                                                                                                                  src/core/io/encoder.ts on lines 2703..2712

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 48.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (
                                                                                                                        this.serverVersion < MIN_SERVER_VER.MANUAL_ORDER_TIME &&
                                                                                                                        orderCancel.manualOrderCancelTime?.length
                                                                                                                      ) {
                                                                                                                        return this.emitError(
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 40 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 1173..1182

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 48.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (
                                                                                                                        this.serverVersion < MIN_SERVER_VER.MANUAL_ORDER_TIME &&
                                                                                                                        order.manualOrderTime?.length
                                                                                                                      ) {
                                                                                                                        return this.emitError(
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 40 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 536..545

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 48.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (
                                                                                                                        this.serverVersion < MIN_SERVER_VER.PRICE_MGMT_ALGO &&
                                                                                                                        order.usePriceMgmtAlgo != null
                                                                                                                      ) {
                                                                                                                        return this.emitError(
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 40 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 1151..1160

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 48.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (
                                                                                                                        this.serverVersion < MIN_SERVER_VER.AUTO_CANCEL_PARENT &&
                                                                                                                        order.autoCancelParent != null
                                                                                                                      ) {
                                                                                                                        return this.emitError(
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 40 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 1118..1127

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 48.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.DELTA_NEUTRAL) {
                                                                                                                        if (contract.deltaNeutralContract) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support delta-neutral orders.",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 9 other locations - About 35 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 775..783
                                                                                                                  src/core/io/encoder.ts on lines 815..823
                                                                                                                  src/core/io/encoder.ts on lines 877..885
                                                                                                                  src/core/io/encoder.ts on lines 1011..1019
                                                                                                                  src/core/io/encoder.ts on lines 1199..1207
                                                                                                                  src/core/io/encoder.ts on lines 1209..1217
                                                                                                                  src/core/io/encoder.ts on lines 1219..1227
                                                                                                                  src/core/io/encoder.ts on lines 1229..1237
                                                                                                                  src/core/io/encoder.ts on lines 2048..2056

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 47.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.NOT_HELD) {
                                                                                                                        if (order.notHeld) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support notHeld parameter.",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 9 other locations - About 35 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 775..783
                                                                                                                  src/core/io/encoder.ts on lines 785..793
                                                                                                                  src/core/io/encoder.ts on lines 877..885
                                                                                                                  src/core/io/encoder.ts on lines 1011..1019
                                                                                                                  src/core/io/encoder.ts on lines 1199..1207
                                                                                                                  src/core/io/encoder.ts on lines 1209..1217
                                                                                                                  src/core/io/encoder.ts on lines 1219..1227
                                                                                                                  src/core/io/encoder.ts on lines 1229..1237
                                                                                                                  src/core/io/encoder.ts on lines 2048..2056

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 47.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.CUSTOMER_ACCOUNT) {
                                                                                                                        if (order.customerAccount) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support customer account parameter",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 9 other locations - About 35 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 775..783
                                                                                                                  src/core/io/encoder.ts on lines 785..793
                                                                                                                  src/core/io/encoder.ts on lines 815..823
                                                                                                                  src/core/io/encoder.ts on lines 877..885
                                                                                                                  src/core/io/encoder.ts on lines 1011..1019
                                                                                                                  src/core/io/encoder.ts on lines 1209..1217
                                                                                                                  src/core/io/encoder.ts on lines 1219..1227
                                                                                                                  src/core/io/encoder.ts on lines 1229..1237
                                                                                                                  src/core/io/encoder.ts on lines 2048..2056

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 47.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.ORDER_SOLICITED) {
                                                                                                                        if (order.solicited) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support order solicited parameter.",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 9 other locations - About 35 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 775..783
                                                                                                                  src/core/io/encoder.ts on lines 785..793
                                                                                                                  src/core/io/encoder.ts on lines 815..823
                                                                                                                  src/core/io/encoder.ts on lines 877..885
                                                                                                                  src/core/io/encoder.ts on lines 1199..1207
                                                                                                                  src/core/io/encoder.ts on lines 1209..1217
                                                                                                                  src/core/io/encoder.ts on lines 1219..1227
                                                                                                                  src/core/io/encoder.ts on lines 1229..1237
                                                                                                                  src/core/io/encoder.ts on lines 2048..2056

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 47.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.INCLUDE_OVERNIGHT) {
                                                                                                                        if (order.includeOvernight) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support include overnight parameter",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 9 other locations - About 35 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 775..783
                                                                                                                  src/core/io/encoder.ts on lines 785..793
                                                                                                                  src/core/io/encoder.ts on lines 815..823
                                                                                                                  src/core/io/encoder.ts on lines 877..885
                                                                                                                  src/core/io/encoder.ts on lines 1011..1019
                                                                                                                  src/core/io/encoder.ts on lines 1199..1207
                                                                                                                  src/core/io/encoder.ts on lines 1209..1217
                                                                                                                  src/core/io/encoder.ts on lines 1229..1237
                                                                                                                  src/core/io/encoder.ts on lines 2048..2056

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 47.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.WHAT_IF_ORDERS) {
                                                                                                                        if (order.whatIf) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support what-if orders.",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 9 other locations - About 35 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 785..793
                                                                                                                  src/core/io/encoder.ts on lines 815..823
                                                                                                                  src/core/io/encoder.ts on lines 877..885
                                                                                                                  src/core/io/encoder.ts on lines 1011..1019
                                                                                                                  src/core/io/encoder.ts on lines 1199..1207
                                                                                                                  src/core/io/encoder.ts on lines 1209..1217
                                                                                                                  src/core/io/encoder.ts on lines 1219..1227
                                                                                                                  src/core/io/encoder.ts on lines 1229..1237
                                                                                                                  src/core/io/encoder.ts on lines 2048..2056

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 47.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.OPT_OUT_SMART_ROUTING) {
                                                                                                                        if (order.optOutSmartRouting) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support optOutSmartRouting parameter.",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 9 other locations - About 35 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 775..783
                                                                                                                  src/core/io/encoder.ts on lines 785..793
                                                                                                                  src/core/io/encoder.ts on lines 815..823
                                                                                                                  src/core/io/encoder.ts on lines 1011..1019
                                                                                                                  src/core/io/encoder.ts on lines 1199..1207
                                                                                                                  src/core/io/encoder.ts on lines 1209..1217
                                                                                                                  src/core/io/encoder.ts on lines 1219..1227
                                                                                                                  src/core/io/encoder.ts on lines 1229..1237
                                                                                                                  src/core/io/encoder.ts on lines 2048..2056

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 47.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.PROFESSIONAL_CUSTOMER) {
                                                                                                                        if (order.professionalCustomer) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support professional customer parameter",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 9 other locations - About 35 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 775..783
                                                                                                                  src/core/io/encoder.ts on lines 785..793
                                                                                                                  src/core/io/encoder.ts on lines 815..823
                                                                                                                  src/core/io/encoder.ts on lines 877..885
                                                                                                                  src/core/io/encoder.ts on lines 1011..1019
                                                                                                                  src/core/io/encoder.ts on lines 1199..1207
                                                                                                                  src/core/io/encoder.ts on lines 1219..1227
                                                                                                                  src/core/io/encoder.ts on lines 1229..1237
                                                                                                                  src/core/io/encoder.ts on lines 2048..2056

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 47.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.CME_TAGGING_FIELDS) {
                                                                                                                        if (order.manualOrderIndicator) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support manual order indicator parameter",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 9 other locations - About 35 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 775..783
                                                                                                                  src/core/io/encoder.ts on lines 785..793
                                                                                                                  src/core/io/encoder.ts on lines 815..823
                                                                                                                  src/core/io/encoder.ts on lines 877..885
                                                                                                                  src/core/io/encoder.ts on lines 1011..1019
                                                                                                                  src/core/io/encoder.ts on lines 1199..1207
                                                                                                                  src/core/io/encoder.ts on lines 1209..1217
                                                                                                                  src/core/io/encoder.ts on lines 1219..1227
                                                                                                                  src/core/io/encoder.ts on lines 2048..2056

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 47.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                      if (this.serverVersion < MIN_SERVER_VER.BOND_ISSUERID) {
                                                                                                                        if (contract.issuerId) {
                                                                                                                          return this.emitError(
                                                                                                                            "It does not support issuerId parameter in reqContractDetails.",
                                                                                                                            ErrorCode.UPDATE_TWS,
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 9 other locations - About 35 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 775..783
                                                                                                                  src/core/io/encoder.ts on lines 785..793
                                                                                                                  src/core/io/encoder.ts on lines 815..823
                                                                                                                  src/core/io/encoder.ts on lines 877..885
                                                                                                                  src/core/io/encoder.ts on lines 1011..1019
                                                                                                                  src/core/io/encoder.ts on lines 1199..1207
                                                                                                                  src/core/io/encoder.ts on lines 1209..1217
                                                                                                                  src/core/io/encoder.ts on lines 1219..1227
                                                                                                                  src/core/io/encoder.ts on lines 1229..1237

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 47.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                    cancelAccountUpdatesMulti(reqId: number): void {
                                                                                                                      const version = 2;
                                                                                                                  
                                                                                                                      this.sendMsg(OUT_MSG_ID.CANCEL_ACCOUNT_UPDATES_MULTI, version, reqId);
                                                                                                                    }
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 4 other locations - About 30 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 486..490
                                                                                                                  src/core/io/encoder.ts on lines 2503..2507
                                                                                                                  src/core/io/encoder.ts on lines 3037..3041
                                                                                                                  src/core/io/encoder.ts on lines 3064..3068

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 45.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                    cancelMktData(tickerId: number): void {
                                                                                                                      const version = 1;
                                                                                                                  
                                                                                                                      this.sendMsg(OUT_MSG_ID.CANCEL_MKT_DATA, version, tickerId);
                                                                                                                    }
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 4 other locations - About 30 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 409..413
                                                                                                                  src/core/io/encoder.ts on lines 2503..2507
                                                                                                                  src/core/io/encoder.ts on lines 3037..3041
                                                                                                                  src/core/io/encoder.ts on lines 3064..3068

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 45.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                    unsubscribeToGroupEvents(reqId: number): void {
                                                                                                                      const version = 1;
                                                                                                                  
                                                                                                                      this.sendMsg(OUT_MSG_ID.UNSUBSCRIBE_FROM_GROUP_EVENTS, version, reqId);
                                                                                                                    }
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 4 other locations - About 30 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 409..413
                                                                                                                  src/core/io/encoder.ts on lines 486..490
                                                                                                                  src/core/io/encoder.ts on lines 2503..2507
                                                                                                                  src/core/io/encoder.ts on lines 3037..3041

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 45.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                    reqAutoOpenOrders(bAutoBind: boolean): void {
                                                                                                                      const version = 1;
                                                                                                                  
                                                                                                                      this.sendMsg(OUT_MSG_ID.REQ_AUTO_OPEN_ORDERS, version, bAutoBind);
                                                                                                                    }
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 30 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 2765..2769

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 45.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                    reqNewsBulletins(allMsgs: boolean): void {
                                                                                                                      const version = 1;
                                                                                                                  
                                                                                                                      this.sendMsg(OUT_MSG_ID.REQ_NEWS_BULLETINS, version, allMsgs);
                                                                                                                    }
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/core/io/encoder.ts and 1 other location - About 30 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 1972..1976

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 45.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                    reqIds(numIds: number): void {
                                                                                                                      const version = 1;
                                                                                                                  
                                                                                                                      this.sendMsg(OUT_MSG_ID.REQ_IDS, version, numIds);
                                                                                                                    }
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 4 other locations - About 30 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 409..413
                                                                                                                  src/core/io/encoder.ts on lines 486..490
                                                                                                                  src/core/io/encoder.ts on lines 3037..3041
                                                                                                                  src/core/io/encoder.ts on lines 3064..3068

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 45.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

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

                                                                                                                    queryDisplayGroups(reqId: number): void {
                                                                                                                      const version = 1;
                                                                                                                  
                                                                                                                      this.sendMsg(OUT_MSG_ID.QUERY_DISPLAY_GROUPS, version, reqId);
                                                                                                                    }
                                                                                                                  Severity: Major
                                                                                                                  Found in src/core/io/encoder.ts and 4 other locations - About 30 mins to fix
                                                                                                                  src/core/io/encoder.ts on lines 409..413
                                                                                                                  src/core/io/encoder.ts on lines 486..490
                                                                                                                  src/core/io/encoder.ts on lines 2503..2507
                                                                                                                  src/core/io/encoder.ts on lines 3064..3068

                                                                                                                  Duplicated Code

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

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

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

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 45.

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

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

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

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

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  There are no issues that match your filters.

                                                                                                                  Category
                                                                                                                  Status