public class Rule extends BaseRule implements ConfigAware
A rule defines how one specific code structure should look like. If code is found which does not meet this structure, it is considered as harmful regarding maintainability or readability.
A rule is implemented using the visitor pattern and should be started using the visit(KtFile) function. If calculations must be done before or after the visiting process, here are two predefined (preVisit/postVisit) functions which can be overridden to setup/teardown additional data.
ConfigAware.DefaultImplsConfig.Companion| Constructor and Description |
|---|
Rule(Config config,
Context ruleContext)
A rule defines how one specific code structure should look like. If code is found
which does not meet this structure, it is considered as harmful regarding maintainability
or readability.
|
Rule()
A rule defines how one specific code structure should look like. If code is found
which does not meet this structure, it is considered as harmful regarding maintainability
or readability.
|
| Modifier and Type | Method and Description |
|---|---|
Config |
getConfig()
Wrapped configuration of the ruleSet this rule is in.
|
java.lang.String |
getId()
Id which is used to retrieve the sub config for this rule.
|
Issue |
getIssue() |
boolean |
visitCondition(org.jetbrains.kotlin.psi.KtFile root) |
clearFindings, getContext, getFindings, getId, postVisit, preVisit, report, report, visit, visitCondition, visitFilegetActive, getAutoCorrect, getConfig, getId, subConfig, valueOrDefault, valueOrNull, withAutoCorrectsubConfig, valueOrDefault, valueOrNullclearFindings, getFindings, report, reportpublic Rule(Config config, Context ruleContext)
A rule defines how one specific code structure should look like. If code is found which does not meet this structure, it is considered as harmful regarding maintainability or readability.
A rule is implemented using the visitor pattern and should be started using the visit(KtFile) function. If calculations must be done before or after the visiting process, here are two predefined (preVisit/postVisit) functions which can be overridden to setup/teardown additional data.
config - Wrapped configuration of the ruleSet this rule is in.public Rule()
A rule defines how one specific code structure should look like. If code is found which does not meet this structure, it is considered as harmful regarding maintainability or readability.
A rule is implemented using the visitor pattern and should be started using the visit(KtFile) function. If calculations must be done before or after the visiting process, here are two predefined (preVisit/postVisit) functions which can be overridden to setup/teardown additional data.
public Issue getIssue()
public java.lang.String getId()
Id which is used to retrieve the sub config for this rule.
public boolean visitCondition(org.jetbrains.kotlin.psi.KtFile root)
public Config getConfig()
Wrapped configuration of the ruleSet this rule is in.