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

pmd / pmd / 353

16 Jan 2026 01:01PM UTC coverage: 78.957% (-0.02%) from 78.976%
353

push

github

adangel
[core] Fix #6184: More consistent enum properties (#6233)

18529 of 24342 branches covered (76.12%)

Branch coverage included in aggregate %.

146 of 164 new or added lines in 20 files covered. (89.02%)

6 existing lines in 5 files now uncovered.

40349 of 50228 relevant lines covered (80.33%)

0.81 hits per line

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

0.0
/pmd-core/src/main/java/net/sourceforge/pmd/lang/metrics/MetricOption.java
1
/*
2
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3
 */
4

5
package net.sourceforge.pmd.lang.metrics;
6

7
import net.sourceforge.pmd.util.StringUtil;
8

9
/**
10
 * Option to pass to a metric. Options modify the behaviour of a metric.
11
 * You must bundle them into a {@link MetricOptions} to pass them all to a metric.
12
 *
13
 * <p>Options must be suitable for use in sets (implement equals/hashcode,
14
 * or be singletons).
15
 *
16
 * @author Clément Fournier
17
 * @since 6.0.0
18
 */
19
public interface MetricOption {
20

21
    /**
22
     * Returns the name of the option constant.
23
     *
24
     * @return The name of the option constant.
25
     */
26
    String name();
27

28
    /**
29
     * Returns the name of the option as it should be used in properties.
30
     *
31
     * @return The name of the option.
32
     * @deprecated Since 7.21.0. When metrics are used for (rule) properties, then the conventional
33
     * enum mapping (from SCREAMING_SNAKE_CASE to camelCase) will be used for the enum values.
34
     * See {@link net.sourceforge.pmd.properties.PropertyFactory#conventionalEnumListProperty(String, Class)}.
35
     */
36
    @Deprecated
37
    default String valueName() {
NEW
38
        return StringUtil.CaseConvention.SCREAMING_SNAKE_CASE.convertTo(StringUtil.CaseConvention.CAMEL_CASE, name());
×
39
    }
40
}
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