-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjmf-rules.txt
More file actions
222 lines (201 loc) · 15.7 KB
/
jmf-rules.txt
File metadata and controls
222 lines (201 loc) · 15.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# jacoco-method-filter — Rules Template (Scala / sbt)
# [jmf:2.1.0]
#
# Syntax reference, pitfalls, examples, and workflows: https://github.com/MoranaApps/jacoco-method-filter/blob/main/docs/rules-reference.md
#
# ─────────────────────────────────────────────────────────────────────────────
# HOW TO USE
# ─────────────────────────────────────────────────────────────────────────────
#
# 1) Review the GLOBAL RULES below — they cover compiler-generated boilerplate.
# 2) Add project-specific patterns in the PROJECT RULES section.
# 3) Keep rules narrow; add id: labels so logs are readable.
# Every rule must have an id:<label>. Unlabelled rules emit a [warn] at load
# time. CLI users: pass --strict to enforce id: as a hard CI requirement.
# (sbt/Maven plugins do not yet expose --strict as a configuration key.)
# 4) Use --verify mode to confirm rules match before committing.
#
# ─────────────────────────────────────────────────────────────────────────────
# GLOBAL RULES
# ─────────────────────────────────────────────────────────────────────────────
# Global rules match ALL packages. Verify they do not suppress real logic.
# See docs/rules-reference.md#global-rule-safety-warning for details.
# Scala case class helpers
*#canEqual(*) id:case-canequal
*#equals(*) id:case-equals
*#apply(*) id:case-apply
*#unapply(*) id:case-unapply
*#hashCode(*) id:case-hashcode
*#copy(*) id:case-copy
# Subsumed by gen-defaults below; kept for clarity. Safe to remove if gen-defaults is enabled.
*#copy$default$*(*) id:case-copy-defaults
*#productElement() id:case-prod-element
*#productArity() id:case-prod-arity
*#productPrefix() id:case-prod-prefix
*#productIterator() id:case-prod-iterator
*#tupled() id:case-tupled
*#curried() id:case-curried
*#toString() id:case-tostring
# Scala 2.13+ case class boilerplate — safe to enable; no-op in 2.11/2.12
# Note: unmatched
#*#productElementName(*) id:case-prod-element-name
#*#productElementNames() id:case-prod-element-names
# WARNING: may collide with domain methods named `name` — rescue with + include rule if needed
# Note: unmatched
#*#name() id:case-name
# WARNING: may collide with domain methods named `groups` — rescue with + include rule if needed
# Note: unmatched
#*#groups() id:case-groups
# WARNING: may collide with domain methods named `optionalAttributes` — rescue with + include rule if needed
# Note: unmatched
#*#optionalAttributes() id:case-optionalAttributes
# Companion objects, constructors, and static definitions
*$#<init>(*) id:gen-ctor
*$#<clinit>() id:gen-clinit
# Companion objects and defaults
*$*#apply(*) id:comp-apply
*$*#unapply(*) id:comp-unapply
*$*#toString(*) id:comp-tostring
*$*#readResolve(*) id:comp-readresolve
# Java serialization hook — compiler-generated on the case class itself (not the companion)
# Body is a single expression returning a serialization proxy; no project logic.
# WARNING: if a class overrides writeReplace with custom logic, rescue with + include rule.
# Note: unmatched
#*#writeReplace(*) id:case-writereplace
# anonymous class created by a macro expansion
# Note: unmatched
#*$macro$*#$anonfun$inst$macro$* id:macro-inst
#*$macro$*#inst$macro$* id:macro-inst
# lambda
*#* synthetic name-contains:$anonfun$ id:scala-anonfun
# Lazy val compute — compiler-generated synchronization wrapper
# Scala compiles `lazy val foo = expr` into an accessor + a `foo$lzycompute()` method.
# The $lzycompute method body IS the lazy initializer (expr). If the initializer contains
# real business logic, filtering this method hides it. Only enable when the lazy val is a
# trivial constant, a boundary call not unit-testable, or an already-tested computation.
# Rescue any lazy vals with real logic via + include rules.
# DISABLED — enable with + include rules to rescue lazy vals whose initializer has real logic
# *#*$lzycompute(*) id:scala-lzycompute
# Lambda serialization helper — compiler-generated private static method
# Emitted by scalac/javac to support SerializedLambda deserialization.
# NOT marked ACC_SYNTHETIC (unlike $anonfun$*), so the synthetic flag does not catch it.
# Body contains only a series of instanceof/handle comparisons — no project logic.
*#$deserializeLambda$(*) id:scala-deser-lambda
# Value class companion extension bridges — compiler-generated identity operations
# When a value class (AnyVal) is used in a boxed context, the Scala compiler emits
# these *$extension methods on the companion object. Each is a single-expression
# delegate to the unboxed static method; no project logic is present.
*#hashCode$extension(*) id:valclass-hashcode-ext
*#equals$extension(*) id:valclass-equals-ext
*#toString$extension(*) id:valclass-tostring-ext
*#canEqual$extension(*) id:valclass-canequal-ext
*#productIterator$extension(*) id:valclass-proditer-ext
*#productElement$extension(*) id:valclass-prodelem-ext
*#productArity$extension(*) id:valclass-prodarity-ext
*#productPrefix$extension(*) id:valclass-prodprefix-ext
*#copy$extension(*) id:valclass-copy-ext
*#copy$default$*$extension(*) id:valclass-copydef-ext
# Function1 trait mixin delegates — single-call forwarders to scala.Function1
# These arise when a class mixes in Function1. Each is a one-liner forwarding to
# the trait default. Rarely contain project logic.
# CAUTION: if your code defines andThen/compose with custom logic in a non-Function1
# class, rescue those methods with + include rules.
*#andThen(*) id:fn1-andthen
*#compose(*) id:fn1-compose
# Default parameter accessors — compiler-generated constant-returning methods
# The Scala compiler emits a $default$N method for every parameter with a default
# value. Each method body returns the constant default expression; no logic.
# This rule supersedes `case-copy-defaults` above; both are safe to keep active.
*#*$default$*(*) id:gen-defaults
# ─────────────────────────────────────────────────────────────────────────────
# INCLUDE RULES (rescue methods from broad exclusions above)
# ─────────────────────────────────────────────────────────────────────────────
# Prefix a rule with "+" to rescue a method. Include always wins over exclude.
#
# RESCUE: Domain factory/accessor methods that collide with broad *#apply(*) rule
# These are real domain methods with business logic, not case-class helpers.
+*Params#apply(*) id:keep-params-apply
+*QueryResultRow#apply(*) id:keep-queryresult-accessors
+*QueryResultRow$#apply(*) id:keep-queryresult-factory
+*DBConnection$#apply(Lscala/Function0;)* id:keep-dbconn-apply
+*DBFunction$#apply(*) id:keep-dbfunction-apply
+*MapBasedNaming$#apply(*) id:keep-naming-transform
# ─────────────────────────────────────────────────────────────────────────────
# PROJECT RULES
# ─────────────────────────────────────────────────────────────────────────────
*DBFunction#perform(*) id:balta-func-perform
*DBFunction#getResult(*) id:balta-func-getresult
*DBFunction#execute(Ljava/lang/String;*)* id:balta-func-execute-orderby
*DBConnection$#apply(Ljava/lang/String;*) id:balta-dbconn-apply-str
*DBConnection#connection(*) id:balta-dbconn-val
*DBConnection#<init>(*) id:balta-dbconn-init
*DBConnection#dbConnectionToJdbcConnection(*) id:balta-dbconn-impl-fwd
*QueryResult#mk*(*) id:balta-qr-iter-mk
*QueryResult#addString(*) id:balta-qr-iter-addstr
*QueryResult#copy*(*) id:balta-qr-iter-copy
*QueryResult#reduce*(*) id:balta-qr-iter-reduce
*QueryResult#fold*(*) id:balta-qr-iter-fold
*QueryResult#scan*(*) id:balta-qr-iter-scan
*QueryResult#zip*(*) id:balta-qr-iter-zip
*QueryResult#take*(*) id:balta-qr-iter-take
*QueryResult#drop*(*) id:balta-qr-iter-drop
*QueryResult#filter*(*) id:balta-qr-iter-filter
*QueryResult#collect*(*) id:balta-qr-iter-collect
*QueryResult#slice*(*) id:balta-qr-iter-slice
*QueryResult#index*(*) id:balta-qr-iter-index
*QueryResult#min*(*) id:balta-qr-iter-min
*QueryResult#max*(*) id:balta-qr-iter-max
*QueryResult#pad*(*) id:balta-qr-iter-pad
*QueryResult#for*(*) id:balta-qr-iter-for
*QueryResult#is*(*) id:balta-qr-iter-is
*QueryResult#size*(*) id:balta-qr-iter-size
*QueryResult#non*(*) id:balta-qr-iter-non
*QueryResult#map(*) id:balta-qr-iter-map
*QueryResult#flatMap(*) id:balta-qr-iter-flatmap
*QueryResult#find(*) id:balta-qr-iter-find
*QueryResult#contains(*) id:balta-qr-iter-contains
*QueryResult#count(*) id:balta-qr-iter-count
*QueryResult#corresponds(*) id:balta-qr-iter-corr
*QueryResult#withFilter(*) id:balta-qr-iter-withfilter
*QueryResult#partition(*) id:balta-qr-iter-partition
*QueryResult#span(*) id:balta-qr-iter-span
*QueryResult#patch(*) id:balta-qr-iter-patch
*QueryResult#buffered(*) id:balta-qr-iter-buffered
*QueryResult#grouped(*) id:balta-qr-iter-grouped
*QueryResult#duplicate(*) id:balta-qr-iter-duplicate
*QueryResult#sameElements(*) id:balta-qr-iter-same
*QueryResult#$plus$plus(*) id:balta-qr-iter-plusplus
*QueryResult#$div$colon(*) id:balta-qr-iter-divcolon
*QueryResult#$colon$bslash(*) id:balta-qr-iter-colonbslash
*QueryResult#aggregate(*) id:balta-qr-iter-aggregate
*QueryResult#sum(*) id:balta-qr-iter-sum
*QueryResult#product(*) id:balta-qr-iter-product
*QueryResult#exists(*) id:balta-qr-iter-exists
*QueryResult#length(*) id:balta-qr-iter-length
*QueryResult#reversed(*) id:balta-qr-iter-reversed
*QueryResult#hasDefiniteSize(*) id:balta-qr-iter-defsize
*QueryResult#toArray(*) id:balta-qr-iter-toarray
*QueryResult#toMap(*) id:balta-qr-iter-tomap
*QueryResult#toTraversable(*) id:balta-qr-iter-totraversable
*QueryResult#toIterator(*) id:balta-qr-iter-toiterator
*QueryResult#toStream(*) id:balta-qr-iter-tostream
*QueryResult#toIterable(*) id:balta-qr-iter-toiterable
*QueryResult#toSeq(*) id:balta-qr-iter-toseq
*QueryResult#toIndexedSeq(*) id:balta-qr-iter-toindexedseq
*QueryResult#toBuffer(*) id:balta-qr-iter-tobuffer
*QueryResult#toSet(*) id:balta-qr-iter-toset
*QueryResult#toVector(*) id:balta-qr-iter-tovector
*QueryResult#sliding(*) id:balta-qr-iter-sliding
*QueryResultRowImplicits$ProductTypeConvertor#row(*) id:balta-valclass-ptc-row
*QueryResultRowImplicits$ProductTypeConvertor#toProductType(*) id:balta-valclass-ptc-tpt
*QueryResultRow#getChar(Ljava/lang/String;)* id:balta-colname-get-char
*QueryResultRow#getObject(Ljava/lang/String;)* id:balta-colname-get-object
*QueryResultRow#getAs(Ljava/lang/String;Lscala/Function1;)* id:balta-colname-getas-transformer
*QueryResultRowImplicits$ProductTypeConvertor#<init>(*) id:balta-qrri-ctor
*QueryResultRowImplicits$ProductTypeConvertor#getConstructor(*) id:balta-valclass-ptc-gc
*QueryResultRowImplicits$ProductTypeConvertor#getConstructorMirror(*) id:balta-valclass-ptc-gcm
*QueryResultRowImplicits$ProductTypeConvertor#readParamsFromRow(*) id:balta-valclass-ptc-rpr
*QueryResultRowImplicits$ProductTypeConvertor#getParamValue(*) id:balta-valclass-ptc-gpv
*DBTable#fieldValue(*) id:balta-dbtable-fieldvalue
*DBTable#count(Lza/co/absa/db/balta/classes/inner/Params$NamedParams;Ljava/sql/Connection;)* id:balta-dbtable-count-named
*DBTable#count(Ljava/lang/String;Ljava/sql/Connection;)* id:balta-dbtable-count-str