Created
February 24, 2010 16:05
-
-
Save jaspervdj/313555 to your computer and use it in GitHub Desktop.
A diagnosis tool for lisp code.
This file contains 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
#!/bin/awk -f | |
BEGIN { | |
total = 0 | |
good = 0 | |
} | |
{ | |
total += length | |
gsub(/[^()]/, "") | |
good += length | |
} | |
END { | |
quality = good / total | |
printf("Overall code quality detected as %.2f\n", quality) | |
if(quality < 0.5) { | |
print "The number of braces used it horrendously low. You should" | |
print "seriously consider adding more braces or migrating to an" | |
print "other language." | |
} else { | |
print "It is obvious you understand the true beauty of lisp and use" | |
print "it to make your programs elegant and concise." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment