Last active
October 4, 2016 11:22
-
-
Save bbrodriges/c954682da2e98cffb7856540876cc7a1 to your computer and use it in GitHub Desktop.
Golang cyclomatic complexity one line script
This file contains hidden or 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
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