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

moosetechnology / MooseIDE / 19894430498

03 Dec 2025 12:50PM UTC coverage: 64.992% (-0.3%) from 65.255%
19894430498

push

github

web-flow
Merge pull request #1548 from moosetechnology/bulk-edit-duplicated-constantes

Bulk edit duplicated constantes

0 of 374 new or added lines in 8 files covered. (0.0%)

21424 of 32964 relevant lines covered (64.99%)

1.3 hits per line

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

0.0
/src/MooseIDE-BulkEditor/MiBulkEndLineCommentRewriter.class.st
1
"
2
a BulkRewriter that adds a comment on the lines of duplicated Java String constantes (`public static final String`)
3

4
The duplicated constantes can be found with this script:
5
```
6
attributes := your_model allAttributes reject: #isStub.
7
statics := attributes select: [ :a |
8
        a isFinal and: 
9
        [ a isClassSide and: 
10
        [ a declaredType ifNil: [ false ] ifNotNil: [ :typ | typ name = 'String'] ] ] ].
11
constantes := statics select: [ :a | [a getFAST expression isLiteral] on: Error do: [ false ] ].
12
(constantes groupedBy: [ :a | a getFAST expression primitiveValue asLowercase ])
13
        associations select: [ :a | (a value size >= 2) and: [ a key size > 2 ] ]```
14
"
15
Class {
16
        #name : 'MiBulkEndLineCommentRewriter',
17
        #superclass : 'MiBulkAbstractRewriter',
18
        #category : 'MooseIDE-BulkEditor',
19
        #package : 'MooseIDE-BulkEditor'
20
}
21

22
{ #category : 'actions' }
NEW
23
MiBulkEndLineCommentRewriter >> afterEol: c at: i [
×
NEW
24
        "Nothing to do after EOL
×
NEW
25
        Typically, only one of #beforeEol:at: , #afterEol:at: should be defined"
×
NEW
26

×
NEW
27
]
×
28

29
{ #category : 'actions' }
NEW
30
MiBulkEndLineCommentRewriter >> intervalEnd: c [
×
NEW
31
        "override because #nextLineDo: is different
×
NEW
32
         see comment in super-class"
×
NEW
33

×
NEW
34
        self insideInterval: c.
×
NEW
35
        self nextLineDo: [
×
NEW
36
                stream
×
NEW
37
                        << ' // same constant as: '.
×
NEW
38
                interval data value do: [ :entity | stream << entity mooseName ] separatedBy: [ stream << ', ' ].
×
NEW
39
                self getNextInterval
×
NEW
40
        ]
×
NEW
41

×
NEW
42

×
NEW
43
]
×
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