/scape

Primary LanguageClojure

Scape

Scape uses the ClojureScript analyzer to emit Datomic transaction data containing useful information about some ClojureScript codebase and putting the data in a datomic database so the program becomes queriable via datalog. The idea is to extract interesting statistics and facts about ClojureScript programs.

This is work in progress. Take a look at core.clj and emitter.clj if you're interested to see how it works.

Example

The following query

[:find ?source ?target
 :in $ %
 :where
 [?e :ast.def/name ?source]
 [?e :ast/ns :domina]
 [ancestor ?e ?d]
 [?d :ast.var/ns :domina]
 [?d :ast.var/ns-qualified-name ?target]]

finds all definitions in the domina namespace together with all (internal) calls those defs make. The code in the call-graph namespace generates a graphviz file which can be seen rendered here.

License

Copyright © 2012 Jonas Enlund

Distributed under the Eclipse Public License, the same as Clojure.