src/api-next/api-next.ts

Summary

Maintainability
F
3 wks
Test Coverage

File api-next.ts has 2117 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

              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 2069..2095

            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

              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 1933..1959

            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 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 1962..1987
            src/api-next/api-next.ts on lines 2032..2055

            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 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 1894..1919
            src/api-next/api-next.ts on lines 1962..1987

            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 1894..1919
            src/api-next/api-next.ts on lines 2032..2055

            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 2968..2986

            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 2992..3010

            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.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 1268..1295
            src/api-next/api-next.ts on lines 1296..1320
            src/api-next/api-next.ts on lines 1321..1348
            src/api-next/api-next.ts on lines 1349..1373
            src/api-next/api-next.ts on lines 1374..1401
            src/api-next/api-next.ts on lines 1402..1429
            src/api-next/api-next.ts on lines 1430..1457

            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 1243..1267
            src/api-next/api-next.ts on lines 1268..1295
            src/api-next/api-next.ts on lines 1296..1320
            src/api-next/api-next.ts on lines 1321..1348
            src/api-next/api-next.ts on lines 1374..1401
            src/api-next/api-next.ts on lines 1402..1429
            src/api-next/api-next.ts on lines 1430..1457

            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 1243..1267
            src/api-next/api-next.ts on lines 1268..1295
            src/api-next/api-next.ts on lines 1296..1320
            src/api-next/api-next.ts on lines 1349..1373
            src/api-next/api-next.ts on lines 1374..1401
            src/api-next/api-next.ts on lines 1402..1429
            src/api-next/api-next.ts on lines 1430..1457

            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 1243..1267
            src/api-next/api-next.ts on lines 1268..1295
            src/api-next/api-next.ts on lines 1296..1320
            src/api-next/api-next.ts on lines 1321..1348
            src/api-next/api-next.ts on lines 1349..1373
            src/api-next/api-next.ts on lines 1374..1401
            src/api-next/api-next.ts on lines 1430..1457

            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_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 1243..1267
            src/api-next/api-next.ts on lines 1296..1320
            src/api-next/api-next.ts on lines 1321..1348
            src/api-next/api-next.ts on lines 1349..1373
            src/api-next/api-next.ts on lines 1374..1401
            src/api-next/api-next.ts on lines 1402..1429
            src/api-next/api-next.ts on lines 1430..1457

            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 1243..1267
            src/api-next/api-next.ts on lines 1268..1295
            src/api-next/api-next.ts on lines 1296..1320
            src/api-next/api-next.ts on lines 1321..1348
            src/api-next/api-next.ts on lines 1349..1373
            src/api-next/api-next.ts on lines 1374..1401
            src/api-next/api-next.ts on lines 1402..1429

            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 1243..1267
            src/api-next/api-next.ts on lines 1268..1295
            src/api-next/api-next.ts on lines 1321..1348
            src/api-next/api-next.ts on lines 1349..1373
            src/api-next/api-next.ts on lines 1374..1401
            src/api-next/api-next.ts on lines 1402..1429
            src/api-next/api-next.ts on lines 1430..1457

            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 1243..1267
            src/api-next/api-next.ts on lines 1268..1295
            src/api-next/api-next.ts on lines 1296..1320
            src/api-next/api-next.ts on lines 1321..1348
            src/api-next/api-next.ts on lines 1349..1373
            src/api-next/api-next.ts on lines 1402..1429
            src/api-next/api-next.ts on lines 1430..1457

            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 2745..2758

            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 2771..2783

            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<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 2525..2541

            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<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 1628..1644

            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 659..672

            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 803..816

            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 2494..2508

            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 1597..1611

            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 897..902

            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 977..985

            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

                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 2209..2213

            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

                } 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 2205..2213

            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 3048..3059

            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 3013..3024

            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

              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 2855..2857

            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

              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 2880..2882

            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 334..342
            src/api-next/api-next.ts on lines 2346..2354

            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 2098..2111
            src/api-next/api-next.ts on lines 2346..2354

            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 334..342
            src/api-next/api-next.ts on lines 2098..2111

            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