Cppcheck
|
Check Internal cppcheck API usage More...
#include <checkinternal.h>
Public Member Functions | |
CheckInternal () | |
This constructor is used when registering the CheckClass. More... | |
Public Member Functions inherited from Check | |
Check (const std::string &aname) | |
This constructor is used when registering the CheckClass. More... | |
virtual | ~Check () |
Check (const Check &)=delete | |
Check & | operator= (const Check &)=delete |
const std::string & | name () const |
class name, used to generate documentation More... | |
virtual FileInfo * | getFileInfo (const Tokenizer &, const Settings &) const |
virtual FileInfo * | loadFileInfoFromXml (const tinyxml2::XMLElement *xmlElement) const |
virtual bool | analyseWholeProgram (const CTU::FileInfo *ctu, const std::list< FileInfo * > &fileInfo, const Settings &, ErrorLogger &) |
Private Member Functions | |
CheckInternal (const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) | |
This constructor is used when running checks. More... | |
void | runChecks (const Tokenizer &tokenizer, ErrorLogger *errorLogger) override |
run checks, the token list is not simplified More... | |
void | checkTokenMatchPatterns () |
Check if a simple pattern is used inside Token::Match or Token::findmatch More... | |
void | checkTokenSimpleMatchPatterns () |
Check if a complex pattern is used inside Token::simpleMatch or Token::findsimplematch More... | |
void | checkMissingPercentCharacter () |
Check for missing % end character in Token::Match pattern More... | |
void | checkUnknownPattern () |
Check for unknown (invalid) complex patterns like "%typ%" More... | |
void | checkRedundantNextPrevious () |
Check for inefficient usage of Token::next(), Token::previous() and Token::tokAt() More... | |
void | checkExtraWhitespace () |
Check if there is whitespace at the beginning or at the end of a pattern More... | |
void | checkRedundantTokCheck () |
Check if there is a redundant check for none-nullness of parameter before Match functions, such as (tok && Token::Match(tok, "foo")) More... | |
void | multiComparePatternError (const Token *tok, const std::string &pattern, const std::string &funcname) |
void | simplePatternError (const Token *tok, const std::string &pattern, const std::string &funcname) |
void | complexPatternError (const Token *tok, const std::string &pattern, const std::string &funcname) |
void | missingPercentCharacterError (const Token *tok, const std::string &pattern, const std::string &funcname) |
void | unknownPatternError (const Token *tok, const std::string &pattern) |
void | redundantNextPreviousError (const Token *tok, const std::string &func1, const std::string &func2) |
void | orInComplexPattern (const Token *tok, const std::string &pattern, const std::string &funcname) |
void | extraWhitespaceError (const Token *tok, const std::string &pattern, const std::string &funcname) |
void | checkRedundantTokCheckError (const Token *tok) |
void | getErrorMessages (ErrorLogger *errorLogger, const Settings *settings) const override |
get error messages More... | |
std::string | classInfo () const override |
get information about this class, used to generate documentation More... | |
Static Private Member Functions | |
static std::string | myName () |
Additional Inherited Members | |
Static Public Member Functions inherited from Check | |
static std::list< Check * > & | instances () |
List of registered check classes. More... | |
static void | writeToErrorList (const ErrorMessage &errmsg) |
Write given error to stdout in xml format. More... | |
Protected Member Functions inherited from Check | |
Check (std::string aname, const Tokenizer *tokenizer, const Settings *settings, ErrorLogger *errorLogger) | |
This constructor is used when running checks. More... | |
void | reportError (const Token *tok, const Severity severity, const std::string &id, const std::string &msg) |
report an error More... | |
void | reportError (const Token *tok, const Severity severity, const std::string &id, const std::string &msg, const CWE &cwe, Certainty certainty) |
report an error More... | |
void | reportError (const std::list< const Token * > &callstack, Severity severity, const std::string &id, const std::string &msg) |
report an error More... | |
void | reportError (const std::list< const Token * > &callstack, Severity severity, const std::string &id, const std::string &msg, const CWE &cwe, Certainty certainty) |
report an error More... | |
void | reportError (const ErrorPath &errorPath, Severity severity, const char id[], const std::string &msg, const CWE &cwe, Certainty certainty) |
void | logChecker (const char id[]) |
log checker More... | |
ErrorPath | getErrorPath (const Token *errtok, const ValueFlow::Value *value, std::string bug) const |
bool | wrongData (const Token *tok, const char *str) |
Use WRONG_DATA in checkers when you check for wrong data. More... | |
Static Protected Member Functions inherited from Check | |
static std::string | getMessageId (const ValueFlow::Value &value, const char id[]) |
Protected Attributes inherited from Check | |
const Tokenizer *const | mTokenizer {} |
const Settings *const | mSettings {} |
ErrorLogger *const | mErrorLogger {} |
Check Internal cppcheck API usage
Definition at line 41 of file checkinternal.h.
|
inline |
This constructor is used when registering the CheckClass.
Definition at line 44 of file checkinternal.h.
|
inlineprivate |
This constructor is used when running checks.
Definition at line 48 of file checkinternal.h.
|
private |
Check if there is whitespace at the beginning or at the end of a pattern
Referenced by runChecks().
|
private |
Check for missing % end character in Token::Match pattern
Referenced by runChecks().
|
private |
Check for inefficient usage of Token::next(), Token::previous() and Token::tokAt()
Referenced by runChecks().
|
private |
Check if there is a redundant check for none-nullness of parameter before Match functions, such as (tok && Token::Match(tok, "foo"))
Referenced by runChecks().
|
private |
Referenced by getErrorMessages().
|
private |
Check if a simple pattern is used inside Token::Match or Token::findmatch
Referenced by runChecks().
|
private |
Check if a complex pattern is used inside Token::simpleMatch or Token::findsimplematch
Referenced by runChecks().
|
private |
Check for unknown (invalid) complex patterns like "%typ%"
Referenced by runChecks().
|
inlineoverrideprivatevirtual |
get information about this class, used to generate documentation
Implements Check.
Definition at line 114 of file checkinternal.h.
|
private |
Referenced by getErrorMessages().
|
private |
Referenced by getErrorMessages().
|
inlineoverrideprivatevirtual |
get error messages
Implements Check.
Definition at line 97 of file checkinternal.h.
References checkRedundantTokCheckError(), complexPatternError(), extraWhitespaceError(), missingPercentCharacterError(), multiComparePatternError(), orInComplexPattern(), redundantNextPreviousError(), simplePatternError(), and unknownPatternError().
|
private |
Referenced by getErrorMessages().
|
private |
Referenced by getErrorMessages().
|
inlinestaticprivate |
Definition at line 110 of file checkinternal.h.
|
private |
Referenced by getErrorMessages().
|
private |
Referenced by getErrorMessages().
|
inlineoverrideprivatevirtual |
run checks, the token list is not simplified
Implements Check.
Definition at line 51 of file checkinternal.h.
References checkExtraWhitespace(), checkMissingPercentCharacter(), checkRedundantNextPrevious(), checkRedundantTokCheck(), Settings::checks, checkTokenMatchPatterns(), checkTokenSimpleMatchPatterns(), checkUnknownPattern(), Tokenizer::getSettings(), internalCheck, and SimpleEnableGroup< T >::isEnabled().
|
private |
Referenced by getErrorMessages().
|
private |
Referenced by getErrorMessages().