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

moosetechnology / MooseIDE / 21818695493

09 Feb 2026 09:02AM UTC coverage: 65.926% (+0.1%) from 65.829%
21818695493

push

github

web-flow
Merge pull request #1588 from moosetechnology/dead-code-heuristic-groups

Dead code heuristic groups

508 of 568 new or added lines in 21 files covered. (89.44%)

21882 of 33192 relevant lines covered (65.93%)

1.32 hits per line

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

85.29
/src/MooseIDE-DeadCode/MiDeadJavaOverridesInvokedRule.class.st
1
"
2
A heuristic to recognize methods overriding another method that is called.
3

4
If a method in a super-class (or interface) is called, we assume any method implementing it in a concrete class can be called
5
"
6
Class {
7
        #name : 'MiDeadJavaOverridesInvokedRule',
8
        #superclass : 'MiDeadAbstractJavaRule',
9
        #category : 'MooseIDE-DeadCode-Rules',
10
        #package : 'MooseIDE-DeadCode',
11
        #tag : 'Rules'
12
}
13

14
{ #category : 'testing' }
15
MiDeadJavaOverridesInvokedRule >> any: tWithMethods hasInvokedMethod: aTMethod [
2✔
16

2✔
17
        tWithMethods do: [ :aTWithMethods |
2✔
18
                aTWithMethods methods
2✔
19
                        detect: [ :mth | (mth signature = aTMethod signature) and: [ mth incomingInvocations isNotEmpty ]]
2✔
20
                        ifOne: [ :mth | ^true ]
2✔
21
        ].
2✔
22

2✔
23
        ^false
2✔
24
]
2✔
25

26
{ #category : 'accessing' }
NEW
27
MiDeadJavaOverridesInvokedRule >> description [
×
28

×
29
        ^super description ,
×
30
        'All methods overriding an invoked method are assumed not-dead'
×
31
]
×
32

33
{ #category : 'accessing' }
34
MiDeadJavaOverridesInvokedRule >> name [
2✔
35

2✔
36
        ^super name , 'Overriden invoked method'
2✔
37
]
2✔
38

39
{ #category : 'testing' }
40
MiDeadJavaOverridesInvokedRule >> notDead: aTMethod [
2✔
41

2✔
42

2✔
43
        | superclasses implementedInterfaces |
2✔
44

2✔
45
        superclasses := { aTMethod parentType } , (aTMethod parentType superclassHierarchy).
2✔
46
        (self any: superclasses hasInvokedMethod: aTMethod)
2✔
47
                ifTrue: [ ^true ].
2✔
48

2✔
49
        implementedInterfaces := superclasses flatCollectAsSet: [ :c | self implementedInterfaceHierarchy: c ].
2✔
50
        (self any: implementedInterfaces hasInvokedMethod: aTMethod)
2✔
51
                ifTrue: [ ^true ].
2✔
52

2✔
53
        ^ false
2✔
54
]
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc