     (@builds job)
     {}))
 
-(defn- store-build! [job build buildData]
+(defn- store-build! [job build build-data]
   (let [entry (job-entry job)
-        updatedEntry (assoc entry build buildData)]
-    (swap! builds assoc job updatedEntry)
-    {:body buildData}))
+        updated-entry (assoc entry build build-data)]
+    (swap! builds assoc job updated-entry)
+    {:body build-data}))
 
 (defn- get-build [job build]
   (if (contains? @builds job)
-    (if-let [buildData ((@builds job) build)]
-      {:body buildData}
+    (if-let [build-data ((@builds job) build)]
+      {:body build-data}
       {:status 404})
     {:status 404}))
 

    summary))

(defn- summary-for [job]
  (let [buildDataEntries (vals (@builds job))]
    (-> {}
        (average-runtime-for buildDataEntries)
        (total-count-for buildDataEntries)
        (error-count-for buildDataEntries)
        (flaky-runs-for buildDataEntries))))

(defn- get-pipeline []
  (let [jobNames (keys @builds)

  (if (and (contains? build :end) (contains? build :end))
    (- (build :end) (build :start))))

(defn- average-runtime-for [summary build-data-entries]
  (let [runtimes (filter (complement nil?) (map duration-for build-data-entries))]
    (if (not (empty? runtimes))
      (assoc summary :averageRuntime (avg runtimes))
      summary)))

(defn- total-count-for [summary build-data-entries]
  (assoc summary :totalCount (count build-data-entries)))

(defn- builds-with-outcome [build-data-entries]
  (filter #(contains? % :outcome) build-data-entries))
