diff --git a/OneSignalSDK/build.gradle b/OneSignalSDK/build.gradle index 7273ef585..abd5f3109 100644 --- a/OneSignalSDK/build.gradle +++ b/OneSignalSDK/build.gradle @@ -9,12 +9,14 @@ buildscript { minSdkVersion: 21 ] androidGradlePluginVersion = '8.8.2' + detektVersion = '1.23.8' googleServicesGradlePluginVersion = '4.3.10' huaweiAgconnectVersion = '1.9.1.304' huaweiHMSPushVersion = '6.3.0.304' huaweiHMSLocationVersion = '4.0.0.300' kotlinVersion = '1.7.10' kotestVersion = '5.8.0' + ioMockVersion = '1.13.2' ktlintVersion = '1.0.1' // Used by Spotless for Kotlin formatting spotlessVersion = '6.25.0' tdunningJsonForTest = '1.0' // DO NOT upgrade for tests, using an old version so it matches AOSP @@ -31,6 +33,7 @@ buildscript { "com.google.gms:google-services:$googleServicesGradlePluginVersion", "com.huawei.agconnect:agcp:$huaweiAgconnectVersion", "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion", + "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion", "com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion", "com.vanniktech.maven.publish:com.vanniktech.maven.publish.gradle.plugin:0.32.0" ] @@ -55,3 +58,27 @@ allprojects { maven { url 'https://developer.huawei.com/repo/' } } } + +subprojects { + plugins.withId("io.gitlab.arturbosch.detekt") { + afterEvaluate { + def configureDetektTask = { task -> + // Only analyze main source sets + task.source = files( + "$projectDir/src/main/java", + "$projectDir/src/main/kotlin" + ) + // Exclude all test-related files and directories + task.exclude "**/test/**", "**/androidTest/**", "**/src/test/**", "**/src/androidTest/**", + "**/*Test.kt", "**/*Tests.kt", "**/*Spec.kt", + "**/*Test.java", "**/*Tests.java", "**/*Spec.java" + + // Enable type resolution to catch !! operator + task.jvmTarget = "1.8" + } + + tasks.withType(io.gitlab.arturbosch.detekt.Detekt).configureEach(configureDetektTask) + tasks.withType(io.gitlab.arturbosch.detekt.DetektCreateBaselineTask).configureEach(configureDetektTask) + } + } +} diff --git a/OneSignalSDK/detekt/detekt-baseline-core.xml b/OneSignalSDK/detekt/detekt-baseline-core.xml new file mode 100644 index 000000000..e177255e5 --- /dev/null +++ b/OneSignalSDK/detekt/detekt-baseline-core.xml @@ -0,0 +1,487 @@ + + + + + ComplexCondition:PropertiesModelStoreListener.kt$PropertiesModelStoreListener$path.startsWith(PropertiesModel::locationTimestamp.name) || path.startsWith(PropertiesModel::locationBackground.name) || path.startsWith(PropertiesModel::locationType.name) || path.startsWith(PropertiesModel::locationAccuracy.name) + ComplexCondition:TrackGooglePurchase.kt$TrackGooglePurchase.Companion$args.size == 4 && args[0] == Int::class.javaPrimitiveType && args[1] == String::class.java && args[2] == String::class.java && args[3] == Bundle::class.java && returnType == Bundle::class.java + ComplexCondition:TrackGooglePurchase.kt$TrackGooglePurchase.Companion$args.size == 4 && args[0] == Int::class.javaPrimitiveType && args[1] == String::class.java && args[2] == String::class.java && args[3] == String::class.java + ConstructorParameterNaming:BackgroundManager.kt$BackgroundManager$private val _applicationService: IApplicationService + ConstructorParameterNaming:BackgroundManager.kt$BackgroundManager$private val _backgroundServices: List<(IBackgroundService)> + ConstructorParameterNaming:BackgroundManager.kt$BackgroundManager$private val _time: ITime + ConstructorParameterNaming:ConfigModelStoreListener.kt$ConfigModelStoreListener$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:ConfigModelStoreListener.kt$ConfigModelStoreListener$private val _paramsBackendService: IParamsBackendService + ConstructorParameterNaming:ConfigModelStoreListener.kt$ConfigModelStoreListener$private val _subscriptionManager: ISubscriptionManager + ConstructorParameterNaming:DatabaseCursor.kt$DatabaseCursor$private val _cursor: Cursor + ConstructorParameterNaming:DatabaseProvider.kt$DatabaseProvider$private val _application: IApplicationService + ConstructorParameterNaming:DeviceService.kt$DeviceService$private val _applicationService: IApplicationService + ConstructorParameterNaming:HttpClient.kt$HttpClient$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:HttpClient.kt$HttpClient$private val _connectionFactory: IHttpConnectionFactory + ConstructorParameterNaming:HttpClient.kt$HttpClient$private val _installIdService: IInstallIdService + ConstructorParameterNaming:HttpClient.kt$HttpClient$private val _prefs: IPreferencesService + ConstructorParameterNaming:HttpClient.kt$HttpClient$private val _time: ITime + ConstructorParameterNaming:HttpConnectionFactory.kt$HttpConnectionFactory$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:IdentityBackendService.kt$IdentityBackendService$private val _httpClient: IHttpClient + ConstructorParameterNaming:IdentityModelStoreListener.kt$IdentityModelStoreListener$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:IdentityOperationExecutor.kt$IdentityOperationExecutor$private val _buildUserService: IRebuildUserService + ConstructorParameterNaming:IdentityOperationExecutor.kt$IdentityOperationExecutor$private val _identityBackend: IIdentityBackendService + ConstructorParameterNaming:IdentityOperationExecutor.kt$IdentityOperationExecutor$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:IdentityOperationExecutor.kt$IdentityOperationExecutor$private val _newRecordState: NewRecordsState + ConstructorParameterNaming:InfluenceDataRepository.kt$InfluenceDataRepository$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:InfluenceManager.kt$InfluenceManager$private val _applicationService: IApplicationService + ConstructorParameterNaming:InfluenceManager.kt$InfluenceManager$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:InfluenceManager.kt$InfluenceManager$private val _sessionService: ISessionService + ConstructorParameterNaming:InstallIdService.kt$InstallIdService$private val _prefs: IPreferencesService + ConstructorParameterNaming:LanguageContext.kt$LanguageContext$private val _propertiesModelStore: PropertiesModelStore + ConstructorParameterNaming:LoginUserFromSubscriptionOperationExecutor.kt$LoginUserFromSubscriptionOperationExecutor$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:LoginUserFromSubscriptionOperationExecutor.kt$LoginUserFromSubscriptionOperationExecutor$private val _propertiesModelStore: PropertiesModelStore + ConstructorParameterNaming:LoginUserFromSubscriptionOperationExecutor.kt$LoginUserFromSubscriptionOperationExecutor$private val _subscriptionBackend: ISubscriptionBackendService + ConstructorParameterNaming:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private val _application: IApplicationService + ConstructorParameterNaming:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private val _deviceService: IDeviceService + ConstructorParameterNaming:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private val _identityOperationExecutor: IdentityOperationExecutor + ConstructorParameterNaming:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private val _languageContext: ILanguageContext + ConstructorParameterNaming:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private val _propertiesModelStore: PropertiesModelStore + ConstructorParameterNaming:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private val _subscriptionsModelStore: SubscriptionModelStore + ConstructorParameterNaming:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private val _userBackend: IUserBackendService + ConstructorParameterNaming:Model.kt$Model$/** * The optional parent model property that references this model. When this is * specified, must also specify [_parentModel] */ private val _parentProperty: String? = null + ConstructorParameterNaming:Model.kt$Model$/** * The optional parent model. When specified this model is a child model, any changes * to this model will *also* be propagated up to it's parent for notification. When * this is specified, must also specify [_parentProperty] */ private var _parentModel: Model? = null + ConstructorParameterNaming:ModelStore.kt$ModelStore$private val _prefs: IPreferencesService? = null + ConstructorParameterNaming:NewRecordsState.kt$NewRecordsState$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:NewRecordsState.kt$NewRecordsState$private val _time: ITime + ConstructorParameterNaming:OSDatabase.kt$OSDatabase$private val _outcomeTableProvider: OutcomeTableProvider + ConstructorParameterNaming:OperationRepo.kt$OperationRepo$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:OperationRepo.kt$OperationRepo$private val _newRecordState: NewRecordsState + ConstructorParameterNaming:OperationRepo.kt$OperationRepo$private val _operationModelStore: OperationModelStore + ConstructorParameterNaming:OperationRepo.kt$OperationRepo$private val _time: ITime + ConstructorParameterNaming:OutcomeEventsBackendService.kt$OutcomeEventsBackendService$private val _http: IHttpClient + ConstructorParameterNaming:OutcomeEventsController.kt$OutcomeEventsController$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:OutcomeEventsController.kt$OutcomeEventsController$private val _deviceService: IDeviceService + ConstructorParameterNaming:OutcomeEventsController.kt$OutcomeEventsController$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:OutcomeEventsController.kt$OutcomeEventsController$private val _influenceManager: IInfluenceManager + ConstructorParameterNaming:OutcomeEventsController.kt$OutcomeEventsController$private val _outcomeEventsBackend: IOutcomeEventsBackendService + ConstructorParameterNaming:OutcomeEventsController.kt$OutcomeEventsController$private val _outcomeEventsCache: IOutcomeEventsRepository + ConstructorParameterNaming:OutcomeEventsController.kt$OutcomeEventsController$private val _outcomeEventsPreferences: IOutcomeEventsPreferences + ConstructorParameterNaming:OutcomeEventsController.kt$OutcomeEventsController$private val _session: ISessionService + ConstructorParameterNaming:OutcomeEventsController.kt$OutcomeEventsController$private val _subscriptionManager: ISubscriptionManager + ConstructorParameterNaming:OutcomeEventsController.kt$OutcomeEventsController$private val _time: ITime + ConstructorParameterNaming:OutcomeEventsRepository.kt$OutcomeEventsRepository$private val _databaseProvider: IDatabaseProvider + ConstructorParameterNaming:ParamsBackendService.kt$ParamsBackendService$private val _http: IHttpClient + ConstructorParameterNaming:PreferencesService.kt$PreferencesService$private val _applicationService: IApplicationService + ConstructorParameterNaming:PreferencesService.kt$PreferencesService$private val _time: ITime + ConstructorParameterNaming:PropertiesModelStoreListener.kt$PropertiesModelStoreListener$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:RebuildUserService.kt$RebuildUserService$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:RebuildUserService.kt$RebuildUserService$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:RebuildUserService.kt$RebuildUserService$private val _propertiesModelStore: PropertiesModelStore + ConstructorParameterNaming:RebuildUserService.kt$RebuildUserService$private val _subscriptionsModelStore: SubscriptionModelStore + ConstructorParameterNaming:RecoverConfigPushSubscription.kt$RecoverConfigPushSubscription$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:RecoverConfigPushSubscription.kt$RecoverConfigPushSubscription$private val _subscriptionModelStore: SubscriptionModelStore + ConstructorParameterNaming:RecoverFromDroppedLoginBug.kt$RecoverFromDroppedLoginBug$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:RecoverFromDroppedLoginBug.kt$RecoverFromDroppedLoginBug$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:RecoverFromDroppedLoginBug.kt$RecoverFromDroppedLoginBug$private val _operationRepo: IOperationRepo + ConstructorParameterNaming:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$private val _buildUserService: IRebuildUserService + ConstructorParameterNaming:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$private val _newRecordState: NewRecordsState + ConstructorParameterNaming:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$private val _propertiesModelStore: PropertiesModelStore + ConstructorParameterNaming:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$private val _subscriptionsModelStore: SubscriptionModelStore + ConstructorParameterNaming:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$private val _userBackend: IUserBackendService + ConstructorParameterNaming:RequestPermissionService.kt$RequestPermissionService$private val _application: IApplicationService + ConstructorParameterNaming:SessionListener.kt$SessionListener$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:SessionListener.kt$SessionListener$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:SessionListener.kt$SessionListener$private val _operationRepo: IOperationRepo + ConstructorParameterNaming:SessionListener.kt$SessionListener$private val _outcomeEventsController: IOutcomeEventsController + ConstructorParameterNaming:SessionListener.kt$SessionListener$private val _sessionService: ISessionService + ConstructorParameterNaming:SessionManager.kt$SessionManager$private val _outcomeController: IOutcomeEventsController + ConstructorParameterNaming:SessionService.kt$SessionService$private val _applicationService: IApplicationService + ConstructorParameterNaming:SessionService.kt$SessionService$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:SessionService.kt$SessionService$private val _sessionModelStore: SessionModelStore + ConstructorParameterNaming:SessionService.kt$SessionService$private val _time: ITime + ConstructorParameterNaming:SimpleModelStore.kt$SimpleModelStore$/** * Will be called whenever a new [TModel] needs to be instantiated. */ private val _create: () -> TModel + ConstructorParameterNaming:SimpleModelStore.kt$SimpleModelStore$_prefs: IPreferencesService? = null + ConstructorParameterNaming:SubscriptionBackendService.kt$SubscriptionBackendService$private val _httpClient: IHttpClient + ConstructorParameterNaming:SubscriptionList.kt$SubscriptionList$private val _fallbackPushSub: IPushSubscription + ConstructorParameterNaming:SubscriptionManager.kt$SubscriptionManager$private val _applicationService: IApplicationService + ConstructorParameterNaming:SubscriptionManager.kt$SubscriptionManager$private val _sessionService: ISessionService + ConstructorParameterNaming:SubscriptionManager.kt$SubscriptionManager$private val _subscriptionModelStore: SubscriptionModelStore + ConstructorParameterNaming:SubscriptionModelStoreListener.kt$SubscriptionModelStoreListener$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:SubscriptionModelStoreListener.kt$SubscriptionModelStoreListener$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$private val _applicationService: IApplicationService + ConstructorParameterNaming:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$private val _buildUserService: IRebuildUserService + ConstructorParameterNaming:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$private val _consistencyManager: IConsistencyManager + ConstructorParameterNaming:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$private val _deviceService: IDeviceService + ConstructorParameterNaming:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$private val _newRecordState: NewRecordsState + ConstructorParameterNaming:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$private val _subscriptionBackend: ISubscriptionBackendService + ConstructorParameterNaming:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$private val _subscriptionModelStore: SubscriptionModelStore + ConstructorParameterNaming:TrackGooglePurchase.kt$TrackGooglePurchase$private val _applicationService: IApplicationService + ConstructorParameterNaming:TrackGooglePurchase.kt$TrackGooglePurchase$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:TrackGooglePurchase.kt$TrackGooglePurchase$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:TrackGooglePurchase.kt$TrackGooglePurchase$private val _operationRepo: IOperationRepo + ConstructorParameterNaming:TrackGooglePurchase.kt$TrackGooglePurchase$private val _prefs: IPreferencesService + ConstructorParameterNaming:UpdateUserOperationExecutor.kt$UpdateUserOperationExecutor$private val _buildUserService: IRebuildUserService + ConstructorParameterNaming:UpdateUserOperationExecutor.kt$UpdateUserOperationExecutor$private val _consistencyManager: IConsistencyManager + ConstructorParameterNaming:UpdateUserOperationExecutor.kt$UpdateUserOperationExecutor$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:UpdateUserOperationExecutor.kt$UpdateUserOperationExecutor$private val _newRecordState: NewRecordsState + ConstructorParameterNaming:UpdateUserOperationExecutor.kt$UpdateUserOperationExecutor$private val _propertiesModelStore: PropertiesModelStore + ConstructorParameterNaming:UpdateUserOperationExecutor.kt$UpdateUserOperationExecutor$private val _userBackend: IUserBackendService + ConstructorParameterNaming:UserBackendService.kt$UserBackendService$private val _httpClient: IHttpClient + ConstructorParameterNaming:UserManager.kt$UserManager$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:UserManager.kt$UserManager$private val _languageContext: ILanguageContext + ConstructorParameterNaming:UserManager.kt$UserManager$private val _propertiesModelStore: PropertiesModelStore + ConstructorParameterNaming:UserManager.kt$UserManager$private val _subscriptionManager: ISubscriptionManager + ConstructorParameterNaming:UserRefreshService.kt$UserRefreshService$private val _applicationService: IApplicationService + ConstructorParameterNaming:UserRefreshService.kt$UserRefreshService$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:UserRefreshService.kt$UserRefreshService$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:UserRefreshService.kt$UserRefreshService$private val _operationRepo: IOperationRepo + ConstructorParameterNaming:UserRefreshService.kt$UserRefreshService$private val _sessionService: ISessionService + CyclomaticComplexMethod:ConfigModelStoreListener.kt$ConfigModelStoreListener$private fun fetchParams() + CyclomaticComplexMethod:HttpClient.kt$HttpClient$@OptIn(DelicateCoroutinesApi::class) private suspend fun makeRequestIODispatcher( url: String, method: String?, jsonBody: JSONObject?, timeout: Int, headers: OptionalHeaders?, ): HttpResponse + CyclomaticComplexMethod:IdentityOperationExecutor.kt$IdentityOperationExecutor$override suspend fun execute(operations: List<Operation>): ExecutionResponse + CyclomaticComplexMethod:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private suspend fun createUser( createUserOperation: LoginUserOperation, operations: List<Operation>, ): ExecutionResponse + CyclomaticComplexMethod:OSDatabase.kt$OSDatabase$@Synchronized private fun internalOnUpgrade( db: SQLiteDatabase, oldVersion: Int, newVersion: Int, ) + CyclomaticComplexMethod:OneSignalImp.kt$OneSignalImp$override fun initWithContext( context: Context, appId: String?, ): Boolean + CyclomaticComplexMethod:OperationModelStore.kt$OperationModelStore$override fun create(jsonObject: JSONObject?): Operation? + CyclomaticComplexMethod:OperationRepo.kt$OperationRepo$internal suspend fun executeOperations(ops: List<OperationQueueItem>) + CyclomaticComplexMethod:PreferencesService.kt$PreferencesService$private fun get( store: String, key: String, type: Class<*>, defValue: Any?, ): Any? + CyclomaticComplexMethod:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$private suspend fun getUser(op: RefreshUserOperation): ExecutionResponse + CyclomaticComplexMethod:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$private suspend fun createSubscription( createOperation: CreateSubscriptionOperation, operations: List<Operation>, ): ExecutionResponse + CyclomaticComplexMethod:UpdateUserOperationExecutor.kt$UpdateUserOperationExecutor$override suspend fun execute(operations: List<Operation>): ExecutionResponse + EmptyCatchBlock:JSONUtils.kt$JSONUtils${ } + EmptyDefaultConstructor:ApplicationService.kt$ApplicationService$() + EmptyDefaultConstructor:CallbackProducer.kt$CallbackProducer$() + EmptyDefaultConstructor:DebugManager.kt$DebugManager$() + EmptyDefaultConstructor:PushSubscription.kt$UninitializedPushSubscription$() + EmptyDefaultConstructor:SubscriptionModel.kt$SubscriptionType$() + ForbiddenComment:DeviceService.kt$DeviceService$// TODO: Maybe able to switch to GoogleApiAvailability.isGooglePlayServicesAvailable to simplify + ForbiddenComment:HttpClient.kt$HttpClient$// TODO: SHOULD RETURN OK INSTEAD OF NOT_MODIFIED TO MAKE TRANSPARENT? + ForbiddenComment:IPreferencesService.kt$PreferenceOneSignalKeys$* (String) The serialized IAMs TODO: This isn't currently used, determine if actually needed for cold start IAM fetch delay + ForbiddenComment:IUserBackendService.kt$IUserBackendService$// TODO: Change to send only the push subscription, optimally + ForbiddenComment:OneSignalImp.kt$OneSignalImp$// TODO: Set JWT Token for all future requests. + ForbiddenComment:OneSignalImp.kt$OneSignalImp$// TODO: remove JWT Token for all future requests. + ForbiddenComment:OperationRepo.kt$OperationRepo$// TODO: Need to provide callback for app to reset JWT. For now, fail with no retry. + ForbiddenComment:ParamsBackendService.kt$ParamsBackendService$// TODO: New + ForbiddenComment:PermissionsActivity.kt$PermissionsActivity$// TODO after we remove IAM from being an activity window we may be able to remove this handler + ForbiddenComment:PermissionsActivity.kt$PermissionsActivity$// TODO improve this method + ForbiddenComment:PermissionsActivity.kt$PermissionsActivity.Companion$// TODO this will be removed once the handled is deleted + ForbiddenComment:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$// TODO: whenever the end-user changes users, we need to add the read-your-write token here, currently no code to handle the re-fetch IAMs + ForbiddenComment:TrackGooglePurchase.kt$TrackGooglePurchase$// TODO: Handle very large list. Test for continuationToken != null then call getPurchases again + FunctionOnlyReturningConstant:AndroidUtils.kt$AndroidUtils$@Keep fun opaqueHasClass(_class: Class<*>): Boolean + FunctionParameterNaming:AndroidUtils.kt$AndroidUtils$_class: Class<*> + FunctionParameterNaming:JSONUtils.kt$JSONUtils$`object`: Any + GlobalCoroutineUsage:HttpClient.kt$HttpClient$GlobalScope.launch(Dispatchers.IO) { var httpResponse = -1 var con: HttpURLConnection? = null if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { TrafficStats.setThreadStatsTag(THREAD_ID) } try { con = _connectionFactory.newHttpURLConnection(url) // https://github.com/OneSignal/OneSignal-Android-SDK/issues/1465 // Android 4.4 and older devices fail to register to onesignal.com to due it's TLS1.2+ requirement if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP_MR1 && con is HttpsURLConnection) { val conHttps = con conHttps.sslSocketFactory = TLS12SocketFactory( conHttps.sslSocketFactory, ) } con.useCaches = false con.connectTimeout = timeout con.readTimeout = timeout con.setRequestProperty("SDK-Version", "onesignal/android/" + OneSignalUtils.sdkVersion) if (OneSignalWrapper.sdkType != null && OneSignalWrapper.sdkVersion != null) { con.setRequestProperty("SDK-Wrapper", "onesignal/${OneSignalWrapper.sdkType}/${OneSignalWrapper.sdkVersion}") } con.setRequestProperty("Accept", OS_ACCEPT_HEADER) val subscriptionId = _configModelStore.model.pushSubscriptionId if (subscriptionId != null && subscriptionId.isNotEmpty()) { con.setRequestProperty("OneSignal-Subscription-Id", subscriptionId) } con.setRequestProperty("OneSignal-Install-Id", _installIdService.getId().toString()) if (jsonBody != null) { con.doInput = true } if (method != null) { con.setRequestProperty("Content-Type", "application/json; charset=UTF-8") con.requestMethod = method con.doOutput = true } logHTTPSent(con.requestMethod, con.url, jsonBody, con.requestProperties) if (jsonBody != null) { val strJsonBody = JSONUtils.toUnescapedEUIDString(jsonBody) val sendBytes = strJsonBody.toByteArray(charset("UTF-8")) con.setFixedLengthStreamingMode(sendBytes.size) val outputStream = con.outputStream outputStream.write(sendBytes) } // H E A D E R S if (headers?.cacheKey != null) { val eTag = _prefs.getString( PreferenceStores.ONESIGNAL, PreferenceOneSignalKeys.PREFS_OS_ETAG_PREFIX + headers.cacheKey, ) if (eTag != null) { con.setRequestProperty("If-None-Match", eTag) Logging.debug("HttpClient: Adding header if-none-match: $eTag") } } if (headers?.rywToken != null) { con.setRequestProperty("OneSignal-RYW-Token", headers.rywToken.toString()) } if (headers?.retryCount != null) { con.setRequestProperty("Onesignal-Retry-Count", headers.retryCount.toString()) } if (headers?.sessionDuration != null) { con.setRequestProperty("OneSignal-Session-Duration", headers.sessionDuration.toString()) } // Network request is made from getResponseCode() httpResponse = con.responseCode val retryAfter = retryAfterFromResponse(con) val retryLimit = retryLimitFromResponse(con) val newDelayUntil = _time.currentTimeMillis + (retryAfter ?: 0) * 1_000 if (newDelayUntil > delayNewRequestsUntil) delayNewRequestsUntil = newDelayUntil when (httpResponse) { HttpURLConnection.HTTP_NOT_MODIFIED -> { val cachedResponse = _prefs.getString( PreferenceStores.ONESIGNAL, PreferenceOneSignalKeys.PREFS_OS_HTTP_CACHE_PREFIX + headers?.cacheKey, ) Logging.debug( "HttpClient: Got Response = ${method ?: "GET"} ${con.url} - Using Cached response due to 304: " + cachedResponse, ) // TODO: SHOULD RETURN OK INSTEAD OF NOT_MODIFIED TO MAKE TRANSPARENT? retVal = HttpResponse(httpResponse, cachedResponse, retryAfterSeconds = retryAfter, retryLimit = retryLimit) } HttpURLConnection.HTTP_ACCEPTED, HttpURLConnection.HTTP_CREATED, HttpURLConnection.HTTP_OK -> { val inputStream = con.inputStream val scanner = Scanner(inputStream, "UTF-8") val json = if (scanner.useDelimiter("\\A").hasNext()) scanner.next() else "" scanner.close() Logging.debug( "HttpClient: Got Response = ${method ?: "GET"} ${con.url} - STATUS: $httpResponse - Body: " + json, ) if (headers?.cacheKey != null) { val eTag = con.getHeaderField("etag") if (eTag != null) { Logging.debug("HttpClient: Got Response = Response has etag of $eTag so caching the response.") _prefs.saveString( PreferenceStores.ONESIGNAL, PreferenceOneSignalKeys.PREFS_OS_ETAG_PREFIX + headers.cacheKey, eTag, ) _prefs.saveString( PreferenceStores.ONESIGNAL, PreferenceOneSignalKeys.PREFS_OS_HTTP_CACHE_PREFIX + headers.cacheKey, json, ) } } retVal = HttpResponse(httpResponse, json, retryAfterSeconds = retryAfter, retryLimit = retryLimit) } else -> { Logging.debug("HttpClient: Got Response = ${method ?: "GET"} ${con.url} - FAILED STATUS: $httpResponse") var inputStream = con.errorStream if (inputStream == null) { inputStream = con.inputStream } var jsonResponse: String? = null if (inputStream != null) { val scanner = Scanner(inputStream, "UTF-8") jsonResponse = if (scanner.useDelimiter("\\A").hasNext()) scanner.next() else "" scanner.close() Logging.warn("HttpClient: Got Response = $method - STATUS: $httpResponse - Body: $jsonResponse") } else { Logging.warn("HttpClient: Got Response = $method - STATUS: $httpResponse - No response body!") } retVal = HttpResponse(httpResponse, jsonResponse, retryAfterSeconds = retryAfter, retryLimit = retryLimit) } } } catch (t: Throwable) { if (t is ConnectException || t is UnknownHostException) { Logging.info("HttpClient: Could not send last request, device is offline. Throwable: " + t.javaClass.name) } else { Logging.warn("HttpClient: $method Error thrown from network stack. ", t) } retVal = HttpResponse(httpResponse, null, t) } finally { con?.disconnect() } } + GlobalCoroutineUsage:PreferencesService.kt$PreferencesService$GlobalScope.async(Dispatchers.IO) { var lastSyncTime = _time.currentTimeMillis while (true) { try { // go through all outstanding items to process for (storeKey in prefsToApply.keys) { val storeMap = prefsToApply[storeKey]!! val prefsToWrite = getSharedPrefsByName(storeKey) if (prefsToWrite == null) { // the assumption here is there is no context yet, but will be. So ensure // we wake up to try again and persist the preference. waiter.wake() continue } val editor = prefsToWrite.edit() synchronized(storeMap) { for (key in storeMap.keys) { when (val value = storeMap[key]) { is String -> editor.putString(key, value as String?) is Boolean -> editor.putBoolean(key, (value as Boolean?)!!) is Int -> editor.putInt(key, (value as Int?)!!) is Long -> editor.putLong(key, (value as Long?)!!) is Set<*> -> editor.putStringSet(key, value as Set<String?>?) null -> editor.remove(key) } } storeMap.clear() } editor.apply() } // potentially delay to prevent this from constant IO if a bunch of // preferences are set sequentially. val newTime = _time.currentTimeMillis val delay = lastSyncTime - newTime + WRITE_CALL_DELAY_TO_BUFFER_MS lastSyncTime = newTime if (delay > 0) { delay(delay) } // wait to be woken up for the next pass waiter.waitForWake() } catch (e: Throwable) { Logging.log(LogLevel.ERROR, "Error with Preference work loop", e) } } } + GlobalCoroutineUsage:RecoverFromDroppedLoginBug.kt$RecoverFromDroppedLoginBug$GlobalScope.launch(Dispatchers.IO) { _operationRepo.awaitInitialized() if (isInBadState()) { Logging.warn( "User with externalId:" + "${_identityModelStore.model.externalId} " + "was in a bad state, causing it to not update on OneSignal's " + "backend! We are recovering and replaying all unsent " + "operations now.", ) recoverByAddingBackDroppedLoginOperation() } } + InstanceOfCheckForException:HttpClient.kt$HttpClient$t is ConnectException + InstanceOfCheckForException:HttpClient.kt$HttpClient$t is UnknownHostException + LongMethod:ApplicationService.kt$ApplicationService$override suspend fun waitUntilSystemConditionsAvailable(): Boolean + LongMethod:ConfigModelStoreListener.kt$ConfigModelStoreListener$private fun fetchParams() + LongMethod:HttpClient.kt$HttpClient$@OptIn(DelicateCoroutinesApi::class) private suspend fun makeRequestIODispatcher( url: String, method: String?, jsonBody: JSONObject?, timeout: Int, headers: OptionalHeaders?, ): HttpResponse + LongMethod:IdentityOperationExecutor.kt$IdentityOperationExecutor$override suspend fun execute(operations: List<Operation>): ExecutionResponse + LongMethod:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private suspend fun createUser( createUserOperation: LoginUserOperation, operations: List<Operation>, ): ExecutionResponse + LongMethod:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private suspend fun loginUser( loginUserOp: LoginUserOperation, operations: List<Operation>, ): ExecutionResponse + LongMethod:OneSignalImp.kt$OneSignalImp$override fun initWithContext( context: Context, appId: String?, ): Boolean + LongMethod:OperationRepo.kt$OperationRepo$internal suspend fun executeOperations(ops: List<OperationQueueItem>) + LongMethod:OutcomeEventsController.kt$OutcomeEventsController$private suspend fun sendAndCreateOutcomeEvent( name: String, weight: Float, // Note: this is optional sessionTime: Long, influences: List<Influence>, ): OutcomeEvent? + LongMethod:OutcomeEventsController.kt$OutcomeEventsController$private suspend fun sendUniqueOutcomeEvent( name: String, sessionInfluences: List<Influence>, ): OutcomeEvent? + LongMethod:OutcomeEventsRepository.kt$OutcomeEventsRepository$override suspend fun getAllEventsToSend(): List<OutcomeEventParams> + LongMethod:OutcomeEventsRepository.kt$OutcomeEventsRepository$override suspend fun getNotCachedUniqueInfluencesForOutcome( name: String, influences: List<Influence>, ): List<Influence> + LongMethod:OutcomeEventsRepository.kt$OutcomeEventsRepository$override suspend fun saveOutcomeEvent(eventParams: OutcomeEventParams) + LongMethod:ParamsBackendService.kt$ParamsBackendService$override suspend fun fetchParams( appId: String, subscriptionId: String?, ): ParamsObject + LongMethod:PropertyOperationHelper.kt$PropertyOperationHelper$fun createPropertiesFromOperation( operation: SetPropertyOperation, propertiesObject: PropertiesObject, ): PropertiesObject + LongMethod:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$private suspend fun getUser(op: RefreshUserOperation): ExecutionResponse + LongMethod:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$private suspend fun createSubscription( createOperation: CreateSubscriptionOperation, operations: List<Operation>, ): ExecutionResponse + LongMethod:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$private suspend fun updateSubscription( startingOperation: UpdateSubscriptionOperation, operations: List<Operation>, ): ExecutionResponse + LongMethod:TrackGooglePurchase.kt$TrackGooglePurchase$private fun queryBoughtItems() + LongMethod:TrackGooglePurchase.kt$TrackGooglePurchase$private fun sendPurchases( skusToAdd: ArrayList<String>, newPurchaseTokens: ArrayList<String>, ) + LongMethod:UpdateUserOperationExecutor.kt$UpdateUserOperationExecutor$override suspend fun execute(operations: List<Operation>): ExecutionResponse + LongParameterList:IDatabase.kt$IDatabase$( table: String, columns: Array<String>? = null, whereClause: String? = null, whereArgs: Array<String>? = null, groupBy: String? = null, having: String? = null, orderBy: String? = null, limit: String? = null, action: (ICursor) -> Unit, ) + LongParameterList:IOutcomeEventsBackendService.kt$IOutcomeEventsBackendService$( appId: String, userId: String, subscriptionId: String, deviceType: String, direct: Boolean?, event: OutcomeEvent, ) + LongParameterList:IParamsBackendService.kt$ParamsObject$( var googleProjectNumber: String? = null, var enterprise: Boolean? = null, var useIdentityVerification: Boolean? = null, var notificationChannels: JSONArray? = null, var firebaseAnalytics: Boolean? = null, var restoreTTLFilter: Boolean? = null, var clearGroupOnSummaryClick: Boolean? = null, var receiveReceiptEnabled: Boolean? = null, var disableGMSMissingPrompt: Boolean? = null, var unsubscribeWhenNotificationsDisabled: Boolean? = null, var locationShared: Boolean? = null, var requiresUserPrivacyConsent: Boolean? = null, var opRepoExecutionInterval: Long? = null, var influenceParams: InfluenceParamsObject, var fcmParams: FCMParamsObject, ) + LongParameterList:IUserBackendService.kt$IUserBackendService$( appId: String, aliasLabel: String, aliasValue: String, properties: PropertiesObject, refreshDeviceMetadata: Boolean, propertyiesDelta: PropertiesDeltasObject, ) + LongParameterList:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$( private val _identityOperationExecutor: IdentityOperationExecutor, private val _application: IApplicationService, private val _deviceService: IDeviceService, private val _userBackend: IUserBackendService, private val _identityModelStore: IdentityModelStore, private val _propertiesModelStore: PropertiesModelStore, private val _subscriptionsModelStore: SubscriptionModelStore, private val _configModelStore: ConfigModelStore, private val _languageContext: ILanguageContext, ) + LongParameterList:OutcomeEventsController.kt$OutcomeEventsController$( private val _session: ISessionService, private val _influenceManager: IInfluenceManager, private val _outcomeEventsCache: IOutcomeEventsRepository, private val _outcomeEventsPreferences: IOutcomeEventsPreferences, private val _outcomeEventsBackend: IOutcomeEventsBackendService, private val _configModelStore: ConfigModelStore, private val _identityModelStore: IdentityModelStore, private val _subscriptionManager: ISubscriptionManager, private val _deviceService: IDeviceService, private val _time: ITime, ) + LongParameterList:SubscriptionObject.kt$SubscriptionObject$( val id: String? = null, val type: SubscriptionObjectType? = null, val token: String? = null, val enabled: Boolean? = null, val notificationTypes: Int? = null, val sdk: String? = null, val deviceModel: String? = null, val deviceOS: String? = null, val rooted: Boolean? = null, val netType: Int? = null, val carrier: String? = null, val appVersion: String? = null, ) + LongParameterList:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$( private val _subscriptionBackend: ISubscriptionBackendService, private val _deviceService: IDeviceService, private val _applicationService: IApplicationService, private val _subscriptionModelStore: SubscriptionModelStore, private val _configModelStore: ConfigModelStore, private val _buildUserService: IRebuildUserService, private val _newRecordState: NewRecordsState, private val _consistencyManager: IConsistencyManager, ) + LoopWithTooManyJumpStatements:ModelStore.kt$ModelStore$for + MagicNumber:ApplicationService.kt$ApplicationService$50 + MagicNumber:BackgroundManager.kt$BackgroundManager$5000 + MagicNumber:ChannelTracker.kt$ChannelTracker$1000L + MagicNumber:ChannelTracker.kt$ChannelTracker$60 + MagicNumber:ConfigModelStoreListener.kt$ConfigModelStoreListener$1000 + MagicNumber:HttpClient.kt$HttpClient$1_000 + MagicNumber:HttpClient.kt$HttpClient$429 + MagicNumber:HttpClient.kt$HttpClient$5000 + MagicNumber:IDeviceService.kt$IDeviceService.DeviceType.Huawei$13 + MagicNumber:IdentityOperationExecutor.kt$IdentityOperationExecutor$404 + MagicNumber:NetworkUtils.kt$NetworkUtils$400 + MagicNumber:NetworkUtils.kt$NetworkUtils$401 + MagicNumber:NetworkUtils.kt$NetworkUtils$402 + MagicNumber:NetworkUtils.kt$NetworkUtils$403 + MagicNumber:NetworkUtils.kt$NetworkUtils$404 + MagicNumber:NetworkUtils.kt$NetworkUtils$409 + MagicNumber:NetworkUtils.kt$NetworkUtils$410 + MagicNumber:NetworkUtils.kt$NetworkUtils$429 + MagicNumber:OSDatabase.kt$OSDatabase$3 + MagicNumber:OSDatabase.kt$OSDatabase$4 + MagicNumber:OSDatabase.kt$OSDatabase$5 + MagicNumber:OSDatabase.kt$OSDatabase$6 + MagicNumber:OSDatabase.kt$OSDatabase$7 + MagicNumber:OSDatabase.kt$OSDatabase$8 + MagicNumber:OSDatabase.kt$OSDatabase$9 + MagicNumber:OperationRepo.kt$OperationRepo$1_000 + MagicNumber:OutcomeEventsController.kt$OutcomeEventsController$1000 + MagicNumber:PermissionsActivity.kt$PermissionsActivity$23 + MagicNumber:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$404 + MagicNumber:SessionListener.kt$SessionListener$1000 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.DISABLED_FROM_REST_API_DEFAULT_REASON$30 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.ERROR$9999 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.FIREBASE_FCM_ERROR_IOEXCEPTION_AUTHENTICATION_FAILED$29 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.FIREBASE_FCM_ERROR_IOEXCEPTION_OTHER$11 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.FIREBASE_FCM_ERROR_IOEXCEPTION_SERVICE_NOT_AVAILABLE$9 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.FIREBASE_FCM_ERROR_MISC_EXCEPTION$12 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.FIREBASE_FCM_INIT_ERROR$8 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.HMS_API_EXCEPTION_OTHER$27 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.HMS_ARGUMENTS_INVALID$26 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.HMS_TOKEN_TIMEOUT$25 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.INVALID_FCM_SENDER_ID$6 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.MISSING_FIREBASE_FCM_LIBRARY$4 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.MISSING_HMS_PUSHKIT_LIBRARY$28 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.MISSING_JETPACK_LIBRARY$3 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.OUTDATED_GOOGLE_PLAY_SERVICES_APP$7 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.OUTDATED_JETPACK_LIBRARY$5 + MagicNumber:SubscriptionModel.kt$SubscriptionStatus.UNSUBSCRIBE$2 + MagicNumber:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$404 + MagicNumber:TimeUtils.kt$TimeUtils$1000 + MagicNumber:TrackGooglePurchase.kt$TrackGooglePurchase$1000000 + MagicNumber:TrackGooglePurchase.kt$TrackGooglePurchase$3 + MagicNumber:TrackGooglePurchase.kt$TrackGooglePurchase.<no name provided>$99 + MagicNumber:TrackGooglePurchase.kt$TrackGooglePurchase.Companion$3 + MagicNumber:TrackGooglePurchase.kt$TrackGooglePurchase.Companion$4 + MagicNumber:TrackGooglePurchase.kt$TrackGooglePurchase.Companion$99 + MagicNumber:UpdateUserOperationExecutor.kt$UpdateUserOperationExecutor$404 + MemberNameEqualsClassName:OneSignal.kt$OneSignal$private val oneSignal: IOneSignal by lazy { OneSignalImp() } + NestedBlockDepth:IdentityOperationExecutor.kt$IdentityOperationExecutor$override suspend fun execute(operations: List<Operation>): ExecutionResponse + NestedBlockDepth:InfluenceManager.kt$InfluenceManager$private fun attemptSessionUpgrade( entryAction: AppEntryAction, directId: String? = null, ) + NestedBlockDepth:JSONUtils.kt$JSONUtils$fun compareJSONArrays( jsonArray1: JSONArray?, jsonArray2: JSONArray?, ): Boolean + NestedBlockDepth:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private suspend fun createUser( createUserOperation: LoginUserOperation, operations: List<Operation>, ): ExecutionResponse + NestedBlockDepth:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$private suspend fun getUser(op: RefreshUserOperation): ExecutionResponse + NestedBlockDepth:ServiceRegistration.kt$ServiceRegistrationReflection$override fun resolve(provider: IServiceProvider): Any? + NestedBlockDepth:ServiceRegistration.kt$ServiceRegistrationReflection$private fun doesHaveAllParameters( constructor: Constructor<*>, provider: IServiceProvider, ): Boolean + NestedBlockDepth:TrackGooglePurchase.kt$TrackGooglePurchase$private fun sendPurchases( skusToAdd: ArrayList<String>, newPurchaseTokens: ArrayList<String>, ) + NestedBlockDepth:UpdateUserOperationExecutor.kt$UpdateUserOperationExecutor$override suspend fun execute(operations: List<Operation>): ExecutionResponse + PrintStackTrace:AndroidUtils.kt$AndroidUtils$e + PrintStackTrace:ApplicationService.kt$ApplicationService$e + PrintStackTrace:DeviceUtils.kt$DeviceUtils$t + PrintStackTrace:JSONUtils.kt$JSONUtils$e + PrintStackTrace:OSDatabase.kt$OSDatabase$e + PrintStackTrace:OneSignalImp.kt$OneSignalImp$e + PrintStackTrace:OutcomeTableProvider.kt$OutcomeTableProvider$e + PrintStackTrace:TrackGooglePurchase.kt$TrackGooglePurchase$e + PrintStackTrace:TrackGooglePurchase.kt$TrackGooglePurchase.<no name provided>$t + RethrowCaughtException:OSDatabase.kt$OSDatabase$throw e + ReturnCount:BackgroundManager.kt$BackgroundManager$override fun cancelRunBackgroundServices(): Boolean + ReturnCount:ConfigModel.kt$ConfigModel$override fun createModelForProperty( property: String, jsonObject: JSONObject, ): Model? + ReturnCount:HttpClient.kt$HttpClient$private suspend fun makeRequest( url: String, method: String?, jsonBody: JSONObject?, timeout: Int, headers: OptionalHeaders?, ): HttpResponse + ReturnCount:IdentityOperationExecutor.kt$IdentityOperationExecutor$override suspend fun execute(operations: List<Operation>): ExecutionResponse + ReturnCount:JSONUtils.kt$JSONUtils$fun compareJSONArrays( jsonArray1: JSONArray?, jsonArray2: JSONArray?, ): Boolean + ReturnCount:LoginUserFromSubscriptionOperationExecutor.kt$LoginUserFromSubscriptionOperationExecutor$private suspend fun loginUser(loginUserOp: LoginUserFromSubscriptionOperation): ExecutionResponse + ReturnCount:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$private suspend fun loginUser( loginUserOp: LoginUserOperation, operations: List<Operation>, ): ExecutionResponse + ReturnCount:Model.kt$Model$protected fun getOptBigDecimalProperty( name: String, create: (() -> BigDecimal?)? = null, ): BigDecimal? + ReturnCount:Model.kt$Model$protected fun getOptDoubleProperty( name: String, create: (() -> Double?)? = null, ): Double? + ReturnCount:Model.kt$Model$protected fun getOptFloatProperty( name: String, create: (() -> Float?)? = null, ): Float? + ReturnCount:Model.kt$Model$protected fun getOptIntProperty( name: String, create: (() -> Int?)? = null, ): Int? + ReturnCount:Model.kt$Model$protected fun getOptLongProperty( name: String, create: (() -> Long?)? = null, ): Long? + ReturnCount:Model.kt$Model$protected inline fun <reified T : Enum<T>> getOptEnumProperty(name: String): T? + ReturnCount:OneSignalImp.kt$OneSignalImp$override fun initWithContext( context: Context, appId: String?, ): Boolean + ReturnCount:OperationModelStore.kt$OperationModelStore$override fun create(jsonObject: JSONObject?): Operation? + ReturnCount:OperationModelStore.kt$OperationModelStore$private fun isValidOperation(jsonObject: JSONObject): Boolean + ReturnCount:OutcomeEventsController.kt$OutcomeEventsController$private suspend fun sendAndCreateOutcomeEvent( name: String, weight: Float, // Note: this is optional sessionTime: Long, influences: List<Influence>, ): OutcomeEvent? + ReturnCount:OutcomeEventsController.kt$OutcomeEventsController$private suspend fun sendUniqueOutcomeEvent( name: String, sessionInfluences: List<Influence>, ): OutcomeEvent? + ReturnCount:PermissionsActivity.kt$PermissionsActivity$private fun shouldShowSettings(permission: String): Boolean + ReturnCount:PreferenceStoreFix.kt$PreferenceStoreFix$fun ensureNoObfuscatedPrefStore(context: Context) + ReturnCount:PreferencesService.kt$PreferencesService$private fun get( store: String, key: String, type: Class<*>, defValue: Any?, ): Any? + ReturnCount:PropertiesModelStoreListener.kt$PropertiesModelStoreListener$override fun getUpdateOperation( model: PropertiesModel, path: String, property: String, oldValue: Any?, newValue: Any?, ): Operation? + ReturnCount:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$private suspend fun getUser(op: RefreshUserOperation): ExecutionResponse + ReturnCount:ServiceRegistration.kt$ServiceRegistrationReflection$private fun doesHaveAllParameters( constructor: Constructor<*>, provider: IServiceProvider, ): Boolean + ReturnCount:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$private suspend fun createSubscription( createOperation: CreateSubscriptionOperation, operations: List<Operation>, ): ExecutionResponse + ReturnCount:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$private suspend fun updateSubscription( startingOperation: UpdateSubscriptionOperation, operations: List<Operation>, ): ExecutionResponse + ReturnCount:UpdateUserOperationExecutor.kt$UpdateUserOperationExecutor$override suspend fun execute(operations: List<Operation>): ExecutionResponse + SpreadOperator:AndroidUtils.kt$AndroidUtils$(*packageInfo.requestedPermissions) + SpreadOperator:ServiceRegistration.kt$ServiceRegistrationReflection$(*paramList.toTypedArray()) + StringLiteralDuplication:OSDatabase.kt$OSDatabase$"Error closing transaction! " + StringLiteralDuplication:OneSignalImp.kt$OneSignalImp$"Must call 'initWithContext' before use" + StringLiteralDuplication:OutcomesDbContract.kt$OutcomesDbContract$"CREATE TABLE " + SwallowedException:AlertDialogPrepromptForAndroidSettings.kt$AlertDialogPrepromptForAndroidSettings$ex: BadTokenException + SwallowedException:AndroidUtils.kt$AndroidUtils$e: PackageManager.NameNotFoundException + SwallowedException:AndroidUtils.kt$AndroidUtils$e: Throwable + SwallowedException:DeviceService.kt$DeviceService$e: ClassNotFoundException + SwallowedException:DeviceService.kt$DeviceService$e: PackageManager.NameNotFoundException + SwallowedException:JSONUtils.kt$JSONUtils$t: Throwable + SwallowedException:PermissionsActivity.kt$PermissionsActivity$e: ClassNotFoundException + SwallowedException:PreferencesService.kt$PreferencesService$ex: Exception + SwallowedException:TrackGooglePurchase.kt$TrackGooglePurchase.Companion$t: Throwable + TooGenericExceptionCaught:AndroidUtils.kt$AndroidUtils$e: Throwable + TooGenericExceptionCaught:DeviceUtils.kt$DeviceUtils$t: Throwable + TooGenericExceptionCaught:HttpClient.kt$HttpClient$e: Throwable + TooGenericExceptionCaught:HttpClient.kt$HttpClient$t: Throwable + TooGenericExceptionCaught:JSONUtils.kt$JSONUtils$t: Throwable + TooGenericExceptionCaught:Logging.kt$Logging$t: Throwable + TooGenericExceptionCaught:OperationRepo.kt$OperationRepo$e: Throwable + TooGenericExceptionCaught:PreferenceStoreFix.kt$PreferenceStoreFix$e: Throwable + TooGenericExceptionCaught:PreferencesService.kt$PreferencesService$e: Throwable + TooGenericExceptionCaught:PreferencesService.kt$PreferencesService$ex: Exception + TooGenericExceptionCaught:ThreadUtils.kt$e: Exception + TooGenericExceptionCaught:TrackGooglePurchase.kt$TrackGooglePurchase$e: Throwable + TooGenericExceptionCaught:TrackGooglePurchase.kt$TrackGooglePurchase$t: Throwable + TooGenericExceptionCaught:TrackGooglePurchase.kt$TrackGooglePurchase.<no name provided>$t: Throwable + TooGenericExceptionCaught:TrackGooglePurchase.kt$TrackGooglePurchase.Companion$t: Throwable + TooGenericExceptionThrown:IdentityOperationExecutor.kt$IdentityOperationExecutor$throw Exception("Can't process SetAliasOperation and DeleteAliasOperation at the same time.") + TooGenericExceptionThrown:IdentityOperationExecutor.kt$IdentityOperationExecutor$throw Exception("Unrecognized operation(s)! Attempted operations:\n$operations") + TooGenericExceptionThrown:LoginUserFromSubscriptionOperationExecutor.kt$LoginUserFromSubscriptionOperationExecutor$throw Exception("Only supports one operation! Attempted operations:\n$operations") + TooGenericExceptionThrown:LoginUserFromSubscriptionOperationExecutor.kt$LoginUserFromSubscriptionOperationExecutor$throw Exception("Unrecognized operation: $startingOp") + TooGenericExceptionThrown:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$throw Exception("Unrecognized operation: $operation") + TooGenericExceptionThrown:LoginUserOperationExecutor.kt$LoginUserOperationExecutor$throw Exception("Unrecognized operation: $startingOp") + TooGenericExceptionThrown:Model.kt$Model$throw Exception("If parent model is set, parent property must also be set.") + TooGenericExceptionThrown:Model.kt$Model$throw Exception("If parent property is set, parent model must also be set.") + TooGenericExceptionThrown:OneSignalImp.kt$OneSignalImp$throw Exception( "Must call 'initWithContext' before use", ) + TooGenericExceptionThrown:OneSignalImp.kt$OneSignalImp$throw Exception("Must call 'initWithContext' before 'login'") + TooGenericExceptionThrown:OneSignalImp.kt$OneSignalImp$throw Exception("Must call 'initWithContext' before 'logout'") + TooGenericExceptionThrown:OperationModelStore.kt$OperationModelStore$throw Exception("Unrecognized operation: $operationName") + TooGenericExceptionThrown:OperationRepo.kt$OperationRepo$throw Exception("Both comparison keys can not be blank!") + TooGenericExceptionThrown:OperationRepo.kt$OperationRepo$throw Exception("Could not find executor for operation ${startingOp.operation.name}") + TooGenericExceptionThrown:PermissionsActivity.kt$PermissionsActivity$throw RuntimeException( "Could not find callback class for PermissionActivity: $className", ) + TooGenericExceptionThrown:PermissionsActivity.kt$PermissionsActivity$throw RuntimeException("Missing handler for permissionRequestType: $permissionRequestType") + TooGenericExceptionThrown:PreferencesService.kt$PreferencesService$throw Exception("Store not found: $store") + TooGenericExceptionThrown:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$throw Exception("Unrecognized operation(s)! Attempted operations:\n$operations") + TooGenericExceptionThrown:RefreshUserOperationExecutor.kt$RefreshUserOperationExecutor$throw Exception("Unrecognized operation: $startingOp") + TooGenericExceptionThrown:ServiceProvider.kt$ServiceProvider$throw Exception("Could not instantiate service: $serviceReg") + TooGenericExceptionThrown:ServiceProvider.kt$ServiceProvider$throw Exception("Service $c could not be instantiated") + TooGenericExceptionThrown:SingletonModelStore.kt$SingletonModelStore$throw Exception("Unable to initialize model from store $store") + TooGenericExceptionThrown:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$throw Exception("Only supports one operation! Attempted operations:\n$operations") + TooGenericExceptionThrown:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$throw Exception("TransferSubscriptionOperation only supports one operation! Attempted operations:\n$operations") + TooGenericExceptionThrown:SubscriptionOperationExecutor.kt$SubscriptionOperationExecutor$throw Exception("Unrecognized operation: $startingOp") + TooGenericExceptionThrown:UpdateUserOperationExecutor.kt$UpdateUserOperationExecutor$throw Exception("Unrecognized operation: $operation") + TooGenericExceptionThrown:Waiter.kt$Waiter$throw Exception("Waiter.wait failed", result.exceptionOrNull()) + TooGenericExceptionThrown:Waiter.kt$WaiterWithValue$throw Exception("WaiterWithValue.wait failed", result.exceptionOrNull()) + TooManyFunctions:AndroidUtils.kt$AndroidUtils + TooManyFunctions:ApplicationService.kt$ApplicationService : IApplicationServiceActivityLifecycleCallbacksOnGlobalLayoutListener + TooManyFunctions:BackgroundManager.kt$BackgroundManager : IApplicationLifecycleHandlerIBackgroundManagerIStartableService + TooManyFunctions:HttpClient.kt$HttpClient : IHttpClient + TooManyFunctions:IUserManager.kt$IUserManager + TooManyFunctions:InfluenceManager.kt$InfluenceManager : IInfluenceManagerISessionLifecycleHandler + TooManyFunctions:JSONObjectExtensions.kt$com.onesignal.common.JSONObjectExtensions.kt + TooManyFunctions:Logging.kt$Logging + TooManyFunctions:Model.kt$Model : IEventNotifier + TooManyFunctions:ModelStore.kt$ModelStore<TModel> : IEventNotifierIModelStoreIModelChangedHandler + TooManyFunctions:OSDatabase.kt$OSDatabase : SQLiteOpenHelperIDatabase + TooManyFunctions:OperationRepo.kt$OperationRepo : IOperationRepoIStartableService + TooManyFunctions:OutcomeEventsController.kt$OutcomeEventsController : IOutcomeEventsControllerIStartableServiceISessionLifecycleHandler + TooManyFunctions:PreferencesService.kt$PreferencesService : IPreferencesServiceIStartableService + TooManyFunctions:SubscriptionManager.kt$SubscriptionManager : ISubscriptionManagerIModelStoreChangeHandlerISessionLifecycleHandler + TooManyFunctions:UserManager.kt$UserManager : IUserManagerISingletonModelStoreChangeHandler + UndocumentedPublicClass:AlertDialogPrepromptForAndroidSettings.kt$AlertDialogPrepromptForAndroidSettings$Callback + UndocumentedPublicClass:AndroidUtils.kt$AndroidUtils + UndocumentedPublicClass:AndroidUtils.kt$AndroidUtils$SchemaType + UndocumentedPublicClass:AndroidUtils.kt$AndroidUtils.SchemaType$Companion + UndocumentedPublicClass:ApplicationService.kt$ApplicationService : IApplicationServiceActivityLifecycleCallbacksOnGlobalLayoutListener + UndocumentedPublicClass:ConfigModel.kt$ConfigModel : Model + UndocumentedPublicClass:ConfigModel.kt$InfluenceConfigModel$Companion + UndocumentedPublicClass:ConfigModelStore.kt$ConfigModelStore : SingletonModelStore + UndocumentedPublicClass:DateUtils.kt$DateUtils + UndocumentedPublicClass:DeviceUtils.kt$DeviceUtils + UndocumentedPublicClass:ICondition.kt$ICondition + UndocumentedPublicClass:IConsistencyKeyEnum.kt$IConsistencyKeyEnum + UndocumentedPublicClass:IConsistencyManager.kt$IConsistencyManager + UndocumentedPublicClass:IDeviceService.kt$IDeviceService + UndocumentedPublicClass:IDeviceService.kt$IDeviceService$DeviceType + UndocumentedPublicClass:IDeviceService.kt$IDeviceService$JetpackLibraryStatus + UndocumentedPublicClass:IIdentityBackendService.kt$IIdentityBackendService + UndocumentedPublicClass:IIdentityBackendService.kt$IdentityConstants + UndocumentedPublicClass:IInAppMessage.kt$IInAppMessage + UndocumentedPublicClass:IInAppMessageClickListener.kt$IInAppMessageClickListener + UndocumentedPublicClass:IInfluenceManager.kt$IInfluenceManager + UndocumentedPublicClass:IInstallIdService.kt$IInstallIdService + UndocumentedPublicClass:ILanguageContext.kt$ILanguageContext + UndocumentedPublicClass:ILogListener.kt$ILogListener + UndocumentedPublicClass:IModelStore.kt$ModelChangeTags + UndocumentedPublicClass:INotification.kt$INotification + UndocumentedPublicClass:IOneSignal.kt$IOneSignal + UndocumentedPublicClass:IOperationExecutor.kt$ExecutionResponse + UndocumentedPublicClass:IOperationExecutor.kt$ExecutionResult + UndocumentedPublicClass:IOutcomeEvent.kt$IOutcomeEvent + UndocumentedPublicClass:IParamsBackendService.kt$FCMParamsObject + UndocumentedPublicClass:IParamsBackendService.kt$IParamsBackendService + UndocumentedPublicClass:IParamsBackendService.kt$InfluenceParamsObject + UndocumentedPublicClass:IParamsBackendService.kt$ParamsObject + UndocumentedPublicClass:IPreferencesService.kt$PreferenceOneSignalKeys + UndocumentedPublicClass:IPreferencesService.kt$PreferencePlayerPurchasesKeys + UndocumentedPublicClass:IPreferencesService.kt$PreferenceStores + UndocumentedPublicClass:IRebuildUserService.kt$IRebuildUserService + UndocumentedPublicClass:IRequestPermissionService.kt$IRequestPermissionService$PermissionCallback + UndocumentedPublicClass:ISubscriptionBackendService.kt$ISubscriptionBackendService + UndocumentedPublicClass:ISubscriptionManager.kt$ISubscriptionChangedHandler + UndocumentedPublicClass:ISubscriptionManager.kt$ISubscriptionManager : IEventNotifier + UndocumentedPublicClass:IUserBackendService.kt$CreateUserResponse + UndocumentedPublicClass:IUserBackendService.kt$IUserBackendService + UndocumentedPublicClass:IamFetchReadyCondition.kt$IamFetchReadyCondition$Companion + UndocumentedPublicClass:IdentityModelStore.kt$IdentityModelStore : SingletonModelStore + UndocumentedPublicClass:InAppMessageActionUrlType.kt$InAppMessageActionUrlType$Companion + UndocumentedPublicClass:Influence.kt$Influence + UndocumentedPublicClass:Influence.kt$Influence$Companion + UndocumentedPublicClass:InfluenceChannel.kt$InfluenceChannel + UndocumentedPublicClass:InfluenceChannel.kt$InfluenceChannel$Companion + UndocumentedPublicClass:InfluenceType.kt$InfluenceType + UndocumentedPublicClass:InfluenceType.kt$InfluenceType$Companion + UndocumentedPublicClass:JSONConverter.kt$JSONConverter + UndocumentedPublicClass:JSONUtils.kt$JSONUtils + UndocumentedPublicClass:LogLevel.kt$LogLevel + UndocumentedPublicClass:LogLevel.kt$LogLevel$Companion + UndocumentedPublicClass:Logging.kt$Logging + UndocumentedPublicClass:MigrationRecovery.kt$MigrationRecovery : IMigrationRecovery + UndocumentedPublicClass:NetworkUtils.kt$NetworkUtils + UndocumentedPublicClass:NetworkUtils.kt$NetworkUtils$ResponseStatusType + UndocumentedPublicClass:OSPrimaryCoroutineScope.kt$OSPrimaryCoroutineScope + UndocumentedPublicClass:OneSignalDbContract.kt$OneSignalDbContract + UndocumentedPublicClass:OneSignalDbContract.kt$OneSignalDbContract$InAppMessageTable : BaseColumns + UndocumentedPublicClass:OneSignalDbContract.kt$OneSignalDbContract$NotificationTable : BaseColumns + UndocumentedPublicClass:OneSignalLogEvent.kt$OneSignalLogEvent + UndocumentedPublicClass:OneSignalUtils.kt$OneSignalUtils + UndocumentedPublicClass:OneSignalWrapper.kt$OneSignalWrapper + UndocumentedPublicClass:Operation.kt$GroupComparisonType + UndocumentedPublicClass:OptionalHeaders.kt$OptionalHeaders + UndocumentedPublicClass:PermissionsActivity.kt$PermissionsActivity : Activity + UndocumentedPublicClass:PermissionsActivity.kt$PermissionsActivity$Companion + UndocumentedPublicClass:PreferenceStoreFix.kt$PreferenceStoreFix + UndocumentedPublicClass:PropertiesDeltasObject.kt$PropertiesDeltasObject + UndocumentedPublicClass:PropertiesDeltasObject.kt$PurchaseObject + UndocumentedPublicClass:PropertiesModel.kt$PropertiesModel : Model + UndocumentedPublicClass:PropertiesModelStore.kt$PropertiesModelStore : SingletonModelStore + UndocumentedPublicClass:PropertiesObject.kt$PropertiesObject + UndocumentedPublicClass:PushSubscriptionChangedState.kt$PushSubscriptionChangedState + UndocumentedPublicClass:RebuildUserService.kt$RebuildUserService : IRebuildUserService + UndocumentedPublicClass:RootToolsInternalMethods.kt$RootToolsInternalMethods + UndocumentedPublicClass:RywData.kt$RywData + UndocumentedPublicClass:ServiceBuilder.kt$ServiceBuilder : IServiceBuilder + UndocumentedPublicClass:ServiceProvider.kt$ServiceProvider$Companion + UndocumentedPublicClass:SessionModelStore.kt$SessionModelStore : SingletonModelStore + UndocumentedPublicClass:SubscriptionModel.kt$SubscriptionModel : Model + UndocumentedPublicClass:SubscriptionModel.kt$SubscriptionStatus + UndocumentedPublicClass:SubscriptionModel.kt$SubscriptionStatus$Companion + UndocumentedPublicClass:SubscriptionModel.kt$SubscriptionType + UndocumentedPublicClass:SubscriptionModelStore.kt$SubscriptionModelStore : SimpleModelStore + UndocumentedPublicClass:SubscriptionObject.kt$SubscriptionObject + UndocumentedPublicClass:SubscriptionObjectType.kt$SubscriptionObjectType + UndocumentedPublicClass:SubscriptionObjectType.kt$SubscriptionObjectType$Companion + UndocumentedPublicClass:SyncJobService.kt$SyncJobService : JobService + UndocumentedPublicClass:TimeUtils.kt$TimeUtils + UndocumentedPublicClass:UserChangedState.kt$UserChangedState + UndocumentedPublicClass:UserRefreshService.kt$UserRefreshService : IStartableServiceISessionLifecycleHandler + UndocumentedPublicClass:ViewUtils.kt$ViewUtils + UnusedParameter:AndroidUtils.kt$AndroidUtils$_class: Class<*> + UnusedPrivateProperty:AndroidUtils.kt$AndroidUtils$var requestPermission: String? = null + UnusedPrivateProperty:ApplicationService.kt$ApplicationService$val listenerKey = "decorViewReady:$runnable" + UnusedPrivateProperty:OSDatabase.kt$OSDatabase.Companion$private const val FLOAT_TYPE = " FLOAT" + UnusedPrivateProperty:OperationRepo.kt$OperationRepo$private val _time: ITime + + diff --git a/OneSignalSDK/detekt/detekt-baseline-in-app-messages.xml b/OneSignalSDK/detekt/detekt-baseline-in-app-messages.xml new file mode 100644 index 000000000..bcbfdc210 --- /dev/null +++ b/OneSignalSDK/detekt/detekt-baseline-in-app-messages.xml @@ -0,0 +1,134 @@ + + + + + ComplexCondition:InAppMessagesManager.kt$InAppMessagesManager$!message.isTriggerChanged && isMessageDisplayed && (isTriggerOnMessage || isNewTriggerAdded && isOnlyDynamicTriggers) + ConstructorParameterNaming:DynamicTriggerController.kt$DynamicTriggerController$private val _session: ISessionService + ConstructorParameterNaming:DynamicTriggerController.kt$DynamicTriggerController$private val _state: InAppStateService + ConstructorParameterNaming:DynamicTriggerController.kt$DynamicTriggerController$private val _time: ITime + ConstructorParameterNaming:InAppBackendService.kt$InAppBackendService$private val _deviceService: IDeviceService + ConstructorParameterNaming:InAppBackendService.kt$InAppBackendService$private val _httpClient: IHttpClient + ConstructorParameterNaming:InAppBackendService.kt$InAppBackendService$private val _hydrator: InAppHydrator + ConstructorParameterNaming:InAppDisplayer.kt$InAppDisplayer$private val _applicationService: IApplicationService + ConstructorParameterNaming:InAppDisplayer.kt$InAppDisplayer$private val _backend: IInAppBackendService + ConstructorParameterNaming:InAppDisplayer.kt$InAppDisplayer$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:InAppDisplayer.kt$InAppDisplayer$private val _influenceManager: IInfluenceManager + ConstructorParameterNaming:InAppDisplayer.kt$InAppDisplayer$private val _languageContext: ILanguageContext + ConstructorParameterNaming:InAppDisplayer.kt$InAppDisplayer$private val _lifecycle: IInAppLifecycleService + ConstructorParameterNaming:InAppDisplayer.kt$InAppDisplayer$private val _promptFactory: IInAppMessagePromptFactory + ConstructorParameterNaming:InAppDisplayer.kt$InAppDisplayer$private val _time: ITime + ConstructorParameterNaming:InAppHydrator.kt$InAppHydrator$private val _propertiesModelStore: PropertiesModelStore + ConstructorParameterNaming:InAppHydrator.kt$InAppHydrator$private val _time: ITime + ConstructorParameterNaming:InAppMessageLocationPrompt.kt$InAppMessageLocationPrompt$private val _locationManager: ILocationManager + ConstructorParameterNaming:InAppMessagePreviewHandler.kt$InAppMessagePreviewHandler$private val _applicationService: IApplicationService + ConstructorParameterNaming:InAppMessagePreviewHandler.kt$InAppMessagePreviewHandler$private val _iamDisplayer: IInAppDisplayer + ConstructorParameterNaming:InAppMessagePreviewHandler.kt$InAppMessagePreviewHandler$private val _notificationActivityOpener: INotificationActivityOpener + ConstructorParameterNaming:InAppMessagePreviewHandler.kt$InAppMessagePreviewHandler$private val _notificationDisplayer: INotificationDisplayer + ConstructorParameterNaming:InAppMessagePreviewHandler.kt$InAppMessagePreviewHandler$private val _notificationLifeCycle: INotificationLifecycleService + ConstructorParameterNaming:InAppMessagePreviewHandler.kt$InAppMessagePreviewHandler$private val _state: InAppStateService + ConstructorParameterNaming:InAppMessagePreviewHandler.kt$InAppMessagePreviewHandler$private val _time: ITime + ConstructorParameterNaming:InAppMessagePromptFactory.kt$InAppMessagePromptFactory$private val _locationManager: ILocationManager + ConstructorParameterNaming:InAppMessagePromptFactory.kt$InAppMessagePromptFactory$private val _notificationsManager: INotificationsManager + ConstructorParameterNaming:InAppMessagePushPrompt.kt$InAppMessagePushPrompt$private val _notificationsManager: INotificationsManager + ConstructorParameterNaming:InAppMessageRedisplayStats.kt$InAppMessageRedisplayStats$private val _time: ITime + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _applicationService: IApplicationService + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _backend: IInAppBackendService + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _consistencyManager: IConsistencyManager + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _displayer: IInAppDisplayer + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _identityModelStore: IdentityModelStore + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _influenceManager: IInfluenceManager + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _languageContext: ILanguageContext + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _lifecycle: IInAppLifecycleService + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _outcomeEventsController: IOutcomeEventsController + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _prefs: IInAppPreferencesController + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _repository: IInAppRepository + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _sessionService: ISessionService + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _state: InAppStateService + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _subscriptionManager: ISubscriptionManager + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _time: ITime + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _triggerController: ITriggerController + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _triggerModelStore: TriggerModelStore + ConstructorParameterNaming:InAppMessagesManager.kt$InAppMessagesManager$private val _userManager: IUserManager + ConstructorParameterNaming:InAppPreferencesController.kt$InAppPreferencesController$private val _prefs: IPreferencesService + ConstructorParameterNaming:InAppRepository.kt$InAppRepository$private val _databaseProvider: IDatabaseProvider + ConstructorParameterNaming:InAppRepository.kt$InAppRepository$private val _prefs: IInAppPreferencesController + ConstructorParameterNaming:InAppRepository.kt$InAppRepository$private val _time: ITime + ConstructorParameterNaming:TriggerController.kt$TriggerController$private var _dynamicTriggerController: DynamicTriggerController + ConstructorParameterNaming:WebViewManager.kt$WebViewManager$private val _applicationService: IApplicationService + ConstructorParameterNaming:WebViewManager.kt$WebViewManager$private val _lifecycle: IInAppLifecycleService + ConstructorParameterNaming:WebViewManager.kt$WebViewManager$private val _promptFactory: IInAppMessagePromptFactory + CyclomaticComplexMethod:TriggerController.kt$TriggerController$private fun evaluateTrigger(trigger: Trigger): Boolean + EmptyDefaultConstructor:IAMLifecycleService.kt$IAMLifecycleService$() + EmptyDefaultConstructor:InAppMessagePrompt.kt$InAppMessagePrompt$() + ForbiddenComment:InAppMessageTag.kt$InAppMessageTag.Companion$// TODO when backend is ready check if key match + ForbiddenComment:InAppMessagesManager.kt$InAppMessagesManager$// TODO until we don't fix the activity going forward or back dismissing the IAM, we need to auto dismiss + ForbiddenComment:InAppMessagesManager.kt$InAppMessagesManager$// TODO: Add more action payload preview logs here in future + GlobalCoroutineUsage:InAppMessagesManager.kt$InAppMessagesManager$GlobalScope.launch(Dispatchers.Main) { _displayer.dismissCurrentInAppMessage() } + LongMethod:DynamicTriggerController.kt$DynamicTriggerController$fun dynamicTriggerShouldFire(trigger: Trigger): Boolean + LongMethod:InAppRepository.kt$InAppRepository$override suspend fun cleanCachedInAppMessages() + LongParameterList:IInAppBackendService.kt$IInAppBackendService$( appId: String, subscriptionId: String, variantId: String?, messageId: String, clickId: String?, isFirstClick: Boolean, ) + LongParameterList:InAppDisplayer.kt$InAppDisplayer$( private val _applicationService: IApplicationService, private val _lifecycle: IInAppLifecycleService, private val _promptFactory: IInAppMessagePromptFactory, private val _backend: IInAppBackendService, private val _influenceManager: IInfluenceManager, private val _configModelStore: ConfigModelStore, private val _languageContext: ILanguageContext, private val _time: ITime, ) + LongParameterList:InAppMessagesManager.kt$InAppMessagesManager$( private val _applicationService: IApplicationService, private val _sessionService: ISessionService, private val _influenceManager: IInfluenceManager, private val _configModelStore: ConfigModelStore, private val _userManager: IUserManager, private val _identityModelStore: IdentityModelStore, private val _subscriptionManager: ISubscriptionManager, private val _outcomeEventsController: IOutcomeEventsController, private val _state: InAppStateService, private val _prefs: IInAppPreferencesController, private val _repository: IInAppRepository, private val _backend: IInAppBackendService, private val _triggerController: ITriggerController, private val _triggerModelStore: TriggerModelStore, private val _displayer: IInAppDisplayer, private val _lifecycle: IInAppLifecycleService, private val _languageContext: ILanguageContext, private val _time: ITime, private val _consistencyManager: IConsistencyManager, ) + LongParameterList:OneSignalAnimate.kt$OneSignalAnimate$( view: View, deltaFromY: Float, deltaToY: Float, duration: Int, interpolator: Interpolator?, animCallback: Animation.AnimationListener?, ) + MagicNumber:DraggableRelativeLayout.kt$DraggableRelativeLayout$3 + MagicNumber:DraggableRelativeLayout.kt$DraggableRelativeLayout$3000 + MagicNumber:DynamicTriggerController.kt$DynamicTriggerController$1000 + MagicNumber:InAppBackendService.kt$InAppBackendService$1_000L + MagicNumber:InAppBackendService.kt$InAppBackendService$425 + MagicNumber:InAppBackendService.kt$InAppBackendService$429 + MagicNumber:InAppBackendService.kt$InAppBackendService$500 + MagicNumber:InAppBackendService.kt$InAppBackendService$599 + MagicNumber:InAppMessageRedisplayStats.kt$InAppMessageRedisplayStats$1000 + MagicNumber:InAppMessageView.kt$InAppMessageView$0.1 + MagicNumber:InAppMessageView.kt$InAppMessageView$1000 + MagicNumber:InAppMessageView.kt$InAppMessageView$24 + MagicNumber:InAppMessageView.kt$InAppMessageView$5 + MagicNumber:InAppMessageView.kt$InAppMessageView$8 + MagicNumber:InAppMessageView.kt$InAppMessageView$8.0 + MagicNumber:InAppMessageView.kt$InAppMessageView.<no name provided>$5 + MagicNumber:InAppMessagesManager.kt$InAppMessagesManager$1000 + MagicNumber:InAppRepository.kt$InAppRepository$1000L + MagicNumber:OneSignalAnimate.kt$OneSignalAnimate$0.5f + MagicNumber:WebViewManager.kt$WebViewManager$3 + NestedBlockDepth:TriggerController.kt$TriggerController$override fun isTriggerOnMessage( message: InAppMessage, triggersKeys: Collection<String>, ): Boolean + PrintStackTrace:InAppMessage.kt$InAppMessage$e + PrintStackTrace:InAppMessage.kt$InAppMessage$exception + PrintStackTrace:InAppMessageClickResult.kt$InAppMessageClickResult$e + PrintStackTrace:InAppMessageOutcome.kt$InAppMessageOutcome$e + PrintStackTrace:InAppMessagePage.kt$InAppMessagePage$e + PrintStackTrace:InAppMessageRedisplayStats.kt$InAppMessageRedisplayStats$exception + PrintStackTrace:InAppMessageTag.kt$InAppMessageTag$e + PrintStackTrace:Trigger.kt$Trigger$exception + PrintStackTrace:WebViewManager.kt$WebViewManager.OSJavaScriptInterface$e + ReturnCount:DraggableRelativeLayout.kt$DraggableRelativeLayout.<no name provided>$override fun clampViewPositionVertical( child: View, top: Int, dy: Int, ): Int + ReturnCount:DynamicTriggerController.kt$DynamicTriggerController$fun dynamicTriggerShouldFire(trigger: Trigger): Boolean + ReturnCount:InAppBackendService.kt$InAppBackendService$override suspend fun getIAMData( appId: String, messageId: String, variantId: String?, ): GetIAMDataResponse + ReturnCount:InAppBackendService.kt$InAppBackendService$private suspend fun attemptFetchWithRetries( baseUrl: String, rywData: RywData, sessionDurationProvider: () -> Long, ): List<InAppMessage>? + ReturnCount:InAppHydrator.kt$InAppHydrator$fun hydrateIAMMessageContent(jsonObject: JSONObject): InAppMessageContent? + ReturnCount:InAppMessage.kt$InAppMessage$private fun parseEndTimeJson(json: JSONObject): Date? + ReturnCount:InAppMessagePreviewHandler.kt$InAppMessagePreviewHandler$private fun inAppPreviewPushUUID(payload: JSONObject): String? + ReturnCount:InAppMessagesManager.kt$InAppMessagesManager$override fun onMessageWasDisplayed(message: InAppMessage) + ReturnCount:InAppMessagesManager.kt$InAppMessagesManager$private suspend fun fetchMessages(rywData: RywData) + ReturnCount:TriggerController.kt$TriggerController$override fun evaluateMessageTriggers(message: InAppMessage): Boolean + ReturnCount:TriggerController.kt$TriggerController$override fun isTriggerOnMessage( message: InAppMessage, triggersKeys: Collection<String>, ): Boolean + ReturnCount:TriggerController.kt$TriggerController$override fun messageHasOnlyDynamicTriggers(message: InAppMessage): Boolean + ReturnCount:TriggerController.kt$TriggerController$private fun evaluateTrigger(trigger: Trigger): Boolean + ReturnCount:TriggerController.kt$TriggerController$private fun triggerMatchesFlex( triggerValue: Any?, deviceValue: Any, operator: Trigger.OSTriggerOperator, ): Boolean + SwallowedException:InAppMessage.kt$InAppMessage$e: JSONException + SwallowedException:InAppMessagePreviewHandler.kt$InAppMessagePreviewHandler$e: JSONException + SwallowedException:InAppMessagesManager.kt$InAppMessagesManager$ex: BackendException + SwallowedException:OneSignalChromeTab.kt$OneSignalChromeTab$e: Throwable + SwallowedException:WebViewManager.kt$WebViewManager.OSJavaScriptInterface$e: JSONException + TooGenericExceptionCaught:InAppDisplayer.kt$InAppDisplayer$e: Exception + TooGenericExceptionCaught:OneSignalChromeTab.kt$OneSignalChromeTab$e: Throwable + TooManyFunctions:InAppBackendService.kt$InAppBackendService : IInAppBackendService + TooManyFunctions:InAppMessage.kt$InAppMessage : IInAppMessage + TooManyFunctions:InAppMessageView.kt$InAppMessageView + TooManyFunctions:InAppMessagesManager.kt$InAppMessagesManager : IInAppMessagesManagerIStartableServiceISubscriptionChangedHandlerISingletonModelStoreChangeHandlerIInAppLifecycleEventHandlerITriggerHandlerISessionLifecycleHandlerIApplicationLifecycleHandler + TooManyFunctions:TriggerController.kt$TriggerController : ITriggerControllerIModelStoreChangeHandler + TooManyFunctions:WebViewManager.kt$WebViewManager : IActivityLifecycleHandler + UndocumentedPublicClass:TriggerModel.kt$TriggerModel : Model + UndocumentedPublicClass:TriggerModelStore.kt$TriggerModelStore : SimpleModelStore + + diff --git a/OneSignalSDK/detekt/detekt-baseline-location.xml b/OneSignalSDK/detekt/detekt-baseline-location.xml new file mode 100644 index 000000000..fd6c11cd7 --- /dev/null +++ b/OneSignalSDK/detekt/detekt-baseline-location.xml @@ -0,0 +1,53 @@ + + + + + ConstructorParameterNaming:GmsLocationController.kt$GmsLocationController$private val _applicationService: IApplicationService + ConstructorParameterNaming:GmsLocationController.kt$GmsLocationController$private val _fusedLocationApiWrapper: IFusedLocationApiWrapper + ConstructorParameterNaming:GmsLocationController.kt$GmsLocationController.GoogleApiClientListener$private val _parent: GmsLocationController + ConstructorParameterNaming:GmsLocationController.kt$GmsLocationController.LocationUpdateListener$private val _applicationService: IApplicationService + ConstructorParameterNaming:GmsLocationController.kt$GmsLocationController.LocationUpdateListener$private val _fusedLocationApiWrapper: IFusedLocationApiWrapper + ConstructorParameterNaming:GmsLocationController.kt$GmsLocationController.LocationUpdateListener$private val _parent: GmsLocationController + ConstructorParameterNaming:HmsLocationController.kt$HmsLocationController$private val _applicationService: IApplicationService + ConstructorParameterNaming:HmsLocationController.kt$HmsLocationController.LocationUpdateListener$private val _applicationService: IApplicationService + ConstructorParameterNaming:HmsLocationController.kt$HmsLocationController.LocationUpdateListener$private val _parent: HmsLocationController + ConstructorParameterNaming:LocationBackgroundService.kt$LocationBackgroundService$private val _applicationService: IApplicationService + ConstructorParameterNaming:LocationBackgroundService.kt$LocationBackgroundService$private val _capturer: ILocationCapturer + ConstructorParameterNaming:LocationBackgroundService.kt$LocationBackgroundService$private val _locationManager: ILocationManager + ConstructorParameterNaming:LocationBackgroundService.kt$LocationBackgroundService$private val _prefs: ILocationPreferencesService + ConstructorParameterNaming:LocationBackgroundService.kt$LocationBackgroundService$private val _time: ITime + ConstructorParameterNaming:LocationCapturer.kt$LocationCapturer$private val _applicationService: IApplicationService + ConstructorParameterNaming:LocationCapturer.kt$LocationCapturer$private val _controller: ILocationController + ConstructorParameterNaming:LocationCapturer.kt$LocationCapturer$private val _prefs: ILocationPreferencesService + ConstructorParameterNaming:LocationCapturer.kt$LocationCapturer$private val _propertiesModelStore: PropertiesModelStore + ConstructorParameterNaming:LocationCapturer.kt$LocationCapturer$private val _time: ITime + ConstructorParameterNaming:LocationManager.kt$LocationManager$private val _applicationService: IApplicationService + ConstructorParameterNaming:LocationManager.kt$LocationManager$private val _capturer: ILocationCapturer + ConstructorParameterNaming:LocationManager.kt$LocationManager$private val _locationController: ILocationController + ConstructorParameterNaming:LocationManager.kt$LocationManager$private val _locationPermissionController: LocationPermissionController + ConstructorParameterNaming:LocationManager.kt$LocationManager$private val _prefs: IPreferencesService + ConstructorParameterNaming:LocationPermissionController.kt$LocationPermissionController$private val _applicationService: IApplicationService + ConstructorParameterNaming:LocationPermissionController.kt$LocationPermissionController$private val _requestPermission: IRequestPermissionService + ConstructorParameterNaming:LocationPreferencesService.kt$LocationPreferencesService$private val _prefs: IPreferencesService + CyclomaticComplexMethod:LocationManager.kt$LocationManager$override suspend fun requestPermission(): Boolean + ForbiddenComment:GmsLocationController.kt$GmsLocationController$// TODO: google api client has a blocking connect with timeout, use that instead of our withTimeout? + LongMethod:GmsLocationController.kt$GmsLocationController$override suspend fun start(): Boolean + LongMethod:HmsLocationController.kt$HmsLocationController$override suspend fun start(): Boolean + LongMethod:LocationManager.kt$LocationManager$override suspend fun requestPermission(): Boolean + MagicNumber:GmsLocationController.kt$GmsLocationController.LocationUpdateListener$1.5 + MagicNumber:HmsLocationController.kt$HmsLocationController.LocationUpdateListener$1.5 + MagicNumber:LocationBackgroundService.kt$LocationBackgroundService$1000 + MagicNumber:LocationCapturer.kt$LocationCapturer$7 + MagicNumber:LocationManager.kt$LocationManager$29 + MayBeConst:GmsLocationController.kt$GmsLocationController.Companion$val API_FALLBACK_TIME = 30000 + PrintStackTrace:GoogleApiClientCompatProxy.kt$GoogleApiClientCompatProxy$t + ProtectedMemberInFinalClass:GmsLocationController.kt$GmsLocationController$LocationHandlerThread : HandlerThread + SwallowedException:GmsLocationController.kt$GmsLocationController$e: TimeoutCancellationException + SwallowedException:LocationUtils.kt$LocationUtils$e: NoClassDefFoundError + TooGenericExceptionCaught:FusedLocationApiWrapperImpl.kt$FusedLocationApiWrapperImpl$t: Throwable + TooGenericExceptionCaught:GoogleApiClientCompatProxy.kt$GoogleApiClientCompatProxy$t: Throwable + TooGenericExceptionCaught:HmsLocationController.kt$HmsLocationController$e: Exception + TooGenericExceptionCaught:LocationManager.kt$LocationManager$t: Throwable + TooGenericExceptionThrown:GmsLocationController.kt$GmsLocationController.LocationUpdateListener$throw Exception("googleApiClient not connected, cannot listen!") + + diff --git a/OneSignalSDK/detekt/detekt-baseline-notifications.xml b/OneSignalSDK/detekt/detekt-baseline-notifications.xml new file mode 100644 index 000000000..805672fc7 --- /dev/null +++ b/OneSignalSDK/detekt/detekt-baseline-notifications.xml @@ -0,0 +1,293 @@ + + + + + ComplexCondition:SummaryNotificationDisplayer.kt$SummaryNotificationDisplayer$updateSummary && summaryList.size > 1 || !updateSummary && summaryList.size > 0 + ConstructorParameterNaming:BadgeCountUpdater.kt$BadgeCountUpdater$private val _applicationService: IApplicationService + ConstructorParameterNaming:BadgeCountUpdater.kt$BadgeCountUpdater$private val _databaseProvider: IDatabaseProvider + ConstructorParameterNaming:BadgeCountUpdater.kt$BadgeCountUpdater$private val _queryHelper: INotificationQueryHelper + ConstructorParameterNaming:DeviceRegistrationListener.kt$DeviceRegistrationListener$private val _channelManager: INotificationChannelManager + ConstructorParameterNaming:DeviceRegistrationListener.kt$DeviceRegistrationListener$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:DeviceRegistrationListener.kt$DeviceRegistrationListener$private val _notificationsManager: INotificationsManager + ConstructorParameterNaming:DeviceRegistrationListener.kt$DeviceRegistrationListener$private val _pushTokenManager: IPushTokenManager + ConstructorParameterNaming:DeviceRegistrationListener.kt$DeviceRegistrationListener$private val _subscriptionManager: ISubscriptionManager + ConstructorParameterNaming:FirebaseAnalyticsTracker.kt$FirebaseAnalyticsTracker$private val _applicationService: IApplicationService + ConstructorParameterNaming:FirebaseAnalyticsTracker.kt$FirebaseAnalyticsTracker$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:FirebaseAnalyticsTracker.kt$FirebaseAnalyticsTracker$private val _time: ITime + ConstructorParameterNaming:GooglePlayServicesUpgradePrompt.kt$GooglePlayServicesUpgradePrompt$private val _applicationService: IApplicationService + ConstructorParameterNaming:GooglePlayServicesUpgradePrompt.kt$GooglePlayServicesUpgradePrompt$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:GooglePlayServicesUpgradePrompt.kt$GooglePlayServicesUpgradePrompt$private val _deviceService: IDeviceService + ConstructorParameterNaming:NotificationBackendService.kt$NotificationBackendService$private val _httpClient: IHttpClient + ConstructorParameterNaming:NotificationBundleProcessor.kt$NotificationBundleProcessor$private val _time: ITime + ConstructorParameterNaming:NotificationBundleProcessor.kt$NotificationBundleProcessor$private val _workManager: INotificationGenerationWorkManager + ConstructorParameterNaming:NotificationChannelManager.kt$NotificationChannelManager$private val _applicationService: IApplicationService + ConstructorParameterNaming:NotificationChannelManager.kt$NotificationChannelManager$private val _languageContext: ILanguageContext + ConstructorParameterNaming:NotificationClickEvent.kt$NotificationClickEvent$private val _notification: Notification + ConstructorParameterNaming:NotificationClickEvent.kt$NotificationClickEvent$private val _result: NotificationClickResult + ConstructorParameterNaming:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$private val _applicationService: IApplicationService + ConstructorParameterNaming:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$private val _notificationChannelManager: INotificationChannelManager + ConstructorParameterNaming:NotificationDisplayer.kt$NotificationDisplayer$private val _applicationService: IApplicationService + ConstructorParameterNaming:NotificationDisplayer.kt$NotificationDisplayer$private val _notificationDisplayBuilder: INotificationDisplayBuilder + ConstructorParameterNaming:NotificationDisplayer.kt$NotificationDisplayer$private val _notificationLimitManager: INotificationLimitManager + ConstructorParameterNaming:NotificationDisplayer.kt$NotificationDisplayer$private val _summaryNotificationDisplayer: ISummaryNotificationDisplayer + ConstructorParameterNaming:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$private val _applicationService: IApplicationService + ConstructorParameterNaming:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$private val _dataController: INotificationRepository + ConstructorParameterNaming:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$private val _lifecycleService: INotificationLifecycleService + ConstructorParameterNaming:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$private val _notificationDisplayer: INotificationDisplayer + ConstructorParameterNaming:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$private val _notificationSummaryManager: INotificationSummaryManager + ConstructorParameterNaming:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$private val _time: ITime + ConstructorParameterNaming:NotificationLifecycleService.kt$NotificationLifecycleService$private val _analyticsTracker: IAnalyticsTracker + ConstructorParameterNaming:NotificationLifecycleService.kt$NotificationLifecycleService$private val _applicationService: IApplicationService + ConstructorParameterNaming:NotificationLifecycleService.kt$NotificationLifecycleService$private val _backend: INotificationBackendService + ConstructorParameterNaming:NotificationLifecycleService.kt$NotificationLifecycleService$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:NotificationLifecycleService.kt$NotificationLifecycleService$private val _deviceService: IDeviceService + ConstructorParameterNaming:NotificationLifecycleService.kt$NotificationLifecycleService$private val _influenceManager: IInfluenceManager + ConstructorParameterNaming:NotificationLifecycleService.kt$NotificationLifecycleService$private val _receiveReceiptWorkManager: IReceiveReceiptWorkManager + ConstructorParameterNaming:NotificationLifecycleService.kt$NotificationLifecycleService$private val _subscriptionManager: ISubscriptionManager + ConstructorParameterNaming:NotificationLifecycleService.kt$NotificationLifecycleService$private val _time: ITime + ConstructorParameterNaming:NotificationLimitManager.kt$NotificationLimitManager$private val _applicationService: IApplicationService + ConstructorParameterNaming:NotificationLimitManager.kt$NotificationLimitManager$private val _dataController: INotificationRepository + ConstructorParameterNaming:NotificationLimitManager.kt$NotificationLimitManager$private val _notificationSummaryManager: INotificationSummaryManager + ConstructorParameterNaming:NotificationOpenedProcessor.kt$NotificationOpenedProcessor$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:NotificationOpenedProcessor.kt$NotificationOpenedProcessor$private val _dataController: INotificationRepository + ConstructorParameterNaming:NotificationOpenedProcessor.kt$NotificationOpenedProcessor$private val _lifecycleService: INotificationLifecycleService + ConstructorParameterNaming:NotificationOpenedProcessor.kt$NotificationOpenedProcessor$private val _summaryManager: INotificationSummaryManager + ConstructorParameterNaming:NotificationOpenedProcessorHMS.kt$NotificationOpenedProcessorHMS$private val _lifecycleService: INotificationLifecycleService + ConstructorParameterNaming:NotificationPermissionController.kt$NotificationPermissionController$private val _application: IApplicationService + ConstructorParameterNaming:NotificationPermissionController.kt$NotificationPermissionController$private val _applicationService: IApplicationService + ConstructorParameterNaming:NotificationPermissionController.kt$NotificationPermissionController$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:NotificationPermissionController.kt$NotificationPermissionController$private val _preferenceService: IPreferencesService + ConstructorParameterNaming:NotificationPermissionController.kt$NotificationPermissionController$private val _requestPermission: IRequestPermissionService + ConstructorParameterNaming:NotificationQueryHelper.kt$NotificationQueryHelper$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:NotificationQueryHelper.kt$NotificationQueryHelper$private val _time: ITime + ConstructorParameterNaming:NotificationRepository.kt$NotificationRepository$private val _applicationService: IApplicationService + ConstructorParameterNaming:NotificationRepository.kt$NotificationRepository$private val _badgeCountUpdater: IBadgeCountUpdater + ConstructorParameterNaming:NotificationRepository.kt$NotificationRepository$private val _databaseProvider: IDatabaseProvider + ConstructorParameterNaming:NotificationRepository.kt$NotificationRepository$private val _queryHelper: INotificationQueryHelper + ConstructorParameterNaming:NotificationRepository.kt$NotificationRepository$private val _time: ITime + ConstructorParameterNaming:NotificationRestoreProcessor.kt$NotificationRestoreProcessor$private val _applicationService: IApplicationService + ConstructorParameterNaming:NotificationRestoreProcessor.kt$NotificationRestoreProcessor$private val _badgeCountUpdater: IBadgeCountUpdater + ConstructorParameterNaming:NotificationRestoreProcessor.kt$NotificationRestoreProcessor$private val _dataController: INotificationRepository + ConstructorParameterNaming:NotificationRestoreProcessor.kt$NotificationRestoreProcessor$private val _workManager: INotificationGenerationWorkManager + ConstructorParameterNaming:NotificationSummaryManager.kt$NotificationSummaryManager$private val _applicationService: IApplicationService + ConstructorParameterNaming:NotificationSummaryManager.kt$NotificationSummaryManager$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:NotificationSummaryManager.kt$NotificationSummaryManager$private val _dataController: INotificationRepository + ConstructorParameterNaming:NotificationSummaryManager.kt$NotificationSummaryManager$private val _notificationRestoreProcessor: INotificationRestoreProcessor + ConstructorParameterNaming:NotificationSummaryManager.kt$NotificationSummaryManager$private val _summaryNotificationDisplayer: ISummaryNotificationDisplayer + ConstructorParameterNaming:NotificationSummaryManager.kt$NotificationSummaryManager$private val _time: ITime + ConstructorParameterNaming:NotificationsManager.kt$NotificationsManager$private val _applicationService: IApplicationService + ConstructorParameterNaming:NotificationsManager.kt$NotificationsManager$private val _notificationDataController: INotificationRepository + ConstructorParameterNaming:NotificationsManager.kt$NotificationsManager$private val _notificationLifecycleService: INotificationLifecycleService + ConstructorParameterNaming:NotificationsManager.kt$NotificationsManager$private val _notificationPermissionController: INotificationPermissionController + ConstructorParameterNaming:NotificationsManager.kt$NotificationsManager$private val _notificationRestoreWorkManager: INotificationRestoreWorkManager + ConstructorParameterNaming:NotificationsManager.kt$NotificationsManager$private val _summaryManager: INotificationSummaryManager + ConstructorParameterNaming:PushRegistratorADM.kt$PushRegistratorADM$private val _applicationService: IApplicationService + ConstructorParameterNaming:PushRegistratorAbstractGoogle.kt$PushRegistratorAbstractGoogle$private val _deviceService: IDeviceService + ConstructorParameterNaming:PushRegistratorAbstractGoogle.kt$PushRegistratorAbstractGoogle$private val _upgradePrompt: GooglePlayServicesUpgradePrompt + ConstructorParameterNaming:PushRegistratorAbstractGoogle.kt$PushRegistratorAbstractGoogle$private var _configModelStore: ConfigModelStore + ConstructorParameterNaming:PushRegistratorFCM.kt$PushRegistratorFCM$val _applicationService: IApplicationService + ConstructorParameterNaming:PushRegistratorFCM.kt$PushRegistratorFCM$var _configModelStore: ConfigModelStore + ConstructorParameterNaming:PushRegistratorHMS.kt$PushRegistratorHMS$private val _applicationService: IApplicationService + ConstructorParameterNaming:PushRegistratorHMS.kt$PushRegistratorHMS$private val _deviceService: IDeviceService + ConstructorParameterNaming:PushTokenManager.kt$PushTokenManager$private val _deviceService: IDeviceService + ConstructorParameterNaming:PushTokenManager.kt$PushTokenManager$private val _pushRegistrator: IPushRegistrator + ConstructorParameterNaming:ReceiveReceiptProcessor.kt$ReceiveReceiptProcessor$private val _backend: INotificationBackendService + ConstructorParameterNaming:ReceiveReceiptProcessor.kt$ReceiveReceiptProcessor$private val _deviceService: IDeviceService + ConstructorParameterNaming:ReceiveReceiptWorkManager.kt$ReceiveReceiptWorkManager$private val _applicationService: IApplicationService + ConstructorParameterNaming:ReceiveReceiptWorkManager.kt$ReceiveReceiptWorkManager$private val _configModelStore: ConfigModelStore + ConstructorParameterNaming:ReceiveReceiptWorkManager.kt$ReceiveReceiptWorkManager$private val _subscriptionManager: ISubscriptionManager + ConstructorParameterNaming:SummaryNotificationDisplayer.kt$SummaryNotificationDisplayer$private val _applicationService: IApplicationService + ConstructorParameterNaming:SummaryNotificationDisplayer.kt$SummaryNotificationDisplayer$private val _dataController: INotificationRepository + ConstructorParameterNaming:SummaryNotificationDisplayer.kt$SummaryNotificationDisplayer$private val _notificationDisplayBuilder: INotificationDisplayBuilder + CyclomaticComplexMethod:NotificationChannelManager.kt$NotificationChannelManager$@RequiresApi(api = Build.VERSION_CODES.O) @Throws( JSONException::class, ) private fun createChannel( context: Context, notificationManager: NotificationManager, payload: JSONObject, ): String + CyclomaticComplexMethod:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$override suspend fun processNotificationData( context: Context, androidNotificationId: Int, jsonPayload: JSONObject, isRestoring: Boolean, timestamp: Long, ) + CyclomaticComplexMethod:SummaryNotificationDisplayer.kt$SummaryNotificationDisplayer$override suspend fun createSummaryNotification( notificationJob: NotificationGenerationJob, notifBuilder: NotificationDisplayBuilder.OneSignalNotificationBuilder?, groupAlertBehavior: Int, ) + EmptyCatchBlock:NotificationDisplayBuilder.kt$NotificationDisplayBuilder${ } + EmptyCatchBlock:NotificationDisplayer.kt$NotificationDisplayer${ } + EmptyCatchBlock:NotificationHelper.kt$NotificationHelper${ } + EmptyDefaultConstructor:PushRegistratorNone.kt$PushRegistratorNone$() + EmptySecondaryConstructor:Notification.kt$Notification${} + ForbiddenComment:FCMBroadcastReceiver.kt$FCMBroadcastReceiver$// TODO: Previous error and related to this Github issue ticket + ForbiddenComment:NotificationChannelManager.kt$NotificationChannelManager$// TODO: Remove this try-catch once it is figured out which argument is causing Issue #895 + ForbiddenComment:NotificationGenerationWorkManager.kt$NotificationGenerationWorkManager$// TODO: Need to figure out how to implement the isHighPriority param + ForbiddenComment:NotificationLifecycleService.kt$NotificationLifecycleService$// TODO: This can have late binding issues too + ForbiddenComment:NotificationOpenedProcessor.kt$NotificationOpenedProcessor$// TODO: Could most likely be simplified checking if BUNDLE_KEY_ONESIGNAL_DATA is present + ForbiddenComment:PushRegistratorAbstractGoogle.kt$PushRegistratorAbstractGoogle$// TODO: New error? + ForbiddenComment:SummaryNotificationDisplayer.kt$SummaryNotificationDisplayer$// TODO: We are re-using the notifBuilder from the normal notification so if a developer as an + ForbiddenComment:UpgradeReceiver.kt$UpgradeReceiver$// TODO: Now that we arent restoring like we use to, think we can remove this? Ill do some + GlobalCoroutineUsage:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$GlobalScope.launch(Dispatchers.IO) { _lifecycleService.externalNotificationWillShowInForeground(notificationWillDisplayEvent) if (notificationWillDisplayEvent.discard) { wantsToDisplay = false } else if (notificationWillDisplayEvent.isPreventDefault) { wantsToDisplay = false // wait on display waiter. If the caller calls `display` or `preventDefault(true)` on the notification, // we will exit `waitForWake` and set `wantsToDisplay` to true or false respectively. If the callback // never calls `display` or `preventDefault(true)`, we will timeout and never update `wantsToDisplay`. wantsToDisplay = notification.displayWaiter.waitForWake() } } + GlobalCoroutineUsage:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$GlobalScope.launch(Dispatchers.IO) { _lifecycleService.externalRemoteNotificationReceived(notificationReceivedEvent) if (notificationReceivedEvent.discard) { wantsToDisplay = false } else if (notificationReceivedEvent.isPreventDefault) { wantsToDisplay = false // wait on display waiter. If the caller calls `display` or `preventDefault(true)` on the notification, // we will exit `waitForWake` and set `wantsToDisplay` to true or false respectively. If the callback // never calls `display` or `preventDefault(true)`, we will timeout and never update `wantsToDisplay`. wantsToDisplay = notification.displayWaiter.waitForWake() } } + LongMethod:GooglePlayServicesUpgradePrompt.kt$GooglePlayServicesUpgradePrompt$suspend fun showUpdateGPSDialog() + LongMethod:Notification.kt$Notification$fun toJSONObject(): JSONObject + LongMethod:Notification.kt$Notification$private fun initPayloadData( currentJsonPayload: JSONObject, time: ITime, ) + LongMethod:NotificationBundleProcessor.kt$NotificationBundleProcessor$private fun maximizeButtonsFromBundle(fcmBundle: Bundle) + LongMethod:NotificationChannelManager.kt$NotificationChannelManager$@RequiresApi(api = Build.VERSION_CODES.O) @Throws( JSONException::class, ) private fun createChannel( context: Context, notificationManager: NotificationManager, payload: JSONObject, ): String + LongMethod:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$override fun getBaseOneSignalNotificationBuilder(notificationJob: NotificationGenerationJob): OneSignalNotificationBuilder + LongMethod:NotificationDisplayer.kt$NotificationDisplayer$@Throws(Throwable::class) private fun addBackgroundImage( fcmJson: JSONObject, notifBuilder: NotificationCompat.Builder?, ) + LongMethod:NotificationDisplayer.kt$NotificationDisplayer$private suspend fun showNotification(notificationJob: NotificationGenerationJob): Boolean + LongMethod:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$override suspend fun processNotificationData( context: Context, androidNotificationId: Int, jsonPayload: JSONObject, isRestoring: Boolean, timestamp: Long, ) + LongMethod:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$private suspend fun saveNotification( notificationJob: NotificationGenerationJob, opened: Boolean, ) + LongMethod:NotificationLifecycleService.kt$NotificationLifecycleService$override suspend fun notificationOpened( activity: Activity, data: JSONArray, ) + LongMethod:NotificationRepository.kt$NotificationRepository$override suspend fun createNotification( id: String, groupId: String?, collapseKey: String?, shouldDismissIdenticals: Boolean, isOpened: Boolean, androidId: Int, title: String?, body: String?, expireTime: Long, jsonPayload: String, ) + LongMethod:NotificationRepository.kt$NotificationRepository$override suspend fun listNotificationsForGroup(summaryGroup: String): List<INotificationRepository.NotificationData> + LongMethod:NotificationRepository.kt$NotificationRepository$override suspend fun listNotificationsForOutstanding(excludeAndroidIds: List<Int>?): List<INotificationRepository.NotificationData> + LongMethod:NotificationRepository.kt$NotificationRepository$override suspend fun markAsConsumed( androidId: Int, dismissed: Boolean, summaryGroup: String?, clearGroupOnSummaryClick: Boolean, ) + LongMethod:NotificationsModule.kt$NotificationsModule$override fun register(builder: ServiceBuilder) + LongMethod:SummaryNotificationDisplayer.kt$SummaryNotificationDisplayer$@RequiresApi(api = Build.VERSION_CODES.M) override suspend fun createGrouplessSummaryNotification( notificationJob: NotificationGenerationJob, intentGenerator: IntentGeneratorForAttachingToNotifications, grouplessNotifCount: Int, groupAlertBehavior: Int, ) + LongMethod:SummaryNotificationDisplayer.kt$SummaryNotificationDisplayer$override suspend fun createSummaryNotification( notificationJob: NotificationGenerationJob, notifBuilder: NotificationDisplayBuilder.OneSignalNotificationBuilder?, groupAlertBehavior: Int, ) + LongParameterList:INotificationGenerationWorkManager.kt$INotificationGenerationWorkManager$( context: Context, osNotificationId: String, androidNotificationId: Int, jsonPayload: JSONObject?, timestamp: Long, isRestoring: Boolean, isHighPriority: Boolean, ) + LongParameterList:INotificationRepository.kt$INotificationRepository$( id: String, groupId: String?, collapseKey: String?, shouldDismissIdenticals: Boolean, isOpened: Boolean, androidId: Int, title: String?, body: String?, expireTime: Long, jsonPayload: String, ) + LongParameterList:NotificationLifecycleService.kt$NotificationLifecycleService$( private val _applicationService: IApplicationService, private val _time: ITime, private val _configModelStore: ConfigModelStore, private val _influenceManager: IInfluenceManager, private val _subscriptionManager: ISubscriptionManager, private val _deviceService: IDeviceService, private val _backend: INotificationBackendService, private val _receiveReceiptWorkManager: IReceiveReceiptWorkManager, private val _analyticsTracker: IAnalyticsTracker, ) + LoopWithTooManyJumpStatements:NotificationLifecycleService.kt$NotificationLifecycleService$for + MagicNumber:FirebaseAnalyticsTracker.kt$FirebaseAnalyticsTracker$1000 + MagicNumber:FirebaseAnalyticsTracker.kt$FirebaseAnalyticsTracker$30 + MagicNumber:FirebaseAnalyticsTracker.kt$FirebaseAnalyticsTracker$60 + MagicNumber:Notification.kt$Notification$1000 + MagicNumber:NotificationBundleProcessor.kt$NotificationBundleProcessor$1000L + MagicNumber:NotificationBundleProcessor.kt$NotificationBundleProcessor$9 + MagicNumber:NotificationChannelManager.kt$NotificationChannelManager$16 + MagicNumber:NotificationChannelManager.kt$NotificationChannelManager$3 + MagicNumber:NotificationChannelManager.kt$NotificationChannelManager$5 + MagicNumber:NotificationChannelManager.kt$NotificationChannelManager$6 + MagicNumber:NotificationChannelManager.kt$NotificationChannelManager$7 + MagicNumber:NotificationChannelManager.kt$NotificationChannelManager$9 + MagicNumber:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$1000L + MagicNumber:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$16 + MagicNumber:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$2000 + MagicNumber:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$3 + MagicNumber:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$4 + MagicNumber:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$5000 + MagicNumber:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$6 + MagicNumber:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$7 + MagicNumber:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$9 + MagicNumber:NotificationDisplayer.kt$NotificationDisplayer$16 + MagicNumber:NotificationDisplayer.kt$NotificationDisplayer$3 + MagicNumber:NotificationDisplayer.kt$NotificationDisplayer$5000 + MagicNumber:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$1000 + MagicNumber:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$1000L + MagicNumber:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$30000L + MagicNumber:NotificationGenerationWorkManager.kt$NotificationGenerationWorkManager.NotificationGenerationWorker$1000L + MagicNumber:NotificationHelper.kt$NotificationHelper$10 + MagicNumber:NotificationQueryHelper.kt$NotificationQueryHelper$1000L + MagicNumber:NotificationQueryHelper.kt$NotificationQueryHelper$604800L + MagicNumber:NotificationRepository.kt$NotificationRepository$1000L + MagicNumber:NotificationRestoreWorkManager.kt$NotificationRestoreWorkManager$15 + MagicNumber:PushRegistratorADM.kt$PushRegistratorADM$30000 + MagicNumber:PushRegistratorHMS.kt$PushRegistratorHMS$30000 + MagicNumber:PushTokenManager.kt$PushTokenManager$6 + MayBeConst:INotificationLimitManager.kt$INotificationLimitManager.Constants$/** * The maximum number of notifications an app is allowed to have in the Android shade. */ val maxNumberOfNotifications: Int = 49 + NestedBlockDepth:PushRegistratorAbstractGoogle.kt$PushRegistratorAbstractGoogle$private suspend fun attemptRegistration( senderId: String, currentRetry: Int, ): IPushRegistrator.RegisterResult? + PrintStackTrace:FirebaseAnalyticsTracker.kt$FirebaseAnalyticsTracker$e + PrintStackTrace:FirebaseAnalyticsTracker.kt$FirebaseAnalyticsTracker$t + PrintStackTrace:FirebaseAnalyticsTracker.kt$FirebaseAnalyticsTracker.Companion$e + PrintStackTrace:GooglePlayServicesUpgradePrompt.kt$GooglePlayServicesUpgradePrompt$e + PrintStackTrace:Notification.kt$Notification$e + PrintStackTrace:Notification.kt$Notification.ActionButton$t + PrintStackTrace:NotificationBundleProcessor.kt$NotificationBundleProcessor$e + PrintStackTrace:NotificationChannelManager.kt$NotificationChannelManager$e + PrintStackTrace:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$t + PrintStackTrace:NotificationDisplayer.kt$NotificationDisplayer$t + PrintStackTrace:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$e + PrintStackTrace:NotificationLifecycleService.kt$NotificationLifecycleService$e + PrintStackTrace:NotificationOpenedProcessor.kt$NotificationOpenedProcessor$e + PrintStackTrace:NotificationOpenedProcessorHMS.kt$NotificationOpenedProcessorHMS$e + PrintStackTrace:NotificationSummaryManager.kt$NotificationSummaryManager$e + ReturnCount:FCMBroadcastReceiver.kt$FCMBroadcastReceiver$override fun onReceive( context: Context, intent: Intent, ) + ReturnCount:FirebaseAnalyticsTracker.kt$FirebaseAnalyticsTracker$override fun trackInfluenceOpenEvent() + ReturnCount:GenerateNotificationOpenIntent.kt$GenerateNotificationOpenIntent$private fun getIntentAppOpen(): Intent? + ReturnCount:NotificationChannelManager.kt$NotificationChannelManager$override fun createNotificationChannel(notificationJob: NotificationGenerationJob): String + ReturnCount:NotificationChannelManager.kt$NotificationChannelManager$override fun processChannelList(list: JSONArray?) + ReturnCount:NotificationChannelManager.kt$NotificationChannelManager$private fun priorityToImportance(priority: Int): Int + ReturnCount:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$private fun convertOSToAndroidPriority(priority: Int): Int + ReturnCount:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$private fun getAccentColor(fcmJson: JSONObject): BigInteger? + ReturnCount:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$private fun getBitmapFromAssetsOrResourceName(bitmapStr: String): Bitmap? + ReturnCount:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$private fun getResourceIcon(iconName: String?): Int + ReturnCount:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$private fun resizeBitmapForLargeIconArea(bitmap: Bitmap?): Bitmap? + ReturnCount:NotificationDisplayer.kt$NotificationDisplayer$private fun getBitmapFromAssetsOrResourceName(bitmapStr: String): Bitmap? + ReturnCount:NotificationDisplayer.kt$NotificationDisplayer$private fun getResourceIcon(iconName: String?): Int + ReturnCount:NotificationFormatHelper.kt$NotificationFormatHelper$private fun getOSNotificationIdFromBundle(bundle: Bundle?): String? + ReturnCount:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$override suspend fun processNotificationData( context: Context, androidNotificationId: Int, jsonPayload: JSONObject, isRestoring: Boolean, timestamp: Long, ) + ReturnCount:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$private fun shouldFireForegroundHandlers(notificationJob: NotificationGenerationJob): Boolean + ReturnCount:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$private suspend fun processHandlerResponse( notificationJob: NotificationGenerationJob, wantsToDisplay: Boolean, isRestoring: Boolean, ): Boolean? + ReturnCount:NotificationGenerationWorkManager.kt$NotificationGenerationWorkManager$override fun beginEnqueueingWork( context: Context, osNotificationId: String, androidNotificationId: Int, jsonPayload: JSONObject?, timestamp: Long, isRestoring: Boolean, isHighPriority: Boolean, ): Boolean + ReturnCount:NotificationGenerationWorkManager.kt$NotificationGenerationWorkManager.NotificationGenerationWorker$override suspend fun doWork(): Result + ReturnCount:NotificationHelper.kt$NotificationHelper$fun areNotificationsEnabled( context: Context, channelId: String? = null, ): Boolean + ReturnCount:NotificationHelper.kt$NotificationHelper$fun getCampaignNameFromNotification(notification: INotification): String + ReturnCount:NotificationHelper.kt$NotificationHelper$fun getNotificationIdFromFCMJson(fcmJson: JSONObject?): String? + ReturnCount:NotificationLifecycleService.kt$NotificationLifecycleService$private fun shouldInitDirectSessionFromNotificationOpen(context: Activity): Boolean + ReturnCount:NotificationPermissionController.kt$NotificationPermissionController$override suspend fun prompt(fallbackToSettings: Boolean): Boolean + ReturnCount:NotificationRestoreProcessor.kt$NotificationRestoreProcessor$private fun getVisibleNotifications(): List<Int>? + ReturnCount:NotificationRestoreWorkManager.kt$NotificationRestoreWorkManager.NotificationRestoreWorker$override suspend fun doWork(): Result + ReturnCount:NotificationSummaryManager.kt$NotificationSummaryManager$private suspend fun internalUpdateSummaryNotificationAfterChildRemoved( group: String, dismissed: Boolean, ) + ReturnCount:OneSignalHmsEventBridge.kt$OneSignalHmsEventBridge$fun onMessageReceived( context: Context, message: RemoteMessage, ) + ReturnCount:PushRegistratorAbstractGoogle.kt$PushRegistratorAbstractGoogle$override suspend fun registerForPush(): IPushRegistrator.RegisterResult + ReturnCount:PushRegistratorAbstractGoogle.kt$PushRegistratorAbstractGoogle$private suspend fun attemptRegistration( senderId: String, currentRetry: Int, ): IPushRegistrator.RegisterResult? + ReturnCount:PushRegistratorHMS.kt$PushRegistratorHMS$@Synchronized @Throws(ApiException::class) private suspend fun getHMSTokenTask(context: Context): IPushRegistrator.RegisterResult + StringLiteralDuplication:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$"collapse_key" + StringLiteralDuplication:NotificationRepository.kt$NotificationRepository$" = 0 AND " + SwallowedException:ADMMessageReceiver.kt$ADMMessageReceiver$e: ClassNotFoundException + SwallowedException:BadgeCountUpdater.kt$BadgeCountUpdater$e: ShortcutBadgeException + SwallowedException:FirebaseAnalyticsTracker.kt$FirebaseAnalyticsTracker.Companion$e: ClassNotFoundException + SwallowedException:GooglePlayServicesUpgradePrompt.kt$GooglePlayServicesUpgradePrompt$e: PackageManager.NameNotFoundException + SwallowedException:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$t: Throwable + SwallowedException:NotificationDisplayer.kt$NotificationDisplayer$t: Throwable + SwallowedException:NotificationFormatHelper.kt$NotificationFormatHelper$e: JSONException + SwallowedException:NotificationHelper.kt$NotificationHelper$e: JSONException + SwallowedException:NotificationHelper.kt$NotificationHelper$e: Throwable + SwallowedException:NotificationHelper.kt$NotificationHelper$t: Throwable + SwallowedException:NotificationLimitManager.kt$NotificationLimitManager$t: Throwable + SwallowedException:NotificationRepository.kt$NotificationRepository$e: JSONException + SwallowedException:OneSignalHmsEventBridge.kt$OneSignalHmsEventBridge$e: JSONException + SwallowedException:PushRegistratorAbstractGoogle.kt$PushRegistratorAbstractGoogle$t: Throwable + SwallowedException:SummaryNotificationDisplayer.kt$SummaryNotificationDisplayer$t: Throwable + TooGenericExceptionCaught:FirebaseAnalyticsTracker.kt$FirebaseAnalyticsTracker$e: Throwable + TooGenericExceptionCaught:FirebaseAnalyticsTracker.kt$FirebaseAnalyticsTracker$t: Throwable + TooGenericExceptionCaught:Notification.kt$Notification$t: Throwable + TooGenericExceptionCaught:Notification.kt$Notification.ActionButton$t: Throwable + TooGenericExceptionCaught:NotificationChannelManager.kt$NotificationChannelManager$t: Throwable + TooGenericExceptionCaught:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$t: Throwable + TooGenericExceptionCaught:NotificationDisplayer.kt$NotificationDisplayer$t: Throwable + TooGenericExceptionCaught:NotificationGenerationProcessor.kt$NotificationGenerationProcessor$t: Throwable + TooGenericExceptionCaught:NotificationHelper.kt$NotificationHelper$e: Throwable + TooGenericExceptionCaught:NotificationHelper.kt$NotificationHelper$t: Throwable + TooGenericExceptionCaught:NotificationLimitManager.kt$NotificationLimitManager$t: Throwable + TooGenericExceptionCaught:NotificationRepository.kt$NotificationRepository$t: Throwable + TooGenericExceptionCaught:NotificationRestoreProcessor.kt$NotificationRestoreProcessor$t: Throwable + TooGenericExceptionCaught:PushRegistratorAbstractGoogle.kt$PushRegistratorAbstractGoogle$t: Throwable + TooGenericExceptionCaught:SummaryNotificationDisplayer.kt$SummaryNotificationDisplayer$t: Throwable + TooGenericExceptionThrown:PushRegistratorAbstractGoogle.kt$PushRegistratorAbstractGoogle$throw Exception("Google has no callback mechanism for push registration!") + TooManyFunctions:INotificationLifecycleService.kt$INotificationLifecycleService + TooManyFunctions:INotificationRepository.kt$INotificationRepository + TooManyFunctions:NotificationDisplayBuilder.kt$NotificationDisplayBuilder : INotificationDisplayBuilder + TooManyFunctions:NotificationDisplayer.kt$NotificationDisplayer : INotificationDisplayer + TooManyFunctions:NotificationGenerationProcessor.kt$NotificationGenerationProcessor : INotificationGenerationProcessor + TooManyFunctions:NotificationHelper.kt$NotificationHelper + TooManyFunctions:NotificationLifecycleService.kt$NotificationLifecycleService : INotificationLifecycleServiceINotificationActivityOpener + TooManyFunctions:NotificationRepository.kt$NotificationRepository : INotificationRepository + TooManyFunctions:NotificationsManager.kt$NotificationsManager : INotificationsManagerINotificationPermissionChangedHandlerIApplicationLifecycleHandler + UndocumentedPublicClass:ADMMessageHandler.kt$ADMMessageHandler : ADMMessageHandlerBase + UndocumentedPublicClass:ADMMessageHandlerJob.kt$ADMMessageHandlerJob : ADMMessageHandlerJobBase + UndocumentedPublicClass:ADMMessageReceiver.kt$ADMMessageReceiver : ADMMessageReceiver + UndocumentedPublicClass:ADMMessageReceiver.kt$ADMMessageReceiver$Companion + UndocumentedPublicClass:BootUpReceiver.kt$BootUpReceiver : BroadcastReceiver + UndocumentedPublicClass:FCMBroadcastReceiver.kt$FCMBroadcastReceiver : BroadcastReceiver + UndocumentedPublicClass:FCMBroadcastReceiver.kt$FCMBroadcastReceiver$Companion + UndocumentedPublicClass:INotificationDisplayer.kt$INotificationDisplayer + UndocumentedPublicClass:INotificationLifecycleCallback.kt$INotificationLifecycleCallback + UndocumentedPublicClass:NotificationConstants.kt$NotificationConstants + UndocumentedPublicClass:NotificationDismissReceiver.kt$NotificationDismissReceiver : BroadcastReceiver + UndocumentedPublicClass:NotificationGenerationJob.kt$NotificationGenerationJob + UndocumentedPublicClass:NotificationHelper.kt$NotificationHelper + UndocumentedPublicClass:NotificationOpenedActivity.kt$NotificationOpenedActivity : NotificationOpenedActivityBase + UndocumentedPublicClass:NotificationOpenedActivityBase.kt$NotificationOpenedActivityBase : Activity + UndocumentedPublicClass:NotificationOpenedActivityHMS.kt$NotificationOpenedActivityHMS : Activity + UndocumentedPublicClass:NotificationsManager.kt$INotificationActivityOpener + UndocumentedPublicClass:OSWorkManagerHelper.kt$OSWorkManagerHelper + UndocumentedPublicClass:UpgradeReceiver.kt$UpgradeReceiver : BroadcastReceiver + UnusedParameter:OneSignalHmsEventBridge.kt$OneSignalHmsEventBridge$context: Context + UnusedPrivateMember:NotificationDisplayBuilder.kt$NotificationDisplayBuilder$private fun addAlertButtons( context: Context, fcmJson: JSONObject, buttonsLabels: MutableList<String>, buttonsIds: MutableList<String>, ) + UnusedPrivateMember:NotificationOpenedProcessor.kt$NotificationOpenedProcessor$private fun newContentValuesWithConsumed(intent: Intent): ContentValues + UnusedPrivateProperty:DeviceRegistrationListener.kt$DeviceRegistrationListener$val pushSubscription = _subscriptionManager.subscriptions.push + + diff --git a/OneSignalSDK/detekt/detekt-config.yml b/OneSignalSDK/detekt/detekt-config.yml new file mode 100644 index 000000000..1100e014e --- /dev/null +++ b/OneSignalSDK/detekt/detekt-config.yml @@ -0,0 +1,151 @@ +build: + maxIssues: 10 + weights: + complexity: 2 + LongParameterList: 1 + style: 1 + comments: 1 + +processors: + active: true + exclude: + - DetektProgressListener + +config: + validation: true + +# ───────────── STYLE ───────────── +style: + MagicNumber: + active: true + ignoreNumbers: ["-1", "0", "1", "2", "100", "200"] + ignoreHashCodeFunction: true + ignorePropertyDeclaration: true + ignoreAnnotation: true + ignoreNamedArgument: true + + MaxLineLength: + active: false + + OptionalUnit: + active: true + + WildcardImport: + active: true + excludeImports: ["java.util.*", "kotlinx.coroutines.*"] + + ForbiddenComment: + active: true + comments: ["TODO", "FIXME", "STOPSHIP"] + +# ───────────── NAMING (moved from style) ───────────── +naming: + VariableNaming: + active: true + variablePattern: '^[a-z][A-Za-z0-9]*$' + privateVariablePattern: '^(_)?[a-z][A-Za-z0-9]*$' + + ClassNaming: + active: true + classPattern: '[A-Z][a-zA-Z0-9]*' + + FunctionNaming: + active: true + functionPattern: '^[a-z][A-Za-z0-9]*$' + +# ───────────── COMPLEXITY ───────────── +complexity: + LongMethod: + active: true + threshold: 40 + + LargeClass: + active: true + threshold: 800 + + LongParameterList: + active: true + functionThreshold: 6 + constructorThreshold: 8 + + ComplexCondition: + active: true + threshold: 4 + + NestedBlockDepth: + active: true + threshold: 4 + + StringLiteralDuplication: + active: true + threshold: 5 + ignoreAnnotation: true + +# ───────────── COMMENTS ───────────── +comments: + UndocumentedPublicClass: + active: true + excludes: ['**/R.class', '**/BuildConfig.*'] + + UndocumentedPublicFunction: + active: false + EndOfSentenceFormat: + active: false + endOfSentenceFormat: ([.?!][ \t\n\r\f<])|([.?!:]$) + +# ───────────── POTENTIAL BUGS ───────────── +potential-bugs: + UnsafeCast: + active: true + + UnreachableCode: + active: true + + IteratorHasNextCallsNextMethod: + active: true + + LateinitUsage: + active: true + ignoreAnnotated: ["Inject"] + + UnsafeCallOnNullableType: + active: true + +# ───────────── COROUTINES ───────────── +coroutines: + GlobalCoroutineUsage: + active: true + + RedundantSuspendModifier: + active: true + +# ───────────── PERFORMANCE ───────────── +performance: + UnnecessaryTemporaryInstantiation: + active: true + + SpreadOperator: + active: true + +# ───────────── EMPTY BLOCKS ───────────── +empty-blocks: + EmptyCatchBlock: + active: true + + EmptyFunctionBlock: + active: false + + EmptyIfBlock: + active: true + + EmptyElseBlock: + active: true + +# ───────────── EXCEPTIONS ───────────── +exceptions: + TooGenericExceptionCaught: + active: true + exceptionNames: ['Exception', 'Throwable'] + + ThrowingExceptionsWithoutMessageOrCause: + active: true \ No newline at end of file diff --git a/OneSignalSDK/onesignal/core/build.gradle b/OneSignalSDK/onesignal/core/build.gradle index cc406cdc7..6f90bb122 100644 --- a/OneSignalSDK/onesignal/core/build.gradle +++ b/OneSignalSDK/onesignal/core/build.gradle @@ -3,6 +3,7 @@ plugins { id 'kotlin-android' id 'com.diffplug.spotless' id 'com.vanniktech.maven.publish' + id 'io.gitlab.arturbosch.detekt' } android { @@ -92,12 +93,13 @@ dependencies { testImplementation("br.com.colman:kotest-extensions-android:0.1.1") testImplementation("androidx.test:core-ktx:1.4.0") testImplementation("androidx.test:core:1.4.0") - testImplementation("io.mockk:mockk:1.13.2") + testImplementation("io.mockk:mockk:$ioMockVersion") testImplementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") // com.tdunning:json is needed for non-Robolectric tests. testImplementation("com.tdunning:json:$tdunningJsonForTest") } +apply from: '../detekt.gradle' apply from: '../spotless.gradle' apply from: '../maven-push.gradle' diff --git a/OneSignalSDK/onesignal/detekt.gradle b/OneSignalSDK/onesignal/detekt.gradle new file mode 100644 index 000000000..f38bed5e7 --- /dev/null +++ b/OneSignalSDK/onesignal/detekt.gradle @@ -0,0 +1,34 @@ +apply plugin: 'io.gitlab.arturbosch.detekt' + +detekt { + // Use the config file from the detekt directory + config.setFrom(files("$rootDir/detekt/detekt-config.yml")) + + // Enable building a baseline in the common detekt/ folder + baseline = file("$rootDir/detekt/detekt-baseline-${project.name}.xml") + + // Parallel execution for better performance + parallel = true + + // Report configuration + reports { + html.required = true + xml.required = false + txt.required = false + sarif.required = false + md.required = false + } + + // Only analyze main source sets (exclude tests) + source.setFrom(files( + "$projectDir/src/main/java", + "$projectDir/src/main/kotlin" + )) + + // Exclude test files + disableDefaultRuleSets = false + buildUponDefaultConfig = true + + // Ignore generated files + ignoredBuildTypes = ["release"] +} diff --git a/OneSignalSDK/onesignal/in-app-messages/build.gradle b/OneSignalSDK/onesignal/in-app-messages/build.gradle index 062090d63..4dbf48cf5 100644 --- a/OneSignalSDK/onesignal/in-app-messages/build.gradle +++ b/OneSignalSDK/onesignal/in-app-messages/build.gradle @@ -3,6 +3,7 @@ plugins { id 'kotlin-android' id 'com.diffplug.spotless' id 'com.vanniktech.maven.publish' + id 'io.gitlab.arturbosch.detekt' } android { @@ -100,5 +101,6 @@ dependencies { testImplementation("com.tdunning:json:$tdunningJsonForTest") } +apply from: '../detekt.gradle' apply from: '../spotless.gradle' apply from: '../maven-push.gradle' diff --git a/OneSignalSDK/onesignal/location/build.gradle b/OneSignalSDK/onesignal/location/build.gradle index 2df634a98..37bbfb486 100644 --- a/OneSignalSDK/onesignal/location/build.gradle +++ b/OneSignalSDK/onesignal/location/build.gradle @@ -3,6 +3,7 @@ plugins { id 'kotlin-android' id 'com.diffplug.spotless' id 'com.vanniktech.maven.publish' + id 'io.gitlab.arturbosch.detekt' } android { @@ -100,5 +101,6 @@ dependencies { testImplementation("com.tdunning:json:$tdunningJsonForTest") } +apply from: '../detekt.gradle' apply from: '../spotless.gradle' apply from: '../maven-push.gradle' diff --git a/OneSignalSDK/onesignal/notifications/build.gradle b/OneSignalSDK/onesignal/notifications/build.gradle index 992bbe4e3..8f8be269c 100644 --- a/OneSignalSDK/onesignal/notifications/build.gradle +++ b/OneSignalSDK/onesignal/notifications/build.gradle @@ -3,6 +3,7 @@ plugins { id 'kotlin-android' id 'com.diffplug.spotless' id 'com.vanniktech.maven.publish' + id 'io.gitlab.arturbosch.detekt' } android { @@ -111,5 +112,6 @@ dependencies { testImplementation("com.tdunning:json:$tdunningJsonForTest") } +apply from: '../detekt.gradle' apply from: '../spotless.gradle' apply from: '../maven-push.gradle' diff --git a/OneSignalSDK/onesignal/testhelpers/build.gradle b/OneSignalSDK/onesignal/testhelpers/build.gradle index e1ea2604b..2e51ec591 100644 --- a/OneSignalSDK/onesignal/testhelpers/build.gradle +++ b/OneSignalSDK/onesignal/testhelpers/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.library' id 'kotlin-android' + id 'io.gitlab.arturbosch.detekt' id 'com.diffplug.spotless' } @@ -44,4 +45,5 @@ dependencies { implementation("androidx.test:core-ktx:1.5.0") } +apply from: '../detekt.gradle' apply from: '../spotless.gradle'