Showing 142 of 497 total issues
Function runWatchdog
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private runWatchdog(): void {
// verify state
if (!this.watchdogInterval || this.connectionWatchdogTimeout) {
return;
}
Function start
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
start(): void {
super.start();
this.api
.getNextValidOrderId()
Function decodeMsg_ERR_MSG
has 26 lines of code (exceeds 25 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);
Function getMarketData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getMarketData(
contract: Contract,
genericTickList: string,
snapshot: boolean,
regulatorySnapshot: boolean,
Consider simplifying this complex logical expression. Open
if (
order.scalePriceAdjustValue !== undefined ||
order.scalePriceAdjustInterval !== undefined ||
order.scaleProfitOffset !== undefined ||
order.scaleAutoReset ||
Function runWatchdog
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private runWatchdog(): void {
// verify state
if (!this.watchdogInterval || this.connectionWatchdogTimeout) {
return;
}
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
start(): void {
super.start();
if (!this.cmdLineArgs.conid) {
this.error("-conid argument missing.");
- 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 onMessage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private onMessage(data: string): void {
// tokenize
const dataWithFragment = this.dataFragment + data;
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
start(): void {
super.start();
if (!this.cmdLineArgs.conid) {
this.error("-conid argument missing.");
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
start(): void {
super.start();
if (!this.cmdLineArgs.conid) {
this.error("-conid argument missing.");
- 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 reqRealTimeBars
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
reqRealTimeBars(
tickerId: number,
contract: Contract,
barSize: number,
whatToShow: WhatToShow,
- 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 startAPI
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private startAPI(): void {
// start API
const VERSION = 2;
if (this.serverVersion >= 3) {
- 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 reqScannerSubscription
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
reqScannerSubscription(
reqId: number,
subscription: ScannerSubscription,
scannerSubscriptionOptions: TagValue[],
scannerSubscriptionFilterOptions?: TagValue[],
- 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 reqWshEventData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
reqWshEventData(reqId: number, wshEventData: WshEventData): void {
if (this.serverVersion < MIN_SERVER_VER.WSHE_CALENDAR) {
return this.emitError(
"It does not support WSHE Calendar API.",
ErrorCode.UPDATE_TWS,
- 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
Consider simplifying this complex logical expression. Open
if (
this.serverVersion < MIN_SERVER_VER.PEGBEST_PEGMID_OFFSETS &&
(order.minTradeQty !== undefined ||
order.minCompeteSize !== undefined ||
order.competeAgainstBestOffset !== undefined ||
Consider simplifying this complex logical expression. Open
if (
eventName !== EventName.connected &&
eventName !== EventName.disconnected &&
eventName !== EventName.error &&
eventName !== EventName.received &&
Function calculateImpliedVolatility
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
calculateImpliedVolatility(
reqId: number,
contract: Contract,
optionPrice: number,
underPrice: number,
- 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 send
has a Cognitive Complexity of 7 (exceeds 5 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) => {
- 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_MKT_DEPTH_EXCHANGES
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private decodeMsg_MKT_DEPTH_EXCHANGES(): void {
const nDepthMktDataDescriptions = this.readInt();
const depthMktDataDescriptions: DepthMktDataDescription[] = new Array(
nDepthMktDataDescriptions,
);
- 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_PORTFOLIO_VALUE
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private decodeMsg_PORTFOLIO_VALUE(): void {
const version = this.readInt();
const contract: Contract = {};
if (version >= 6) {
- 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"