private void ColorSmellsOfType(string type) { decolorCells(smellyCells); List <Smell> smellsOfType = type == "" ? controller.DetectedSmells : controller.DetectedSmells.Where(x => x.AnalysisType.ToString() == type).ToList(); foreach (var smell in smellsOfType) { var analyzerExtension = new tmpAnalyzerExtension(smell.AnalysisType); if (analyzerExtension.GetMetricScore(smell.RiskValue) > MetricScore.None) { ColorCell(smell); } } }
public void Apply(Smell smell) { Cell.Interior.Pattern = ExcelRaw.XlPattern.xlPatternSolid; Cell.Interior.Color = ColorTranslator.ToOle(Color.Red); var existingComment = ""; var analyzerExtension = new tmpAnalyzerExtension(smell.AnalysisType); var comments = analyzerExtension.GetSmellMessage(smell); if (!string.IsNullOrEmpty(comments)) { if (Cell.Comment != null) { existingComment = Cell.Comment.Text() + "\n"; Cell.Comment.Delete(); } Cell.AddComment(existingComment + comments); Cell.Comment.Visible = true; } }
public void LoadSmellTypesSelect() { addIn.theRibbon.selectSmellType.Items.Clear(); foreach (var smellType in controller.DetectedSmells.Select(x => x.AnalysisType).Distinct()) { tmpAnalyzerExtension analyzerExtension = new tmpAnalyzerExtension(smellType); if (controller.DetectedSmells.Any(x => analyzerExtension.GetMetricScore(x.RiskValue) > MetricScore.None)) { addSelectSmellTypeItem(smellType.ToString(), analyzerExtension.SmellName); } } addSelectSmellTypeItem("", "(all)", true); if (addIn.theRibbon.selectSmellType.Items.Count > 1) { addIn.theRibbon.selectSmellType.Enabled = true; } }