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 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; } }