Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to API 10.32.01 #227

Merged
merged 2 commits into from
Nov 8, 2024
Merged

Upgrade to API 10.32.01 #227

merged 2 commits into from
Nov 8, 2024

Conversation

rylorin
Copy link
Member

@rylorin rylorin commented Nov 8, 2024

Test Suites: 1 failed, 44 passed, 45 total
Tests: 1 failed, 111 passed, 112 total
Snapshots: 0 total
Time: 91.715 s
Ran all test suites.

@@ -1461,6 +1484,12 @@ export class Decoder {
contract.longName = this.readStr();
}

if (this.serverVersion >= MIN_SERVER_VER.BOND_TRADING_HOURS) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 3 locations. Consider refactoring.


if (this.serverVersion < MIN_SERVER_VER.CME_TAGGING_FIELDS) {
if (order.manualOrderIndicator) {
return this.emitError(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid too many return statements within this function.

@@ -1177,6 +1216,26 @@
}
}

if (this.serverVersion < MIN_SERVER_VER.INCLUDE_OVERNIGHT) {
if (order.includeOvernight) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid too many return statements within this function.

@@ -2144,18 +2219,43 @@
/**
* Encode a REQ_GLOBAL_CANCEL message.
*/
reqGlobalCancel(): void {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function reqGlobalCancel has 29 lines of code (exceeds 25 allowed). Consider refactoring.

@@ -526,12 +532,10 @@
/**
* Encode a CANCEL_ORDER message to an array of tokens.
*/
cancelOrder(orderId: number, manualCancelOrderTime?: string): void {
const version = 1;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function cancelOrder has 42 lines of code (exceeds 25 allowed). Consider refactoring.

@@ -1177,6 +1216,26 @@ function tagValuesToTokens(tagValues: TagValue[]): unknown[] {
}
}

if (this.serverVersion < MIN_SERVER_VER.INCLUDE_OVERNIGHT) {
if (order.includeOvernight) {
return this.emitError(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid too many return statements within this function.

src/core/io/encoder.ts Show resolved Hide resolved
@@ -2144,18 +2219,43 @@ function tagValuesToTokens(tagValues: TagValue[]): unknown[] {
/**
* Encode a REQ_GLOBAL_CANCEL message.
*/
reqGlobalCancel(): void {
reqGlobalCancel(orderCancel?: OrderCancel): void {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function reqGlobalCancel has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.

@@ -2144,18 +2219,43 @@ function tagValuesToTokens(tagValues: TagValue[]): unknown[] {
/**
* Encode a REQ_GLOBAL_CANCEL message.
*/
reqGlobalCancel(): void {
reqGlobalCancel(orderCancel?: OrderCancel): void {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function reqGlobalCancel has 29 lines of code (exceeds 25 allowed). Consider refactoring.

cancelOrder(orderId: number, manualCancelOrderTime?: string): void {
const version = 1;

cancelOrder(orderId: number, orderCancel?: OrderCancel): void {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function cancelOrder has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.

Copy link

codeclimate bot commented Nov 8, 2024

Code Climate has analyzed commit 54df66f and detected 9 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 6
Duplication 3

View more on Code Climate.

@rylorin rylorin merged commit 3605ed9 into master Nov 8, 2024
5 of 6 checks passed
@rylorin rylorin deleted the r103201 branch November 8, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant