Package org.sonar.python.checks.cdk
Class AbstractCdkResourceCheck
- java.lang.Object
-
- org.sonar.plugins.python.api.PythonSubscriptionCheck
-
- org.sonar.python.checks.cdk.AbstractCdkResourceCheck
-
- All Implemented Interfaces:
PythonCheck,SubscriptionCheck
- Direct Known Subclasses:
AbstractIamPolicyStatementCheck,AbstractS3BucketCheck,ClearTextProtocolsCheckPart,DisabledEFSEncryptionCheck,DisabledESDomainEncryptionCheck,DisabledRDSEncryptionCheck,DisabledSNSTopicEncryptionCheck,PublicApiIsSecuritySensitiveCheck,PublicNetworkAccessToCloudResourcesCheck,UnencryptedEbsVolumeCheck,UnencryptedSageMakerNotebookCheck,UnencryptedSqsQueueCheck,UnrestrictedAdministrationCheckPartCfnSecurity,UnrestrictedAdministrationCheckPartConnections,UnrestrictedOutboundCommunicationsCheck,WeakSSLProtocolCheckPart
public abstract class AbstractCdkResourceCheck extends PythonSubscriptionCheck
Since most CDK related checks check arguments of method calls or object initializations, this abstract class can be used to register CallExpression consumers for various fully qualified names. For this purpose the methodcheckFqn(String, BiConsumer)orcheckFqns(Collection, BiConsumer)must be called in theregisterFqnConsumer()method which has to be implemented.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.sonar.plugins.python.api.PythonCheck
PythonCheck.CheckScope, PythonCheck.PreciseIssue
-
Nested classes/interfaces inherited from interface org.sonar.plugins.python.api.SubscriptionCheck
SubscriptionCheck.Context
-
-
Constructor Summary
Constructors Constructor Description AbstractCdkResourceCheck()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckFqn(String fqn, BiConsumer<SubscriptionContext,CallExpression> consumer)Register a consumer for a single FQNprotected voidcheckFqns(Collection<String> suffixes, BiConsumer<SubscriptionContext,CallExpression> consumer)Register a consumer for multiple FQNsvoidinitialize(SubscriptionCheck.Context context)protected abstract voidregisterFqnConsumer()protected voidvisitNode(SubscriptionContext ctx)-
Methods inherited from class org.sonar.plugins.python.api.PythonSubscriptionCheck
leaveFile, scanFile
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.sonar.plugins.python.api.PythonCheck
scanWithoutParsing, scope
-
-
-
-
Method Detail
-
initialize
public void initialize(SubscriptionCheck.Context context)
-
visitNode
protected void visitNode(SubscriptionContext ctx)
-
registerFqnConsumer
protected abstract void registerFqnConsumer()
-
checkFqn
protected void checkFqn(String fqn, BiConsumer<SubscriptionContext,CallExpression> consumer)
Register a consumer for a single FQN
-
checkFqns
protected void checkFqns(Collection<String> suffixes, BiConsumer<SubscriptionContext,CallExpression> consumer)
Register a consumer for multiple FQNs
-
-