If you are a developer or a tech lead, Dead Code Detector (DCD) simply finds never used code in your Java/JEE applications.
Author: Emeric Vernat
License: ASL
See wiki
Dead Code Detector finds never used code in Java applications
Home Page: https://github.com/evernat/dead-code-detector/wiki
License: Apache License 2.0
If you are a developer or a tech lead, Dead Code Detector (DCD) simply finds never used code in your Java/JEE applications.
Author: Emeric Vernat
License: ASL
See wiki
The "java.util.function.Consumer<T>
" operation introduced in Java 1.8 are not considered, so provide a falsy dead code detection
Exemple:
dataList.forEach(this::countElement);
private void countElement(RequestElement element) {
this.number += element.getData().size();
}
"countElement
" is not private dead code...
The library does not take into account the annotations "javax.annotation.PostConstruct
" and "javax.annotation.PreDestroy
", so associated methods are falsy considered as dead code.
The usage of the parameter "excludedMethods
" is painfull because it does not take into account a class name. So all methods with same name, but from different classes are excluded.
I'd like to specify a class name + a method name in order to avoid unwanted exclusions like in the following exemple:
excludedMethods = org.*.MyClass#myExcludedMethod
Trying to run it on MAC:
java -cp dcd.jar:src/main/lib/* dcd.ui.DeadCodeDetectorUI
java.awt.IllegalComponentStateException: The frame is decorated
at java.awt.Frame.setOpacity(Frame.java:960)
at java.awt.Window$1.setOpacity(Window.java:4035)
at com.sun.awt.AWTUtilities.setWindowOpacity(AWTUtilities.java:174)
at sun.lwawt.macosx.CPlatformWindow$3.applyProperty(CPlatformWindow.java:163)
at sun.lwawt.macosx.CPlatformWindow$3.applyProperty(CPlatformWindow.java:162)
at com.apple.laf.ClientPropertyApplicator.applyProperty(ClientPropertyApplicator.java:45)
at com.apple.laf.ClientPropertyApplicator.propertyChange(ClientPropertyApplicator.java:75)
at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
at java.awt.Component.firePropertyChange(Component.java:8428)
at javax.swing.JComponent.putClientProperty(JComponent.java:4087)
at dcd.ui.DeadCodeDetectorUI.setWindowOpacity(DeadCodeDetectorUI.java:169)
at dcd.ui.DeadCodeDetectorUI.disappear(DeadCodeDetectorUI.java:156)
at dcd.ui.DeadCodeDetectorUI.showFrame(DeadCodeDetectorUI.java:125)
at dcd.ui.DeadCodeDetectorUI$3.run(DeadCodeDetectorUI.java:212)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
java -version
java version "1.8.0_102"
What is this supposed to mean:
Private suspects in class com.vmware.vmtx.activities.VmtxActivityCallbackTest:
[Object[][] onFailureTestCases()]
How can I detect unused classes? How does DCD work with spring?
Sorry, but at the moment it looks useless.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.