diff --git a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryImpl.kt index 5c272e09e..55bcfa287 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/AuthRepositoryImpl.kt @@ -443,7 +443,6 @@ class AuthRepositoryImpl( }, ) - @Suppress("ReturnCount") override suspend fun createNewSsoUser(): NewSsoUserResult { val account = authDiskSource.userState?.activeAccount ?: return NewSsoUserResult.Failure val orgIdentifier = rememberedOrgIdentifier ?: return NewSsoUserResult.Failure @@ -501,7 +500,6 @@ class AuthRepositoryImpl( ) } - @Suppress("ReturnCount") override suspend fun completeTdeLogin( requestPrivateKey: String, asymmetricalKey: String, @@ -678,7 +676,6 @@ class AuthRepositoryImpl( } ?: ResendEmailResult.Error(message = null) - @Suppress("ReturnCount") override fun switchAccount(userId: String): SwitchAccountResult { val currentUserState = authDiskSource.userState ?: return SwitchAccountResult.NoChange val previousActiveUserId = currentUserState.activeUserId @@ -711,7 +708,7 @@ class AuthRepositoryImpl( ) } - @Suppress("ReturnCount", "LongMethod") + @Suppress("LongMethod") override suspend fun register( email: String, masterPassword: String, @@ -806,7 +803,6 @@ class AuthRepositoryImpl( ) } - @Suppress("ReturnCount") override suspend fun resetPassword( currentPassword: String?, newPassword: String, @@ -1059,7 +1055,6 @@ class AuthRepositoryImpl( onFailure = { PasswordStrengthResult.Error }, ) - @Suppress("ReturnCount") override suspend fun validatePassword(password: String): ValidatePasswordResult { val userId = activeUserId ?: return ValidatePasswordResult.Error return authDiskSource @@ -1109,7 +1104,7 @@ class AuthRepositoryImpl( ): Boolean = passwordPolicies .all { validatePasswordAgainstPolicy(password, it) } - @Suppress("CyclomaticComplexMethod", "ReturnCount") + @Suppress("CyclomaticComplexMethod") private suspend fun validatePasswordAgainstPolicy( password: String, policy: PolicyInformation.MasterPassword, @@ -1438,7 +1433,6 @@ class AuthRepositoryImpl( /** * A helper method to handle the [TrustedDeviceUserDecryptionOptionsJson] specific to TDE. */ - @Suppress("ReturnCount") private suspend fun handleLoginCommonSuccessTrustedDeviceUserDecryptionOptions( trustedDeviceDecryptionOptions: TrustedDeviceUserDecryptionOptionsJson, userStateJson: UserStateJson, diff --git a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/di/AuthRepositoryModule.kt b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/di/AuthRepositoryModule.kt index 94d58b024..495c57a39 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/di/AuthRepositoryModule.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/di/AuthRepositoryModule.kt @@ -34,7 +34,6 @@ object AuthRepositoryModule { @Provides @Singleton - @Suppress("LongParameterList") fun providesAuthRepository( accountsService: AccountsService, devicesService: DevicesService, diff --git a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/JwtTokenUtils.kt b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/JwtTokenUtils.kt index c83b7d72d..68a02363d 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/JwtTokenUtils.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/JwtTokenUtils.kt @@ -17,7 +17,7 @@ private val json: Json by lazy { /** * Parses a [JwtTokenDataJson] from the given [jwtToken], or `null` if this parsing is not possible. */ -@Suppress("MagicNumber", "ReturnCount") +@Suppress("MagicNumber") fun parseJwtTokenDataOrNull(jwtToken: String): JwtTokenDataJson? { val parts = jwtToken.split(".") if (parts.size != 3) return null diff --git a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt index 3ff6bb621..93b9683df 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/auth/repository/util/UserStateJsonExtensions.kt @@ -17,7 +17,6 @@ import com.x8bit.bitwarden.ui.platform.base.util.toHexColorRepresentation * [UserStateJson]. The original will be returned if the sync response does not match any accounts * in the [UserStateJson]. */ -@Suppress("ReturnCount") fun UserStateJson.toUpdatedUserStateJson( syncResponse: SyncResponseJson, ): UserStateJson { diff --git a/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/di/Fido2ProviderModule.kt b/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/di/Fido2ProviderModule.kt index 3c4faff3b..44c7a9c6d 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/di/Fido2ProviderModule.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/di/Fido2ProviderModule.kt @@ -9,7 +9,6 @@ import com.x8bit.bitwarden.data.autofill.fido2.manager.Fido2CredentialManager import com.x8bit.bitwarden.data.autofill.fido2.manager.Fido2CredentialManagerImpl import com.x8bit.bitwarden.data.autofill.fido2.processor.Fido2ProviderProcessor import com.x8bit.bitwarden.data.autofill.fido2.processor.Fido2ProviderProcessorImpl -import com.x8bit.bitwarden.data.platform.annotation.OmitFromCoverage import com.x8bit.bitwarden.data.platform.manager.AssetManager import com.x8bit.bitwarden.data.platform.manager.dispatcher.DispatcherManager import com.x8bit.bitwarden.ui.platform.manager.intent.IntentManager @@ -24,7 +23,6 @@ import javax.inject.Singleton /** * Provides dependencies within the fido2 package. */ -@OmitFromCoverage @Module @InstallIn(SingletonComponent::class) object Fido2ProviderModule { diff --git a/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/manager/Fido2CredentialManagerImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/manager/Fido2CredentialManagerImpl.kt index ed9d14979..f4b6321d7 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/manager/Fido2CredentialManagerImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/manager/Fido2CredentialManagerImpl.kt @@ -51,7 +51,6 @@ class Fido2CredentialManagerImpl( null } - @Suppress("ReturnCount") private suspend fun validateCallingApplicationAssetLinks( fido2CredentialRequest: Fido2CredentialRequest, ): Fido2ValidateOriginResult { diff --git a/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/processor/Fido2ProviderProcessorImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/processor/Fido2ProviderProcessorImpl.kt index 404d555f0..851cf1f58 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/processor/Fido2ProviderProcessorImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/processor/Fido2ProviderProcessorImpl.kt @@ -81,7 +81,6 @@ class Fido2ProviderProcessorImpl( } } - @Suppress("ReturnCount") private fun handleCreatePasskeyQuery( request: BeginCreatePublicKeyCredentialRequest, ): BeginCreateCredentialResponse? { diff --git a/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/util/Fido2IntentUtils.kt b/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/util/Fido2IntentUtils.kt index 6b5c1c469..8ace17c5e 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/util/Fido2IntentUtils.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/autofill/fido2/util/Fido2IntentUtils.kt @@ -13,7 +13,6 @@ import com.x8bit.bitwarden.ui.platform.manager.intent.EXTRA_KEY_USER_ID * Checks if this [Intent] contains a [Fido2CredentialRequest] related to an ongoing FIDO 2 * credential creation process. */ -@Suppress("ReturnCount") @OmitFromCoverage fun Intent.getFido2CredentialRequestOrNull(): Fido2CredentialRequest? { if (isBuildVersionBelow(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)) return null diff --git a/app/src/main/java/com/x8bit/bitwarden/data/autofill/util/ViewNodeExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/data/autofill/util/ViewNodeExtensions.kt index 712ab291b..985ec2048 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/autofill/util/ViewNodeExtensions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/autofill/util/ViewNodeExtensions.kt @@ -155,7 +155,6 @@ private fun AssistStructure.ViewNode.buildAutofillView( /** * Check whether this [AssistStructure.ViewNode] represents a password field. */ -@Suppress("ReturnCount") fun AssistStructure.ViewNode.isPasswordField( supportedHint: String?, ): Boolean { diff --git a/app/src/main/java/com/x8bit/bitwarden/data/autofill/util/ViewNodeTraversalDataExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/data/autofill/util/ViewNodeTraversalDataExtensions.kt index f06cc3dd0..c24df615f 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/autofill/util/ViewNodeTraversalDataExtensions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/autofill/util/ViewNodeTraversalDataExtensions.kt @@ -13,7 +13,6 @@ private const val ANDROID_APP_SCHEME: String = "androidapp" * Try and build a URI. First, try building a website from the list of [ViewNodeTraversalData]. If * that fails, try converting [packageName] into an Android app URI. */ -@Suppress("ReturnCount") fun List.buildUriOrNull( packageName: String?, ): String? { diff --git a/app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/core/ResultCall.kt b/app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/core/ResultCall.kt index eeb62576e..1c7523599 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/core/ResultCall.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/core/ResultCall.kt @@ -56,7 +56,7 @@ class ResultCall( */ fun executeForResult(): Result = requireNotNull(execute().body()) - @Suppress("ReturnCount", "TooGenericExceptionCaught") + @Suppress("TooGenericExceptionCaught") override fun execute(): Response> { val response = try { backingCall.execute() diff --git a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PolicyManagerImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PolicyManagerImpl.kt index b47efd6bf..12f025546 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PolicyManagerImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PolicyManagerImpl.kt @@ -57,7 +57,6 @@ class PolicyManagerImpl( /** * A helper method to filter policies. */ - @Suppress("ReturnCount") private fun filterPolicies( userId: String, type: PolicyTypeJson, diff --git a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManagerImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManagerImpl.kt index c89c55178..400e2919d 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManagerImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManagerImpl.kt @@ -281,7 +281,6 @@ class PushManagerImpl @Inject constructor( } } - @Suppress("ReturnCount") override fun registerStoredPushTokenIfNecessary() { val userId = activeUserId ?: return if (!isLoggedIn(userId)) return diff --git a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/event/OrganizationEventManagerImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/event/OrganizationEventManagerImpl.kt index 5c831b39a..968081c59 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/event/OrganizationEventManagerImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/event/OrganizationEventManagerImpl.kt @@ -57,7 +57,6 @@ class OrganizationEventManagerImpl( ) } - @Suppress("ReturnCount") override fun trackEvent(event: OrganizationEvent) { val userId = authRepository.activeUserId ?: return if (authRepository.authStateFlow.value !is AuthState.Authenticated) return diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/service/CiphersServiceImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/service/CiphersServiceImpl.kt index c6cab841d..7610fa77e 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/service/CiphersServiceImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/service/CiphersServiceImpl.kt @@ -105,7 +105,6 @@ class CiphersServiceImpl( ?: throw throwable } - @Suppress("ReturnCount") override suspend fun shareAttachment( cipherId: String, attachment: Attachment, diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/CipherManagerImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/CipherManagerImpl.kt index b19e4be80..b3db64bcc 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/CipherManagerImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/CipherManagerImpl.kt @@ -399,7 +399,6 @@ class CipherManagerImpl( onFailure = { DownloadAttachmentResult.Failure }, ) - @Suppress("ReturnCount") private suspend fun downloadAttachmentForResult( cipherView: CipherView, attachmentId: String, @@ -482,7 +481,6 @@ class CipherManagerImpl( vaultSdkSource.encryptCipher(userId = userId, cipherView = this) } - @Suppress("ReturnCount") private suspend fun migrateAttachments( userId: String, cipherView: CipherView, diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/FileManagerImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/FileManagerImpl.kt index 298c1678a..c83327847 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/FileManagerImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/FileManagerImpl.kt @@ -38,7 +38,7 @@ class FileManagerImpl( } } - @Suppress("NestedBlockDepth", "ReturnCount") + @Suppress("NestedBlockDepth") override suspend fun downloadFileToCache(url: String): DownloadResult { val response = downloadService .getDataStream(url) diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt index 0f7aee2b3..f257bcf65 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/manager/VaultLockManagerImpl.kt @@ -431,7 +431,6 @@ class VaultLockManagerImpl( * Checks the current [VaultTimeout] for the given [userId]. If the given timeout value has * been exceeded, the [VaultTimeoutAction] for the given user will be performed. */ - @Suppress("ReturnCount") private fun checkForVaultTimeout( userId: String, isAppRestart: Boolean = false, @@ -485,7 +484,6 @@ class VaultLockManagerImpl( ) } - @Suppress("ReturnCount") private suspend fun unlockVaultForUser( userId: String, initUserCryptoMethod: InitUserCryptoMethod, diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt index 2963f439c..574d9cd59 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/repository/VaultRepositoryImpl.kt @@ -524,7 +524,6 @@ class VaultRepositoryImpl( mutableTotpCodeResultFlow.tryEmit(totpCodeResult) } - @Suppress("ReturnCount") override suspend fun unlockVaultWithBiometrics(): VaultUnlockResult { val userId = activeUserId ?: return VaultUnlockResult.InvalidStateError val biometricsKey = authDiskSource @@ -543,7 +542,6 @@ class VaultRepositoryImpl( } } - @Suppress("ReturnCount") override suspend fun unlockVaultWithMasterPassword( masterPassword: String, ): VaultUnlockResult { @@ -564,7 +562,6 @@ class VaultRepositoryImpl( } } - @Suppress("ReturnCount") override suspend fun unlockVaultWithPin( pin: String, ): VaultUnlockResult { @@ -601,7 +598,6 @@ class VaultRepositoryImpl( organizationKeys = organizationKeys, ) - @Suppress("ReturnCount") override suspend fun createSend( sendView: SendView, fileUri: Uri?, @@ -834,7 +830,6 @@ class VaultRepositoryImpl( } } - @Suppress("ReturnCount") override suspend fun exportVaultDataToString(format: ExportFormat): ExportVaultDataResult { val userId = activeUserId ?: return ExportVaultDataResult.Error val folders = vaultDiskSource @@ -920,7 +915,6 @@ class VaultRepositoryImpl( } } - @Suppress("ReturnCount") private suspend fun unlockVaultForUser( userId: String, initUserCryptoMethod: InitUserCryptoMethod, @@ -1128,7 +1122,6 @@ class VaultRepositoryImpl( * are met. If the resource cannot be found cloud-side, and it was updated, delete it from disk * for now. */ - @Suppress("ReturnCount") private suspend fun syncCipherIfNecessary(syncCipherUpsertData: SyncCipherUpsertData) { val userId = activeUserId ?: return val cipherId = syncCipherUpsertData.cipherId diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/masterpasswordhint/MasterPasswordHintViewModel.kt b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/masterpasswordhint/MasterPasswordHintViewModel.kt index 70a0863d8..131e8df38 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/masterpasswordhint/MasterPasswordHintViewModel.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/masterpasswordhint/MasterPasswordHintViewModel.kt @@ -60,7 +60,7 @@ class MasterPasswordHintViewModel @Inject constructor( ) } - @Suppress("LongMethod", "ReturnCount") + @Suppress("LongMethod") private fun handleSubmitClick() { val email = stateFlow.value.emailInput diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavScreen.kt index 23d4c11d4..0ae453d8b 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/rootnav/RootNavScreen.kt @@ -202,7 +202,6 @@ fun RootNavScreen( * As noted above, this can be removed after upgrading to latest compose navigation, since * the nav args can prevent us from having to do this check. */ -@Suppress("ReturnCount") private fun NavDestination?.rootLevelRoute(): String? { if (this == null) { return null diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/autofill/blockautofill/util/StringExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/autofill/blockautofill/util/StringExtensions.kt index 7ac40c798..3e03d0032 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/autofill/blockautofill/util/StringExtensions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/autofill/blockautofill/util/StringExtensions.kt @@ -15,7 +15,6 @@ import com.x8bit.bitwarden.ui.platform.base.util.asText * * This function will return the error message or null if there is no error. */ -@Suppress("ReturnCount") fun String.validateUri(existingUris: List): Text? { // Check if URI starts with allowed schemes. diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/exportvault/ExportVaultViewModel.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/exportvault/ExportVaultViewModel.kt index 09759f853..ac30ba858 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/exportvault/ExportVaultViewModel.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/exportvault/ExportVaultViewModel.kt @@ -130,7 +130,6 @@ class ExportVaultViewModel @Inject constructor( /** * Verify the master password after confirming exporting the vault. */ - @Suppress("ReturnCount") private fun handleConfirmExportVaultClicked() { // Display an error alert if the user hasn't entered a password. if (state.passwordInput.isBlank()) { diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/manager/intent/IntentManagerImpl.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/manager/intent/IntentManagerImpl.kt index 28a2623c8..ed0fc825e 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/manager/intent/IntentManagerImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/manager/intent/IntentManagerImpl.kt @@ -131,7 +131,6 @@ class IntentManagerImpl( override fun getFileDataFromIntent(intent: Intent): IntentManager.FileData? = intent.clipData?.getItemAt(0)?.uri?.let { getLocalFileData(it) } - @Suppress("ReturnCount") override fun getShareDataFromIntent(intent: Intent): IntentManager.ShareData? { if (intent.action != Intent.ACTION_SEND) return null return if (intent.type?.contains("text/") == true) { diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/generator/util/ServiceTypeExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/generator/util/ServiceTypeExtensions.kt index 3ad9a6ab7..5ba7031a3 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/generator/util/ServiceTypeExtensions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/tools/feature/generator/util/ServiceTypeExtensions.kt @@ -8,7 +8,7 @@ import com.x8bit.bitwarden.ui.tools.feature.generator.GeneratorState.MainType.Us /** * Converts a [ServiceType] to a [UsernameGeneratorRequest.Forwarded]. */ -@Suppress("ReturnCount", "LongMethod") +@Suppress("LongMethod") fun ServiceType.toUsernameGeneratorRequest(website: String?): UsernameGeneratorRequest.Forwarded? { return when (this) { is ServiceType.AddyIo -> { diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModel.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModel.kt index e46a59b5d..30bc21eaf 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModel.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModel.kt @@ -287,7 +287,6 @@ class VaultItemListingViewModel @Inject constructor( sendEvent(VaultItemListingEvent.NavigateToSendItem(id = action.sendId)) } - @Suppress("ReturnCount") private fun handleItemClick(action: VaultItemListingsAction.ItemClick) { if (state.isAutofill) { val cipherView = getCipherViewOrNull(action.id) ?: return diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/qrcodescan/QrCodeScanViewModel.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/qrcodescan/QrCodeScanViewModel.kt index 0e48b1f54..be797ab9f 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/qrcodescan/QrCodeScanViewModel.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/qrcodescan/QrCodeScanViewModel.kt @@ -79,7 +79,7 @@ class QrCodeScanViewModel @Inject constructor( ) } - @Suppress("NestedBlockDepth", "ReturnCount", "MagicNumber") + @Suppress("NestedBlockDepth", "MagicNumber") private fun areParametersValid(scannedCode: String, parameters: Set): Boolean { parameters.forEach { parameter -> Uri.parse(scannedCode).getQueryParameter(parameter)?.let { value -> diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/util/CollectionViewExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/util/CollectionViewExtensions.kt index 319cb34ad..67870e68e 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/util/CollectionViewExtensions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/util/CollectionViewExtensions.kt @@ -9,7 +9,6 @@ private const val COLLECTION_DIVIDER: String = "/" * display names. This function is necessary if we want to show the nested collections for a * specific collection. */ -@Suppress("ReturnCount") fun List.getCollections(collectionId: String): List { val currentCollection = this.find { it.id == collectionId } ?: return emptyList() diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/util/FolderViewExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/util/FolderViewExtensions.kt index 8004be080..d3f1200c5 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/util/FolderViewExtensions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/util/FolderViewExtensions.kt @@ -8,7 +8,6 @@ private const val FOLDER_DIVIDER: String = "/" * Retrieves the subfolders of a given [folderId] and updates their names to proper display names. * This function is necessary if we want to show the subfolders for a specific folder. */ -@Suppress("ReturnCount") fun List.getFolders(folderId: String): List { val currentFolder = this.find { it.id == folderId } ?: return emptyList() diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultDataExtensions.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultDataExtensions.kt index dab0d2aec..edcabb6dc 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultDataExtensions.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/util/VaultDataExtensions.kt @@ -142,7 +142,6 @@ fun VaultData.toViewState( /** * Method to build the icon data for login item icons. */ -@Suppress("ReturnCount") fun List?.toLoginIconData( isIconLoadingDisabled: Boolean, baseIconUrl: String, diff --git a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/item/util/CipherViewExtensionsTest.kt b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/item/util/CipherViewExtensionsTest.kt index b52f226fe..be745325b 100644 --- a/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/item/util/CipherViewExtensionsTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/ui/vault/feature/item/util/CipherViewExtensionsTest.kt @@ -33,7 +33,7 @@ class CipherViewExtensionsTest { // This visibility state should be preserved isVisible = true, canViewPassword = false, - ) + ), ), ), isPremiumUser = true, @@ -58,7 +58,7 @@ class CipherViewExtensionsTest { password = "password", isVisible = true, canViewPassword = false, - ) + ), ), ), viewState, diff --git a/detekt-config.yml b/detekt-config.yml index a6ed6c7a3..1a3b30793 100644 --- a/detekt-config.yml +++ b/detekt-config.yml @@ -595,7 +595,7 @@ style: RedundantVisibilityModifierRule: active: false ReturnCount: - active: true + active: false max: 2 excludedFunctions: [ 'equals' ] excludeLabeled: false