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); } }
protected override double GetArea(Artifact item) { return(_hotspotCalculator.GetArea(item)); }