Package org.sonar.python.checks
Class AbstractStringFormatCheck
java.lang.Object
org.sonar.plugins.python.api.PythonSubscriptionCheck
org.sonar.python.checks.AbstractStringFormatCheck
- All Implemented Interfaces:
PythonCheck,SubscriptionCheck
- Direct Known Subclasses:
StringFormatCorrectnessCheck,StringFormatMisuseCheck
-
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidcheckPrintfDictionary(SubscriptionContext ctx, StringFormat format, DictionaryLiteral dict) protected static voidcheckPrintfExpressionList(SubscriptionContext ctx, StringFormat format, Token locFrom, Token locTo, List<Expression> expressions) protected voidprotected abstract voidcheckPrintfStyle(SubscriptionContext ctx, BinaryExpression modulo, StringLiteral literal) protected voidprotected abstract voidcheckStrFormatStyle(SubscriptionContext ctx, CallExpression callExpression, Expression qualifier, StringLiteral literal) protected static StringLiteralextractStringLiteral(Tree tree) protected static booleanisMapping(Expression expression) protected static booleanisQualifiedCallToStrFormat(CallExpression callExpression) protected static voidreportInvalidArgumentSize(SubscriptionContext ctx, Token locFrom, Token locTo, long expected, long actual) protected static voidreportIssue(SubscriptionContext ctx, Tree primary, Tree secondary, String message) syntaxIssueReporter(SubscriptionContext ctx, Tree primary, Tree secondary) 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, scopeMethods inherited from interface org.sonar.plugins.python.api.SubscriptionCheck
initialize
-
Field Details
-
IGNORE_SYNTAX_ERRORS
-
-
Constructor Details
-
AbstractStringFormatCheck
protected AbstractStringFormatCheck()
-
-
Method Details
-
checkPrintfStyle
-
checkPrintfStyle
protected abstract void checkPrintfStyle(SubscriptionContext ctx, BinaryExpression modulo, StringLiteral literal) -
checkPrintfDictionary
protected static void checkPrintfDictionary(SubscriptionContext ctx, StringFormat format, DictionaryLiteral dict) -
checkPrintfExpressionList
protected static void checkPrintfExpressionList(SubscriptionContext ctx, StringFormat format, Token locFrom, Token locTo, List<Expression> expressions) -
checkStrFormatStyle
-
checkStrFormatStyle
protected abstract void checkStrFormatStyle(SubscriptionContext ctx, CallExpression callExpression, Expression qualifier, StringLiteral literal) -
isQualifiedCallToStrFormat
-
syntaxIssueReporter
protected static Consumer<String> syntaxIssueReporter(SubscriptionContext ctx, Tree primary, Tree secondary) -
reportIssue
protected static void reportIssue(SubscriptionContext ctx, Tree primary, Tree secondary, String message) -
reportInvalidArgumentSize
protected static void reportInvalidArgumentSize(SubscriptionContext ctx, Token locFrom, Token locTo, long expected, long actual) -
extractStringLiteral
-
isMapping
-