title: PMD - check for too many public methods (but exclude constructors and getters/setters)
body: <p>I wish to add a PMD check to ensure that a class does not have too many public methods, but I do not want constructors and getters/setters to be included in the check.</p>
  
  <p>The ExcessivePublicCount check includes constructors, getters/setters and public variables, and I can't see a way to customise it.</p>
  
  <p>The TooManyMethods check excludes getters/setters, but includes everything else (including private methods).  The XPath code for the check is as follows.</p>
  
  <pre><code>//ClassOrInterfaceDeclaration/ClassOrInterfaceBody
  [
      count(descendant::MethodDeclarator[
          not
          (
          starts-with(@Image,'get')
              or
          starts-with(@Image,'set')
          )
      ]) &amp;gt; $maxmethods
  ]
  </code></pre>
  
  <p>Can anyone help me out with modifying this to achieve what I want, or suggest another way to do this with PMD?</p>