diff --git a/src/Famix-CallGraphs/FamixAbstractCallGraphNode.class.st b/src/Famix-CallGraphs/FamixAbstractCallGraphNode.class.st index 99e4db2..b6d0cc1 100644 --- a/src/Famix-CallGraphs/FamixAbstractCallGraphNode.class.st +++ b/src/Famix-CallGraphs/FamixAbstractCallGraphNode.class.st @@ -122,7 +122,7 @@ FamixAbstractCallGraphNode >> inspectGraph: aBuilder [ "We want to color nodes with additional properties if this feature is available" (node respondsTo: #additionalProperties) ifTrue: [ node additionalProperties ifNotNil: [ box color: (node = self ifTrue: [ #purple ] ifFalse: [ #green ]) ] ]. - box @ (RSLabeled new text: [ :n | n realMethod printString ]) ]. + box @ (RSLabeled new text: [ :n | n realMethod printString ]) ] limit: (20 max: self callees size). canvas addAll: shapes. @@ -249,6 +249,24 @@ FamixAbstractCallGraphNode >> withAllCalleesCollect: aBlock [ ^ self withDeep: #callees collect: aBlock ] +{ #category : 'API' } +FamixAbstractCallGraphNode >> withAllCalleesCollect: aBlock limit: aNumber [ + + | result nbCollected queue | + nbCollected := 0. + result := OrderedCollection new. + queue := OrderedCollection with: self. + + [ queue isNotEmpty and: [ nbCollected <= aNumber ] ] whileTrue: [ + | node | + nbCollected := nbCollected + 1. + node := queue removeFirst. + queue addAll: node callees. + result add: (aBlock value: node) ]. + + ^ result +] + { #category : 'API' } FamixAbstractCallGraphNode >> withAllCalleesDo: aBlock [ "Execute the block with myself and all the nodes I call transitively as argument for each iteration." diff --git a/src/Famix-CallGraphs/FamixCallGraph.class.st b/src/Famix-CallGraphs/FamixCallGraph.class.st index 23ff64f..aa9d1e9 100644 --- a/src/Famix-CallGraphs/FamixCallGraph.class.st +++ b/src/Famix-CallGraphs/FamixCallGraph.class.st @@ -40,7 +40,7 @@ FamixCallGraph >> entryPoints: aCollection [ entryPoints := aCollection collect: [ :method | method isMooseObject ifTrue: [ method asCallGraphNode ] - ifFalse: [ method ] ] + ifFalse: [ method ] ] as: Array "We want to be sure we do not have a MooseGroup" ] { #category : 'accessing' }