|
1 | 1 | CodeChecker |
2 | 2 | ============ |
3 | 3 |
|
4 | | -INSTRUCTIONS |
5 | | -============= |
6 | | - |
7 | | -Deploy this application to any web-accessible directory. |
8 | | - |
9 | | -Rules may be added or modified in the app/services/Rules.cfc file. |
10 | | - |
11 | | -Third party plugins are packaged in app/services/. |
12 | | - |
13 | | -Visit <your-web-root>/CodeChecker/app/index.cfm to begin via the UI. |
14 | | - |
15 | | -To specify directories and/or files to review/check, use the check files form (frm_codechecker.cfm) and separate entries by a carriage return. |
16 | | - |
17 | | -Alternatively, only the services directory is required for running the application outside of the browser. |
18 | | - |
19 | | -To run CodeChecker outside of the browser, call the following: |
20 | | -* Component: /services/CodeChecker |
21 | | -* Function: startCodeReview |
22 | | -* Parameters: |
23 | | -- filepath (required string): the directory or file path for which to review |
24 | | -- recurse (optional boolean): flag for whether or not to review recursively |
25 | | - |
26 | | -Call getResults() to return an array of structs of the code check results. |
27 | | - |
28 | | -DOCUMENTATION |
29 | | -============= |
30 | | - |
31 | | -- APPLICATION STRUCTURE |
32 | | - |
33 | | -This application uses a basic MVC structure. |
34 | | - |
35 | | -The heart of the application resides in the "services" directory. This is where the code checker and rules engines can be found. Third party plugins also reside in services. |
36 | | - |
37 | | -Resources such as css, javascript, images, etc. reside in the "assets" directory. |
38 | | - |
39 | | -The "model" directory contains files "action" files for the view layer. |
40 | | - |
41 | | -The "view" directory contains the UI for the results table and check files form (frm_codechecker.cfm). |
42 | | - |
43 | | -If you only want to run CodeChecker without a web UI, you only need the services directory. |
44 | | - |
45 | | -- SERVICES LAYER |
46 | | - |
47 | | -CodeChecker.cfc is the object that checks and enforces the defined rules. The default check function uses REFindNoCase(). |
48 | | - |
49 | | -Rules.cfc is the object defining the code check rules. |
50 | | - |
51 | | -Initial categories of rules are: |
52 | | -* Security |
53 | | -* Performance |
54 | | -* Standards |
55 | | -* Maintenance |
56 | | - |
57 | | -Initial metadata for rules include: |
58 | | -* bulkcheck - boolean value of whether to check the entire file in one pass (true) or line-by-line (false) |
59 | | -* category - string value corresponding to one of the categories listed above or your own custom category |
60 | | -* componentname - string value of the check component name to call in the dynamic cfinvoke |
61 | | -* customcode - currently does not do anything but considering using this as an option to run custom code instead of always using the regular expression pattern |
62 | | -* extensions - comma-delimited list of file extensions of files to check |
63 | | -* functionname - string value of the check function name to call in the dynamic cfinvoke |
64 | | -* message - string value of the explanation of the rule |
65 | | -* name - string value of the title of the rule |
66 | | -* passonmatch - boolean value of whether to pass or fail if a match is found |
67 | | -* pattern - string value of the regular expression of the rule |
68 | | -* severity - value of the severity level of the broken rule (default values are 1-5) |
69 | | -* tagname - pipe delimited list of ColdFusion tags that directs the checker to run the rule only if the line contains one of the specified tags |
70 | | - |
71 | | -Third party plugins are supported for additional rules. |
72 | | - |
73 | | -Currently integrated third party plugins include: |
74 | | - |
75 | | -* QueryParamScanner by Peter Boughton |
76 | | -* VarScoper by Mike Schierberl |
77 | | - |
78 | | -These plugins are automatically ran by CodeChecker. |
79 | | - |
80 | | -- VIEW LAYER |
81 | | - |
82 | | -To specify directories and/or files to review/check, use the check files form (frm_codechecker.cfm) and separate entries by a carriage return. |
83 | | - |
84 | | -The results of the code check are returned as an array of structs and will be displayed in a table (dsp_codechecker.cfm). The results page will show exceptions to the defined rules as well as display any failed files/directories that were not checked (i.e., missing files). |
85 | | - |
86 | | -Results display the following exception data: |
87 | | -* Directory |
88 | | -* File |
89 | | -* Rule |
90 | | -* Message |
91 | | -* Line Number |
92 | | -* Category |
93 | | -* Severity |
94 | | - |
95 | | -- TESTS |
96 | | - |
97 | | -The "tests" directory contains test files containing intentionally broken rules. |
98 | | - |
99 | | -MXUnit tests will be written in the future. |
100 | | - |
101 | | -- CUSTOMIZATION |
102 | | - |
103 | | -Any of the default rules can be modified or deleted. |
104 | | - |
105 | | -To add a new rule, simply copy one of the "temprulestruct" blocks of code and paste it below another block. |
106 | | -Be sure to set temprulestruct to an empty structure to clear out the data for any previously defined rules. |
107 | | -Also ensure that the bottom of your block appends temprulestruct to the "rules" array. |
108 | | - |
109 | | -CREDITS |
110 | | -======= |
111 | | - |
112 | | -Steve Bryant for inspiring this project with his CodeCop application. |
113 | | -http://codecop.riaforge.org/ |
114 | | - |
115 | | -Peter Boughton for the QueryParamScanner cfc. |
116 | | -http://qpscanner.riaforge.org/ |
117 | | - |
118 | | -Mike Schierberl for the VarScoper cfc. |
119 | | -http://varscoper.riaforge.org/ |
120 | | - |
121 | | -RELEASE NOTES |
122 | | -============= |
123 | | - |
124 | | -1.0 - 2013/06/01 - Initial release |
125 | | - |
126 | | -1.0.1 - 2013/06/03 - modified "Use Len method" rule pattern (replaced double quotes with octal value 042 to eliminate false |
127 | | -positives; added octal 047 for single quote expressions); modified ArrayNew(1) rule message |
128 | | - |
| 4 | +See the [Wiki](https://github.com/wellercs/CodeChecker/wiki) |
| 5 | +for instructions, documentation, credits, and release notes. |
0 commit comments