Code Metrics Plugin - that can work both on source code (primary focus is here) and binaries

Is there a simple and efficient plugin, which could give the following details of source code?

1. Total Number of Public, Private, Protected, Package Fields
2. Total Number of static fields
3. Total Number of final and non-final fields
4. Total method parameters
5. Total method parameters which are non-final
6. Total number of public, private, protected, package methods
7. Total number of objects created (even approx)
8. Total Memory used by each object at runtime
9. Total Size of apk or jar file it would generate - to track and optimize the footprint
10. Total number of block-level, final, and non-final local variables 
11. How many if conditions, else conditions, switch conditions  are used in the project
12. How many loops i.e. for, while etc.. are used
13. Number of overridden methods
14. Total Try/Catch nested and unnested
15. Fileds, which are transferred over the network  and the appx Data Size calculations
16. Most expensive for loops based on hardcoded loop conditions (helps in image processing applications)
17. How many times each of the constant referenced (this number should change drastically when seen from source code and when the compiler does inline)
18. How many times each of the methods invoked (appx is also ok)

19. Class which has max imports, methods, method parameters

Ideally, the plugin should work seamlessly on polyglot projects eg. in android with java + kotlin + C++ ndk code.

The sole purpose of refactoring and code simplification is to play with the above in a certain way. Good refactoring should reduce the number of class variables and make most of them into method local variables.

评论操作 固定链接

I do understand IntelliJ structural search is powerful enough to give all these.. but a well-tested plugin with professional UI to manage/trace these numbers in a smart way would be of great value for developers.

Structural Search will have challenges (still achievable) as each language defaults are different e.g in kotlin every class is final and public etc.. while it is not the same with java.