How to count the number of unused files in an Eclipse project

So, how to count the number of files in an Eclipse project, with the specific requirement that derived resources not be counted. (otherwise you could easily use the unix command-line tools to calculate this) Related and virtual resources should not be considered, though, bonus points if you do.

+3
source share
2 answers

And, I found the right way to do this: Open the "File Search" dialog box, delete all the text in the "Contains Text:" field, select the "File Name Template" that you want (for all files that will be ""), and then select the area you want (workspace, selected resources, etc.). Perform a search, and then view the hit counter in the search box. The key here is the "Contains text:" field. If it is ", it will match strings, not just files. First I tried to use a regular expression that would match only one file, for example," \ A (. | \ R)? "Which works to a certain extent (matches all non-empty , not binary files).But only an empty text field will really find all the files in the Eclipse resource model (including linked and virtual folders, but not derived or command-private resources).

+2

, , , , ( ).
. Eclipse (3.5 3.6).

( , )

alt text http://metrics.sourceforge.net/view.gif

+1

Source: https://habr.com/ru/post/1757815/


All Articles