-
How to create a rule using RuleWizard to identify a comparison operator?
I am creating a Parasoft rule for C/C++test using RuleWizard that flags whenever a type std::string is used as an argument within certain function calls. For example, this line should be a violation since it uses the variable 'mytestString' without a call to .c_str() LOG_TRACE(7, "ParasoftTestProj::main() Some TRACE…
-
How to create a rule in RuleWizard to check if the filename contains the foldername?
I want to create a rule that checks if a filename contains the foldername at the beginning of the file, for example: I have a folder named "folder1" containing a folder named "folder2" which contains a c file. This file should be named: "folder1_folder2_myFile.c" Is it possible to create such a rule with the rule wizard?
-
How do I create a custom static analysis rule to check that a variable is of a certain data type?
More specifically, how do I check that the variable in an if condition is of a pointer type, when the variable is a pointer dereference? I have tried "left hand side:variable" > "filter:pointer", "left hand side:variable" > "type:pointer" and "left hand side:pointer", and none of them works. This rule wizard is proving to…
-
How do I create a custom static analysis rule to count the number of pre-compilation directives?
Hi, how do I create a custom rule to count the total number of pre-compilation directives in my entire software using the Rule Wizard? I had spent an entire day attempting only to fail.
-
COMMENT-04 Bug
Hey, As I was customizing a rule set I noticed a bug in COMMENT-04. It seems that if you run it on a directory with files, it works as indicated in the documentation. However, if you run it on a .sln, with multiple sub directories it flags many more (correctly commented) functions. I presume that it has to do with the way…
-
dotTest 10.3 - Is it possible to edit a rule.
Hi, dotTest 10.3 - Is it possible to edit a rule. Similarity to C++test ? Is it possible to do it from the IDE ? Thanks In Advanced,
-
"Comments shall not be nested." Custom Rule in Static Analysis
Hi, I have to add this rule to perform a static analysis. The rule is the MISRA C RULE 9. "Comments shall not be nested". Can someone help me? Thanks.
-
Create custom rule during Static Analysis in Rule Wizard
Hi everyone. I've some issues to make this rule in Rule Wizard: "Only ISO 9899 standard C shall be used." I hope somebody could help me. Thank you.
-
Static analysis - custom rule for ascii characters >127
Hi, I have to create a custom rule that checks that ascii characters > 127 are not present. I have some issues doing it. Can someone help me? The rule is: "Define identifiers shall be as following: < DEFINE_NAME > = D _ < USER_NAME > Where: < USER_NAME > length is at most 12 characters and not composed by ascii characters…
-
Parsing comment with RuleWizard
Hi, One of our organizational rules state that the file name shall be included in a Doxygen style comment, like the following: /** * @file filename.ext * * file_description */ I have created the rule to verify everything until the name of the file, however I wasn't able to check if the added filename.ext in Doxygen comment…
-
Function templates
Hello, I am having difficulty matching code patterns involving function templates using the rule wizard. It seems that context a(b) does not work when "a" is function template. Here is the template: template <typename object> void ptr_remove(const object*& to_remove) { if(to_remove != NULL) delete to_remove; to_remove =…
-
How do I change the rule description in RuleWizard
Change rule description in RuleWizardRight click in the rule area not on any of the elements and select Properties. This will bring up a window from which you can edit the rule description, severity, ID, author, language (C or C++), and the heading.
-
Check unused code in comment lines
Hello All, I have some problems about configing JTest's rules. Could you guys tell me the ways to resolve it. 1. How can I check the old code ( not unused code ) in comment lines. 2. If JTest have rules to test it, pls. tell me the way to config. 3. If JTest have no rule, How can I create rule by rule wizard for check this…