Showing 142 of 497 total issues
Function decodeMsg_HISTORICAL_DATA
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
private decodeMsg_HISTORICAL_DATA(): void {
let version = Number.MAX_SAFE_INTEGER;
if (this.serverVersion < MIN_SERVER_VER.SYNT_REALTIME_BARS) {
version = this.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_ORDER_STATUS
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
private decodeMsg_ORDER_STATUS(): void {
const version =
this.serverVersion >= MIN_SERVER_VER.MARKET_CAP_PRICE
? Number.MAX_SAFE_INTEGER
: this.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
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support secIdType and secId parameters.",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support Scale order parameters: PriceAdjustValue, PriceAdjustInterval, ProfitOffset, AutoReset, InitPosition, InitFillQty and RandomPercent",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support tradingClass parameters in placeOrder.",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support algoId parameter",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support scaleTable, activeStartTime and activeStopTime parameters.",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support oms container parameter.",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support D-Peg orders.",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support advanced error override attribute",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support professional customer parameter",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support issuerId parameter in reqContractDetails.",
ErrorCode.UPDATE_TWS,
reqId,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support notHeld parameter.",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support conId parameter.",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support hedge orders.",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support duration attribute",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support ext operator",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support don't use auto price for hedge parameter.",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support model code parameter.",
ErrorCode.UPDATE_TWS,
id,
);
Avoid too many return
statements within this function. Open
Open
return this.emitError(
"It does not support soft dollar tier",
ErrorCode.UPDATE_TWS,
id,
);