Skip to content

Commit

Permalink
Fix minor issues on report modules (#182)
Browse files Browse the repository at this point in the history
Signed-off-by: romanodanilo <[email protected]>
Signed-off-by: romanodanilo <[email protected]>
  • Loading branch information
romanodanilo authored Sep 17, 2024
1 parent 3f58efc commit 869b53c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -650,15 +650,6 @@ void cCheckerWidget::ShowIssue(cIssue *const itemToShow, const cLocationsContain
}
}
}
else
{
// This is the implementation of very simple reports. If a issue point to a
// xodr or xosc file, it should have a FileLocation

// If issue referes to an OpenDRIVE, show it!
if (hasInputPath)
ShowInputIssue(itemToShow, -1);
}
}
}

Expand Down
26 changes: 13 additions & 13 deletions src/report_modules/report_module_text/src/report_format_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void WriteResults(const char *file, cResultContainer *ptrResultContainer)
std::list<cIssue *> issues;
std::list<cRule *> rules;
std::list<cMetadata *> metadata;
std::set<std::string> info_violated_rules;
std::set<std::string> info_rules;
std::set<std::string> warning_violated_rules;
std::set<std::string> error_violated_rules;
std::set<std::string> addressed_rules;
Expand Down Expand Up @@ -358,7 +358,7 @@ void WriteResults(const char *file, cResultContainer *ptrResultContainer)
eIssueLevel current_issue_level = (*it_Issue)->GetIssueLevel();
if (current_issue_level == eIssueLevel::INFO_LVL)
{
info_violated_rules.insert((*it_Issue)->GetRuleUID());
info_rules.insert((*it_Issue)->GetRuleUID());
}
if (current_issue_level == eIssueLevel::WARNING_LVL)
{
Expand Down Expand Up @@ -420,32 +420,32 @@ void WriteResults(const char *file, cResultContainer *ptrResultContainer)
ss << "\n" << BASIC_SEPARATOR_LINE << "\n";
}

ss << "Addressed vs Violated rules report \n\n";
ss << "Rules report \n\n";

ss << "\nTotal number of addressed rules: " << addressed_rules.size();
for (const auto &str : addressed_rules)
{
ss << "\n\t-> Addressed RuleUID: " << str << "\n";
}

int total_number_of_violated_rules =
info_violated_rules.size() + warning_violated_rules.size() + error_violated_rules.size();
ss << "\nTotal number of violated rules: " << total_number_of_violated_rules << "\n";
int total_number_of_rules_with_issues =
info_rules.size() + warning_violated_rules.size() + error_violated_rules.size();
ss << "\nTotal number of rules with found issues: " << total_number_of_rules_with_issues << "\n";

ss << "\nInfo violated rules: " << info_violated_rules.size();
for (const auto &str : info_violated_rules)
ss << "\nRules for information: " << info_rules.size();
for (const auto &str : info_rules)
{
ss << "\n\t-> Info violation RuleUID: " << str;
ss << "\n\t-> RuleUID with info: " << str;
}
ss << "\nWarning violated rules: " << warning_violated_rules.size();
ss << "\nRules with warning issues: " << warning_violated_rules.size();
for (const auto &str : warning_violated_rules)
{
ss << "\n\t-> Warning violation RuleUID: " << str;
ss << "\n\t-> RuleUID with warning issue: " << str;
}
ss << "\nError violated rules: " << error_violated_rules.size();
ss << "\nRules with error issues: " << error_violated_rules.size();
for (const auto &str : error_violated_rules)
{
ss << "\n\t-> Error violation RuleUID: " << str;
ss << "\n\t-> RuleUID with error issue: " << str;
}

ss << "\n" << BASIC_SEPARATOR_LINE << "\n";
Expand Down

0 comments on commit 869b53c

Please sign in to comment.