mirror of
https://github.com/mandiant/capa.git
synced 2026-01-20 08:30:54 -08:00
removing empty structural expressions from tree view
This commit is contained in:
@@ -324,14 +324,9 @@ class CapaExplorerDataModel(QtCore.QAbstractItemModel):
|
||||
parent2 = CapaExplorerDefaultItem(parent, '%d or more' % result.statement.count)
|
||||
elif not isinstance(result.statement, (capa.features.Feature, capa.engine.Range, capa.engine.Regex)):
|
||||
# when rending a structural node (and/or/not) then we only care about the node name.
|
||||
'''
|
||||
succs = list(filter(lambda c: bool(c), result.children))
|
||||
if len(succs) == 1:
|
||||
# skip structural node with single succeeding child
|
||||
parent2 = parent
|
||||
else:
|
||||
parent2 = CapaExplorerDefaultItem(parent, result.statement.name.lower())
|
||||
'''
|
||||
if not len(list(filter(lambda c: bool(c), result.children))):
|
||||
# ignore empty structural expressions (e.g. not)
|
||||
return
|
||||
parent2 = CapaExplorerDefaultItem(parent, result.statement.name.lower())
|
||||
else:
|
||||
# but when rendering a Feature, want to see any arguments to it
|
||||
|
||||
Reference in New Issue
Block a user