protected override string GetDescription(Artifact item) { var hotspot = _hotspotCalculator.GetHotspot(item); return(item.ServerPath + "\nCommits: " + item.Commits + "\nLOC: " + _hotspotCalculator.GetArea(item) + "\nHotspot: " + hotspot.ToString("F5", CultureInfo.InvariantCulture)); }
object CreateDataGridFriendlyArtifact(Artifact artifact, HotspotCalculator hotspotCalculator) { var linesOfCode = (int)hotspotCalculator.GetArea(artifact); if (_contributions != null) { var result = new DataGridFriendlyArtifact(); var artifactContribution = _contributions[artifact.LocalPath.ToLowerInvariant()]; var mainDev = artifactContribution.GetMainDeveloper(); result.LocalPath = artifact.LocalPath; result.Revision = artifact.Revision; result.Commits = artifact.Commits; result.Committers = artifact.Committers.Count; result.LOC = linesOfCode; result.WorkItems = artifact.WorkItems.Count; result.CodeAge_Days = (DateTime.Now - artifact.Date).Days; result.Hotspot = hotspotCalculator.GetHotspot(artifact); // Work related information result.FractalValue = artifactContribution.CalculateFractalValue(); result.MainDev = mainDev.Developer; result.MainDevPercent = mainDev.Percent; return(result); } else { var result = new DataGridFriendlyArtifactBasic(); result.LocalPath = artifact.LocalPath; result.Revision = artifact.Revision; result.Commits = artifact.Commits; result.Committers = artifact.Committers.Count; result.LOC = linesOfCode; result.WorkItems = artifact.WorkItems.Count; result.CodeAge_Days = (DateTime.Now - artifact.Date).Days; result.Hotspot = hotspotCalculator.GetHotspot(artifact); return(result); } }