Skip to content

Commit a256ae3

Browse files
authored
Merge pull request #36 from auth0/task/code-smell-fix-lint
Code Smell + Lint Fix Via AutoCorrect
2 parents 9566d47 + 3042b09 commit a256ae3

75 files changed

Lines changed: 253 additions & 358 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

universal_components/src/main/java/com/auth0/universalcomponents/Auth0UniversalComponents.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,4 @@ public object Auth0UniversalComponents {
8383
throw IllegalStateException("Auth0UniversalComponents must be initialized first.")
8484
}
8585
}
86-
87-
}
86+
}

universal_components/src/main/java/com/auth0/universalcomponents/data/MyAccountProvider.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import com.auth0.universalcomponents.BuildConfig
88
/**
99
* Provider class that creates and provides instances of MyAccount from the Auth0 Android SDK.
1010
*/
11-
class MyAccountProvider(
12-
) {
11+
class MyAccountProvider() {
1312

1413
/**
1514
* Creates and returns a MyAccountAPIClient instance configured with the current access token.

universal_components/src/main/java/com/auth0/universalcomponents/data/TokenManager.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class TokenManager private constructor() {
4848
* If not found or expired, fetches a new token and caches it
4949
*/
5050
suspend fun fetchToken(audience: String, scope: String): String {
51-
5251
val cachedCredentials = tokenMap[cacheKey(audience, scope)]
5352
if (cachedCredentials != null) {
5453
if (!willTokenExpire(cachedCredentials.expiresAt.time)) {
@@ -90,4 +89,4 @@ class TokenManager private constructor() {
9089
val currentTimeInMillis = System.currentTimeMillis()
9190
return expiresAt <= currentTimeInMillis
9291
}
93-
}
92+
}

universal_components/src/main/java/com/auth0/universalcomponents/data/mapper/EnrollmentChallengeMapper.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ fun SdkMfaEnrollmentChallenge.toDomainModel(): MfaEnrollmentChallenge {
3131
)
3232
}
3333

34-
3534
fun SdkTotpEnrollmentChallenge.toDomainModel(): TotpEnrollmentChallenge {
3635
return TotpEnrollmentChallenge(
3736
id = this.id,

universal_components/src/main/java/com/auth0/universalcomponents/data/mapper/ErrorMapper.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ internal object ErrorMapper {
2525
message = exception.message ?: "Unknown error occurred",
2626
cause = exception
2727
)
28-
2928
}
3029
}
3130

@@ -101,7 +100,6 @@ internal object ErrorMapper {
101100
}
102101
}
103102

104-
105103
private fun mapCredentialsManagerException(
106104
exception: CredentialsManagerException,
107105
scope: String?
@@ -165,4 +163,4 @@ internal object ErrorMapper {
165163
)
166164
}
167165
}
168-
}
166+
}

universal_components/src/main/java/com/auth0/universalcomponents/data/network/WithErrorMapping.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.auth0.universalcomponents.data.network
33
import com.auth0.universalcomponents.data.mapper.ErrorMapper
44
import kotlin.coroutines.cancellation.CancellationException
55

6-
76
/**
87
* Executes a suspend request and maps exceptions to Auth0Error.
98
* Rethrows [CancellationException] to preserve structured concurrency.
@@ -23,4 +22,4 @@ internal suspend inline fun <reified T> withErrorMapping(
2322
} catch (e: Throwable) {
2423
throw ErrorMapper.mapToAuth0Error(e, scope)
2524
}
26-
}
25+
}

universal_components/src/main/java/com/auth0/universalcomponents/data/repository/MyAccountRepositoryImpl.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ class MyAccountRepositoryImpl(
7979
val client = myAccountProvider.getMyAccount(accessToken)
8080
client.deleteAuthenticationMethod(authenticationMethodId).await()
8181
}
82-
8382
}
8483

8584
/**

universal_components/src/main/java/com/auth0/universalcomponents/di/UniversalComponentsModule.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import com.auth0.universalcomponents.domain.usecase.VerifyAuthenticatorUseCase
2121

2222
object UniversalComponentsModule {
2323

24-
25-
//Viewmodel factories
24+
// Viewmodel factories
2625
fun provideAuthenticatorMethodViewModelFactory(): AuthenticatorMethodViewModelFactory {
2726
return AuthenticatorMethodViewModelFactory(
2827
getEnabledAuthenticatorMethodsUseCase = provideEnabledAuthenticatorMethodsUseCase()
@@ -57,7 +56,7 @@ object UniversalComponentsModule {
5756
)
5857
}
5958

60-
//Use cases
59+
// Use cases
6160
private fun provideEnabledAuthenticatorMethodsUseCase(): GetEnabledAuthenticatorMethodsUseCase {
6261
return GetEnabledAuthenticatorMethodsUseCase(
6362
repository = provideMyAccountRepository(),
@@ -76,7 +75,6 @@ object UniversalComponentsModule {
7675
)
7776
}
7877

79-
8078
private fun provideEnrollAuthenticatorUseCase(): EnrollAuthenticatorUseCase {
8179
return EnrollAuthenticatorUseCase(
8280
repository = provideMyAccountRepository()
@@ -106,5 +104,4 @@ object UniversalComponentsModule {
106104
private fun provideTokenManager(): TokenManager {
107105
return TokenManager.getInstance()
108106
}
109-
110107
}

universal_components/src/main/java/com/auth0/universalcomponents/di/viewmodelfactory/AuthenticatorMethodViewModelFactory.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ class AuthenticatorMethodViewModelFactory(private val getEnabledAuthenticatorMet
1818
else -> throw IllegalArgumentException("Unknown ViewModel class: ${modelClass.name}")
1919
}
2020
}
21-
}
21+
}

universal_components/src/main/java/com/auth0/universalcomponents/domain/DispatcherProvider.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ package com.auth0.universalcomponents.domain
22

33
import kotlinx.coroutines.CoroutineDispatcher
44

5-
65
interface DispatcherProvider {
76
val main: CoroutineDispatcher
87
val io: CoroutineDispatcher
98
val default: CoroutineDispatcher
109
val unconfined: CoroutineDispatcher
11-
}
10+
}

0 commit comments

Comments
 (0)