Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

make tolerant of unreadable files

put mem and server flags in readme
no fulltext on source
  • Loading branch information...
commit f04bedc45fc94dfd69656e843112b52c5d5a6058 1 parent 6c47d96
@richhickey richhickey authored
Showing with 17 additions and 14 deletions.
  1. +1 −1 
  2. +16 −13 src/datomic/codeq/core.clj
2 
@@ -14,7 +14,7 @@ Unzip it, then start the Datomic Free transactor. Follow the instructions for [r
cd theGitRepoYouWantToImport
- java -jar whereverYouPutCodeq/target/codeq-0.1.0-SNAPSHOT-standalone.jar datomic:free://localhost:4334/git
+ java -server -Xmx1g -jar whereverYouPutCodeq/target/codeq-0.1.0-SNAPSHOT-standalone.jar datomic:free://localhost:4334/git
This will create a db called `git` (you can call it whatever you like) and import the commits from the local view of the repo. You should see output like:
29 src/datomic/codeq/core.clj
@@ -237,7 +237,7 @@
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one
:db/doc "The source code for a code segment"
- :db/fulltext true
+ ;;:db/fulltext true
:db.install/_attribute :db.part/db}
{:db/id #db/id[:db.part/db]
@@ -506,19 +506,22 @@
[?tx :codeq/file ?f]]
db aname arev)))]
;;find files not yet analyzed
- (doseq [f (clojure.set/difference cfiles afiles)]
+ (doseq [f (sort (clojure.set/difference cfiles afiles))]
;;analyze them
- (println "analyzing file:" f)
- (let [db (d/db conn)
- src (with-open [s (exec-stream (str "git cat-file -p " (:git/sha (d/entity db f))))]
- (slurp s))
- adata (az/analyze a db f src)]
- (d/transact conn
- (conj adata {:db/id (d/tempid :db.part/tx)
- :codeq/op :analyze
- :codeq/file f
- :codeq/analyzer aname
- :codeq/analyzerRev arev})))))))
+ (println "analyzing file:" f " - sha: " (:git/sha (d/entity db f)))
+ (try
+ (let [db (d/db conn)
+ src (with-open [s (exec-stream (str "git cat-file -p " (:git/sha (d/entity db f))))]
+ (slurp s))
+ adata (az/analyze a db f src)]
+ (d/transact conn
+ (conj adata {:db/id (d/tempid :db.part/tx)
+ :codeq/op :analyze
+ :codeq/file f
+ :codeq/analyzer aname
+ :codeq/analyzerRev arev})))
+ (catch Exception ex
+ (println (.getMessage ex))))))))
(println "Analysis complete!"))
(defn main [& [db-uri commit]]
Please sign in to comment.
Something went wrong with that request. Please try again.