Overview

The Code Janitor is a utility for finding "objectionable" content in source code trees before releasing them to the public. These can be things your developers wrote (like profanity, insults, confessions, and so on), or things that indicate code that might be inappropriate to use in the project (like copyright notices or license statements).

Setup:

System Requirements: This is a web-based application, using Django as its framework. You will need Django 1.0 or later. Django is provided in most recent Linux distributions, or you can get it from the Django Project.

Installation:

Currently the project is only available from git. You can checkout the code with the commands:

git clone http://git.linuxfoundation.org/janitor.git
cd janitor
make
If you don't have root permissions on the machine to install Django, you can install it in-place with the dep-checker install:
tar -xf Django-x.x.x.tar-gz
cp -ar Django-x.x.x/django janitor/janitor
cd janitor
ln -s janitor/django .
System Layout:
Running the GUI server:

You can start the GUI server with the following command:

  ./code-janitor.py start
This will start the server and point a Web browser at the Code Janitor main page.

Using the GUI:

The GUI is arranged with "tabs" for the major functional areas. First you must define keywords then you are ready to start a scan.

Scan:

The Scan tab is the home page of the system and where you initiate a test run. If there are no keywords defined you will be directed to go to the Keywords tab and add keywords. Once you have defined keywords you can either type in a file or directory path or select one using the path browser. If you have groups defined, you will also be presented with the option to only scan for certain groups of keywords. Once you press Start Scan, the display will change to show a status screen of the test and will redirect to the test results when complete.

Results:

The Results tab displays a running list of all the test results. Clicking on the link for a given result will display the test detail page.

Keywords:

The Keywords tab allows you to enter keywords to scan for. The large text entry area is where you add new keywords. Words all on one line are considered a phrase, and words entered on separate lines will be different keyword records. You can also delete keyword entries by selecting the checkbox next to the entry and clicking on Delete Selected Keywords.

You can also create groups (e.g. Language, Legal, Competition) that can be used to combine into groups if you want to only scan for a subset of keywords. Deleting a group will also remove keyword associations.

Authors:
Jeff Licquia <licquia@linuxfoundation.org>
Stew Benedict <stewb@linuxfoundation.org>

Changelog:
0.0.1:
    Initial version.

0.0.2:
   Add keyword entry tab
   Add keyword grouping capabilty
   Allow scanning either files or directories and ignore inappropriate files

Contributing:
Any contribution submitted for inclusion in the Code Janitor Tool must 
be signed by its author following the Developer's Certificate of Origin 1.1.

By making a contribution to this project, I certify that:
a) The contribution was created in whole or in part by me and I have the right 
   to submit it under the open source license indicated in the file; or
b) The contribution is based upon previous work that, to the best of my 
   knowledge, is covered under an appropriate open source license and I have 
   the right under that license to submit that work with modifications, 
   whether created in whole or in part by me, under the same open source 
   license (unless I am permitted to submit under a different license), as 
   indicated in the file; or
c) The contribution was provided directly to me by some other person who 
   certified (a), (b) or (c) and I have not modified it.
d) I understand and agree that this project and the contribution are public 
   and that a record of the contribution (including all personal information 
   I submit with it, including my sign-off) is maintained indefinitely and 
   may be redistributed consistent with this project or the open source 
   license(s) involved.

Patches to the mailing list need to be signed as:

	Signed-off-by: <author name> <author email address>

Same thing applies for reviewers: 

	Signed-off-by: <reviewer name> <reviewer email address>

and committer:

	Signed-off-by: <committer name> <committer email address>

License:
Copyright (c) 2010 Linux Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.