Skip to content

Commit d99afa1

Browse files
committed
Merge pull request #2 from wellercs/dev
Converted to ColdBox App
2 parents a80afa7 + 2c21f82 commit d99afa1

File tree

82 files changed

+3638
-2185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+3638
-2185
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coldbox

.project

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>CodeChecker</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
</buildSpec>
9+
<natures>
10+
<nature>com.adobe.ide.coldfusion.projectNature</nature>
11+
</natures>
12+
</projectDescription>
13+

Application.cfc

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/**
2+
********************************************************************************
3+
Copyright 2005-2007 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
4+
www.ortussolutions.com
5+
********************************************************************************
6+
*/
7+
component{
8+
// Application properties
9+
this.name = hash( getCurrentTemplatePath() );
10+
this.sessionManagement = true;
11+
this.sessionTimeout = createTimeSpan(0,0,30,0);
12+
this.setClientCookies = true;
13+
14+
// COLDBOX STATIC PROPERTY, DO NOT CHANGE UNLESS THIS IS NOT THE ROOT OF YOUR COLDBOX APP
15+
COLDBOX_APP_ROOT_PATH = getDirectoryFromPath( getCurrentTemplatePath() );
16+
// The web server mapping to this application. Used for remote purposes or static purposes
17+
COLDBOX_APP_MAPPING = "";
18+
// COLDBOX PROPERTIES
19+
COLDBOX_CONFIG_FILE = "";
20+
// COLDBOX APPLICATION KEY OVERRIDE
21+
COLDBOX_APP_KEY = "";
22+
// JAVA INTEGRATION: JUST DROP JARS IN THE LIB FOLDER
23+
// You can add more paths or change the reload flag as well.
24+
this.javaSettings = { loadPaths = [ "lib" ], reloadOnChange = false };
25+
26+
// custom mappings
27+
this.mappings["/coldbox"] = COLDBOX_APP_ROOT_PATH & "coldbox/";
28+
this.mappings["/resources"] = COLDBOX_APP_ROOT_PATH & "includes/resources/";
29+
30+
// application start
31+
public boolean function onApplicationStart(){
32+
application.cbBootstrap = new coldbox.system.Bootstrap( COLDBOX_CONFIG_FILE, COLDBOX_APP_ROOT_PATH, COLDBOX_APP_KEY, COLDBOX_APP_MAPPING );
33+
application.cbBootstrap.loadColdbox();
34+
return true;
35+
}
36+
37+
// request start
38+
public boolean function onRequestStart(String targetPage){
39+
// Process ColdBox Request
40+
application.cbBootstrap.onRequestStart( arguments.targetPage );
41+
42+
return true;
43+
}
44+
45+
public void function onSessionStart(){
46+
application.cbBootStrap.onSessionStart();
47+
}
48+
49+
public void function onSessionEnd( struct sessionScope, struct appScope ){
50+
arguments.appScope.cbBootStrap.onSessionEnd( argumentCollection=arguments );
51+
}
52+
53+
public boolean function onMissingTemplate( template ){
54+
return application.cbBootstrap.onMissingTemplate( argumentCollection=arguments );
55+
}
56+
57+
}

README.md

Lines changed: 2 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,5 @@
11
CodeChecker
22
============
33

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.

app/Application.cfc

Lines changed: 0 additions & 55 deletions
This file was deleted.

app/assets/css/_tables.css

Lines changed: 0 additions & 89 deletions
This file was deleted.

app/index.cfm

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/model/act_codechecker.cfm

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)