Skip to content

Instantly share code, notes, and snippets.

@Tantas
Created August 21, 2015 16:20
Show Gist options
  • Save Tantas/9d0aef0c6626be01a3d3 to your computer and use it in GitHub Desktop.
Save Tantas/9d0aef0c6626be01a3d3 to your computer and use it in GitHub Desktop.
Gives some metrics of the size of an objective-c code base.
#!/bin/bash
# Lines of code
cloc ./Classes
# Number of classes
grep -r "^\@interface [a-zA-Z0-9]* \: " ./Classes | wc -l
# Number of instance selectors
grep -r "^\- ([a-zA-Z0-9 ]*)[a-zA-Z0-8:() ]* {" ./Classes | wc -l
# Number of class selectors
grep -r "^\+ ([a-zA-Z0-9 ]*)[a-zA-Z0-8:() ]* {" ./Classes | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment