Integer classLines = 0;
Integer triggerLines = 0;
for(ApexClass a : [Select Name, Body From ApexClass]){
List
classLines += lines.size();
System.debug(a.name + ‘:’ + lines.size());
}
for(ApexTrigger a : [Select Name, Body From ApexTrigger]){
List
triggerLines += lines.size();
System.debug(a.name + ‘:’ + lines.size());
}
system.debug(‘Apex Class lines: ‘ + classLines);
system.debug(‘Apex Trigger lines: ‘ + triggerLines);
system.debug(‘Apex Total lines: ‘ + (classLines+ triggerLines));