Showing 142 of 497 total issues
Function start
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
start(): void {
super.start();
if (!this.cmdLineArgs.conid) {
this.error("-conid argument missing.");
Function start
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
start(): void {
super.start();
if (!this.cmdLineArgs.conid) {
this.error("-conid argument missing.");
Function readComboLegs
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
readComboLegs(): void {
if (this.version >= 14) {
this.contract.comboLegsDescription = this.decoder.readStr();
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function decodeMsg_ERR_MSG
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private decodeMsg_ERR_MSG(): void {
const version = this.readInt();
if (version < 2) {
const errorMsg = this.readStr();
this.callback.emitError(errorMsg, -1, -1);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function start
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
start(): void {
super.start();
if (!this.cmdLineArgs.conid) {
this.error("-conid argument missing.");
Function start
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
start(): void {
super.start();
if (!this.cmdLineArgs.conid) {
this.error("-conid argument missing.");
Function connect
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
connect(reconnectInterval?: number, clientId?: number): void {
// create the IBApiNext object
const port = (this.cmdLineArgs.port as number) ?? configuration.ib_port;
const host = (this.cmdLineArgs.host as string) ?? configuration.ib_host;
Function onServerVersion
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private onServerVersion(tokens: string[]): void {
this._status = ConnectionStatus.Connected;
this._serverVersion = parseInt(tokens[0], 10);
this._serverConnectionTime = tokens[1];
Function reqFundamentalData
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
reqFundamentalData(
reqId: number,
contract: Contract,
reportType: string,
fundamentalDataOptions: TagValue[],
Function send
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
send(tokens: unknown[]): void {
// flatten arrays and convert boolean types to 0/1
tokens = this.flattenDeep(tokens);
tokens.forEach((value, i) => {
Function getSecDefOptParams
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
getSecDefOptParams(
underlyingSymbol: string,
futFopExchange: string,
underlyingSecType: SecType,
underlyingConId: number,
Function createObservable
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
createObservable(): Observable<ItemListUpdate<T>> {
return new Observable<ItemListUpdate<T>>((subscriber) => {
// create new subject and reqId if there is an has error
if (this.hasError) {
Function start
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
start(): void {
super.start();
if (!this.cmdLineArgs.conid) {
this.error("-conid argument missing.");
Function start
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
start(): void {
super.start();
if (!this.cmdLineArgs.conid) {
this.error("-conid argument missing.");
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
appDescription: string,
usageDescription: string,
optionArgumentDescriptions: [string, string][],
usageExample: string,
Function decodeMsg_SYMBOL_SAMPLES
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private decodeMsg_SYMBOL_SAMPLES(): void {
const reqId = this.readInt();
const nContractDescriptions = this.readInt();
const contractDescriptions: ContractDescription[] = new Array(
Function next
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
next: (marketData) => {
const changedOrAddedDataWithTickNames = new Map<string, number>();
marketData.added?.forEach((tick, type) => {
if (type > IBApiNextTickType.API_NEXT_FIRST_TICK_ID) {
changedOrAddedDataWithTickNames.set(
Function readConditions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
readConditions(): void {
if (this.serverVersion >= MIN_SERVER_VER.PEGGED_TO_BENCHMARK) {
const nConditions = this.decoder.readInt();
if (nConditions > 0) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function readAlgoParams
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
readAlgoParams(): void {
if (this.version >= 21) {
this.order.algoStrategy = this.decoder.readStr();
if (this.order.algoStrategy && this.order.algoStrategy !== "") {
const algoParamsCount = this.decoder.readInt();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function decodeMsg_POSITION_MULTI
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private decodeMsg_POSITION_MULTI(): void {
this.readInt(); // version
const reqId = this.readInt();
const account = this.readStr();
const contract: Contract = {};