Skip to content

refactor: migrate identity module to TS - #1248

Open
jaissica12 wants to merge 4 commits into
developmentfrom
refactor/SDKE-1103-migrate-identity-module-to-ts
Open

refactor: migrate identity module to TS#1248
jaissica12 wants to merge 4 commits into
developmentfrom
refactor/SDKE-1103-migrate-identity-module-to-ts

replace var with const/let, remove unnecessary casts and unused self …

8f4c21b
Select commit
Loading
Failed to load commit list.
SonarQubeCloud / SonarCloud Code Analysis succeeded May 20, 2026 in 45s

Annotations

Check warning on line 135 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `Date.now()` over `Date#getTime()`.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnM&open=AZ5G3ykAJdmH6nGEsFnM&pullRequest=1248

Check warning on line 1290 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

The signature '(): mParticleUserCart' of 'self.mParticleUserCart' is deprecated.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnW&open=AZ5G3ykAJdmH6nGEsFnW&pullRequest=1248

Check warning on line 241 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer using an optional chain expression instead, as it's more concise and easier to read.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnO&open=AZ5G3ykAJdmH6nGEsFnO&pullRequest=1248

Check warning on line 1182 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

This assertion is unnecessary since the receiver accepts the original type of the expression.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnV&open=AZ5G3ykAJdmH6nGEsFnV&pullRequest=1248

Check failure on line 1431 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 33 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnZ&open=AZ5G3ykAJdmH6nGEsFnZ&pullRequest=1248

Check failure on line 1112 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnT&open=AZ5G3ykAJdmH6nGEsFnT&pullRequest=1248

Check warning on line 1167 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnU&open=AZ5G3ykAJdmH6nGEsFnU&pullRequest=1248

Check warning on line 1825 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

'onUserAlias' is deprecated.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnd&open=AZ5G3ykAJdmH6nGEsFnd&pullRequest=1248

Check warning on line 39 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Remove this unused import of 'SDKIdentityTypeEnum'.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnK&open=AZ5G3ykAJdmH6nGEsFnK&pullRequest=1248

Check failure on line 53 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Do not assign `this` to `self`.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnL&open=AZ5G3ykAJdmH6nGEsFnL&pullRequest=1248

Check warning on line 9 in src/identity-utils.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

'./identity-user-interfaces' imported multiple times.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3yjwJdmH6nGEsFnI&open=AZ5G3yjwJdmH6nGEsFnI&pullRequest=1248

Check warning on line 1363 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

'mParticleUserCart' is deprecated.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnY&open=AZ5G3ykAJdmH6nGEsFnY&pullRequest=1248

Check warning on line 223 in src/identity.interfaces.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Replace this union type with a type alias.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ygXJdmH6nGEsFnH&open=AZ5G3ygXJdmH6nGEsFnH&pullRequest=1248

Check warning on line 1826 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

'onUserAlias' is deprecated.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFne&open=AZ5G3ykAJdmH6nGEsFne&pullRequest=1248

Check warning on line 840 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `Date.now()` over `Date#getTime()`.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnQ&open=AZ5G3ykAJdmH6nGEsFnQ&pullRequest=1248

Check warning on line 1830 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

'onUserAlias' is deprecated.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnf&open=AZ5G3ykAJdmH6nGEsFnf&pullRequest=1248

Check warning on line 1769 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Compare with `undefined` directly instead of using `typeof`.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnb&open=AZ5G3ykAJdmH6nGEsFnb&pullRequest=1248

Check warning on line 1742 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Replace this union type with a type alias.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFna&open=AZ5G3ykAJdmH6nGEsFna&pullRequest=1248

Check warning on line 572 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer using an optional chain expression instead, as it's more concise and easier to read.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnP&open=AZ5G3ykAJdmH6nGEsFnP&pullRequest=1248

Check warning on line 847 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `Date.now()` over `Date#getTime()`.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnR&open=AZ5G3ykAJdmH6nGEsFnR&pullRequest=1248

Check warning on line 1080 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer using an optional chain expression instead, as it's more concise and easier to read.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnS&open=AZ5G3ykAJdmH6nGEsFnS&pullRequest=1248

Check warning on line 1347 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer using nullish coalescing operator (`??=`) instead of an assignment expression, as it is simpler to read.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnX&open=AZ5G3ykAJdmH6nGEsFnX&pullRequest=1248

Check warning on line 18 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Remove this unused import of 'Environment'.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnJ&open=AZ5G3ykAJdmH6nGEsFnJ&pullRequest=1248

Check warning on line 165 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer `Date.now()` over `Date#getTime()`.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnN&open=AZ5G3ykAJdmH6nGEsFnN&pullRequest=1248

Check warning on line 1825 in src/identity.ts

See this annotation in the file changed.

@sonarqubecloud sonarqubecloud / SonarCloud Code Analysis

Prefer using an optional chain expression instead, as it's more concise and easier to read.

See more on https://sonarcloud.io/project/issues?id=mParticle_mparticle-web-sdk&issues=AZ5G3ykAJdmH6nGEsFnc&open=AZ5G3ykAJdmH6nGEsFnc&pullRequest=1248