Skip to content

Commit

Permalink
#723 Removed unnecessary directory separator replacement.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
koschke committed Jun 14, 2024
1 parent 00371d7 commit 432645d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Assets/SEE/GraphProviders/VCSMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 432645d

Please sign in to comment.