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

moosetechnology / MooseIDE / 19065958778

04 Nov 2025 10:41AM UTC coverage: 65.79% (+0.08%) from 65.711%
19065958778

push

github

web-flow
Merge pull request #1504 from moosetechnology/dead-code

Refactoring DeadCode tests

159 of 159 new or added lines in 3 files covered. (100.0%)

5 existing lines in 1 file now uncovered.

21112 of 32090 relevant lines covered (65.79%)

1.32 hits per line

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

70.41
/src/MooseIDE-DeadCode/MiDeadCodeBrowser.class.st
1
"
2
Computes dead methods/functions from an initial list of methods/functions
3
There are several heurisitcs to find out what are dead entities
4
The user must:
5
- first select some heuristics to apply
6
- then do a ""first run"" (apply the chosen heurisitcs to the list of entities
7
- this gives a firs tlist of dead entities
8
- this list can be expanded by running a ""recursion"": any entity only called by a dead entity is also dead
9

10
Accepted entities: A list of methods/functions (behavioural entities)
11
"
12
Class {
13
        #name : 'MiDeadCodeBrowser',
14
        #superclass : 'MiAbstractBrowser',
15
        #instVars : [
16
                'lstMethod',
17
                'lblAllMethods',
18
                'resultColumn',
19
                'heuristicColumn'
20
        ],
21
        #category : 'MooseIDE-DeadCode',
22
        #package : 'MooseIDE-DeadCode'
23
}
24

25
{ #category : 'world menu' }
26
MiDeadCodeBrowser class >> menuCommandOn: aBuilder [
×
27

×
28
        <worldMenu>
×
29
        ^ self buildMenuItemIn: aBuilder
×
30
]
×
31

32
{ #category : 'world menu' }
33
MiDeadCodeBrowser class >> menuItem [
×
34

×
35
        ^#mooseCancel
×
36
]
×
37

38
{ #category : 'world menu' }
39
MiDeadCodeBrowser class >> menuPriority [
×
40

×
41
        ^ self menuMetaToolsPriority + 1
×
42
]
×
43

44
{ #category : 'world menu' }
45
MiDeadCodeBrowser class >> newModel [
2✔
46

2✔
47
        ^ MiDeadCodeBrowserModel new
2✔
48
]
2✔
49

50
{ #category : 'world menu' }
51
MiDeadCodeBrowser class >> open [
×
52
        <script>
×
53
        ^ super open
×
54
]
×
55

56
{ #category : 'world menu' }
57
MiDeadCodeBrowser class >> preferredExtent [
2✔
58

2✔
59
        ^ 900 @ 700
2✔
60
]
2✔
61

62
{ #category : 'world menu' }
63
MiDeadCodeBrowser class >> title [
2✔
64
        ^'Dead code browser'
2✔
65
]
2✔
66

67
{ #category : 'testing' }
68
MiDeadCodeBrowser >> canFollowEntity: anObject [
2✔
69

2✔
70
        ^anObject isCollection and:
2✔
71
        [ anObject anySatisfy: [ :entity | entity usesFamixTrait: FamixTWithInvocations ] ]
2✔
72
]
2✔
73

74
{ #category : 'layout' }
75
MiDeadCodeBrowser >> candidateEntiesColumnLayout [
2✔
76

2✔
77
        ^SpBoxLayout newTopToBottom
2✔
78
                add: lblAllMethods expand: false;
2✔
79
                add: lstMethod ;
2✔
80
                yourself
2✔
81
]
2✔
82

83
{ #category : 'accessing' }
84
MiDeadCodeBrowser >> candidateEntities: aCollection [
2✔
85

2✔
86
        lstMethod items: aCollection.
2✔
87
        lblAllMethods label: aCollection size asString , ' entities'
2✔
88
]
2✔
89

90
{ #category : 'heuristic column' }
91
MiDeadCodeBrowser >> chosenHeuristics [
×
92

×
93
        ^specModel chosenHeuristics
×
94
]
×
95

96
{ #category : 'layout' }
97
MiDeadCodeBrowser >> defaultLayout [
2✔
98

2✔
99
        ^SpPanedLayout newLeftToRight 
2✔
100
                add: self candidateEntiesColumnLayout;
2✔
101
                add: (SpPanedLayout newLeftToRight 
2✔
102
                        add: heuristicColumn ;
2✔
103
                        add: resultColumn ;
2✔
104
                        yourself) ;
2✔
105
                positionOfSlider: 0.3 ;
2✔
106
                yourself
2✔
107
]
2✔
108

109
{ #category : 'actions' }
110
MiDeadCodeBrowser >> followEntity: anEntity [
2✔
111

2✔
112
        super followEntity: anEntity anyOne mooseModel.
2✔
113
        specModel followEntity: anEntity
2✔
114
]
2✔
115

116
{ #category : 'accessing' }
UNCOV
117
MiDeadCodeBrowser >> heuristicColumn [
×
UNCOV
118

×
UNCOV
119
        ^heuristicColumn 
×
UNCOV
120
]
×
121

122
{ #category : 'initialization' }
123
MiDeadCodeBrowser >> initializePresenters [
2✔
124

2✔
125
        lstMethod := self newList
2✔
126
                display: #name ;
2✔
127
                sortingBlock: #name ascending.
2✔
128

2✔
129
        lblAllMethods := self newLabel
2✔
130
                label: '0 entities'.
2✔
131

2✔
132
        heuristicColumn := self instantiate: MiDeadCodeBrowserHeuristicColum.
2✔
133
        resultColumn := self instantiate: MiDeadCodeBrowserResultColum.
2✔
134
]
2✔
135

136
{ #category : 'accessing' }
137
MiDeadCodeBrowser >> miSelectedItem [
2✔
138

2✔
139
        ^specModel miSelectedItem 
2✔
140
]
2✔
141

142
{ #category : 'TOREMOVE' }
UNCOV
143
MiDeadCodeBrowser >> toolbarHeight [
×
144

×
145
        ^self class toolbarHeight
×
146
]
×
147

148
{ #category : 'actions' }
149
MiDeadCodeBrowser >> updateChosenHeuristics [
2✔
150

2✔
151
        heuristicColumn chosenHeuristics: specModel chosenHeuristics.
2✔
152
        resultColumn updateChosenHeuristics
2✔
153
]
2✔
154

155
{ #category : 'actions' }
156
MiDeadCodeBrowser >> updateDeadEntities [
2✔
157

2✔
158
        resultColumn update
2✔
159
]
2✔
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