//[OutputCache(Duration = 60 * 30, VaryByParam = "id;day;flag;sort", VaryByHeader = "User-Agent")] public PageResult ShowScanResult(int id, DateTime day, string flag, string sort, int?page) { _totalResult = ScanResultCache.GetTotalResult(id, day); _branchId = id; _dataFlag = flag; _sortField = sort; _pageIndex = page; switch (flag) { case "RuntimeScan": return(ShowAssemblyScanResult()); case "DatabaseScan": return(ShowDatabaseScanResult()); case "JsCodeScan": return(ShowJsCodeScanResult()); case "CsCodeScan": return(ShowCsCodeScanResult()); case "ExceptionLog": return(ShowExceptionLog()); case "PerformanceLog": return(ShowPerformanceLog()); case "ProjectScan": return(ShowProjectScanResult()); case "VsRuleScan": return(ShowVsRuleScanResult()); case "UnitTest": { SetLogFileUrl(id, day); return(ShowUnitTestResult()); } case "CodeCover": return(ShowCodeCoverResult()); case "CommentScan": return(ShowCommentScanResult()); default: throw new NotImplementedException(); } }
public IActionResult ShowPerformanceLog(int id, DateTime day, Guid g, int?xml) { TotalResult totalResult = ScanResultCache.GetTotalResult(id, day); PerformanceInfo info = totalResult.PerformanceInfos.FirstOrDefault(x => x.InfoGuid == g); if (info == null) { return(new TextResult("parameters is invaild.")); } if (xml.HasValue && xml.Value == 1) { return(new XmlResult(info)); } else { return(PageResult("/CodeScan/Partial/PerformanceDetail.cshtml", info)); } }
public IActionResult DailyReport(int id, DateTime day) { BranchSettings branch = JobManager.GetBranch(id); if (branch == null) { return(new TextResult("id is invaild.")); } if (day > DateTime.Today) { return(new TextResult("day is invaild.")); } DateTime today = day.Date; DailyReportViewModel model = new DailyReportViewModel(); model.Today = today.ToDateString(); model.DayMonth = today.Day.ToString() + "/" + today.Month.ToString(); //today.ToString("d/M"); model.Branch = branch; // 加载工具扫描的结果 TotalResult totalResult = null; try { totalResult = ScanResultCache.GetTotalResult(id, day); } catch (FileNotFoundException) { return(new TextResult("找不到匹配的数据文件。")); } model.ComplieMessage = totalResult.CompilerError; model.TotalResult = totalResult; // 注意:注释问题不是单独扫描出来的, // 是由于大家觉得这类问题的修复优先级可以降低点,所以就从【代码扫描结果】中提取 // 提取之后,还要从【代码扫描结果】去掉那部分数据 totalResult.EvalCommentScanResultCount(); return(PageResult("/CodeScan/DailyReport.cshtml", model)); }