public IHttpActionResult FuncCount(string repoUrl, uint diff = 10, uint times = 10)
        {
            var path       = GitController.InitRepository(repoUrl);
            var funcCounts = new List <int>();

            for (var i = 0; i < times; i++)
            {
                var srcmlPath = SrcmlController.ParseSources(path);
                funcCounts.Add(XmlController.CountFuncs(srcmlPath));
                GitController.TimeTravelCommits(path, diff);
            }
            return(Ok(new XmlOutput <int>(funcCounts.ToArray(), JobType.FuncCount)));
        }
        public IHttpActionResult AverageRowCountPerFunction(string repoUrl, uint diff = 10, uint times = 10)
        {
            var path         = GitController.InitRepository(repoUrl);
            var avgRowCounts = new List <double>();

            for (var i = 0; i < times; i++)
            {
                var srcmlPath = SrcmlController.ParseSources(path);
                avgRowCounts.Add(XmlController.GetAverageRowsPerFunction(srcmlPath));
                GitController.TimeTravelCommits(path, diff);
            }
            return(Ok(new XmlOutput <double>(avgRowCounts.ToArray(), JobType.AvgRowsPerFunction)));
        }
        public IHttpActionResult Imports(string repoUrl, uint diff = 10, uint times = 10)
        {
            var path         = GitController.InitRepository(repoUrl);
            var importCounts = new List <Dictionary <string, int> >();

            for (var i = 0; i < times; i++)
            {
                var srcmlPath = SrcmlController.ParseSources(path);
                importCounts.Add(XmlController.CountImports(srcmlPath));
                GitController.TimeTravelCommits(path, diff);
            }
            var orderedCounts = Sort(importCounts);

            return(Ok(new XmlOutput <List <KeyValuePair <string, int> > >(orderedCounts.ToArray(), JobType.Imports)));
        }