Is there any Apex exchange tool or utility which can give me the following details in an Apex class.
- Number of methods defined
- Number of SOQL's used
and the respective character count for each of those.
Cannot tell about SOQL and the character count, but you can use the Tooling API to fetch data from ApexClass
. There you get the SymbolTable
object that contains list of all the methods used. Refer Tooling API documentation
Another method is as @Enry suggested, by querying the ApexClass
object and writing a parser of your own.
I m not aware of packages to do that.
Some input to start from scratch: You can query "Apex Class" object. http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_apexclass.htm
Query the body and then parse it as a string. For example you can count the number of "from" to know how many queries there are.