Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space CSHARP and version Publish

...

Dont print
Code Block
languageql
titleQuery: TSizeOfAPI.ql
collapsetrue
/**
 * @name Size of type APIs
 * @description Types with a large public API might be difficult to use and might have too many responsibilities.
 * @kind treemap
 * @treemap.warnOn highValues
 * @metricType reftype
 * @metricAggregate avg sum max
 * @tags testability
 *       modularity
 * @id cs/public-functions-per-type
 */

import csharp

from ValueOrRefType t, int n
where
  t.isSourceDeclaration() and
  t.isPublic() and
  n =
    count(Method m | m.getDeclaringType() = t and m.isPublic()) +
      count(Operator o | o.getDeclaringType() = t and o.isPublic()) +
      count(Property p | p.getDeclaringType() = t and p.isPublic()) +
      count(Indexer i | i.getDeclaringType() = t and i.isPublic()) +
      count(Event e | e.getDeclaringType() = t and e.isPublic())
select t, n order by n desc

...

Htmlcomment
hiddentrue
hashconfluence_uploader_hash:e682f6f460919459f57778bfe7d3dfbe89c651b17637289174146e72c81b94f8d8961c99a051e2f6