Skip to content

[MOB-12231] refactor-classes-to-reduce-circular-dependencies - #731

Closed
lposen wants to merge 23 commits into
jwt/MOB-11032-task-4-ios-bridge-retrypolicy-and-authfailurefrom
MOB-12231-refactor-classes-to-reduce-circular-dependencies
Closed

lposen wants to merge 23 commits into
jwt/MOB-11032-task-4-ios-bridge-retrypolicy-and-authfailurefrom
MOB-12231-refactor-classes-to-reduce-circular-dependencies

Conversation

@lposen

@lposen lposen commented Oct 7, 2025 •

Copy link
Copy Markdown
Contributor

🔹 JIRA Ticket(s) if any

✏️ Description

Please provide a brief description of what this pull request does.

@qltysh

qltysh Bot commented Oct 7, 2025 •

Copy link
Copy Markdown

6 new issues

Tool Category Rule Count
qlty Structure Function with many parameters (count = 4): initialize2WithApiKey 4
qlty Structure Function with high complexity (count = 6): setupUserNotificationCenter 1
qlty Structure Function with many returns (count = 8): IterableAppProvider 1

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableAuthManager.ts Outdated
Comment thread src/core/constants/defaults.ts Outdated
…lure' into MOB-12231-refactor-classes-to-reduce-circular-dependencies
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
…lure' into MOB-12231-refactor-classes-to-reduce-circular-dependencies
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
@github-actions

github-actions Bot commented Oct 9, 2025 •

Copy link
Copy Markdown
Lines Statements Branches Functions
Coverage: 50%
51.11% (276/540) 26.44% (55/208) 48.5% (97/200)

@qltysh

qltysh Bot commented Oct 9, 2025 •

Copy link
Copy Markdown

Diff Coverage: The code coverage on the diff in this pull request is 82.4%.

Total Coverage: This PR will increase coverage by 3.98%.

File Coverage Changes
Path File Coverage Δ Indirect
src/core/classes/Iterable.ts 1.2
src/core/classes/IterableApi.ts 82.9
src/core/classes/IterableAuthManager.ts 0.0
src/inbox/classes/IterableInboxDataModel.ts 0.2
🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
@lposen
lposen marked this pull request as ready for review October 9, 2025 19:23
@Ayyanchira
Ayyanchira self-requested a review October 9, 2025 22:31

@Ayyanchira Ayyanchira left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Partially reviewed

Comment thread package.json
"prepare": "yarn build",
"release": "release-it"
"release": "release-it",
"circ": "npx madge --circular --extensions ts ./"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it a dedicated package to results circular dependency?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yup!

Comment thread src/core/classes/Iterable.ts Outdated
@@ -23,9 +21,14 @@ import type { IterableCommerceItem } from './IterableCommerceItem';
import { IterableConfig } from './IterableConfig';
import { IterableLogger } from './IterableLogger';
import type { IterableAuthFailure } from '../types/IterableAuthFailure';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Import 'type' is removed above. Is this one ok?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. The issue was coming from the use of Iterable.logger in IterableInAppManager. This has been changed to not require that anymore.

Comment thread src/core/classes/Iterable.ts Outdated

const RNEventEmitter = new NativeEventEmitter(RNIterableAPI);

const defaultConfig = new IterableConfig();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure how default implementation comes into play. Any possibility of regression?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No -- it's the same functionality as was there before -- it's just assigning it to a variable

Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment thread src/core/classes/IterableApi.ts
Comment on lines +45 to +49
static initialize2WithApiKey(
apiKey: string,
config: IterableConfig = new IterableConfig(),
version: string,
apiEndPoint: string

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Function with many parameters (count = 4): initialize2WithApiKey [qlty:function-parameters]

Comment on lines +163 to +168
static trackPushOpenWithCampaignId(
campaignId: number,
templateId: number,
messageId: string | null | undefined,
appAlreadyRunning: boolean,
dataFields?: unknown

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Function with many parameters (count = 5): trackPushOpenWithCampaignId [qlty:function-parameters]

Comment on lines +253 to +257
static trackInAppClose(
message: IterableInAppMessage,
location: IterableInAppLocation,
source: IterableInAppCloseSource,
clickedUrl?: string

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Function with many parameters (count = 4): trackInAppClose [qlty:function-parameters]

Comment on lines +512 to +518
static updateSubscriptions(
emailListIds: number[] | null,
unsubscribedChannelIds: number[] | null,
unsubscribedMessageTypeIds: number[] | null,
subscribedMessageTypeIds: number[] | null,
campaignId: number,
templateId: number

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Function with many parameters (count = 6): updateSubscriptions [qlty:function-parameters]

@lposen lposen closed this Oct 10, 2025
@jferrao-itrbl
jferrao-itrbl deleted the MOB-12231-refactor-classes-to-reduce-circular-dependencies branch September 15, 2026 06:11
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.

2 participants