Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #1191 #1200

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
8 changes: 8 additions & 0 deletions src/MooseIDE-Dependency/FamixTClass.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Extension { #name : #FamixTClass }

{ #category : #'*MooseIDE-Dependency' }
FamixTClass >> addDeclaredTypesIn: dependencies [

self children do: [ :c | c addDeclaredTypesIn: dependencies ].

]
8 changes: 8 additions & 0 deletions src/MooseIDE-Dependency/FamixTMethod.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Extension { #name : #FamixTMethod }

{ #category : #'*MooseIDE-Dependency' }
FamixTMethod >> addDeclaredTypesIn: dependencies [

self children do: [ :c | c addDeclaredTypesIn: dependencies ].
self declaredType ifNotNil: [ dependencies add: self declaredType ]
]
7 changes: 7 additions & 0 deletions src/MooseIDE-Dependency/FamixTPackage.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #FamixTPackage }

{ #category : #'*MooseIDE-Dependency' }
FamixTPackage >> addDeclaredTypesIn: dependencies [

self children do: [ :c | c addDeclaredTypesIn: dependencies ].
]
7 changes: 7 additions & 0 deletions src/MooseIDE-Dependency/FamixTTypedEntity.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #FamixTTypedEntity }

{ #category : #'*MooseIDE-Dependency' }
FamixTTypedEntity >> addDeclaredTypesIn: dependencies [

self declaredType ifNotNil: [dependencies add: self declaredType. "1haltIf: [ dependencies anySatisfy: [:e | e isLocalVariable] ]".]
]
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,23 @@ MiDependencyStructuralMatrixBrowserModel >> getTupleDependencyWeight: tuple [
^(tuple key = tuple value)
ifTrue: [ ^0 ]
ifFalse: [
tuple key model queryAllOutgoing count: [ :dependency || opposites |
opposites := dependency target.
opposites isCollection
ifTrue: [ opposites anySatisfy: [ :each | (each atScope: tuple value model class) includes: tuple value model] ]
ifFalse: [(opposites atScope: tuple value model class) includes: tuple value model ]
tuple key model queryAllOutgoingForDSM count: [ :dependency || opposites |
dependency isAssociation ifTrue: [
"Association so need to get the target because DSM is done between entities"
opposites := dependency target.
opposites isCollection
ifTrue: [ opposites anySatisfy: [ :each | (each atScope: tuple value model class) includes: tuple value model] ]
"The ifNotNil is to avoid the null dependency problem coming from the model due to generic types"
ifFalse: [ opposites
ifNotNil: [ (opposites atScope: tuple value model class) includes: tuple value model ]
ifNil: [false]]
]
ifFalse: [
"Case of declaredType"
dependency isStub ifTrue: [ false ] ifFalse: [ (dependency atScope: tuple value model class) includes: tuple value model ]
]
]

]
]

Expand Down
15 changes: 15 additions & 0 deletions src/MooseIDE-Dependency/TEntityMetaLevelDependency.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ TEntityMetaLevelDependency >> miTreeExtension [
beResizable
]

{ #category : #'*MooseIDE-Dependency' }
TEntityMetaLevelDependency >> queryAllOutgoingForDSM [
"Query all the outgoing associations of the receiver and its children.

Example:
aFAMIXClass queryAllOutgoing.
--> Will return a MooseOutgoingQueryResult containing the FAMIXAssociation having aFAMIXClass or its children as source
"

| dependencies |
dependencies := self queryAllOutgoing.
self addDeclaredTypesIn: dependencies.
^ dependencies
]

{ #category : #'*MooseIDE-Dependency' }
TEntityMetaLevelDependency >> rootsForTreeMap [

Expand Down