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,ImpossibleBoundariesCheck,InvalidRegexCheck,MultipleWhitespaceCheck,RedundantRegexAlternativesCheck,RegexComplexityCheck,RegexLookaheadCheck,ReluctantQuantifierCheck,ReluctantQuantifierWithEmptyContinuationCheck,SingleCharacterAlternationCheck,SingleCharCharacterClassCheck,StringReplaceCheck,SuperfluousCurlyBraceCheck,UnquantifiedNonCapturingGroupCheck,VerboseRegexCheck
public abstract class AbstractRegexCheck extends PythonSubscriptionCheck
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.sonar.plugins.python.api.PythonCheck
PythonCheck.PreciseIssue
-
Nested classes/interfaces inherited from interface org.sonar.plugins.python.api.SubscriptionCheck
SubscriptionCheck.Context
-
-
Field Summary
Fields Modifier and Type Field Description protected RegexContextregexContextprotected Set<org.sonarsource.analyzer.commons.regex.ast.RegexSyntaxElement>reportedRegexTrees
-
Constructor Summary
Constructors Constructor Description AbstractRegexCheck()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddIssue(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)protected Map<String,Integer>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.static Optional<Integer>mapPythonFlag(QualifiedExpression ch)-
Methods inherited from class org.sonar.plugins.python.api.PythonSubscriptionCheck
leaveFile, scanFile
-
-
-
-
Field Detail
-
regexContext
protected RegexContext regexContext
-
reportedRegexTrees
protected final Set<org.sonarsource.analyzer.commons.regex.ast.RegexSyntaxElement> reportedRegexTrees
-
-
Method Detail
-
lookedUpFunctions
protected Map<String,Integer> 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
public void initialize(SubscriptionCheck.Context context)
-
checkRegex
public abstract void checkRegex(org.sonarsource.analyzer.commons.regex.RegexParseResult regexParseResult, CallExpression regexFunctionCall)
-
mapPythonFlag
public static Optional<Integer> mapPythonFlag(QualifiedExpression ch)
-
-