Created
October 3, 2014 13:14
-
-
Save KorbenC/30e468e9e14f55d7acf7 to your computer and use it in GitHub Desktop.
Counts the lines of apex code in org, combined both class and triggers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Integer classLines = 0; | |
Integer triggerLines = 0; | |
for(ApexClass a : [Select Body From ApexClass]){ | |
List<String> lines = a.Body.split('\n'); | |
classLines += lines.size(); | |
} | |
for(ApexTrigger a : [Select Body From ApexTrigger]){ | |
List<String> lines = a.Body.split('\n'); | |
triggerLines += lines.size(); | |
} | |
system.debug('Apex Class lines: ' + classLines); | |
system.debug('Apex Trigger lines: ' + triggerLines); | |
system.debug('Apex Total lines: ' + (classLines+ triggerLines)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very cool. Thanks