Description / Features
The objective of this plugin is report on the number of lines that can be reduced in an application. It currently works on 3 axes :
1. report on number of duplicated lines that could be reduced
Currently Sonar tells you that you have 50 lines involves in a duplication. But it does not tell easily you whether this is two blocks of 25 lines that are duplicated (in which case you can save 25 lines) or 5 blocks of 10 lines (in which case you can save 40 lines). With the plugin you get this extra information
2. report on the number of lines of dead code that could be reduced
Currently Sonar reports on the number of unsused private method within you application. This can be done through the PMD:UnusedPrivateMethod or through the SQUID:UnusedPrivateMethod. This plugin calculates the number of lines that can be saved for each of them and aggregates them.
3. report on the number of lines of potential dead code that could be reduced
Currently Sonar reports on the number of unsused protected method within you application. This can be done through the PMD:UnusedProtectedMethod or through the SQUID:UnusedProtectedMethod. This plugin calculates the number of lines that can be saved for each of them and aggregates them.
It is to be noted that an unused protected method could be used outside the application through inheritance. This is why we call it potential dead code.
Usage & Installation
- Install the jar into /extensions/plugins
- Restart the Sonar server
- Switch on the rules you want to monitor in your quality profile
- Run a quality analysis
This plugin only functions for Java projects.
Release 0.3 (2 issues)
|SONARPLUGINS-970||Remove usage of SquidSearch||Closed||Fixed|
|SONARPLUGINS-915||0 dead code line files should not be displayed||Closed||Fixed|
Release 0.2 (1 issues)
|SONARPLUGINS-799||NPE when getting line id from Violation||Closed||Fixed|