Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/Famix-CallGraphs/FamixAbstractCallGraphNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion src/Famix-CallGraphs/FamixCallGraph.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand Down
Loading