File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
app/Infrastructure/Graph/Adapters/Cytoscape Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 5
5
use App \Presenter \Analyze \Shared \Network \Network ;
6
6
use App \Presenter \Analyze \Shared \Network \NetworkBuilder ;
7
7
use App \Infrastructure \Graph \Adapters \Cytoscape \CytoscapeNetwork ;
8
+ use App \Presenter \Analyze \Shared \Network \NetworkAttribute ;
8
9
9
10
class CytoscapeNetworkBuilder implements NetworkBuilder
10
11
{
@@ -33,6 +34,10 @@ private function mapEdges(array $metrics): void
33
34
34
35
foreach ($ item ->dependencies () as $ dependency ) {
35
36
37
+ if ($ this ->isSelfDependency ($ dependency , $ item )) {
38
+ continue ;
39
+ }
40
+
36
41
if ($ this ->network ->missingNode ($ dependency )) {
37
42
$ this ->network ->addNode ($ dependency );
38
43
}
@@ -41,4 +46,12 @@ private function mapEdges(array $metrics): void
41
46
}
42
47
}
43
48
}
49
+
50
+ /**
51
+ * We remove self dependency from graph for readability reasons
52
+ */
53
+ private function isSelfDependency (string $ dependency , NetworkAttribute $ item ): bool
54
+ {
55
+ return $ dependency === $ item ->name ();
56
+ }
44
57
}
You can’t perform that action at this time.
0 commit comments