We are looking to add the ability to run Code Inspection across an entire project or solution:
case=104537
Obviously this could get slow, but its a popular idea.
As for skipping certain checks, yes, this can be done. I have just realised though that the instructions were lost when our website was updated. So, here are some examples of how to do this:
First, to skip several lines of code:
static void simpleSkippingChecks()
{
for(int nScan = 1; nScan < 10; ++nScan)
{
continue; // vaCI:skip - skip reporting this line
}
int *pTesting = 0;
// vaCI:skip-2 - skip current line and previous line as well
// skipping 2 lines in TOTAL, skip line and line above
// vaCI:skip+3 - skip current line and next lines as well
// skipping 3 lines in TOTAL, so skip line + 2 more lines
return;
}
or skipping specific checks:
// vaCI:skip+3:readability-container-size-empty - use the full name of the check to skip, so you know VA will only skip this one check
if (mapPrimeNumbers.size() == 0)
{
pTesting++;
}
// vaCI:skip+10:null,empty - 10 lines in total, but only skipping checks where the name contains "null" or "empty" #CodeInspectSkip
int *pTesting = 0; // warning here skipped
if (0 == pTesting) // warning here skipped
return;