Skip to content

This extension adds a debug template that you can use to log all the script files that are touched. This allows you to see which files don't have test coverage (for example) or files that should be safe to delete. It is very useful when dealing with unknown or legacy code.

License

Notifications You must be signed in to change notification settings

cybersonic/lucee-filecoverage-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lucee File Coverage Extension

Build Status This extension provides a debugging template that logs all the calls to script files as a user navigates your site. It then allows you to browse which files have been used and more importantly which have not

Getting Started

(We are hoping this will go onto the lucee extension store in the future).

Check out the installation guide. At the moment this is the main way of installing it until we get this everything ready to be added to the Lucee Extension "store".

I would love to be able to actually add this to http://forgebox.io too.

Prerequisites

  • Apache Ant to build the project (it is running a simple build.xml file)
  • Lucee 5.x and greater. No ACF implementation yet.
  • Currently it is also using the H2 database extension. Which can be installed fropm the Extension:Applications section of the admin.

Installing

First you need to build the project, simply go into the root and run:

ant

This will create a file in the dist folder called filecoverage-extension-X.X.X.X.lex. This extension is meant to deployed to a web context (versus a server context) as it installs the reporting application into your webroot in a folder called /filecoverage so you can access it as http://localhost/filecoverage.

  1. Go to the Lucee web administrator - http://localhost/lucee/admin/web.cfm and log in
  2. Click on Applications under Extension
  3. Scroll to the bottom to where it says "Upload new extension (experimental)" and choose the filecoverage-extension-X.X.X.X.lex we created and click Upload
  4. Since we need to use a database to store the captured data, instal the H2 database
  5. Create a datasource called codecoverage using the H2 Database Engine in Embedded Mode
  6. Put a path in the path section (for example "db") and click save
  7. Under Debugging:Settings click "Yes" to enable debugging.
  8. Under Debugging:Templates enter a label such as "CodeCoverage" and select the "File Coverage" template type and click create
  9. In the Datasource Name field enter 'codecoverage' and click submit ( you can also then limit to which IP ranges you want this debugging template to work with)

The site is now ready for testing. You just need to browse it. The next part is viewing the results.

Reports

At the moment this is pretty rough and ready and you just need to go to http://localhost/filecoverage to view how many hits each file gets as well as some information on which functions/methods are used in a CFC.

Listing of files and directories

Details about a CFC

Deployment

This extension should NOT be deployed on a live system. It's meant to be used as part of an investigation or your testing process. DO. NOT. RUN. ON. A. LIVE. SYSTEM. You have been warned.

Versioning

We use SemVer for versioning.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

About

This extension adds a debug template that you can use to log all the script files that are touched. This allows you to see which files don't have test coverage (for example) or files that should be safe to delete. It is very useful when dealing with unknown or legacy code.

Resources

License

Stars

Watchers

Forks

Packages

No packages published