Coroutine inspections
- '@Deferred' result is unused
Reports function calls with the Deferred result type if the return value is not used.
- 'CoroutineContext' can contain 'Job' element
Reports coroutine builders calls that violate structured concurrency by accepting a CoroutineContext containing a Job.
- 'forEach { it.join() }' call on 'Collection<Job>' instead of single 'joinAll()'
Reports forEach { it.join() } calls on collections of Job.
- 'map { it.await() }' call on 'Collection<Deferred>' instead of single 'awaitAll()'
Reports map { it.await() } calls on collections of Deferred.
- 'runBlocking' inside suspend function
Reports runBlocking calls inside suspend functions.
- 'suspendCoroutine' lacks cancellation guarantees
Reports usages of kotlin.coroutines.suspendCoroutine and suggests replacing them with kotlinx.coroutines.suspendCancellableCoroutine when the kotlinx.coroutines dependency is present.
- Potentially ambiguous 'kotlin.coroutine.coroutineContext' usage
Reports usages of kotlin.coroutine.coroutineContext property in code that has a dependency on kotlinx.coroutines library.
- RunBlocking in coroutine
Reports runBlocking builders that can be reached from coroutines.
- Suspicious implicit 'CoroutineScope' receiver access
Reports potentially problematic implicit CoroutineScope receiver access from within a suspending context.