File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/command/SaveMessageSourceAsCommand.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/command/SaveMessageBodyAsCommand.java | |||
Method name: String getValidFilename(String, boolean)
|
Method name: String getValidFilename(String, boolean)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | if (subj == null) {↵ | 1 | if (subj == null) {↵ | |
2 | return "";↵ | 2 | return "";↵ | |
3 | }↵ | 3 | }↵ | |
4 | StringBuffer buf = new StringBuffer();↵ | 4 | StringBuffer buf = new StringBuffer();↵ | |
5 | for (int i = 0; i < subj.length(); i++) {↵ | 5 | for (int i = 0; i < subj.length(); i++) {↵ | |
6 | char c = subj.charAt(i);↵ | 6 | char c = subj.charAt(i);↵ | |
7 | if ((c == '\\') || (c == '/') || (c == ':') || (c == ',')↵ | 7 | if ((c == '\\') || (c == '/') || (c == ':') || (c == ',')↵ | |
8 | || (c == '\n') || (c == '\t') || (c == '[') || (c == ']')) {↵ | 8 | || (c == '\n') || (c == '\t') || (c == '(') || (c == ')') || (c == '[') || (c == ']')) {↵ | |
9 | // dismiss char↵ | 9 | // dismiss char↵ | |
10 | } else if ((c == ' ') && (replSpaces)) {↵ | 10 | } else if ((c == ' ') && (replSpaces)) {↵ | |
11 | buf.append('_');↵ | 11 | buf.append('_');↵ | |
12 | } else {↵ | 12 | } else {↵ | |
13 | buf.append(c);↵ | 13 | buf.append(c);↵ | |
14 | }↵ | 14 | }↵ | |
15 | }↵ | 15 | }↵ | |
16 | return buf.toString(); | 16 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 24 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (subj == null) | 1 | if (subj == null) | |||||||||||||
2 | return ""; | 2 | return ""; | |||||||||||||
3 | StringBuffer buf = new StringBuffer(); | 3 | StringBuffer buf = new StringBuffer(); | |||||||||||||
4 | for (int i = 0; i < subj.length(); i++) | 4 | for (int i = 0; i < subj.length(); i++) | |||||||||||||
5 | char c = subj.charAt(i); | 5 | char c = subj.charAt(i); | |||||||||||||
6 | if ((c == '\\') || (c == '/') || (c == ':') || (c == ',') || (c == '\n') || (c == '\t') || (c == '[') || (c == ']')) |
| 6 | if ((c == '\\') || (c == '/') || (c == ':') || (c == ',') || (c == '\n') || (c == '\t') || (c == '(') || (c == ')') || (c == '[') || (c == ']')) | ||||||||||||
7 | else if ((c == ' ') && (replSpaces)) | 7 | else if ((c == ' ') && (replSpaces)) | |||||||||||||
8 | buf.append('_'); | 8 | buf.append('_'); | |||||||||||||
else | else | |||||||||||||||
9 | buf.append(c); | 9 | buf.append(c); | |||||||||||||
10 | return buf.toString(); | 10 | return buf.toString(); |
Row | Violation |
---|---|
1 | Expression (c == '\\') || (c == '/') || (c == ':')|| (c == ',')|| (c == '\n')|| (c == '\t')|| (c == '[')|| (c == ']') cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression (c == '\\') || (c == '/') || (c == ':')|| (c == ',')|| (c == '\n')|| (c == '\t')|| (c == '(')|| (c == ')')|| (c == '[')|| (c == ']') cannot be parameterized, because it has dependencies to/from statements that will be extracted |