Last active
August 29, 2015 14:06
-
-
Save JimmyHoffa/b4fd667b30249008fa6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let filter (key:string,items:FileSummary seq) = | |
(getGroupLineCount items) > threshold | |
summaries | |
|> Seq.groupBy (fun x->x.RelativePath) | |
|> (fun group -> if useThresholds then (Seq.filter filter group) else group ) | |
|> (fun group -> if useTakeLimits.IsSome then Seq.take(useTakeLimits.Value) group else group) | |
|> Seq.map (fun (key,items) -> (key, items |> Seq.sumBy (fun i->i.LineCount) , items)) | |
|> Seq.sortBy (fun (key,l,items)-> -l) | |
could be something like... | |
let groupByPaths y = Seq.groupBy (fun x->x.RelativePath) y | |
let filterByThreshold x = if useThresholds then (Seq.filter filter x) else x | |
let takeLimitedAmount x = if useTakeLimits.IsSome then Seq.take(useTakeLimits.Value) x else x | |
let itemsLineCounter x = Seq.map (fun (key,items) -> (key, items |> Seq.sumBy (fun i->i.LineCount) , items)) | |
//...then nice readable line: | |
summaries |> groupByPaths |> filterByThreshold |> takeLimitedAmount |> itemsLineCounter |> Seq.sortBy (snd |> (-)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment