Showing 142 of 497 total issues
Function reqHistoricalData
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
reqHistoricalData(
tickerId: number,
contract: Contract,
endDateTime: string,
durationStr: string,
Function readVolOrderParams
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
readVolOrderParams(readOpenOrderAttribs: boolean): void {
if (this.version >= 11) {
this.order.volatility = this.decoder.readDoubleOrUndefined();
this.order.volatilityType = this.decoder.readInt();
if (this.version == 11) {
- 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
File socket.ts
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
import net from "net";
import { TextEncoder } from "util";
import {
IBApiCreationOptions,
Function exerciseOptions
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
exerciseOptions(
tickerId: number,
contract: Contract,
exerciseAction: OptionExerciseAction,
exerciseQuantity: number,
Function decodeMsg_COMPLETED_ORDER
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
private decodeMsg_COMPLETED_ORDER(): void {
const contract: Contract = {};
const order: Order = {};
const orderState: OrderState = {};
const orderDecoder = new OrderDecoder(
Function decodeMsg_BOND_CONTRACT_DATA
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
private decodeMsg_BOND_CONTRACT_DATA(): void {
let version = 6;
if (this.serverVersion < MIN_SERVER_VER.SIZE_RULES) {
version = this.readInt();
}
Function register
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
register<T>(
requestFunction: (reqId: number) => void,
cancelFunction: (reqId: number) => void | null | undefined,
eventHandler: [
EventName,
Function decodeMsg_TICK_OPTION_COMPUTATION
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
private decodeMsg_TICK_OPTION_COMPUTATION(): void {
let version;
if (this.serverVersion >= MIN_SERVER_VER.PRICE_BASED_VOLATILITY)
version = Number.MAX_VALUE;
else version = this.readInt();
Function reqHistoricalData
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
reqHistoricalData(
tickerId: number,
contract: Contract,
endDateTime: string,
durationStr: string,
- 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_EXECUTION_DATA
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
private decodeMsg_EXECUTION_DATA(): void {
let version = this.serverVersion;
if (version < MIN_SERVER_VER.LAST_LIQUIDITY) {
version = this.readInt();
}
Function reqMktDepth
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
reqMktDepth(
tickerId: number,
contract: Contract,
numRows: number,
isSmartDepth: boolean,
Function decodeMsg_TICK_OPTION_COMPUTATION
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private decodeMsg_TICK_OPTION_COMPUTATION(): void {
let version;
if (this.serverVersion >= MIN_SERVER_VER.PRICE_BASED_VOLATILITY)
version = Number.MAX_VALUE;
else 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 process
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
process(): void {
while (true) {
// verify there is data to process
if (!this.dataQueue.length) {
- 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 exerciseOptions
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
exerciseOptions(
tickerId: number,
contract: Contract,
exerciseAction: OptionExerciseAction,
exerciseQuantity: 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 decodeMsg_HISTORICAL_DATA
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
private decodeMsg_HISTORICAL_DATA(): void {
let version = Number.MAX_SAFE_INTEGER;
if (this.serverVersion < MIN_SERVER_VER.SYNT_REALTIME_BARS) {
version = this.readInt();
}
Function decodeMsg_TICK_BY_TICK
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
private decodeMsg_TICK_BY_TICK(): void {
const reqId = this.readInt();
const tickType = this.readInt();
const time = this.readStr();
Function reqScannerSubscription
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
reqScannerSubscription(
reqId: number,
subscription: ScannerSubscription,
scannerSubscriptionOptions: TagValue[],
scannerSubscriptionFilterOptions?: TagValue[],
Controller
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
export class Controller implements EncoderCallbacks, DecoderCallbacks {
/**
*
* @param ib The [[IBApi]] object.
* @param _options The [[IBApi]] creation options.
Socket
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
export class Socket {
/**
* Create a new [[Socket]] object.
*
* @param controller The parent [[Controller]] object.
Function connect
has a Cognitive Complexity of 16 (exceeds 5 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;
- 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"