mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-18 19:19:33 +01:00
style(detekt): Restrict the number of return statements in methods
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
0c2a29f27e
commit
8d0c6b0ce3
@ -117,15 +117,14 @@ class PushUtils {
|
||||
private fun saveKeyToFile(key: Key, path: String): Int {
|
||||
val encoded = key.encoded
|
||||
try {
|
||||
if (!File(path).exists()) {
|
||||
if (!File(path).createNewFile()) {
|
||||
return -1
|
||||
return if (!File(path).exists() && !File(path).createNewFile()) {
|
||||
-1
|
||||
} else {
|
||||
FileOutputStream(path).use { keyFileOutputStream ->
|
||||
keyFileOutputStream.write(encoded)
|
||||
0
|
||||
}
|
||||
}
|
||||
FileOutputStream(path).use { keyFileOutputStream ->
|
||||
keyFileOutputStream.write(encoded)
|
||||
return 0
|
||||
}
|
||||
} catch (e: FileNotFoundException) {
|
||||
Log.d(TAG, "Failed to save key to file")
|
||||
} catch (e: IOException) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
# SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
build:
|
||||
maxIssues: 83
|
||||
maxIssues: 82
|
||||
weights:
|
||||
# complexity: 2
|
||||
# LongParameterList: 1
|
||||
|
Loading…
Reference in New Issue
Block a user