|
27 | 27 | import soot.SootMethod; |
28 | 28 | import soot.jimple.infoflow.methodSummary.data.provider.IMethodSummaryProvider; |
29 | 29 |
|
| 30 | +/** |
| 31 | + * Reports missing summaries by writing the results to a XML file. |
| 32 | + */ |
30 | 33 | public class ReportMissingSummaryWrapper extends SummaryTaintWrapper { |
31 | 34 |
|
32 | 35 | public ReportMissingSummaryWrapper(IMethodSummaryProvider flows) { |
@@ -60,30 +63,58 @@ private static <T> void count(T item, Map<T, AtomicInteger> map) { |
60 | 63 | ai.incrementAndGet(); |
61 | 64 | } |
62 | 65 |
|
| 66 | + /** |
| 67 | + * Sets the pretty printing flag. When enabled, pretty printing |
| 68 | + * creates new lines for each XML node, and uses indentation for the XML tree |
| 69 | + * @param prettyPrint whether pretty printing should be enabled |
| 70 | + */ |
63 | 71 | public void setPrettyPrinting(boolean prettyPrint) { |
64 | 72 | this.prettyPrint = prettyPrint; |
65 | 73 | } |
66 | 74 |
|
| 75 | + /** |
| 76 | + * Pretty printing creates new lines for each XML node, and uses indentation for the XML tree |
| 77 | + * @return returns true if enabled, otherwise false |
| 78 | + */ |
67 | 79 | public boolean isPrettyPrinting() { |
68 | 80 | return prettyPrint; |
69 | 81 | } |
70 | 82 |
|
| 83 | + /** |
| 84 | + * When the given parameter is true, the class also reports application classes, |
| 85 | + * i.e. classes that are part of the application being analyzed. |
| 86 | + * @param showAppClasses whether app classes should be shown |
| 87 | + */ |
71 | 88 | public void setShowApplicationClasses(boolean showAppClasses) { |
72 | 89 | this.showAppClasses = showAppClasses; |
73 | 90 | } |
74 | 91 |
|
| 92 | + /** |
| 93 | + * Returns whether this class also reports application classes, |
| 94 | + * i.e. classes that are part of the application being analyzed |
| 95 | + * @return returns true if enabled, otherwise false |
| 96 | + */ |
75 | 97 | public boolean isShowingApplicationClasses() { |
76 | 98 | return showAppClasses; |
77 | 99 | } |
78 | 100 |
|
79 | | - public boolean isCountMethods() { |
80 | | - return countMethods; |
81 | | - } |
82 | | - |
| 101 | + /** |
| 102 | + * If the given parameter is true, this class will report counts |
| 103 | + * on a per class and per method basis. |
| 104 | + * @param countMethods whether to count methods |
| 105 | + */ |
83 | 106 | public void setCountMethods(boolean countMethods) { |
84 | 107 | this.countMethods = countMethods; |
85 | 108 | } |
86 | 109 |
|
| 110 | + /** |
| 111 | + * Returns whether counting methods is enabled |
| 112 | + * @return returns true if enabled, otherwise false |
| 113 | + */ |
| 114 | + public boolean isCountMethods() { |
| 115 | + return countMethods; |
| 116 | + } |
| 117 | + |
87 | 118 | public void writeResults(File file) throws IOException, ParserConfigurationException, TransformerException { |
88 | 119 | Map<SootClass, Integer> sortedClassSummariesMissing = sortMap(classSummariesMissing); |
89 | 120 | DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); |
|
0 commit comments