开发者

Is there a way to see a list of a class' methods with their length (no of lines) in Eclipse?

开发者 https://www.devze.com 2023-02-10 15:56 出处:网络
When refactoring a class that is too large, to get an overview of \"problematic\" methods I find it useful to see a list of all methods, with the number of lines of each method.

When refactoring a class that is too large, to get an overview of "problematic" methods I find it useful to see a list of all methods, with the number of lines of each method.

Eclipse of course has a list of the methods of a class (breadcrumbs, Outline view), but I can't see a way to show the number 开发者_运维问答of lines for each method.

Is there a way to see this, in Eclipse, or using some other tool?


CodePro AnalytiX does this (and much more).


Edit: or if you just want to know which methods are too big, you can use checkstyle. It will check that for you, and put warnings where appropriate.


What can be useful to you is Metrics in Eclipse.

Try http://www.stateofflow.com/projects/16/eclipsemetrics and http://eclipse-metrics.sourceforge.net/descriptions/LinesOfCode.html

Lines of Code in Method

This measure indicates the number of lines a method occupies - a line is determined by the presence of a newline character. It is a very basic measure of size and is susceptible to variation purely on the basis of different formatting styles. However, many users of the Eclipse Metrics plugin asked for it's inclusion, so here it is (...)

0

精彩评论

暂无评论...
验证码 换一张
取 消