Showing 142 of 497 total issues

Function start has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

    Function start has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function readComboLegs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

        readComboLegs(): void {
          if (this.version >= 14) {
            this.contract.comboLegsDescription = this.decoder.readStr();
          }
      
      
      Severity: Minor
      Found in src/core/io/decoder.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 decodeMsg_ERR_MSG has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

        private decodeMsg_ERR_MSG(): void {
          const version = this.readInt();
          if (version < 2) {
            const errorMsg = this.readStr();
            this.callback.emitError(errorMsg, -1, -1);
      Severity: Minor
      Found in src/core/io/decoder.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 start has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        start(): void {
          super.start();
      
          if (!this.cmdLineArgs.conid) {
            this.error("-conid argument missing.");
      Severity: Minor
      Found in src/tools/histogram-data.ts - About 1 hr to fix

        Function start has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Function connect has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            connect(reconnectInterval?: number, clientId?: number): void {
              // create the IBApiNext object
          
              const port = (this.cmdLineArgs.port as number) ?? configuration.ib_port;
              const host = (this.cmdLineArgs.host as string) ?? configuration.ib_host;
          Severity: Minor
          Found in src/tools/common/ib-api-next-app.ts - About 1 hr to fix

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

              private onServerVersion(tokens: string[]): void {
                this._status = ConnectionStatus.Connected;
            
                this._serverVersion = parseInt(tokens[0], 10);
                this._serverConnectionTime = tokens[1];
            Severity: Minor
            Found in src/core/io/socket.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 send has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  send(tokens: unknown[]): void {
                    // flatten arrays and convert boolean types to 0/1
                
                    tokens = this.flattenDeep(tokens);
                    tokens.forEach((value, i) => {
                Severity: Minor
                Found in src/core/io/socket.ts - About 1 hr to fix

                  Function getSecDefOptParams has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    getSecDefOptParams(
                      underlyingSymbol: string,
                      futFopExchange: string,
                      underlyingSecType: SecType,
                      underlyingConId: number,
                  Severity: Minor
                  Found in src/api-next/api-next.ts - About 1 hr to fix

                    Function createObservable has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      createObservable(): Observable<ItemListUpdate<T>> {
                        return new Observable<ItemListUpdate<T>>((subscriber) => {
                          // create new subject and reqId if there is an has error
                    
                          if (this.hasError) {
                    Severity: Minor
                    Found in src/core/api-next/subscription.ts - About 1 hr to fix

                      Function start has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        start(): void {
                          super.start();
                      
                          if (!this.cmdLineArgs.conid) {
                            this.error("-conid argument missing.");
                      Severity: Minor
                      Found in src/tools/historical-data-updates.ts - About 1 hr to fix

                        Function start has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          start(): void {
                            super.start();
                        
                            if (!this.cmdLineArgs.conid) {
                              this.error("-conid argument missing.");
                        Severity: Minor
                        Found in src/tools/market-depth.ts - About 1 hr to fix

                          Function constructor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            constructor(
                              appDescription: string,
                              usageDescription: string,
                              optionArgumentDescriptions: [string, string][],
                              usageExample: string,
                          Severity: Minor
                          Found in src/tools/common/ib-api-next-app.ts - About 1 hr to fix

                            Function decodeMsg_SYMBOL_SAMPLES has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              private decodeMsg_SYMBOL_SAMPLES(): void {
                                const reqId = this.readInt();
                            
                                const nContractDescriptions = this.readInt();
                                const contractDescriptions: ContractDescription[] = new Array(
                            Severity: Minor
                            Found in src/core/io/decoder.ts - About 1 hr to fix

                              Function next has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      next: (marketData) => {
                                        const changedOrAddedDataWithTickNames = new Map<string, number>();
                                        marketData.added?.forEach((tick, type) => {
                                          if (type > IBApiNextTickType.API_NEXT_FIRST_TICK_ID) {
                                            changedOrAddedDataWithTickNames.set(
                              Severity: Minor
                              Found in src/tools/market-data.ts - About 1 hr to fix

                                Function readConditions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  readConditions(): void {
                                    if (this.serverVersion >= MIN_SERVER_VER.PEGGED_TO_BENCHMARK) {
                                      const nConditions = this.decoder.readInt();
                                
                                      if (nConditions > 0) {
                                Severity: Minor
                                Found in src/core/io/decoder.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 readAlgoParams has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  readAlgoParams(): void {
                                    if (this.version >= 21) {
                                      this.order.algoStrategy = this.decoder.readStr();
                                      if (this.order.algoStrategy && this.order.algoStrategy !== "") {
                                        const algoParamsCount = this.decoder.readInt();
                                Severity: Minor
                                Found in src/core/io/decoder.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 decodeMsg_POSITION_MULTI has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  private decodeMsg_POSITION_MULTI(): void {
                                    this.readInt(); // version
                                    const reqId = this.readInt();
                                    const account = this.readStr();
                                    const contract: Contract = {};
                                Severity: Minor
                                Found in src/core/io/decoder.ts - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language