Skip to content

Commit

Permalink
add main-dev metric
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkes committed Sep 8, 2015
1 parent 0e375b7 commit 6e54729
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/clj/gitomic/reports.clj
Expand Up @@ -84,4 +84,15 @@
(defn coupling->csv [db repo fname & opts]
(let [tc (temporal-coupling db repo opts)
pairs (i/$order [:churn :f1 :percentage] :desc tc)]
(i/save pairs fname)))
(i/save pairs fname)))

(defn main-dev [ds]
(i/add-derived-column :ownership [:change/added :change/added-total]
(fn [x y] (Math/round (if (pos? y)
(* 100 (float (/ x y)))
-1.0)))
(i/$join [:file/path :file/path]
(i/$rollup :sum :change/added [:person/name :file/path] ds)
(i/rename-cols {:change/added :change/added-total}
(i/$rollup :sum :change/added :file/path ds))))
)

0 comments on commit 6e54729

Please sign in to comment.