Clover coverage report - PMD - 3.9 Coverage timestamp: Tue Dec 19 2006 09:38:44 EST FRAMES NO FRAMES |
file stats: | LOC: | 31 |  | Methods: | 4
| NCLOC: | 22 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
ExternalRuleID.java | 50% | 75% | 75% | 71.4% |

1 |  | /**
2 |  | * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3 |  | */
4 |  | package net.sourceforge.pmd;
5 |  |
6 |  | public class ExternalRuleID {
7 |  |
8 |  | private String filename;
9 |  | private String ruleName;
10 |  |
11 | 16 | public ExternalRuleID(String id) {
12 | 16 | int afterXML = id.indexOf(".xml") + 5;
13 | 16 | if (afterXML >= id.length()) {
14 | 0 | throw new RuntimeException("Unable to parse reference to external rule " + id + ". These references need to be in the form <rulesetname>/<rulename>, i.e., <rule ref=\"rulesets/unusedcode.xml/UnusedPrivateField\"/>");
15 |  | }
16 | 16 | filename = id.substring(0, afterXML - 1);
17 | 16 | ruleName = id.substring(afterXML);
18 |  | }
19 |  |
20 | 16 | public String getFilename() {
21 | 16 | return filename;
22 |  | }
23 |  |
24 | 17 | public String getRuleName() {
25 | 17 | return ruleName;
26 |  | }
27 |  |
28 | 0 | public String toString() {
29 | 0 | return filename + "/" + ruleName;
30 |  | }
31 |  | }