• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / MooseIDE / 18190945728

02 Oct 2025 10:55AM UTC coverage: 66.766% (-0.04%) from 66.804%
18190945728

push

github

web-flow
Merge pull request #1447 from moosetechnology/scoping

Use new scoping API

1 of 5 new or added lines in 2 files covered. (20.0%)

15 existing lines in 2 files now uncovered.

20582 of 30827 relevant lines covered (66.77%)

1.34 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/MooseIDE-LayerVisualization/MiLayerVisualizationModel.class.st
1
Class {
2
        #name : 'MiLayerVisualizationModel',
3
        #superclass : 'MiAbstractModel',
4
        #instVars : [
5
                'mooseModel',
6
                'queriesHolder',
7
                'description',
8
                'index',
9
                'continueClient',
10
                'continueServer',
11
                'clientLayers',
12
                'purgatoryLayer',
13
                'serverLayers',
14
                'sharedLayer',
15
                'incomingCache',
16
                'outgoingCache',
17
                'serverClasses',
18
                'displayStrategy'
19
        ],
20
        #category : 'MooseIDE-LayerVisualization-Model',
21
        #package : 'MooseIDE-LayerVisualization',
22
        #tag : 'Model'
23
}
24

25
{ #category : 'as yet unclassified' }
26
MiLayerVisualizationModel class >> findModelApplicableTo: aMooseModel [
×
27

×
28
        self subclassesDo: [ :modelClass | 
×
29
                (modelClass queriesHolder canBeAppliedOnModel: aMooseModel) ifTrue: [ 
×
30
                        ^ modelClass ] ].
×
31
        ^ nil
×
32
]
×
33

34
{ #category : 'as yet unclassified' }
35
MiLayerVisualizationModel class >> queriesHolder [
36

37
        self subclassResponsibility
38
]
39

40
{ #category : 'adding' }
41
MiLayerVisualizationModel >> addCacheServerDependencies [
×
42

×
43
        ^ (serverLayers at: index) flatCollectAsSet: [ :class | 
×
44
                  (self classDependenciesFor: class) select: [ :dc | 
×
45
                          | exits |
×
46
                          exits := incomingCache includesKey: dc.
×
47
                          self addDependency: dc in: outgoingCache for: class.
×
48
                          self addDependency: class in: incomingCache for: dc.
×
49
                          (self checkIsImplementationOrService: dc) not and: [ exits not ] ] ]
×
50
]
×
51

52
{ #category : 'partitioning' }
53
MiLayerVisualizationModel >> addDependency: valueEntity in: aDictionary for: keyEntity [
×
54

×
55
        aDictionary
×
56
                at: keyEntity
×
57
                ifPresent: [ :collection | collection add: valueEntity ]
×
58
                ifAbsentPut: [ OrderedCollection with: valueEntity ]
×
59
]
×
60

61
{ #category : 'testing' }
62
MiLayerVisualizationModel >> checkIsImplementation: aFamixJavaClass [
×
63

×
64
        ^ (self serverLayers at: 1) includes: aFamixJavaClass
×
65
]
×
66

67
{ #category : 'partitioning' }
68
MiLayerVisualizationModel >> checkIsImplementationOrService: aClass [
69
 self subclassResponsibility 
70
]
71

72
{ #category : 'partitioning' }
73
MiLayerVisualizationModel >> classDependantsFor: aClass [
×
74

×
75
        ^ ((aClass queryAllIncoming withoutSelfLoops reject: [ :a | 
×
76
                    (a target isCollection
×
77
                             ifTrue: [ a target first ]
×
78
                             ifFalse: [ a target ]) isStub ]) collect: [ :e | 
×
79
                   self rootClass: e source ]) asSet
×
80
]
×
81

82
{ #category : 'partitioning' }
83
MiLayerVisualizationModel >> classDependenciesFor: aClass [
×
84

×
85
        ^ (aClass allProviders
×
86
                  reject: [ :c | c isStub ]
×
87
                  thenCollect: [ :e | self rootClass: e ]) asSet
×
88
]
×
89

90
{ #category : 'accessing' }
91
MiLayerVisualizationModel >> clientLayers [
×
92

×
93
        ^ clientLayers
×
94
]
×
95

96
{ #category : 'accessing' }
97
MiLayerVisualizationModel >> commonPackagesFor: elements [
×
98

×
99
        | groups |
×
NEW
100
        groups := (elements groupedBy: [ :e | (e containersOfType: FamixTPackage) anyOne ]) associations.
×
101

×
NEW
102
        ^ groups collect: [ :a | self createPackageElement: a key with: a value ]
×
103
]
×
104

105
{ #category : 'building' }
106
MiLayerVisualizationModel >> createLinksIn: hNodeDict [
107

108
        self subclassResponsibility
109
]
110

111
{ #category : 'accessing' }
112
MiLayerVisualizationModel >> createPackageElement: famixPackage with: elements [
×
113

×
114
        ^ MiLVPackageElement new
×
115
                  model: famixPackage;
×
116
                  children: (self createTypeElementsFor: elements);
×
117
                  yourself
×
118
]
×
119

120
{ #category : 'accessing' }
121
MiLayerVisualizationModel >> createTypeElementsFor: aCollectionOfMooseEntities [
×
122

×
123
        ^ aCollectionOfMooseEntities collect: [ :me | 
×
124
                  MiLVTypeElement new
×
125
                          model: me;
×
126
                          yourself ]
×
127
]
×
128

129
{ #category : 'accessing' }
130
MiLayerVisualizationModel >> entities [
×
131

×
132
        ^ nil
×
133
]
×
134

135
{ #category : 'building' }
136
MiLayerVisualizationModel >> entitiesOf: aLayer [
×
137

×
138
        ^ aLayer size > 100
×
139
                  ifTrue: [ self commonPackagesFor: aLayer ]
×
140
                  ifFalse: [ self createTypeElementsFor: aLayer ]
×
141
]
×
142

143
{ #category : 'actions' }
144
MiLayerVisualizationModel >> followEntity: anEntity [
×
145

×
146
        self mooseModel: (anEntity isMooseModel
×
147
                              ifTrue: [ anEntity ]
×
148
                              ifFalse: [ anEntity mooseModel ]).
×
149
        
×
150
        browser runVisualization.
×
151
]
×
152

153
{ #category : 'accessing' }
154
MiLayerVisualizationModel >> incomingCache [
×
155

×
156
        ^ incomingCache
×
157
]
×
158

159
{ #category : 'initialization' }
160
MiLayerVisualizationModel >> initialize [
×
161

×
162
        super initialize.
×
163
        self initializeSettings.
×
164
        incomingCache := Dictionary new.
×
165
        outgoingCache := Dictionary new.
×
166
        sharedLayer := Set new.
×
167
        purgatoryLayer := Set new.
×
168
        serverLayers := OrderedCollection new.
×
169
        clientLayers := OrderedCollection new.
×
170
        queriesHolder := self class queriesHolder new.
×
171
]
×
172

173
{ #category : 'accessing' }
174
MiLayerVisualizationModel >> mooseModel [
×
175

×
176
        ^ mooseModel
×
177
]
×
178

179
{ #category : 'accessing' }
180
MiLayerVisualizationModel >> mooseModel: aMooseModel [
×
181

×
182
        mooseModel := aMooseModel.
×
183
        queriesHolder mooseModel: mooseModel
×
184
]
×
185

186
{ #category : 'accessing' }
187
MiLayerVisualizationModel >> outgoingCache [
×
188

×
189
        ^ outgoingCache
×
190
]
×
191

192
{ #category : 'accessing' }
193
MiLayerVisualizationModel >> purgatoryLayer [
×
194

×
195
        ^ purgatoryLayer
×
196
]
×
197

198
{ #category : 'building' }
199
MiLayerVisualizationModel >> rootClass: anEntity [
×
200

×
201
        | rootTypes |
×
NEW
202
        rootTypes := anEntity query containers withProperty: [ :c | c isType and: [ c typeContainer isPackage ] ].
×
203

×
NEW
204
        self flag: 'This should not be empty, if it happens. It means that there is a problem in the model'.
×
205
        rootTypes ifEmpty: [ ^ anEntity ].
×
206

×
207
        ^ rootTypes anyOne
×
208
]
×
209

210
{ #category : 'accessing' }
211
MiLayerVisualizationModel >> serverLayers [
×
212

×
213
        ^ serverLayers
×
214
]
×
215

216
{ #category : 'initialization' }
217
MiLayerVisualizationModel >> setServerClasses [ 
×
218

×
219
        serverClasses := Dictionary new.
×
220
        self serverLayers allButFirst doWithIndex: [ :l :i | l do: [:c | serverClasses at: c put: i + 1]  ] .
×
221
]
×
222

223
{ #category : 'accessing' }
224
MiLayerVisualizationModel >> sharedLayer [
×
225

×
226
        ^ sharedLayer
×
227
]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc