From 432645d744ffdcbb46c86c605502824bb0df18d5 Mon Sep 17 00:00:00 2001 From: Rainer Koschke Date: Fri, 14 Jun 2024 14:23:33 +0200 Subject: [PATCH] #723 Removed unnecessary directory separator replacement. The ID of a file created by a VCSGraphProvider is always the relative path in the syntax of the repository (e.g., in Git / is used as the separator). --- Assets/SEE/GraphProviders/VCSMetrics.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Assets/SEE/GraphProviders/VCSMetrics.cs b/Assets/SEE/GraphProviders/VCSMetrics.cs index 5b8b1b6d04..7a002a020b 100644 --- a/Assets/SEE/GraphProviders/VCSMetrics.cs +++ b/Assets/SEE/GraphProviders/VCSMetrics.cs @@ -66,9 +66,7 @@ private static void AddLinesOfCodeChurnMetric(Graph graph, Repository repository { foreach (Node node in graph.Nodes()) { - // TODO: Why is this needed? Is it always needed on every platform? - // Can't we just use the path attribute of the node as it is? - if (node.ID.Replace('\\', '/') == change.Path) + if (node.ID == change.Path) { node.SetInt(DataModel.DG.VCS.LinesAdded, change.LinesAdded); node.SetInt(DataModel.DG.VCS.LinesDeleted, change.LinesDeleted); @@ -119,7 +117,7 @@ private static void AddNumberOfDevelopersMetric(Graph graph, Repository reposito { foreach (Node node in graph.Nodes()) { - if (node.ID.Replace('\\', '/') == entry.Key) + if (node.ID == entry.Key) { node.SetInt(DataModel.DG.VCS.NumberOfDevelopers, entry.Value.Count); } @@ -172,7 +170,7 @@ private static void AddCommitFrequencyMetric(Graph graph, Repository repository, { foreach (Node node in graph.Nodes()) { - if (node.ID.Replace('\\', '/') == entry.Key) + if (node.ID == entry.Key) { node.SetInt(DataModel.DG.VCS.CommitFrequency, entry.Value); }