Start
Preferences
More
Releases
FAQ
Custom
License
Contact & Links

UCDetector UCDetector: Unnecessary Code Detector

Custom

Write your own detector: Get Code

- Import all UCDetector projects using this eclipse project set.

Or:

- Check out projects org.ucdetector and org.ucdetector.additional from SVN:

svn co http://svn.code.sf.net/p/ucdetector/code/trunk/org.ucdetector org.ucdetector
svn co http://svn.code.sf.net/p/ucdetector/code/trunk/org.ucdetector.additional org.ucdetector.additional

Create custom marker

Create your own problem markers! I already provided example code for

  • Detect naming conventions for classes, methods or fields and create markers
  • Detect class names which are not unique
  • Detect no java files
  • Find all comments which contain "TODO"

This code is easy to extend. Look at this example:

  protected void handleType(IType type) throws CoreException {
    String className = type.getElementName();
    if (!type.isAnonymous() && !startsWithUpper(className)) {
      markerFactory.createMarker(type,
        "Class name must start with upper case");
    }

To create your own detector plugin:

  • Change code of example above found in CheckNameConventionIterator.java
  • Create plugin running ant build file in Eclipse: org.ucdetector.additional/doc/build.xml
  • Put create plugins in ECLIPSE_HOME/dropins directory
  • Restart Eclipse
E-Mail me your detection example!
Additional

Debug your changes

Cool: Debug a running eclipse IDE.
Create a new Eclipse run configuration. Menu:
  • Run
  • Run Configurations...
  • Eclipse Application
  • See screenshots
  • Click button 'Debug'
Main

Arguments

Plugins

Last Update: 2013-10-22Jörg Spieler    Show profile of Jörg Spieler in LinkedInCopyright © 2013, by Jörg Spieler

Page views since 2008-03-01: Page views since 2008-03-01 Hosted by: SourceForge.net Logo