Skip to content

Commit

Permalink
improve code formatting for detekt score
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
  • Loading branch information
AndyScherzinger committed Sep 20, 2023
1 parent 838b14b commit 3cb6321
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ class UriUtilsIT {
UriUtils.extractInstanceInternalFileFileIdNew("https://cloud.nextcloud.com/apps/files/files/42?dir=/")
)
}
}
}
13 changes: 10 additions & 3 deletions app/src/main/java/com/nextcloud/talk/utils/UriUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion detekt.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build:
maxIssues: 117
maxIssues: 116
weights:
# complexity: 2
# LongParameterList: 1
Expand Down

0 comments on commit 3cb6321

Please sign in to comment.