Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Static code analyzer

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
me76 Posted - Aug 13 2024 : 4:56:13 PM
Would be awesome to have static code analyzer as part of Visual Assist package. It could be separate executable that would be available in two ways:
1. through a command in Visual Assist menu to analyze the content in current editor;
2. invoking it from command line for a set of source files or for entire project - could be hooked to git commits or used for pre-release code checks.

Give that you guys have already implemented C++ code parser, static code check could be relatively easy implemented on top of that.
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Aug 19 2024 : 10:40:19 AM
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;

me76 Posted - Aug 19 2024 : 08:54:55 AM
I didn't know about that, that's really nice feature! Can code inspection be applied to entire code base or specific files from command line? I think this would be valuable feature because it would cover old code as well, not just the code that developer is currently editing.

Another request - sometimes developers may be fine with certain code and may want to disable inspection for it - would be nice to have special format in comments or through #pragma directive that would tell Code Inspector to disable specific check(s) for given line of block of code.
feline Posted - Aug 14 2024 : 08:26:20 AM
Have you looked at Code Inspection:

https://www.wholetomato.com/documentation/code-inspection/introduction-to-code-inspection

We are slowly enabling more checks by default, as we get them working well, but you can always enable some of the other checks, which can be shown via the setting:

VA Options -> Code Inspection -> Show Unevaluated Checkers

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000