Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Codan

I would like to use Codan to verify/enforce that code conforms to architectural rules.
 
I currently have a checker implemented that reads in a file that contains a list of illegal functions (a "rule file") and checks that these functions are not called from my system's code. However, at lower levels in my system many of these functions are allowed as they are necessary to provide infrastructure to the higher layers of the system.
 
For instance in my system if a class inherits from a UIComponent class then the most restrictive rules apply and I would like to use a particular "rule file".
 
I would like to be able to extend the CustomizeProblemDialog to be able to add my own Tab called Context, where I can build a UI that allows a user to setup the test condition(s) that apply and browse to a given rule file per condition/context. My idea is that the user would select from two drop-down boxes from a few pre-populated drop-down list and fill in a text box. The first drop-down box would be a noun e.g. File Path, File Contents, Class, Method, etc., the second would  be a verb e.g. Contains, Invokes, Inherits, etc., and the last field would be a text box that the user can input the string to compare against. 
 
So I would have something like the following for a single entry:
 
Label: UI Context, Test:  (First Drop down Box (Noun) ): Class, ( Second Drop down Box (verb) ): Inherits, (Textbox) UIBaseClass, Label: Rule File: (File Browser Dialog)
 
Is there any way to do what I want without modifying the Codan codebase?
 
--
Chris Andrews

Back to the top