Skip to content

Commit

Permalink
Fix #13265 (generate lib/checkers.cpp, update id mappings)
Browse files Browse the repository at this point in the history
  • Loading branch information
danmar committed Oct 26, 2024
1 parent eab6b48 commit f6b65b8
Show file tree
Hide file tree
Showing 5 changed files with 1,859 additions and 568 deletions.
18 changes: 6 additions & 12 deletions gui/resultstree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,25 +262,19 @@ void ResultsTree::keyPressEvent(QKeyEvent *event)
void ResultsTree::setReportType(ReportType reportType) {
mReportType = reportType;

auto readInfo = [this](const std::vector<checkers::Info>& info) {
for (const auto& i: info)
for (const QString& cppcheckId: QString(i.cppcheckIds).split(","))
mGuideline[cppcheckId] = QString(i.guideline).toUpper();
};

auto readIdMapping = [this](const std::vector<checkers::IdMapping>& idMapping) {
auto readIdMapping = [this](const std::vector<checkers::IdMapping>& idMapping, const char* ext = "") {
for (const auto& i: idMapping)
for (const QString& cppcheckId: QString(i.cppcheckId).split(","))
mGuideline[cppcheckId] = i.guideline;
mGuideline[cppcheckId] = QString(i.guideline) + ext;
};

if (reportType == ReportType::autosar)
readInfo(checkers::autosarInfo);
readIdMapping(checkers::idMappingAutosar);
else if (reportType == ReportType::certC)
readInfo(checkers::certCInfo);
readIdMapping(checkers::idMappingCertC, "-C");
else if (reportType == ReportType::certCpp) {
readInfo(checkers::certCInfo);
readInfo(checkers::certCppInfo);
readIdMapping(checkers::idMappingCertC, "-C");
readIdMapping(checkers::idMappingCertCpp, "-CPP");
}
else if (reportType == ReportType::misraC)
readIdMapping(checkers::idMappingMisraC);
Expand Down
Loading

0 comments on commit f6b65b8

Please sign in to comment.