Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Adjust detekt TooManyFunctions threshold #9927

Merged
merged 2 commits into from Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -33,7 +33,7 @@ internal const val INITIAL_NUMBER_OF_PROVIDERS = 5
/**
* A customizable [AwesomeBar] implementation.
*/
@Suppress("TooManyFunctions", "LargeClass")
@Suppress("LargeClass")
class BrowserAwesomeBar @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
Expand Down
Expand Up @@ -13,7 +13,6 @@ import org.junit.Assert.assertTrue
import org.junit.Test

@MediumTest
@Suppress("TooManyFunctions")
class GeckoViewFetchTestCases : mozilla.components.tooling.fetch.tests.FetchTestCases() {
override fun createNewClient(): Client = GeckoViewFetchClient(ApplicationProvider.getApplicationContext())

Expand Down
Expand Up @@ -65,7 +65,7 @@ import java.lang.ref.WeakReference
/**
* Gecko-based implementation of Engine interface.
*/
@Suppress("TooManyFunctions", "LargeClass")
@Suppress("LargeClass")
class GeckoEngine(
context: Context,
private val defaultSettings: Settings? = null,
Expand Down
Expand Up @@ -24,7 +24,6 @@ import org.mozilla.geckoview.GeckoSession
/**
* Gecko-based EngineView implementation.
*/
@Suppress("TooManyFunctions")
class GeckoEngineView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
Expand Down
Expand Up @@ -26,7 +26,7 @@ import org.mozilla.geckoview.PanZoomController.INPUT_RESULT_UNHANDLED
* https://github.com/takahirom/webview-in-coordinatorlayout
*/

@Suppress("TooManyFunctions", "ClickableViewAccessibility")
@Suppress("ClickableViewAccessibility")
open class NestedGeckoView(context: Context) : GeckoView(context), NestedScrollingChild {

@VisibleForTesting
Expand Down
Expand Up @@ -54,7 +54,6 @@ typealias AC_FILE_FACING_MODE = PromptRequest.File.FacingMode
/**
* Gecko-based PromptDelegate implementation.
*/
@Suppress("TooManyFunctions")
internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSession) :
PromptDelegate {

Expand Down
Expand Up @@ -31,7 +31,6 @@ import org.mozilla.geckoview.WebExtension.Action as GeckoNativeWebExtensionActio
* Gecko-based implementation of [WebExtension], wrapping the native web
* extension object provided by GeckoView.
*/
@Suppress("TooManyFunctions")
class GeckoWebExtension(
val nativeExtension: GeckoNativeWebExtension,
val runtime: GeckoRuntime
Expand Down
Expand Up @@ -13,7 +13,6 @@ import org.junit.Assert.assertTrue
import org.junit.Test

@MediumTest
@Suppress("TooManyFunctions")
class GeckoViewFetchTestCases : mozilla.components.tooling.fetch.tests.FetchTestCases() {
override fun createNewClient(): Client = GeckoViewFetchClient(ApplicationProvider.getApplicationContext())

Expand Down
Expand Up @@ -65,7 +65,7 @@ import java.lang.ref.WeakReference
/**
* Gecko-based implementation of Engine interface.
*/
@Suppress("TooManyFunctions", "LargeClass")
@Suppress("LargeClass")
class GeckoEngine(
context: Context,
private val defaultSettings: Settings? = null,
Expand Down
Expand Up @@ -24,7 +24,6 @@ import org.mozilla.geckoview.GeckoSession
/**
* Gecko-based EngineView implementation.
*/
@Suppress("TooManyFunctions")
class GeckoEngineView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
Expand Down
Expand Up @@ -26,7 +26,7 @@ import org.mozilla.geckoview.PanZoomController.INPUT_RESULT_UNHANDLED
* https://github.com/takahirom/webview-in-coordinatorlayout
*/

@Suppress("TooManyFunctions", "ClickableViewAccessibility")
@Suppress("ClickableViewAccessibility")
open class NestedGeckoView(context: Context) : GeckoView(context), NestedScrollingChild {

@VisibleForTesting
Expand Down
Expand Up @@ -54,7 +54,6 @@ typealias AC_FILE_FACING_MODE = PromptRequest.File.FacingMode
/**
* Gecko-based PromptDelegate implementation.
*/
@Suppress("TooManyFunctions")
internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSession) :
PromptDelegate {

Expand Down
Expand Up @@ -31,7 +31,6 @@ import org.mozilla.geckoview.WebExtension.Action as GeckoNativeWebExtensionActio
* Gecko-based implementation of [WebExtension], wrapping the native web
* extension object provided by GeckoView.
*/
@Suppress("TooManyFunctions")
class GeckoWebExtension(
val nativeExtension: GeckoNativeWebExtension,
val runtime: GeckoRuntime
Expand Down
Expand Up @@ -13,7 +13,6 @@ import org.junit.Assert.assertTrue
import org.junit.Test

@MediumTest
@Suppress("TooManyFunctions")
class GeckoViewFetchTestCases : mozilla.components.tooling.fetch.tests.FetchTestCases() {
override fun createNewClient(): Client = GeckoViewFetchClient(ApplicationProvider.getApplicationContext())

Expand Down
Expand Up @@ -65,7 +65,7 @@ import java.lang.ref.WeakReference
/**
* Gecko-based implementation of Engine interface.
*/
@Suppress("TooManyFunctions", "LargeClass")
@Suppress("LargeClass")
class GeckoEngine(
context: Context,
private val defaultSettings: Settings? = null,
Expand Down
Expand Up @@ -24,7 +24,6 @@ import org.mozilla.geckoview.GeckoSession
/**
* Gecko-based EngineView implementation.
*/
@Suppress("TooManyFunctions")
class GeckoEngineView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
Expand Down
Expand Up @@ -26,7 +26,7 @@ import org.mozilla.geckoview.PanZoomController.INPUT_RESULT_UNHANDLED
* https://github.com/takahirom/webview-in-coordinatorlayout
*/

@Suppress("TooManyFunctions", "ClickableViewAccessibility")
@Suppress("ClickableViewAccessibility")
open class NestedGeckoView(context: Context) : GeckoView(context), NestedScrollingChild {

@VisibleForTesting
Expand Down
Expand Up @@ -54,7 +54,6 @@ typealias AC_FILE_FACING_MODE = PromptRequest.File.FacingMode
/**
* Gecko-based PromptDelegate implementation.
*/
@Suppress("TooManyFunctions")
internal class GeckoPromptDelegate(private val geckoEngineSession: GeckoEngineSession) :
PromptDelegate {

Expand Down
Expand Up @@ -31,7 +31,6 @@ import org.mozilla.geckoview.WebExtension.Action as GeckoNativeWebExtensionActio
* Gecko-based implementation of [WebExtension], wrapping the native web
* extension object provided by GeckoView.
*/
@Suppress("TooManyFunctions")
class GeckoWebExtension(
val nativeExtension: GeckoNativeWebExtension,
val runtime: GeckoRuntime
Expand Down
Expand Up @@ -29,8 +29,6 @@ import mozilla.components.concept.engine.EngineView
* Based on:
* https://github.com/takahirom/webview-in-coordinatorlayout
*/

@Suppress("TooManyFunctions")
class NestedWebView(context: Context) : WebView(context), NestedScrollingChild {

@VisibleForTesting
Expand Down
Expand Up @@ -24,7 +24,6 @@ import kotlin.coroutines.CoroutineContext
/**
* This class provides access to a centralized registry of search engines.
*/
@Suppress("TooManyFunctions")
class SearchEngineManager(
private val providers: List<SearchEngineProvider> = listOf(
AssetsSearchEngineProvider(LocaleSearchLocalizationProvider())),
Expand Down
Expand Up @@ -33,7 +33,7 @@ import org.json.JSONObject
* Optionally <code>additionalIdentifiers</code> to be loaded can be specified. A search engine
* identifier corresponds to the search plugin XML file name (e.g. duckduckgo -> duckduckgo.xml).
*/
@Suppress("TooManyFunctions", "LargeClass")
@Suppress("LargeClass")
class AssetsSearchEngineProvider(
private val localizationProvider: SearchLocalizationProvider,
private val filters: List<SearchEngineFilter> = emptyList(),
Expand Down
Expand Up @@ -16,7 +16,7 @@ import kotlin.math.min
/**
* This class provides access to a centralized registry of all active sessions.
*/
@Suppress("TooManyFunctions", "LargeClass")
@Suppress("LargeClass")
class LegacySessionManager(
val engine: Engine,
delegate: DeprecatedObserverRegistry<SessionManager.Observer> = DeprecatedObserverRegistry()
Expand Down
Expand Up @@ -34,7 +34,7 @@ import kotlin.properties.Delegates
/**
* Value type that represents the state of a browser session. Changes can be observed.
*/
@Suppress("TooManyFunctions", "LongParameterList")
@Suppress("LongParameterList")
class Session(
initialUrl: String,
val private: Boolean = false,
Expand Down
Expand Up @@ -33,7 +33,7 @@ import mozilla.components.support.base.observer.DeprecatedObservable
/**
* This class provides access to a centralized registry of all active sessions.
*/
@Suppress("TooManyFunctions", "LargeClass")
@Suppress("LargeClass")
class SessionManager(
val engine: Engine,
private val store: BrowserStore? = null,
Expand Down
Expand Up @@ -25,7 +25,6 @@ import mozilla.components.support.base.log.logger.Logger
* [Middleware] responsible for delegating calls to the appropriate [EngineSession] instance for
* actions like [EngineAction.LoadUrlAction].
*/
@Suppress("TooManyFunctions")
internal class EngineDelegateMiddleware(
private val engine: Engine,
private val sessionLookup: (String) -> Session?,
Expand Down
Expand Up @@ -25,7 +25,6 @@ const val AUTOCOMPLETE_SOURCE_NAME = "memoryHistory"
/**
* An in-memory implementation of [mozilla.components.concept.storage.HistoryStorage].
*/
@SuppressWarnings("TooManyFunctions")
class InMemoryHistoryStorage : HistoryStorage {
@VisibleForTesting
internal var pages: HashMap<String, MutableList<Visit>> = linkedMapOf()
Expand Down
Expand Up @@ -61,7 +61,6 @@ internal interface Connection : Closeable {
/**
* A singleton implementation of the [Connection] interface backed by the Rust Places library.
*/
@Suppress("TooManyFunctions")
internal object RustPlacesConnection : Connection {
@GuardedBy("this")
private var api: PlacesApi? = null
Expand Down
Expand Up @@ -21,7 +21,6 @@ import org.json.JSONObject
/**
* Implementation of the [BookmarksStorage] which is backed by a Rust Places lib via [PlacesApi].
*/
@Suppress("TooManyFunctions")
open class PlacesBookmarksStorage(context: Context) : PlacesStorage(context), BookmarksStorage, SyncableStore {

override val logger = Logger("PlacesBookmarksStorage")
Expand Down
Expand Up @@ -32,7 +32,6 @@ const val AUTOCOMPLETE_SOURCE_NAME = "placesHistory"
/**
* Implementation of the [HistoryStorage] which is backed by a Rust Places lib via [PlacesApi].
*/
@SuppressWarnings("TooManyFunctions")
open class PlacesHistoryStorage(
context: Context,
crashReporter: CrashReporting? = null
Expand Down
Expand Up @@ -25,7 +25,6 @@ typealias ViewHolderProvider = (ViewGroup) -> TabViewHolder
* @param viewHolderProvider a function that creates a `TabViewHolder`.
* @param delegate TabsTray.Observer registry to allow `TabsAdapter` to conform to `Observable<TabsTray.Observer>`.
*/
@Suppress("TooManyFunctions")
open class TabsAdapter(
thumbnailLoader: ImageLoader? = null,
private val viewHolderProvider: ViewHolderProvider = { parent ->
Expand Down
Expand Up @@ -59,7 +59,6 @@ const val MAX_URI_LENGTH = 25000
* +----------------+ +----------------+
* ```
*/
@Suppress("TooManyFunctions")
class BrowserToolbar @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
Expand Down
Expand Up @@ -38,7 +38,6 @@ enum class ToolbarPosition {
* - On showing a [Snackbar] position it above the [BrowserToolbar].
* - Snap the [BrowserToolbar] to be hidden or visible when the user stops scrolling.
*/
@Suppress("TooManyFunctions")
class BrowserToolbarBehavior(
val context: Context?,
attrs: AttributeSet?,
Expand Down
Expand Up @@ -65,7 +65,7 @@ import mozilla.components.concept.toolbar.Toolbar
* Progress (optional):
* A horizontal progress bar showing the loading progress (at the top or bottom of the toolbar).
*/
@Suppress("LargeClass", "TooManyFunctions")
@Suppress("LargeClass")
class DisplayToolbar internal constructor(
private val context: Context,
private val toolbar: BrowserToolbar,
Expand Down
Expand Up @@ -50,7 +50,7 @@ private const val AUTOCOMPLETE_QUERY_THREADS = 3
* - actions: Optional action icons injected by other components (e.g. barcode scanner)
* - exit: Button that switches back to display mode or invoke an app-defined callback.
*/
@Suppress("TooManyFunctions", "LargeClass")
@Suppress("LargeClass")
class EditToolbar internal constructor(
context: Context,
private val toolbar: BrowserToolbar,
Expand Down
Expand Up @@ -7,7 +7,6 @@ package mozilla.components.concept.engine
/**
* Contract to indicate how objects with the ability to clear data should behave.
*/
@Suppress("TooManyFunctions")
interface DataCleanable {
/**
* Clears browsing data stored.
Expand Down
Expand Up @@ -22,7 +22,6 @@ import org.json.JSONObject
/**
* Entry point for interacting with the engine implementation.
*/
@Suppress("TooManyFunctions")
interface Engine : WebExtensionRuntime, DataCleanable {

/**
Expand Down
Expand Up @@ -13,7 +13,6 @@ import mozilla.components.concept.engine.selection.SelectionActionDelegate
/**
* View component that renders web content.
*/
@Suppress("TooManyFunctions")
interface EngineView {

/**
Expand Down
Expand Up @@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

@file:Suppress("TooManyFunctions")

package mozilla.components.concept.engine.manifest

import android.graphics.Color
Expand Down
Expand Up @@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

@file:Suppress("TooManyFunctions")

package mozilla.components.concept.engine.manifest.parser

import mozilla.components.concept.engine.manifest.Size
Expand Down
Expand Up @@ -20,7 +20,6 @@ import org.json.JSONObject
* @property supportActions whether or not browser and page actions are handled when
* received from the web extension
*/
@Suppress("TooManyFunctions")
abstract class WebExtension(
val id: String,
val url: String,
Expand Down
Expand Up @@ -11,7 +11,6 @@ import mozilla.components.concept.engine.EngineSession
* extensions e.g. an extension was installed, or an extension wants to open
* a new tab.
*/
@Suppress("TooManyFunctions")
interface WebExtensionDelegate {

/**
Expand Down
Expand Up @@ -9,7 +9,6 @@ import kotlinx.coroutines.Deferred
/**
* An interface which defines read/write methods for credit card and address data.
*/
@SuppressWarnings("TooManyFunctions")
interface CreditCardsAddressesStorage {

/**
Expand Down
Expand Up @@ -7,7 +7,6 @@ package mozilla.components.concept.storage
/**
* An interface which defines read/write methods for history data.
*/
@SuppressWarnings("TooManyFunctions")
interface HistoryStorage : Storage {
/**
* Records a visit to a page.
Expand Down
Expand Up @@ -10,7 +10,6 @@ import org.json.JSONObject
/**
* An interface describing a storage layer for logins/passwords.
*/
@SuppressWarnings("TooManyFunctions")
interface LoginsStorage : AutoCloseable {
/**
* Deletes all login records. These deletions will be synced to the server on the next call to sync.
Expand Down
@@ -1,7 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@file:SuppressWarnings("TooManyFunctions")

package mozilla.components.concept.sync

import android.content.Context
Expand Down
Expand Up @@ -43,7 +43,6 @@ data class MigratingAccountInfo(
/**
* Facilitates testing consumers of FirefoxAccount.
*/
@SuppressWarnings("TooManyFunctions")
interface OAuthAccount : AutoCloseable {

/**
Expand Down