Skip to content

Commit e86f3ef

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 <vcs@hasper.info>
1 parent a99eec4 commit e86f3ef

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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)