Skip to content

Commit aec6581

Browse files
committed
Suppress Codacy findings in NextcloudViewMatchers.kt
Working around the limitation of returns as well as the condition complexity was attempted but made the code just less readable. Ignoring these two specific findings is more appropriate here. Signed-off-by: Philipp Hasper <[email protected]>
1 parent b2387fb commit aec6581

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/src/androidTest/java/com/nextcloud/test/NextcloudViewMatchers.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ fun withSelectedText(expected: String): Matcher<View> = object : TypeSafeMatcher
1818
description.appendText("with selected text \"$expected\"")
1919
}
2020

21+
@Suppress("ReturnCount")
2122
override fun matchesSafely(view: View): Boolean {
2223
if (view !is TextView) return false
2324
val text = view.text?.toString() ?: ""
2425
val s = view.selectionStart
2526
val e = view.selectionEnd
27+
@Suppress("ComplexCondition")
2628
if (s < 0 || e < 0 || s > e || e > text.length) return false
2729
return text.substring(s, e) == expected
2830
}

0 commit comments

Comments
 (0)