Skip to content

Commit bfca7dd

Browse files
committed
fix code analytics
Signed-off-by: alperozturk <alper_ozturk@proton.me>
1 parent 1f44c75 commit bfca7dd

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

library/src/main/java/com/nextcloud/extensions/JsonObjectExtensions.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package com.nextcloud.extensions
99

1010
import com.google.gson.JsonObject
1111

12+
@Suppress("ReturnCount")
1213
fun JsonObject?.getBoolean(key: String): Boolean? {
1314
if (this == null) {
1415
return null

library/src/main/java/com/owncloud/android/lib/resources/shares/attributes/ShareAttributes.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ data class ShareAttributes(
1515
companion object {
1616
const val DOWNLOAD_ATTRIBUTE_KEY = "download"
1717

18-
fun createDownloadAttributes(value: Boolean): ShareAttributes {
19-
return ShareAttributes(scope = "permissions", key = DOWNLOAD_ATTRIBUTE_KEY, value = value)
20-
}
18+
fun createDownloadAttributes(value: Boolean): ShareAttributes =
19+
ShareAttributes(scope = "permissions", key = DOWNLOAD_ATTRIBUTE_KEY, value = value)
2120
}
2221
}
2322

library/src/main/java/com/owncloud/android/lib/resources/shares/attributes/ShareAttributesSerializer.kt renamed to library/src/main/java/com/owncloud/android/lib/resources/shares/attributes/ShareAttributesDeserializer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import java.lang.reflect.Type
1616
/**
1717
* Custom serializer for the ShareAttributes class.
1818
* This handles the deserialization and serialization of the ShareAttributes data class.
19-
* Since Nextcloud 30, the enabled key have bee renamed to value and supports more than boolean.
19+
* Since Nextcloud 30, the enabled key have been renamed to value and supports more than boolean.
2020
*
2121
* https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-share-api.html#share-attributes
2222
*/

library/src/main/java/com/owncloud/android/lib/resources/shares/attributes/ShareAttributesJsonHandler.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ import com.google.gson.GsonBuilder
1111
import com.google.gson.reflect.TypeToken
1212

1313
object ShareAttributesJsonHandler {
14-
private val gson = GsonBuilder()
15-
.registerTypeAdapter(ShareAttributes::class.java, ShareAttributesDeserializer())
16-
.create()
14+
private val gson =
15+
GsonBuilder()
16+
.registerTypeAdapter(ShareAttributes::class.java, ShareAttributesDeserializer())
17+
.create()
1718

1819
fun toList(jsonString: String?): List<ShareAttributes>? {
1920
if (jsonString == null) {

0 commit comments

Comments
 (0)