Beispiel #1
0
        private static int DisplayFullHistory(FullHistory opts)
        {
            using (var repo = new SourceControlAnalysisBuilder()
                              .WithPath(opts.Path)
                              .WithEntireHistory()
                              .WithIgnorePatterns(opts.IgnorePatterns)
                              .WithBranch(opts.Branch)
                              .WithWeekends(opts.WeekendDays)
                              .WithWorkingDaysPerWeek(opts.WorkingDaysPerWeek)
                              .WithWorkingWeekHours(opts.WorkingHoursPerWeek)
                              .WithIgnoreComments(opts.IgnoreComments)
                              .Build())
            {
                // todo : make configurable
                //var aliasMap = new List<Alias>
                //{
                //    new Alias{
                //        Name = "T-rav",
                //        Emails = new List<string>{
                //            "*****@*****.**",
                //            "*****@*****.**",
                //            "*****@*****.**"}
                //    }
                //};

                // todo : wip, first attempt to make aliases confiurable
                //var aliasRepository = new AliasRepository(opts.AliasFile);
                //var aliasMap = aliasRepository.Load();

                var dashboard = new CodeStatsDashboard();
                var authors   = repo.List_Authors();
                var stats     = repo.Build_Individual_Developer_Stats(authors);
                var teamStats = repo.Build_Team_Stats();
                dashboard.RenderDashboard(stats, teamStats, repo.ReportingRange);
            }

            return(1);
        }
Beispiel #2
0
        private static int Display_Full_History(FullHistory opts)
        {
            var presenter    = Create_Presenter(opts.Mode);
            var builder      = new SourceControlAnalysisBuilder();
            var statsUseCase = new FullStatsUseCase(builder);

            var inputTo = new FullStatsInput
            {
                Path           = opts.Path,
                IgnorePatterns = opts.IgnorePatterns,
                Branch         = opts.Branch,
                WeekDays       = opts.WeekendDays,
                DaysPerWeek    = opts.WorkingDaysPerWeek,
                HoursPerWeek   = opts.WorkingHoursPerWeek,
                IgnoreComments = opts.IgnoreComments,
                AliasFile      = opts.AliasFile,
                WeekendDays    = opts.WeekendDays
            };

            statsUseCase.Execute(inputTo, presenter);
            presenter.Render();

            return(1);
        }