| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
package com.puppycrawl.tools.checkstyle.checks.javadoc; |
| 20 |
|
|
| 21 |
|
import java.io.File; |
| 22 |
|
import java.util.Iterator; |
| 23 |
|
import java.util.Set; |
| 24 |
|
import java.util.HashSet; |
| 25 |
|
|
| 26 |
|
import com.puppycrawl.tools.checkstyle.api.MessageDispatcher; |
| 27 |
|
import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; |
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
@author |
| 33 |
|
|
|
|
|
| 93.5% |
Uncovered Elements: 2 (31) |
Complexity: 7 |
Complexity Density: 0.35 |
|
| 34 |
|
public class PackageHtmlCheck extends AbstractFileSetCheck |
| 35 |
|
{ |
| 36 |
|
|
| 37 |
|
|
| 38 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 39 |
1
|
public PackageHtmlCheck()... |
| 40 |
|
{ |
| 41 |
|
|
| 42 |
|
|
| 43 |
1
|
setFileExtensions(new String[]{"java"}); |
| 44 |
|
} |
| 45 |
|
|
| 46 |
|
|
| 47 |
|
|
| 48 |
|
|
| 49 |
|
@param |
| 50 |
|
|
|
|
|
| 93.8% |
Uncovered Elements: 1 (16) |
Complexity: 3 |
Complexity Density: 0.25 |
|
| 51 |
1
|
public void process(File[] aFiles)... |
| 52 |
|
{ |
| 53 |
1
|
final File[] javaFiles = filter(aFiles); |
| 54 |
1
|
final Set directories = getParentDirs(javaFiles); |
| 55 |
2
|
for (final Iterator it = directories.iterator(); it.hasNext();) { |
| 56 |
1
|
final File dir = (File) it.next(); |
| 57 |
1
|
final File packageHtml = new File(dir, "package.html"); |
| 58 |
1
|
final MessageDispatcher dispatcher = getMessageDispatcher(); |
| 59 |
1
|
final String path = packageHtml.getPath(); |
| 60 |
1
|
dispatcher.fireFileStarted(path); |
| 61 |
1
|
if (!packageHtml.exists()) { |
| 62 |
1
|
log(0, "javadoc.packageHtml"); |
| 63 |
1
|
fireErrors(path); |
| 64 |
|
} |
| 65 |
1
|
dispatcher.fireFileFinished(path); |
| 66 |
|
} |
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
|
| 70 |
|
|
| 71 |
|
@param |
| 72 |
|
@return |
| 73 |
|
|
|
|
|
| 90.9% |
Uncovered Elements: 1 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
| 74 |
1
|
protected final Set getParentDirs(File[] aFiles)... |
| 75 |
|
{ |
| 76 |
1
|
final Set directories = new HashSet(); |
| 77 |
2
|
for (int i = 0; i < aFiles.length; i++) { |
| 78 |
1
|
final File f = aFiles[i].getAbsoluteFile(); |
| 79 |
1
|
if (f.getName().endsWith(".java")) { |
| 80 |
1
|
final File dir = f.getParentFile(); |
| 81 |
1
|
directories.add(dir); |
| 82 |
|
} |
| 83 |
|
} |
| 84 |
1
|
return directories; |
| 85 |
|
} |
| 86 |
|
} |