private void ParseReport() { ToolStatusModel.StatusMessage = "Minions are Parsing the Report...."; ToolStatusModel.StatusImage = "../Images/ParsingReport.png"; AnalysisReport[] parsedReport; try { parsedReport = CodeAnalysisServiceClient.ParseReport(ToolRunModel.SelectedTool, ToolRunModel.RepoPath, ToolRunModel.Branch); } catch { parsedReport = new AnalysisReport[1]; parsedReport[0] = new AnalysisReport { FileName = ToolRunModel.RepoPath, Line = 0, Message = "Report too big to transfer", TypeId = "Warning" }; } if (parsedReport == null) { ToolStatusModel.StatusMessage = "Oops. The minion couldnt understand the report. \nTry again when the minion has has studied it further"; ToolStatusModel.StatusImage = "../Images/ParseFailed.png"; } else { UpdateReport(parsedReport.ToList()); GetResult(); } }
private void OnSignIn(object obj) { if (!CodeAnalysisServiceClient.SignIn(SignInModel.UserName, SignInModel.Password)) { MessageBox.Show("Invalid Username or Password"); } else { UpdateUserName.Invoke(SignInModel.UserName); Navigate.Invoke(ViewPages.ToolRun); } }
private void ExecuteTool() { ToolStatusModel.StatusMessage = "Minions hard at work running the Tool...."; ToolStatusModel.StatusImage = "../Images/RunningTool.png"; if (!CodeAnalysisServiceClient.InvokeTool(ToolRunModel.RepoPath, ToolRunModel.SelectedTool)) { ToolStatusModel.StatusMessage = "Oops. A Minion slipped while Running the tool. \nPlease Try Again"; ToolStatusModel.StatusImage = "../Images/RunToolFailed.png"; } else { ParseReport(); } }
private void DownloadRepo() { ToolStatusModel.StatusMessage = "Sit Tight. The Minions are Downloading your repository...."; ToolStatusModel.StatusImage = "../Images/Downloading.png"; if (!CodeAnalysisServiceClient.Download(ToolRunModel.RepoPath, ToolRunModel.Branch)) { ToolStatusModel.StatusMessage = "Oops. The Minion couldnt reach the repository. \nTry again with a different minion"; ToolStatusModel.StatusImage = "../Images/DownloadFailed.png"; } else { ExecuteTool(); } }
private void InitializeToolRunModel() { ToolRunModel.Branch = "master"; ToolRunModel.GateThreshold = -1; ToolRunModel.GateType = false; ToolRunModel.RepoType = false; ToolRunModel.AllTools = new Dictionary <Tools, string>(); ToolRunModel.AllTools.Add(Tools.PVS, Tools.PVS.ToString()); ToolRunModel.AllTools.Add(Tools.Resharper, Tools.Resharper.ToString()); ToolRunModel.AllTools.Add(Tools.Simian, Tools.Simian.ToString()); var results = CodeAnalysisServiceClient.GetRecentResults(UserName); UserRepos = ParseRecentRepos(results); }
private void GetResult() { bool result; ToolStatusModel.StatusMessage = "Almost done. Minions are Putting Finishing Touches on the Report...."; ToolStatusModel.StatusImage = "../Images/GetResult.png"; if (!ToolRunModel.GateType) { result = CodeAnalysisServiceClient.GetResult(-1, ToolRunModel.SelectedTool, ToolRunModel.RepoPath, ToolRunModel.Branch); } else { result = CodeAnalysisServiceClient.GetResult(ToolRunModel.GateThreshold, ToolRunModel.SelectedTool, ToolRunModel.RepoPath, ToolRunModel.Branch); } UpdateResult(result); Navigate.Invoke(ViewPages.Results); }
private void OnSignUp(object obj) { if (SignUpModel.Password == SignUpModel.ReenterPw) { if (CodeAnalysisServiceClient.SignUp(SignUpModel.UserName, SignUpModel.Password)) { Navigate.Invoke(ViewPages.SignIn); } else { MessageBox.Show("Invalid Sign In"); } } else { MessageBox.Show("Ensure Passwords are identical"); } }