Skip to content

Commit c984d06

Browse files
committed
Prevent <self> nodes with no methods in the package list.
1 parent 9c96292 commit c984d06

File tree

1 file changed

+9
-2
lines changed
  • codepulse/src/main/resources/toserve/pages/traces

1 file changed

+9
-2
lines changed

codepulse/src/main/resources/toserve/pages/traces/TreeData.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,22 @@
137137
/*
138138
A node is eligible for a 'self' node if it is a
139139
'package' node that has at least one 'package' child
140+
and one non-package child (class or method).
140141
*/
141142
function isEligibleForSelfNode(node){
142143
if(node.kind != 'package') return false
143144
if(!node.children) return false
144145

146+
var hasPackageChild = false,
147+
hasNonPackageChild = false
148+
145149
for(var i in node.children){
146-
if(node.children[i].kind == 'package') return true
150+
var kind = node.children[i].kind
151+
152+
if(kind == 'package') hasPackageChild = true
153+
else hasNonPackageChild = true
147154
}
148-
return false
155+
return hasPackageChild && hasNonPackageChild
149156
}
150157

151158
})(this);

0 commit comments

Comments
 (0)