Beispiel #1
0
        private static void ReportTableRow(
            StreamWriter file,
            string prefix,
            ContributionsReport.Interval interval,
            ContributionsReport.Report report,
            IEnumerable <DataModelIssue> issues)
        {
            IEnumerable <DataModelIssue> defaultGroupIssues = issues
                                                              .Where(issue => report.Groups.Where(group => group.ContainsAuthor(issue)).None()).ToList();

            ReportTableRow(file,
                           "  ",
                           $"<b>{interval.GetLabel(report.Unit != ContributionsReport.Report.UnitKind.Month)}</b>",
                           issues.NonPullRequests().Count().ToString(),
                           issues.PullRequests().Count().ToString(),
                           report.Groups.SelectMany(group =>
            {
                IEnumerable <DataModelIssue> filteredIssues = issues.Where(issue => group.ContainsAuthor(issue)).ToList();
                return(new string[]
                {
                    filteredIssues.NonPullRequests().Count().ToString(),
                    filteredIssues.PullRequests().Count().ToString()
                });
            }),
                           defaultGroupIssues.NonPullRequests().Count().ToString(),
                           defaultGroupIssues.PullRequests().Count().ToString());
        }
Beispiel #2
0
        private static void ReportTableRow_Users(
            StreamWriter file,
            string prefix,
            ContributionsReport.Report report,
            IEnumerable <DataModelIssue> allIssues)
        {
            ContributionsReport.Interval reprotInterval = report.FullInterval;
            IEnumerable <DataModelIssue> issues         = allIssues.Where(issue => reprotInterval.Contains(issue.CreatedAt.Value));

            IEnumerable <DataModelIssue> defaultGroupIssues = issues
                                                              .Where(issue => report.Groups.Where(group => group.ContainsAuthor(issue)).None()).ToList();

            ReportTableRow(file,
                           "  ",
                           report.Groups.Select(group => GetUserBreakdown(issues.Where(issue => group.ContainsAuthor(issue)).ToList())),
                           GetUserBreakdown(defaultGroupIssues));
        }