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
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 method
checkFqn(String, BiConsumer) or checkFqns(Collection, BiConsumer)
must be called in the registerFqnConsumer() method which has to be implemented.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.sonar.plugins.python.api.PythonCheck
PythonCheck.CheckScope, PythonCheck.PreciseIssueNested classes/interfaces inherited from interface org.sonar.plugins.python.api.SubscriptionCheck
SubscriptionCheck.Context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 voidprotected voidMethods inherited from class org.sonar.plugins.python.api.PythonSubscriptionCheck
leaveFile, scanFileMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.sonar.plugins.python.api.PythonCheck
scanWithoutParsing, scope
-
Constructor Details
-
AbstractCdkResourceCheck
public AbstractCdkResourceCheck()
-
-
Method Details
-
initialize
-
visitNode
-
registerFqnConsumer
protected abstract void registerFqnConsumer() -
checkFqn
Register a consumer for a single FQN -
checkFqns
protected void checkFqns(Collection<String> suffixes, BiConsumer<SubscriptionContext, CallExpression> consumer) Register a consumer for multiple FQNs
-