Skip to content

Commit a12d01f

Browse files
SONARKT-618 Rule S7410: Keyboard cache should be disabled for password inputs
1 parent 70f4edc commit a12d01f

File tree

23 files changed

+986
-0
lines changed

23 files changed

+986
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package androidx.compose.foundation.text
2+
3+
import androidx.compose.ui.text.input.KeyboardCapitalization
4+
import androidx.compose.ui.text.input.KeyboardType
5+
6+
// Partial stubbing of the primary constructor
7+
class KeyboardOptions(
8+
val capitalization: KeyboardCapitalization = KeyboardCapitalization.Unspecified,
9+
val autoCorrectEnabled: Boolean? = null,
10+
val keyboardType: KeyboardType = KeyboardType.Unspecified,
11+
// ...
12+
) {
13+
companion object {
14+
val Default = KeyboardOptions()
15+
}
16+
17+
// Partial stubbing of parameters
18+
fun copy(
19+
capitalization: KeyboardCapitalization = this.capitalization,
20+
autoCorrectEnabled: Boolean? = this.autoCorrectEnabled,
21+
keyboardType: KeyboardType = this.keyboardType,
22+
// ...
23+
) : KeyboardOptions {
24+
throw Exception("Stub!")
25+
}
26+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package androidx.compose.foundation.text.input
2+
3+
import androidx.compose.ui.text.TextRange
4+
5+
// Partial stubbing of the primary constructor
6+
class TextFieldState {
7+
constructor(
8+
initialText: String = "",
9+
initialSelection: TextRange = TextRange(initialText.length)
10+
// ...
11+
) {
12+
throw Exception("Stub!")
13+
}
14+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package androidx.compose.material
2+
3+
import androidx.compose.foundation.text.KeyboardOptions
4+
import androidx.compose.foundation.text.input.TextFieldState
5+
import androidx.compose.ui.Modifier
6+
import androidx.compose.ui.text.input.VisualTransformation
7+
8+
// Partial stubbing of parameters
9+
fun OutlinedTextField(
10+
state: TextFieldState,
11+
modifier: Modifier = Modifier,
12+
enabled: Boolean = true,
13+
readOnly: Boolean = false,
14+
// ...
15+
) {
16+
throw Exception("Stub!")
17+
}
18+
19+
// Partial stubbing of parameters
20+
fun OutlinedTextField(
21+
value: String,
22+
onValueChange: (String) -> Unit,
23+
// ...
24+
visualTransformation: VisualTransformation = VisualTransformation.None,
25+
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
26+
// ...
27+
) {
28+
throw Exception("Stub!")
29+
}
30+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package androidx.compose.material
2+
3+
// Partial stubbing of parameters
4+
fun SecureTextField(
5+
// ...
6+
) {
7+
throw Exception("Stub!")
8+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package androidx.compose.material
2+
3+
import androidx.compose.foundation.text.KeyboardOptions
4+
import androidx.compose.ui.text.input.VisualTransformation
5+
6+
// Partial stubbing of parameters
7+
fun TextField(
8+
value: String,
9+
onValueChange: (String) -> Unit,
10+
// ...
11+
visualTransformation: VisualTransformation = VisualTransformation.None,
12+
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
13+
// ...
14+
) {
15+
throw Exception("Stub!")
16+
}
17+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package androidx.compose.material3
2+
3+
import androidx.compose.foundation.text.KeyboardOptions
4+
import androidx.compose.foundation.text.input.TextFieldState
5+
import androidx.compose.ui.Modifier
6+
import androidx.compose.ui.text.input.VisualTransformation
7+
8+
// Partial stubbing of parameters
9+
fun OutlinedTextField(
10+
state: TextFieldState,
11+
modifier: Modifier = Modifier,
12+
enabled: Boolean = true,
13+
readOnly: Boolean = false,
14+
// ...
15+
) {
16+
throw Exception("Stub!")
17+
}
18+
19+
// Partial stubbing of parameters
20+
fun OutlinedTextField(
21+
value: String,
22+
onValueChange: (String) -> Unit,
23+
// ...
24+
visualTransformation: VisualTransformation = VisualTransformation.None,
25+
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
26+
// ...
27+
) {
28+
throw Exception("Stub!")
29+
}
30+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package androidx.compose.material3
2+
3+
// Partial stubbing of parameters
4+
fun SecureTextField(
5+
// ...
6+
) {
7+
throw Exception("Stub!")
8+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package androidx.compose.material3
2+
3+
import androidx.compose.foundation.text.KeyboardOptions
4+
import androidx.compose.ui.text.input.VisualTransformation
5+
6+
// Partial stubbing of parameters
7+
fun TextField(
8+
value: String,
9+
onValueChange: (String) -> Unit,
10+
// ...
11+
visualTransformation: VisualTransformation = VisualTransformation.None,
12+
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
13+
// ...
14+
) {
15+
throw Exception("Stub!")
16+
}
17+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package androidx.compose.ui
2+
3+
class AnnotatedString
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package androidx.compose.ui
2+
3+
interface Modifier {
4+
companion object : Modifier
5+
}

0 commit comments

Comments
 (0)