Number of Public Callables of a Type (Size of API)

Count the number of public methods or constructors defined in a type. This provides an indication of the size of the API defined by this type.

Pre-packaged Query

Query name="Semmle/Metrics/Types/Size/Reftypes with many public callables"

Reports types that define more than 35 public callables.

from MetricRefType t, int n
where t.fromSource() and
      n = t.getNumberOfPublicCallables() and
      n > 35
select t,n order by n desc

.QL Source of Metric

This metric is introduced in class MetricRefType, and its definition reads:

int getNumberOfPublicCallables() {
   result = count(Callable m | m.getDeclaringType() = this
                               and
                               m.hasModifier("public"))
}

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

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