Static code analysis tool for Common Lisp?
Asked Answered
T

3

11

I'm busy learning Common Lisp, & I'm looking for a static code analysis tool that will help me develop better style & avoid falling into common traps.

I've found Lisp Critic and I think it looks good, but I was hoping that someone may be able to recommend some other tools, and / or share their experiences with them.

Tithable answered 13/5, 2011 at 5:26 Comment(0)
C
12

Given the dynamic nature of Lisp, static analysis is everything from tough to impossible, depending on the type of source code.

For some purposes I would recommend using the SBCL compiler. Check out its manual for what features it provides. One feature is some form of type inference. It provides also a lot of standard warnings for things like undeclared variables, type problems, calling functions with the wrong number of args, using undefined functions, violating the ANSI CL standard in various ways and more.

Caracole answered 13/5, 2011 at 6:11 Comment(1)
Reading through the output from SBCL's compiler is quite frequently a good way of finding possible sources of future bugs. It is also, sometimes, good for finding stylistic or performance issues.Bootleg
F
3

The best way to learn about good style is to read a lot of code and ask for others to review your code. This isn't something that's specific to Common Lisp.

Fraction answered 13/5, 2011 at 10:35 Comment(2)
Agreed; I've already posted some Common Lisp code to codereview.stackexchange.com and received some excellent feedback.Tithable
@DuncanBayne Any platform that has become enough big and complex in the last 11 years has too much entropy to be handle only by human eyes. The world urges for automated code quality tools like Black Duck, SonarQube and Snyk to mitigate security risks. I am searching for Clojure and Lisp tools that I may integrate into SonarQube or Code Climate.Volcanic
C
1

I think that one gray tool is use lisp-critic, you can get some information here:

http://quickdocs.org/lisp-critic/

and a remake that was done by @Xach

http://xach.com/lisp/

Comprehension answered 12/12, 2015 at 7:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.