src/api-next/api-next.ts

Summary

Maintainability
F
3 wks
Test Coverage

File api-next.ts has 2116 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { lastValueFrom, Observable, Subject } from "rxjs";
import { map } from "rxjs/operators";
import {
  Bar,
  BarSizeSetting,
Severity: Major
Found in src/api-next/api-next.ts - About 5 days to fix

    IBApiNext has 89 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class IBApiNext {
      /**
       * Create an [[IBApiNext]] object.
       *
       * @param options Creation options.
    Severity: Major
    Found in src/api-next/api-next.ts - About 1 day to fix

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

        constructor(options?: IBApiNextCreationOptions) {
          this.logger = new IBApiNextLogger(options?.logger ?? new ConsoleLogger());
      
          // create the IBApiAutoConnection and subscription registry
      
      
      Severity: Minor
      Found in src/api-next/api-next.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 getMarketData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            getMarketData(
              contract: Contract,
              genericTickList: string,
              snapshot: boolean,
              regulatorySnapshot: boolean,
          Severity: Minor
          Found in src/api-next/api-next.ts - About 1 hr to fix

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

              getHistoricalTicksLast(
                contract: Contract,
                startDateTime: string,
                endDateTime: string,
                numberOfTicks: number,
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 6 hrs to fix
            src/api-next/api-next.ts on lines 1932..1958

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

            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

              getHistoricalTicksMid(
                contract: Contract,
                startDateTime: string,
                endDateTime: string,
                numberOfTicks: number,
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 6 hrs to fix
            src/api-next/api-next.ts on lines 2068..2094

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

            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

              private readonly onHistoricalTicksLast = (
                subscriptions: Map<number, IBApiNextSubscription<HistoricalTickLast[]>>,
                reqId: number,
                ticks: HistoricalTickLast[],
                done: boolean,
            Severity: Major
            Found in src/api-next/api-next.ts and 2 other locations - About 6 hrs to fix
            src/api-next/api-next.ts on lines 1893..1918
            src/api-next/api-next.ts on lines 1961..1986

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

            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

              private readonly onHistoricalTicksBidAsk = (
                subscriptions: Map<number, IBApiNextSubscription<HistoricalTickBidAsk[]>>,
                reqId: number,
                ticks: HistoricalTickBidAsk[],
                done: boolean,
            Severity: Major
            Found in src/api-next/api-next.ts and 2 other locations - About 6 hrs to fix
            src/api-next/api-next.ts on lines 1893..1918
            src/api-next/api-next.ts on lines 2031..2054

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

            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

              private readonly onHistoricalTicks = (
                subscriptions: Map<number, IBApiNextSubscription<HistoricalTick[]>>,
                reqId: number,
                ticks: HistoricalTick[],
                done: boolean,
            Severity: Major
            Found in src/api-next/api-next.ts and 2 other locations - About 6 hrs to fix
            src/api-next/api-next.ts on lines 1961..1986
            src/api-next/api-next.ts on lines 2031..2054

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

            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

              getCommissionReport(filter: ExecutionFilter): Promise<CommissionReport[]> {
                return lastValueFrom(
                  this.subscriptions
                    .register<CommissionReport[]>(
                      (reqId) => {
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 5 hrs to fix
            src/api-next/api-next.ts on lines 2967..2985

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

            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

              getExecutionDetails(filter: ExecutionFilter): Promise<ExecutionDetail[]> {
                return lastValueFrom(
                  this.subscriptions
                    .register<ExecutionDetail[]>(
                      (reqId) => {
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 5 hrs to fix
            src/api-next/api-next.ts on lines 2991..3009

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

            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

                  case IBApiTickType.DELAYED_BID_OPTION:
                    ticks.push(
                      [
                        IBApiNextTickType.DELAYED_BID_OPTION_IV,
                        { value: impliedVolatility, ingressTm: now },
            Severity: Major
            Found in src/api-next/api-next.ts and 7 other locations - About 4 hrs to fix
            src/api-next/api-next.ts on lines 1242..1266
            src/api-next/api-next.ts on lines 1295..1319
            src/api-next/api-next.ts on lines 1320..1347
            src/api-next/api-next.ts on lines 1348..1372
            src/api-next/api-next.ts on lines 1373..1400
            src/api-next/api-next.ts on lines 1401..1428
            src/api-next/api-next.ts on lines 1429..1456

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

            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

                  case IBApiTickType.DELAYED_LAST_OPTION:
                    ticks.push(
                      [
                        IBApiNextTickType.DELAYED_LAST_OPTION_IV,
                        { value: impliedVolatility, ingressTm: now },
            Severity: Major
            Found in src/api-next/api-next.ts and 7 other locations - About 4 hrs to fix
            src/api-next/api-next.ts on lines 1242..1266
            src/api-next/api-next.ts on lines 1267..1294
            src/api-next/api-next.ts on lines 1295..1319
            src/api-next/api-next.ts on lines 1320..1347
            src/api-next/api-next.ts on lines 1348..1372
            src/api-next/api-next.ts on lines 1401..1428
            src/api-next/api-next.ts on lines 1429..1456

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

            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

                  case IBApiTickType.LAST_OPTION:
                    ticks.push(
                      [
                        IBApiNextTickType.LAST_OPTION_IV,
                        { value: impliedVolatility, ingressTm: now },
            Severity: Major
            Found in src/api-next/api-next.ts and 7 other locations - About 4 hrs to fix
            src/api-next/api-next.ts on lines 1242..1266
            src/api-next/api-next.ts on lines 1267..1294
            src/api-next/api-next.ts on lines 1295..1319
            src/api-next/api-next.ts on lines 1320..1347
            src/api-next/api-next.ts on lines 1373..1400
            src/api-next/api-next.ts on lines 1401..1428
            src/api-next/api-next.ts on lines 1429..1456

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

            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

                  case IBApiTickType.ASK_OPTION:
                    ticks.push(
                      [
                        IBApiNextTickType.ASK_OPTION_IV,
                        { value: impliedVolatility, ingressTm: now },
            Severity: Major
            Found in src/api-next/api-next.ts and 7 other locations - About 4 hrs to fix
            src/api-next/api-next.ts on lines 1242..1266
            src/api-next/api-next.ts on lines 1267..1294
            src/api-next/api-next.ts on lines 1320..1347
            src/api-next/api-next.ts on lines 1348..1372
            src/api-next/api-next.ts on lines 1373..1400
            src/api-next/api-next.ts on lines 1401..1428
            src/api-next/api-next.ts on lines 1429..1456

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

            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

                  case IBApiTickType.DELAYED_ASK_OPTION:
                    ticks.push(
                      [
                        IBApiNextTickType.DELAYED_ASK_OPTION_IV,
                        { value: impliedVolatility, ingressTm: now },
            Severity: Major
            Found in src/api-next/api-next.ts and 7 other locations - About 4 hrs to fix
            src/api-next/api-next.ts on lines 1242..1266
            src/api-next/api-next.ts on lines 1267..1294
            src/api-next/api-next.ts on lines 1295..1319
            src/api-next/api-next.ts on lines 1348..1372
            src/api-next/api-next.ts on lines 1373..1400
            src/api-next/api-next.ts on lines 1401..1428
            src/api-next/api-next.ts on lines 1429..1456

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

            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

                  case IBApiTickType.BID_OPTION:
                    ticks.push(
                      [
                        IBApiNextTickType.BID_OPTION_IV,
                        { value: impliedVolatility, ingressTm: now },
            Severity: Major
            Found in src/api-next/api-next.ts and 7 other locations - About 4 hrs to fix
            src/api-next/api-next.ts on lines 1267..1294
            src/api-next/api-next.ts on lines 1295..1319
            src/api-next/api-next.ts on lines 1320..1347
            src/api-next/api-next.ts on lines 1348..1372
            src/api-next/api-next.ts on lines 1373..1400
            src/api-next/api-next.ts on lines 1401..1428
            src/api-next/api-next.ts on lines 1429..1456

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

            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

                  case IBApiTickType.MODEL_OPTION:
                    ticks.push(
                      [
                        IBApiNextTickType.MODEL_OPTION_IV,
                        { value: impliedVolatility, ingressTm: now },
            Severity: Major
            Found in src/api-next/api-next.ts and 7 other locations - About 4 hrs to fix
            src/api-next/api-next.ts on lines 1242..1266
            src/api-next/api-next.ts on lines 1267..1294
            src/api-next/api-next.ts on lines 1295..1319
            src/api-next/api-next.ts on lines 1320..1347
            src/api-next/api-next.ts on lines 1348..1372
            src/api-next/api-next.ts on lines 1373..1400
            src/api-next/api-next.ts on lines 1429..1456

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

            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

                  case IBApiTickType.DELAYED_MODEL_OPTION:
                    ticks.push(
                      [
                        IBApiNextTickType.DELAYED_MODEL_OPTION_IV,
                        { value: impliedVolatility, ingressTm: now },
            Severity: Major
            Found in src/api-next/api-next.ts and 7 other locations - About 4 hrs to fix
            src/api-next/api-next.ts on lines 1242..1266
            src/api-next/api-next.ts on lines 1267..1294
            src/api-next/api-next.ts on lines 1295..1319
            src/api-next/api-next.ts on lines 1320..1347
            src/api-next/api-next.ts on lines 1348..1372
            src/api-next/api-next.ts on lines 1373..1400
            src/api-next/api-next.ts on lines 1401..1428

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

            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

                return this.subscriptions.register<OpenOrder[]>(
                  () => {
                    this.api.reqOpenOrders();
                  },
                  undefined,
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 2 hrs to fix
            src/api-next/api-next.ts on lines 2744..2757

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

            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

                  this.subscriptions
                    .register<OpenOrder[]>(
                      () => {
                        this.api.reqAllOpenOrders();
                      },
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 2 hrs to fix
            src/api-next/api-next.ts on lines 2770..2782

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

            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

                  this.subscriptions
                    .register<HistogramEntry[]>(
                      (reqId) => {
                        this.api.reqHistogramData(
                          reqId,
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 2 hrs to fix
            src/api-next/api-next.ts on lines 1627..1643

            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

                  this.subscriptions
                    .register<string>(
                      (reqId) => {
                        this.api.reqHeadTimestamp(
                          reqId,
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 2 hrs to fix
            src/api-next/api-next.ts on lines 2524..2540

            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

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

                  if (changePositionIndex === -1) {
                    // new position - add it
                    accountPositions.push(updatedPosition);
                    hasAdded = true;
                  } else {
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 2 hrs to fix
            src/api-next/api-next.ts on lines 802..815

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

            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 (changePositionIndex === -1) {
                    // new position - add it
                    accountPositions.push(updatedPosition);
                    hasAdded = true;
                  } else {
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 2 hrs to fix
            src/api-next/api-next.ts on lines 658..671

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

            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

              private onHeadTimestamp = (
                subscriptions: Map<number, IBApiNextSubscription<string>>,
                reqId: number,
                headTimestamp: string,
              ): void => {
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 1 hr to fix
            src/api-next/api-next.ts on lines 2493..2507

            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

              private readonly onHistogramData = (
                subscriptions: Map<number, IBApiNextSubscription<HistogramEntry[]>>,
                reqId: number,
                data: HistogramEntry[],
              ): void => {
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 1 hr to fix
            src/api-next/api-next.ts on lines 1596..1610

            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

              private readonly onSecurityDefinitionOptionParameterEnd = (
                subscriptions: Map<
                  number,
                  IBApiNextSubscription<SecurityDefinitionOptionParameterType[]>
                >,
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 1 hr to fix
            src/api-next/api-next.ts on lines 896..901

            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

              private readonly onContractDetailsEnd = (
                subscriptions: Map<number, IBApiNextSubscription<ContractDetails[]>>,
                reqId: number,
              ) => {
                subscriptions.get(reqId)?.complete();
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 1 hr to fix
            src/api-next/api-next.ts on lines 976..984

            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

                } else if (side == 1) {
                  // bid side
                  cachedRows = <Map<OrderBookRowPosition, OrderBookRow>>cached.bids;
                  changedRows = <Map<OrderBookRowPosition, OrderBookRow>>changed.bids;
                }
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 1 hr to fix
            src/api-next/api-next.ts on lines 2204..2212

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

            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 (side == 0) {
                  // ask side
                  cachedRows = <Map<OrderBookRowPosition, OrderBookRow>>cached.asks;
                  changedRows = <Map<OrderBookRowPosition, OrderBookRow>>changed.asks;
                } else if (side == 1) {
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 1 hr to fix
            src/api-next/api-next.ts on lines 2208..2212

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

            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

              private readonly onSymbolSamples = (
                subscriptions: Map<number, IBApiNextSubscription<ContractDescription[]>>,
                reqId: number,
                contractDescriptions: ContractDescription[],
              ): void => {
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 1 hr to fix
            src/api-next/api-next.ts on lines 3047..3058

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

            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

              private readonly onUserInfo = (
                subscriptions: Map<number, IBApiNextSubscription<string>>,
                reqId: number,
                whiteBrandingId: string,
              ): void => {
            Severity: Major
            Found in src/api-next/api-next.ts and 1 other location - About 1 hr to fix
            src/api-next/api-next.ts on lines 3012..3023

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

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

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

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

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

            Refactorings

            Further Reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 52.

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

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

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

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

            Refactorings

            Further Reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 52.

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

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

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

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

            Refactorings

            Further Reading

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

              private readonly onMktDepthExchanges = (
                subscriptions: Map<
                  number,
                  IBApiNextSubscription<DepthMktDataDescription[]>
                >,
            Severity: Minor
            Found in src/api-next/api-next.ts and 2 other locations - About 40 mins to fix
            src/api-next/api-next.ts on lines 333..341
            src/api-next/api-next.ts on lines 2345..2353

            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

              private readonly onScannerParameters = (
                subscriptions: Map<number, IBApiNextSubscription<string>>,
                xml: string,
              ): void => {
                subscriptions.forEach((sub) => {
            Severity: Minor
            Found in src/api-next/api-next.ts and 2 other locations - About 40 mins to fix
            src/api-next/api-next.ts on lines 333..341
            src/api-next/api-next.ts on lines 2097..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 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

              private readonly onCurrentTime = (
                subscriptions: Map<number, IBApiNextSubscription<number>>,
                time: number,
              ): void => {
                subscriptions.forEach((sub) => {
            Severity: Minor
            Found in src/api-next/api-next.ts and 2 other locations - About 40 mins to fix
            src/api-next/api-next.ts on lines 2097..2110
            src/api-next/api-next.ts on lines 2345..2353

            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

                  (tickType === IBApiTickType.BID ||
                    tickType === IBApiTickType.DELAYED_BID ||
                    tickType === IBApiTickType.ASK ||
                    tickType === IBApiTickType.DELAYED_ASK)
            Severity: Minor
            Found in src/api-next/api-next.ts and 1 other location - About 30 mins to fix
            src/core/io/controller.ts on lines 173..176

            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