Creating a Rule for C code

NikhithaNikhitha Posts: 4
edited December 2016 in C/C++test

A rule to identify this violation has to be created.

"Every file shall have a file header. It should basically detail about information contained in that file in a specific format".

Can we try adding a simple python method to do this? or is there a specific node method to be followed.
For a template refer attachment

Comments

  • Billy McMullinBilly McMullin Posts: 60 admin

    Hi Nikhitha,

    It is possible to add code into the Rule Wizard to define what code/pattern you want identified as a rule violation. In this case, the Python method would have to define what exactly you want marked as a violation.

    Another option is to create the Rule by Node and this will allow you to create a flow to mark code/patterns as a violation. The Node option allows you define the conditions to what is marked as a violation.

    You can try to use the Python Method to see if the Rule Wizard will be able to create a rule based. Be sure to meet the Method Requirements when you do, there is a section in the Rule Wizard User Guide titled "Method Requirements" and this goes over what is needed to use it as well as the below information provides more tips when scripting.

    Creating the Rule by Node might be easier as this would allow you to create the flow for what exactly you are trying to mark as a violation, you can visually see the flow on how you want your rule to behave, and can control the conditionals for the rule based from that.

Sign In or Register to comment.