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 {
|
private fun saveKeyToFile(key: Key, path: String): Int {
|
||||||
val encoded = key.encoded
|
val encoded = key.encoded
|
||||||
try {
|
try {
|
||||||
if (!File(path).exists()) {
|
return if (!File(path).exists() && !File(path).createNewFile()) {
|
||||||
if (!File(path).createNewFile()) {
|
-1
|
||||||
return -1
|
} else {
|
||||||
|
FileOutputStream(path).use { keyFileOutputStream ->
|
||||||
|
keyFileOutputStream.write(encoded)
|
||||||
|
0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FileOutputStream(path).use { keyFileOutputStream ->
|
|
||||||
keyFileOutputStream.write(encoded)
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
} catch (e: FileNotFoundException) {
|
} catch (e: FileNotFoundException) {
|
||||||
Log.d(TAG, "Failed to save key to file")
|
Log.d(TAG, "Failed to save key to file")
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
|
# SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
build:
|
build:
|
||||||
maxIssues: 83
|
maxIssues: 82
|
||||||
weights:
|
weights:
|
||||||
# complexity: 2
|
# complexity: 2
|
||||||
# LongParameterList: 1
|
# LongParameterList: 1
|
||||||
|
Loading…
Reference in New Issue
Block a user