/
PotentialBugProvider.kt
57 lines (53 loc) · 2.24 KB
/
PotentialBugProvider.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package io.gitlab.arturbosch.detekt.rules.bugs
import io.gitlab.arturbosch.detekt.api.Config
import io.gitlab.arturbosch.detekt.api.RuleSet
import io.gitlab.arturbosch.detekt.api.internal.ActiveByDefault
import io.gitlab.arturbosch.detekt.api.internal.DefaultRuleSetProvider
/**
* The potential-bugs rule set provides rules that detect potential bugs.
*/
@ActiveByDefault(since = "1.0.0")
class PotentialBugProvider : DefaultRuleSetProvider {
override val ruleSetId: String = "potential-bugs"
override fun instance(config: Config): RuleSet = RuleSet(
ruleSetId,
listOf(
AvoidReferentialEquality(config),
Deprecation(config),
DontDowncastCollectionTypes(config),
DoubleMutabilityForCollection(config),
@Suppress("DEPRECATION") DuplicateCaseInWhenExpression(config),
ElseCaseInsteadOfExhaustiveWhen(config),
EqualsAlwaysReturnsTrueOrFalse(config),
EqualsWithHashCodeExist(config),
ExitOutsideMain(config),
ExplicitGarbageCollectionCall(config),
HasPlatformType(config),
ImplicitDefaultLocale(config),
InvalidRange(config),
IteratorHasNextCallsNextMethod(config),
IteratorNotThrowingNoSuchElementException(config),
LateinitUsage(config),
MapGetWithNotNullAssertionOperator(config),
MissingPackageDeclaration(config),
@Suppress("DEPRECATION") MissingWhenCase(config),
NullCheckOnMutableProperty(config),
@Suppress("DEPRECATION") RedundantElseInWhen(config),
UnconditionalJumpStatementInLoop(config),
UnnecessaryNotNullOperator(config),
UnnecessaryNotNullCheck(config),
UnnecessarySafeCall(config),
UnreachableCode(config),
UnsafeCallOnNullableType(config),
UnsafeCast(config),
UselessPostfixExpression(config),
WrongEqualsTypeParameter(config),
IgnoredReturnValue(config),
ImplicitUnitReturnType(config),
NullableToStringCall(config),
UnreachableCatchBlock(config),
CastToNullableType(config),
UnusedUnaryOperator(config)
)
)
}