Skip to content

Commit

Permalink
ANDROID-11179 LongMethod issue ignored on Composable annotated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jmanriquehiberus committed Sep 24, 2024
1 parent 3ff5363 commit 8305ea3
Show file tree
Hide file tree
Showing 23 changed files with 5 additions and 25 deletions.
3 changes: 3 additions & 0 deletions build-tools/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ complexity:
active: false
LongParameterList:
active: false
LongMethod:
ignoreAnnotated: 'Composable'


style:
NewLineAtEndOfFile:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ fun Buttons() {
}

@Composable
@Suppress("LongMethod")
private fun Buttons(
modifier: Modifier = Modifier,
filter: (ButtonStyle) -> Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import com.telefonica.mistica.compose.input.DropDownInput
import com.telefonica.mistica.compose.theme.MisticaTheme

@Composable
@Suppress("LongMethod")
fun Callouts() {
Column(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import com.telefonica.mistica.tag.TagView
import com.telefonica.mistica.tag.TagView.Companion.TYPE_PROMO

@Composable
@Suppress("LongMethod")
fun DataCards() {

var tag: String by remember { mutableStateOf("tag") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

@Composable
@Suppress("LongMethod")
fun EmptyStateCards() {

val retryDelay = 2000L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

@Composable
@Suppress("LongMethod")
fun EmptyStateScreens() {

var shouldShowEmptyStateScreen by remember { mutableStateOf(false) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

@Composable
@Suppress("LongMethod")
fun Feedbacks(
@StyleRes themeOverride: Int? = null,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import com.telefonica.mistica.compose.theme.MisticaTheme

@Preview(showSystemUi = true)
@Composable
@Suppress("LongMethod")
fun HighlightedCards() {
val context = LocalContext.current
var cardTitle by remember { mutableStateOf("Card Title Text") }
Expand Down Expand Up @@ -234,7 +233,6 @@ fun HighLightedImageType(imageConfig: HighLightCardImageConfig, onImageTypeSelec
}

@Composable
@Suppress("LongMethod")
fun HighLightedCardButtonType(buttonConfig: HighLightCardButtonSettings, onButtonTypeSelected: (HighLightCardButtonSettings) -> Unit) {
Card(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const val SUBTITLE = "Subtitle"
const val DESCRIPTION = "Description"

@Composable
@Suppress("LongMethod")
fun samples() = listOf(
ListItem(
title = TITLE,
Expand Down Expand Up @@ -302,7 +301,6 @@ fun samples() = listOf(
const val IMAGE_URL = "https://www.fotoaparat.cz/imgs/a/26/2639/0n1wjdf0-cr-em13-09-1200x627x9.jpg"

@Composable
@Suppress("LongMethod")
fun Lists() {
val samples = samples()
val context = LocalContext.current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import com.telefonica.mistica.compose.tag.Tag
import com.telefonica.mistica.tag.TagView.Companion.TYPE_PROMO

@Composable
@Suppress("LongMethod")
fun MediaCards() {

var tag: String by remember { mutableStateOf("tag") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import com.telefonica.mistica.compose.popover.PopOver
import com.telefonica.mistica.compose.theme.MisticaTheme

@Composable
@Suppress("LongMethod")
fun PopOvers() {

var title: String by remember { mutableStateOf("Title of the pop over") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import com.telefonica.mistica.compose.skeleton.TextSkeleton
import com.telefonica.mistica.compose.theme.MisticaTheme

@Composable
@Suppress("LongMethod")
fun Skeletons() {
val infiniteTransition: InfiniteTransition =
rememberInfiniteTransition()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import com.telefonica.mistica.compose.tabs.Tabs
import com.telefonica.mistica.compose.theme.MisticaTheme

@Composable
@Suppress("LongMethod")
fun TabsCatalog() {
Column(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import com.telefonica.mistica.compose.theme.brand.MovistarBrand
import com.telefonica.mistica.tag.TagView

@Composable
@Suppress("LongMethod")
fun Tags() {
val customText = remember { mutableStateOf(TextFieldValue("Promotion")) }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import androidx.compose.ui.Modifier
import com.telefonica.mistica.compose.theme.MisticaTheme

@Composable
@Suppress("LongMethod")
fun Texts() {
Column(
modifier = Modifier.fillMaxSize(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class ProgressButton : FrameLayout {
}

@SuppressLint("ClickableViewAccessibility")
@Suppress("LongMethod")
private fun init(attrs: AttributeSet? = null, defStyleAttr: Int = 0) {
if (attrs != null) {
val theme = context.theme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import com.telefonica.mistica.compose.card.datacard.resourceIconPainter
import com.telefonica.mistica.compose.theme.MisticaTheme

@Composable
@Suppress("LongMethod")
fun Callout(
modifier: Modifier = Modifier,
title: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import com.telefonica.mistica.compose.button.ButtonStyle
import com.telefonica.mistica.compose.theme.MisticaTheme

@Composable
@Suppress("LongMethod")
fun HighLightedCard(
modifier: Modifier = Modifier,
title: String = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import com.telefonica.mistica.compose.theme.MisticaTheme

@OptIn(ExperimentalPagerApi::class)
@SuppressLint("MutableCollectionMutableState")
@Suppress("LongMethod")
@Composable
fun CarouselPagerIndicator(
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fun ListRowItem(
}

@Composable
@Suppress("LongMethod", "CyclomaticComplexMethod")
@Suppress("CyclomaticComplexMethod")
private fun ListRowItemImp(
modifier: Modifier = Modifier,
icon: @Composable (() -> Unit)? = null,
Expand Down Expand Up @@ -285,7 +285,6 @@ object ListRowItemTestTags {

@Preview(showBackground = true)
@Composable
@Suppress("LongMethod")
fun ListRowItemPreview() {
MisticaTheme(brand = MovistarBrand) {
val checkedState = remember { mutableStateOf(true) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import com.telefonica.mistica.compose.theme.MisticaTheme

@OptIn(ExperimentalComposeUiApi::class)
@Composable
@Suppress("LongMethod")
fun PopOver(
modifier: Modifier = Modifier,
@DrawableRes imageRes: Int?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import kotlinx.coroutines.launch

@Composable
@UiComposable
@Suppress("LongMethod", "CyclomaticComplexMethod")
@Suppress("CyclomaticComplexMethod")
fun Tabs(
modifier: Modifier = Modifier,
selectedIndex: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import com.telefonica.mistica.compose.theme.values.MisticaRadius
import com.telefonica.mistica.compose.theme.values.MisticaValues

@Composable
@Suppress("LongMethod")
fun MisticaTheme(
brand: Brand,
darkTheme: Boolean = isSystemInDarkTheme(),
Expand Down

0 comments on commit 8305ea3

Please sign in to comment.