Skip to content

Fix #14657 report type: handle id suffix better when getting guideline number#8426

Open
wjakobsson wants to merge 2 commits intodanmar:mainfrom
wjakobsson:fix-14657
Open

Fix #14657 report type: handle id suffix better when getting guideline number#8426
wjakobsson wants to merge 2 commits intodanmar:mainfrom
wjakobsson:fix-14657

Conversation

@wjakobsson
Copy link
Copy Markdown

No description provided.

Comment on lines +1084 to +1088
auto dashPos = errId.rfind('-');
while (dashPos != std::string::npos && isalpha(errId[dashPos + 1])) {
dashPos = errId.rfind('-', dashPos - 1);
}
guideline = errId.substr(dashPos + 1, errId.find('-', dashPos + 1) - dashPos - 1);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I don't have a very strong opinion but an alternative could be something like:

auto pos1 = errId.find("20") + 5;
if (errId.compare(pos1,4,"dir-",0,4) == 0)
    pos1 += 4;
const auto endpos = errId.find('-', pos1);
guideline = errId.substr(pos1, endpos-pos1);

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

if (errId.compare(pos1,4,"dir-",0,4) == 0)
pos1 += 4;
const auto endpos = errId.find('-', pos1);
guideline = errId.substr(pos1, endpos-pos1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants