Skip to content

Instantly share code, notes, and snippets.

@jaspervdj
Created February 24, 2010 16:05
Show Gist options
  • Save jaspervdj/313555 to your computer and use it in GitHub Desktop.
Save jaspervdj/313555 to your computer and use it in GitHub Desktop.
A diagnosis tool for lisp code.
#!/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