Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielpetroianu/91e5dd77816f5050360e to your computer and use it in GitHub Desktop.
Save danielpetroianu/91e5dd77816f5050360e to your computer and use it in GitHub Desktop.
Rudimentary code complexity check. From: http://matthewmorey.com/improved-xcode-build-phases/
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -and \( -path "${SRCROOT}/Pods/*" -prune -o -print0 \) \
| xargs -0 wc -l \
| awk '$1 > 400 && $2 != "total" {for(i=2;i<NF;i++){printf "%s%s", $i, " "} print $NF ":1: warning: File more than 400 lines (" $1 "), consider refactoring." }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment