From c41a1ae7b8bc8b8f4566925e2415541b85e7929b Mon Sep 17 00:00:00 2001 From: Adam Tornhill <adam@adamtornhill.com> Date: Tue, 29 Dec 2020 17:45:42 +0100 Subject: [PATCH] Remove dead code such as earlier prototypes --- src/code_maat/analysis/authors.clj | 15 +-------- src/code_maat/parsers/limitters.clj | 47 ----------------------------- 2 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 src/code_maat/parsers/limitters.clj diff --git a/src/code_maat/analysis/authors.clj b/src/code_maat/analysis/authors.clj index a3928dad..a275a3ee 100644 --- a/src/code_maat/analysis/authors.clj +++ b/src/code_maat/analysis/authors.clj @@ -26,12 +26,6 @@ [ds] (distinct (ds/-select-by :author ds))) -(defn entity-with-author-count - "Calculates the number of different authors for the given module, m. - Returns a tuple of [entity-name number-of-distinct-authors]." - [m ds] - [m (ds/-nrows (of-module m ds))]) - (defn- authors-of-entity [entity-group] (->> @@ -59,16 +53,9 @@ Returns a dataset with the columns :entity :n-authors." ([ds options] (by-count ds options :desc)) - ([ds options order-fn] + ([ds _options order-fn] (->> ds (ds/-group-by :entity) (map make-entity-with-author-count) (ds/-dataset [:entity :n-authors :n-revs]) (ds/-order-by [:n-authors :n-revs] order-fn)))) - -(defn all-authors - [ds] - (->> ds - all - (ds/-dataset [:author]) - (ds/-order-by [:author] :asc))) diff --git a/src/code_maat/parsers/limitters.clj b/src/code_maat/parsers/limitters.clj deleted file mode 100644 index 45c5269d..00000000 --- a/src/code_maat/parsers/limitters.clj +++ /dev/null @@ -1,47 +0,0 @@ -;;; Copyright (C) 2013 Adam Tornhill -;;; -;;; Distributed under the GNU General Public License v3.0, -;;; see http://www.gnu.org/licenses/gpl.html - -(ns code-maat.parsers.limitters - (:require [clj-time.core :as clj-time])) - -;;; The input from a VCS log is filtered (optionally) on both -;;; the total number of entries considered as well as a specified -;;; date span. The filtering is encapsulated within this module and -;;; shared between the different front-end parsers (e.g. git, svn). - -(defn make-entries-limited-seq [parse-options s] - (if-let [n (:max-entries parse-options)] - (take n s) - s)) - -(defn- after-start-date? - "A predicate that returns true if the given log-entry contains - a time span after the start-time. - The intent is to limit the commits included in the analysis. - Over time, design issues get fixed and we don't want old - data to interfere with our analysis results." - [start-date entity-date-extractor-fn log-entry] - (clj-time/after? (entity-date-extractor-fn log-entry) start-date)) - -(defn make-date-span-limited-seq - [parse-options entity-date-extractor-fn s] - (if-let [date (:date parse-options)] - (take-while - (partial after-start-date? date entity-date-extractor-fn) - s) - s)) - -(defn log-entries-to-include - "Returns a lazy seq of s filtered and limited according - to the given parse-options. The third argument is simply - a function that given an entry returns its date as a clj-time - instance." - [parse-options entity-date-extractor-fn s] - (let [limitter (comp - (partial make-date-span-limited-seq - parse-options - entity-date-extractor-fn) - make-entries-limited-seq)] - (limitter parse-options s)))