Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ tomlj = "1.1.1"

# Linters
androidx-lint = "1.0.0"
# Fix LongParameterList thresholds to preserve behavior when we update from 1.23.8
# see - https://github.com/detekt/detekt/issues/3679
detekt = "1.23.8"
google-java-format = "1.28.0"
ktfmt = "0.64"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import mozilla.components.support.ktx.android.util.dpToPx
* @param isInPrimaryState Lambda to return true/false to indicate checkbox primary or secondary state.
* @param onCheckedChangedListener Callback to be invoked when checkbox is clicked.
*/
@Suppress("LongParameterList")
class BrowserMenuImageTextCheckboxButton(
@DrawableRes imageResource: Int,
private val label: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ sealed class PromptRequest(
* @property onClear callback that is called when the user requests the picker to be clear up.
* @property onDismiss A callback executed when dismissed.
*/
@Suppress("LongParameterList")
class TimeSelection(
val title: String,
val initialDate: java.util.Date,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ import mozilla.components.support.ktx.kotlin.stripCommonSubdomains
* @property ioDispatcher The dispatcher for the work that must not run on the thread the store dispatched on.
* @property chunker Splits article text into the chunks.
*/
@Suppress("LongParameterList")
class ListenMiddleware(
private val browserStore: BrowserStore,
private val contentProvider: ContentProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import mozilla.components.support.base.feature.LifecycleAwareFeature
* @param presenter See [SyncedTabsPresenter].
* @param interactor See [SyncedTabsInteractor].
*/
@Suppress("LongParameterList")
class SyncedTabsFeature(
context: Context,
storage: SyncedTabsStorage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ internal const val NOTIFICATION_ID = 1
* @param activityClass The Activity that the notification will launch if user taps on it
* @param coroutineContext An instance of [CoroutineContext] used for executing async site permission checks.
*/
@Suppress("LongParameterList")
class WebNotificationFeature(
private val context: Context,
private val engine: Engine,
Expand Down
4 changes: 3 additions & 1 deletion mobile/android/android-components/config/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ complexity:
LongParameterList:
active: true
functionThreshold: 8 # (Default: 6) Increased in https://bugzilla.mozilla.org/show_bug.cgi?id=1872996
constructorThreshold: 7
# threshold of 10 means up to 9 parameters are allowed
# this behavior changed in detekt > 1.23.8 see - https://github.com/detekt/detekt/issues/3679
constructorThreshold: 10 # Increased in https://bugzilla.mozilla.org/show_bug.cgi?id=2074093
ignoreDefaultParameters: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/10835
ignoreDataClasses: true
ignoreAnnotatedParameter: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import mozilla.components.support.base.feature.LifecycleAwareFeature
import mozilla.components.ui.widgets.DefaultSnackbarDelegate
import org.mozilla.samples.browser.databinding.FragmentBrowserBinding

@Suppress("LongParameterList", "UndocumentedPublicClass")
@Suppress("UndocumentedPublicClass")
class ContextMenuIntegration(
context: Context,
fragmentManager: FragmentManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import org.mozilla.fenix.ext.nav
import org.mozilla.fenix.utils.Settings

/** Displays an [InfoBanner] when a user visits a website that can be opened in an installed native app. */
@Suppress("LongParameterList")
class OpenInAppOnboardingObserver(
private val context: Context,
private val store: BrowserStore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import org.mozilla.fenix.perf.lazyMonitored
import org.mozilla.fenix.shortcut.PasswordManagerIntentProcessor

/** Component group for miscellaneous components. */
@Suppress("LongParameterList")
class IntentProcessors(
private val context: Context,
private val store: BrowserStore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ data class IPProtectionAuthSources(
)

/** Provides access to IP Protection related components. */
@Suppress("LongParameterList")
class IPProtection(
val engine: Engine,
val browserStore: BrowserStore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ import org.mozilla.fenix.webcompat.WebCompatReporterMoreInfoSender
* @param webCompatReporterMoreInfoSender [WebCompatReporterMoreInfoSender] used to send WebCompat info to
* webcompat.com.
*/
@Suppress("LongParameterList")
class MenuNavigationMiddleware(
private val browserStore: BrowserStore,
private val navController: NavController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import org.mozilla.fenix.utils.Settings
* @param topToolbarHeight The height of the top toolbar.
* @param onToolbarsReset Callback to be invoked when the toolbars need to be reset.
*/
@Suppress("LongParameterList")
class ToolbarsIntegration(
private val fullScreenFeature: () -> FullScreenFeature?,
private val webAppHideToolbarFeature: () -> WebAppHideToolbarFeature?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.maxActiveTime

/** Handles intercepting touch events on the toolbar for swipe gestures and executes the necessary animations. */
@Suppress("LargeClass", "TooManyFunctions", "LongParameterList")
@Suppress("LargeClass", "TooManyFunctions")
class ToolbarHorizontalGesturesHandler(
private val activity: Activity,
private val contentLayout: View,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ private const val BREADCRUMB_CATEGORY = "CollectionsToTabGroupsMigration"
* @param ioDispatcher The [CoroutineDispatcher] used for reading the collections' session snapshots from disk and
* persisting the migration progress.
*/
@Suppress("LongParameterList")
class CollectionsToTabGroupsMigration(
private val tabCollectionStorage: TabCollectionStorage,
private val restoreUseCase: TabsUseCases.RestoreUseCase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import org.mozilla.fenix.components.appstate.AppAction
* @param ioDispatcher The dispatcher to be used for background IO work.
* @param currentTimeMillis provider for the current time in milliseconds, injectable for testing.
*/
@Suppress("LongParameterList")
class RecentSyncedTabFeature(
private val context: Context,
private val appStore: AppStore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ interface RecentVisitsController {
}

/** The default implementation of [RecentVisitsController]. */
@Suppress("LongParameterList")
class DefaultRecentVisitsController(
private val store: BrowserStore,
private val appStore: AppStore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import org.mozilla.fenix.components.toolbar.gestures.ToolbarHorizontalGesturesHa
* out yet.
* @param tabPreview The [TabPreview] used to display the adjacent tab while swiping.
*/
@Suppress("LongParameterList")
class HomeSwipeIntegration(
private val activity: Activity,
private val store: BrowserStore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import org.mozilla.fenix.library.LibraryPageView
import org.mozilla.fenix.theme.ThemeManager

/** View that contains and configures the History List */
@Suppress("LongParameterList")
class HistoryView(
container: ViewGroup,
val store: HistoryFragmentStore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ interface RecentlyClosedController {
fun handleBackPressed(): Boolean
}

@Suppress("TooManyFunctions", "LongParameterList")
@Suppress("TooManyFunctions")
class DefaultRecentlyClosedController(
private val appStore: AppStore,
private val navController: NavController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ internal sealed class EditPageEndActionsInteractions : BrowserToolbarEvent {
* @param scope [CoroutineScope] used for running long running operations in background.
* @param autocompleteDispatcher [CoroutineContext] used for querying autocomplete suggestions.
*/
@Suppress("LongParameterList")
class BrowserToolbarSearchMiddleware(
private val uiContext: Context,
private val appStore: AppStore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ private fun Modifier.awesomeBarContentWidth(useAddressBarFocusMode: Boolean) =
* @param searchAccessPoint Where search was started from.
* @param isEdgeToEdgeBackgroundEnabled Whether the Edge2Edge background is enabled.
*/
@Suppress("LongParameterList")
class AwesomeBarComposable(
private val activity: HomeActivity,
private val fragment: Fragment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import mozilla.components.service.fxa.manager.SyncEnginesStorage
* @param onReconnectClicked A callback executed when the [syncPreference] is clicked with a preference status of
* "Reconnect".
*/
@Suppress("LongParameterList")
class SyncPreferenceView(
private val syncPreference: SyncPreference,
private val lifecycleOwner: LifecycleOwner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import org.mozilla.fenix.ext.nav
import org.mozilla.fenix.settings.SupportUtils
import org.mozilla.fenix.utils.Settings

@Suppress("LongParameterList")
internal class DataChoicesMiddleware(
private val settings: Settings,
private val nimbusSdk: NimbusApi,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import org.mozilla.fenix.settings.SupportUtils
* @param ioDispatcher Coroutine dispatcher for IO operations.
* @param clipboardManager For copying logins URLs.
*/
@Suppress("LongParameterList")
internal class LoginsMiddleware(
private val loginsStorage: LoginsStorage,
private val getNavController: () -> NavController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import org.mozilla.fenix.settings.SupportUtils
import org.mozilla.fenix.settings.SupportUtils.SumoTopic.OPT_OUT_STUDIES
import org.mozilla.fenix.utils.Settings

@Suppress("LongParameterList")
class StudiesView(
private val scope: CoroutineScope,
private val context: Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class TrustPanelStore(
reducer = ::reducer,
middleware = middleware,
) {
@Suppress("LongParameterList")
constructor(
isTrackingProtectionEnabled: Boolean,
websiteInfoState: WebsiteInfoState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import mozilla.components.feature.summarize.summarizationReducer
* embedded settings screen.
* @param errorReporter reports caught exceptions to the crash reporting service.
*/
@Suppress("LongParameterList")
class SummarizationStoreViewModel(
currentTab: SessionState?,
initializedFromShake: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ interface GridInteractionState {
* @param ignoredItems List of keys for non-draggable items.
* @param liveReorderEnabled Whether item reorders should happen 'live' during a drag.
*/
@Suppress("LongParameterList")
class GridInteractionStateImpl
internal constructor(
private val gridState: LazyGridState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ interface ListInteractionState {
* @param liveReorderEnabled Whether reordering should happen 'live' while a drag is active.
* @param onLongPress Optional callback to be invoked when long pressing an item.
*/
@Suppress("LongParameterList")
class ListInteractionStateImpl
internal constructor(
private val listState: LazyListState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ fun createListReorderState(
* @param onLongPress Optional callback to be invoked when long pressing an item.
* @param onExitLongPress Optional callback to be invoked when the item is dragged after long press.
*/
@Suppress("LongParameterList")
class ListReorderState
internal constructor(
private val listState: LazyListState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ internal data class MutableTabGroup(
* @param scope The [CoroutineScope] for running the tab data transformation off of the main thread.
* @param mainScope The [CoroutineScope] used for returning to the main thread.
*/
@Suppress("LargeClass", "LongParameterList")
@Suppress("LargeClass")
class TabStorageMiddleware(
private val inactiveTabsEnabled: Boolean,
private val tabGroupsEnabled: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import org.mozilla.fenix.tabstray.redux.store.TabsTrayStore
* @param accountManager An instance of [FxaAccountManager] used for synced tabs authentication.
* @param lifecycleOwner View lifecycle owner used to determine when to cancel UI jobs.
*/
@Suppress("LongParameterList")
class SyncedTabsIntegration(
private val store: TabsTrayStore,
private val context: Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import org.mozilla.fenix.utils.Settings
* @param currentLocale The locale currently being used on the device.
* @param getDisplaySize Returns the current size of the display, in pixels, that a full screen wallpaper has to cover.
*/
@Suppress("LongParameterList")
class WallpapersUseCases(
settings: Settings,
filesDir: File,
Expand Down Expand Up @@ -108,7 +107,6 @@ class WallpapersUseCases(
suspend operator fun invoke()
}

@Suppress("LongParameterList")
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
internal class DefaultInitializeWallpaperUseCase(
private val appStore: AppStore,
Expand Down
4 changes: 3 additions & 1 deletion mobile/android/fenix/config/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ complexity:
LongParameterList:
active: true
functionThreshold: 8 # (Default: 6) Increased in https://bugzilla.mozilla.org/show_bug.cgi?id=1872996
constructorThreshold: 7
# threshold of 10 means up to 9 parameters are allowed
# this behavior changed in detekt > 1.23.8 see - https://github.com/detekt/detekt/issues/3679
constructorThreshold: 10 # Increased in https://bugzilla.mozilla.org/show_bug.cgi?id=2074093
ignoreDefaultParameters: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/10835
ignoreDataClasses: true
ignoreAnnotatedParameter: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import org.mozilla.focus.ext.hide
import org.mozilla.focus.ext.showAsFixed

/** Integration for the full-screen feature, managing immersive mode and toolbar visibility. */
@Suppress("LongParameterList")
class FullScreenIntegration(
val activity: Activity,
val store: BrowserStore,
Expand Down
4 changes: 3 additions & 1 deletion mobile/android/focus-android/quality/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ complexity:
LongParameterList:
active: true
functionThreshold: 8 # (Default: 6) Increased in https://bugzilla.mozilla.org/show_bug.cgi?id=1872996
constructorThreshold: 7
# threshold of 10 means up to 9 parameters are allowed
# this behavior changed in detekt > 1.23.8 see - https://github.com/detekt/detekt/issues/3679
constructorThreshold: 10 # Increased in https://bugzilla.mozilla.org/show_bug.cgi?id=2074093
ignoreDefaultParameters: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/10835
ignoreDataClasses: true
ignoreAnnotatedParameter: []
Expand Down
Loading