Number of Fields in a Package

Counts the number of fields defined anywhere in a package.

The number includes fields defined in nested, local and anonymous classes.

Pre-packaged Query

Query name = "Semmle/Metrics/Packages/Size/Packages that contain many fields"

Reports packages that contain more than 50 fields, in descending order, as a bar chart.

from MetricPackage p, int fs
where p.fromSource() and fs = p.getNumberOfFields() and fs > 50
select p,fs order by fs desc

.QL Source of Metric

This metric is defined in MetricPackage, and its definition reads:

    int getNumberOfFields() {
      result = count(Field f | f.getDeclaringType().getPackage()=this)
    }

Digg!Reddit!Del.icio.us!Facebook!Slashdot!Technorati!StumbleUpon!Ma.gnolia!

Comments
Only registered users can write comments!
 
< Prev   Next >