Skip to content

Instantly share code, notes, and snippets.

@bbrodriges
Last active October 4, 2016 11:22
Show Gist options
  • Save bbrodriges/c954682da2e98cffb7856540876cc7a1 to your computer and use it in GitHub Desktop.
Save bbrodriges/c954682da2e98cffb7856540876cc7a1 to your computer and use it in GitHub Desktop.
Golang cyclomatic complexity one line script
gocyclo . | awk '{if ($1 > 20) {if (status == 0) {printf "\033[1;31mCyclomatic complexity too high:\033[0m\n"}; compl = $1; $1 = ""; print "\033[31;4m" compl "\033[0m", $0; status = 1}} END {exit status}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment