Showing 142 of 497 total issues

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

                                      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

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

                                        readSmartComboRoutingParams(): void {
                                          if (this.version >= 26) {
                                            const smartComboRoutingParamsCount = this.decoder.readInt();
                                            if (smartComboRoutingParamsCount > 0) {
                                              this.order.smartComboRoutingParams = [];
                                      Severity: Minor
                                      Found in src/core/io/decoder.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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language