How can I know the default style for a layer in Geoserver, and the number of rules it contains, using a REST call or service?
You can request the style using REST (_http://myserver.com/geoserver/styles/mystyle). Once you've got the file use something like
grep '<Rule' mystyle.sld | wc -l
to count the number of lines.
Obviously you can use any programming language of your choice to automate this.