From 3cb6321fdb88a7e05169e4ecdc777c60c139faac Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Wed, 20 Sep 2023 23:07:44 +0200 Subject: [PATCH] improve code formatting for detekt score Signed-off-by: Andy Scherzinger --- .../java/com/nextcloud/talk/utils/UriUtilsIT.kt | 2 +- .../main/java/com/nextcloud/talk/utils/UriUtils.kt | 13 ++++++++++--- detekt.yml | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/src/androidTest/java/com/nextcloud/talk/utils/UriUtilsIT.kt b/app/src/androidTest/java/com/nextcloud/talk/utils/UriUtilsIT.kt index ef4b7be2a03..0312b166d54 100644 --- a/app/src/androidTest/java/com/nextcloud/talk/utils/UriUtilsIT.kt +++ b/app/src/androidTest/java/com/nextcloud/talk/utils/UriUtilsIT.kt @@ -152,4 +152,4 @@ class UriUtilsIT { UriUtils.extractInstanceInternalFileFileIdNew("https://cloud.nextcloud.com/apps/files/files/42?dir=/") ) } -} +} diff --git a/app/src/main/java/com/nextcloud/talk/utils/UriUtils.kt b/app/src/main/java/com/nextcloud/talk/utils/UriUtils.kt index 19cb39a1acd..f4ca0cfea7f 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/UriUtils.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/UriUtils.kt @@ -48,13 +48,20 @@ class UriUtils { fun isInstanceInternalFileUrl(baseUrl: String, url: String): Boolean { // https://cloud.nextcloud.com/apps/files/?dir=/Engineering&fileid=41 - return (url.startsWith("$baseUrl/apps/files/") || url.startsWith("$baseUrl/index.php/apps/files/")) && - Uri.parse(url).queryParameterNames.contains("fileid") && Regex(""".*fileid=\d*""").matches(url) + return ( + url.startsWith("$baseUrl/apps/files/") || + url.startsWith("$baseUrl/index.php/apps/files/") + ) && + Uri.parse(url).queryParameterNames.contains("fileid") && + Regex(""".*fileid=\d*""").matches(url) } fun isInstanceInternalFileUrlNew(baseUrl: String, url: String): Boolean { // https://cloud.nextcloud.com/apps/files/files/41?dir=/ - return url.startsWith("$baseUrl/apps/files/files/") || url.startsWith("$baseUrl/index.php/apps/files/files/") + return url.startsWith( + "$baseUrl/apps/files/files/") || + url.startsWith("$baseUrl/index.php/apps/files/files/" + ) } fun extractInstanceInternalFileFileIdNew(url: String): String { diff --git a/detekt.yml b/detekt.yml index 066a0a18199..089cbd7f6e8 100644 --- a/detekt.yml +++ b/detekt.yml @@ -1,5 +1,5 @@ build: - maxIssues: 117 + maxIssues: 116 weights: # complexity: 2 # LongParameterList: 1