@Extension public class CppcheckWarningParser extends WarningParser
WarningParser.CommentProperties, WarningParser.MisraVersion, WarningParser.Suppression, WarningParser.ViolationERR_COULD_NOT_DETERMINE_SUPPRESSED_GUIDELINE, ERR_GRP_ERROR, ERR_GUIDELINE_NOT_FOUND, ERR_ILLEGAL_DEVIATION, ERR_READ_FILE, ERR_WRITE_FILE, errorCode, out| Constructor and Description |
|---|
CppcheckWarningParser() |
| Modifier and Type | Method and Description |
|---|---|
protected List<String> |
findSuppressionComments(String fileContent)
Parse the contents of a source code file, and return a list of all
suppression comments in the file.
|
protected Set<String> |
getGuidelineIdsFromComment(String comment)
For a single suppression comment, find each MISRA violation that is
suppressed by this comment.
|
String |
name() |
protected List<WarningParser.Violation> |
parseWarningLine(String line)
Parse a line from the output of the MISRA checker tool (e.g.
|
Set<WarningParser.MisraVersion> |
supportedMisraVersions()
Returns the set of all MISRA-guideline versions supported by this warning
parser.
|
all, getDeviationPattern, getErrorCode, getFalsePositivePattern, getGuidelinePattern, getGuidelines, getLogFilePath, getMisraLintFileContent, getMisraVersion, getNonMisraPattern, getWorkspace, initialize, isCompliant, log, parseSourceFile, parseSourceFiles, parseWarnings, readGrp, setDeviationPattern, setFalsePositivePattern, setGuidelinePattern, setGuidelines, setLogFilePath, setLogger, setMisraVersion, setNonMisraPattern, setWorkspace, summaryprotected List<WarningParser.Violation> parseWarningLine(String line)
WarningParserparseWarningLine in class WarningParserline - A single line of text from the parser tools output. The parser
should be configured so that a violation does not cover more than
one line.protected List<String> findSuppressionComments(String fileContent)
WarningParserfindSuppressionComments in class WarningParserfileContent - The full contents of the source file as a stringprotected Set<String> getGuidelineIdsFromComment(String comment)
WarningParserNote: This is likely the most difficult method to implement, since it may have to map tool error codes to MISRA guidelines. If this mapping is too complex, you can implement this method to always return null. This will force the user to always add a GUIDELINE(...) tag to suppression comments, or end up with an invalid report.
getGuidelineIdsFromComment in class WarningParsercomment - A suppression comment from the source filepublic String name()
name in class WarningParserpublic Set<WarningParser.MisraVersion> supportedMisraVersions()
WarningParsersupportedMisraVersions in class WarningParserCopyright © 2016–2019. All rights reserved.