Package org.sonar.python.checks.regex
Class AbstractRegexCheck
java.lang.Object
org.sonar.plugins.python.api.PythonSubscriptionCheck
org.sonar.python.checks.regex.AbstractRegexCheck
- All Implemented Interfaces:
PythonCheck,SubscriptionCheck
- Direct Known Subclasses:
AnchorPrecedenceCheck,DuplicatesInCharacterClassCheck,EmptyAlternativeCheck,EmptyGroupCheck,EmptyStringRepetitionCheck,GraphemeClustersInClassesCheck,GroupReplacementCheck,ImpossibleBackReferenceCheck,ImpossibleBoundariesCheck,InvalidRegexCheck,MultipleWhitespaceCheck,OctalEscapeCheck,PossessiveQuantifierContinuationCheck,RedosCheck,RedundantRegexAlternativesCheck,RegexComplexityCheck,RegexLookaheadCheck,ReluctantQuantifierCheck,ReluctantQuantifierWithEmptyContinuationCheck,SingleCharacterAlternationCheck,SingleCharCharacterClassCheck,StringReplaceCheck,SuperfluousCurlyBraceCheck,UnquantifiedNonCapturingGroupCheck,UnusedGroupNamesCheck,VerboseRegexCheck
-
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RegexContextprotected final Set<org.sonarsource.analyzer.commons.regex.ast.RegexSyntaxElement> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddIssue(org.sonarsource.analyzer.commons.regex.ast.RegexSyntaxElement regexTree, String message, Integer cost, List<org.sonarsource.analyzer.commons.regex.RegexIssueLocation> secondaries) abstract voidcheckRegex(org.sonarsource.analyzer.commons.regex.RegexParseResult regexParseResult, CallExpression regexFunctionCall) voidinitialize(SubscriptionCheck.Context context) Should return a map whose keys are the functions the check is interested in, and the values are the position of the flags parameter.Methods 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
-
Field Details
-
regexContext
-
reportedRegexTrees
protected final Set<org.sonarsource.analyzer.commons.regex.ast.RegexSyntaxElement> reportedRegexTrees
-
-
Constructor Details
-
AbstractRegexCheck
public AbstractRegexCheck()
-
-
Method Details
-
lookedUpFunctions
Should return a map whose keys are the functions the check is interested in, and the values are the position of the flags parameter. Set the position of the flags parameter tonullif there is none. -
initialize
-
checkRegex
public abstract void checkRegex(org.sonarsource.analyzer.commons.regex.RegexParseResult regexParseResult, CallExpression regexFunctionCall) -
mapPythonFlag
-
addIssue
public PythonCheck.PreciseIssue addIssue(org.sonarsource.analyzer.commons.regex.ast.RegexSyntaxElement regexTree, String message, @Nullable Integer cost, List<org.sonarsource.analyzer.commons.regex.RegexIssueLocation> secondaries)
-