Giter VIP home page Giter VIP logo

deadmethods's Introduction

DeadMethods

deadmethods is an ant task that will find uncalled methods regardless of access qualifier. Licensed by Apache 2.0 license

This project uses ant, to build do

ant

You can run deadmethods on itself, by running

ant test

To run it on your project do the following:

Copy the deadmethods.jar and the asm.jar to your ~/.ant/lib directory

Then create a task such as:

<target name="dm" xmlns:dm="antlib:com.mebigfatguy.deadmethods"> 
    <dm:deadmethods>
        <classpath refid="your.classes.classpath"/>
        <auxClasspath refid="your.aux.classpath"/>
        <reflectiveAnnotation name="YourAnnotation"/>
        <reflectiveAnnotation name="YourOtherAnnotation"/>
        <ignoredPackage pattern="com.you.ignore.me.*"/>
        <ignoredPackage pattern="you.ignore.me2.*"/>
        <ignoredClass pattern=".*MBean"/>
        <ignoredMethod pattern="_get_.*"/>
    </dm:deadmethods>
</target>

Obviously, methods will be reported as 'dead' even though they are important to you. This will happen because

  • Methods are used via reflection
  • Methods are part of an api, that clients are expected to use
  • Methods are called from unit tests, or other code not included in your deadmethods ant task

Care should be taken to not indiscriminately remove methods reported by this tool. This tool offers you a starting point. Use due diligence to validate what the results are.

Deadmethods is available on maven with the following coordinates:

groupId: com.mebigfatguy.deadmethods
artifactId: deadmethods
version: 0.9.0

deadmethods's People

Contributors

cwinters avatar mebigfatguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.