From fc0708a95e5b8b3c1848dda0230f075d8550c13b Mon Sep 17 00:00:00 2001 From: smeyer198 Date: Thu, 9 Nov 2023 13:39:02 +0100 Subject: [PATCH] Adapt Javadoc for releases --- .../crypto/analysis/CrySLRulesetSelector.java | 14 +++-- .../crypto/constraints/ConstraintSolver.java | 1 - .../crypto/cryslhandler/CrySLModelReader.java | 11 ++-- .../StateMachineGraphBuilder.java | 2 +- .../crypto/predicates/PredicateHandler.java | 5 +- .../providerdetection/ProviderDetection.java | 62 +++++++++---------- .../java/crypto/reporting/CSVReporter.java | 4 +- .../crypto/reporting/CSVSummaryReporter.java | 4 +- .../crypto/reporting/CommandLineReporter.java | 2 - .../main/java/crypto/reporting/Reporter.java | 4 +- .../java/crypto/reporting/SARIFReporter.java | 2 +- .../java/crypto/rules/CrySLRuleReader.java | 2 +- .../typestate/ExtendedIDEALAnaylsis.java | 3 +- pom.xml | 28 +++++---- 14 files changed, 72 insertions(+), 72 deletions(-) diff --git a/CryptoAnalysis/src/main/java/crypto/analysis/CrySLRulesetSelector.java b/CryptoAnalysis/src/main/java/crypto/analysis/CrySLRulesetSelector.java index d48a9ba2a..23ad2e83d 100644 --- a/CryptoAnalysis/src/main/java/crypto/analysis/CrySLRulesetSelector.java +++ b/CryptoAnalysis/src/main/java/crypto/analysis/CrySLRulesetSelector.java @@ -44,7 +44,7 @@ public static enum Ruleset { * @param ruleFormat the file extension of the CrySL files * @param set the {@link Ruleset} for which the {@link CrySLRule} objects should be created for * @return the {@link List} with {@link CrySLRule} objects - * @throws CryptoAnalysisException + * @throws CryptoAnalysisException If there is an error reading a ruleset */ public static List makeFromRuleset(String rulesBasePath, RuleFormat ruleFormat, Ruleset... set) throws CryptoAnalysisException { @@ -59,11 +59,13 @@ public static List makeFromRuleset(String rulesBasePath, RuleFormat r } /** - * Computes the ruleset from a string. The sting + * Computes the ruleset from a string. * - * @param rulesetString - * @return - * @throws CryptoAnalysisException + * @param rulesBasePath a {@link String} path giving the location of the CrySL ruleset base folder + * @param ruleFormat the file extension of the CrySL file + * @param rulesetString String + * @return a list of the rules from the ruleset + * @throws CryptoAnalysisException If there is no ruleset */ public static List makeFromRulesetString(String rulesBasePath, RuleFormat ruleFormat, String rulesetString) throws CryptoAnalysisException { @@ -111,7 +113,7 @@ private static List getRulesset(String rulesBasePath, RuleFormat rule * @param ruleset the {@link Ruleset} where the rule belongs to * @param rulename the name of the rule * @return the {@link CrySLRule} object - * @throws CryptoAnalysisException + * @throws CryptoAnalysisException If the rule cannot be found */ public static CrySLRule makeSingleRule(String rulesBasePath, RuleFormat ruleFormat, Ruleset ruleset, String rulename) throws CryptoAnalysisException { File file = new File(rulesBasePath + "/" + ruleset + "/" + rulename + RuleFormat.SOURCE); diff --git a/CryptoAnalysis/src/main/java/crypto/constraints/ConstraintSolver.java b/CryptoAnalysis/src/main/java/crypto/constraints/ConstraintSolver.java index 06d2f60a8..ca39e5768 100644 --- a/CryptoAnalysis/src/main/java/crypto/constraints/ConstraintSolver.java +++ b/CryptoAnalysis/src/main/java/crypto/constraints/ConstraintSolver.java @@ -651,7 +651,6 @@ protected Map extractValueAsString(String va * Function that finds the values assigned to a soot array. * @param callSite call site at which sootValue is involved * @param allocSite allocation site at which sootValue is involved - * @param arrayLocal soot array local variable for which values are to be found * @return extracted array values */ protected Map extractSootArray(CallSiteWithParamIndex callSite, ExtractedValue allocSite){ diff --git a/CryptoAnalysis/src/main/java/crypto/cryslhandler/CrySLModelReader.java b/CryptoAnalysis/src/main/java/crypto/cryslhandler/CrySLModelReader.java index 9aa3ea19f..80bf707eb 100644 --- a/CryptoAnalysis/src/main/java/crypto/cryslhandler/CrySLModelReader.java +++ b/CryptoAnalysis/src/main/java/crypto/cryslhandler/CrySLModelReader.java @@ -54,7 +54,7 @@ public class CrySLModelReader { /** * Creates a CrySLModelReader - * @throws MalformedURLException + * @throws MalformedURLException If there is a problem with the URL */ public CrySLModelReader() throws MalformedURLException { CrySLStandaloneSetup crySLStandaloneSetup = new CrySLStandaloneSetup(); @@ -82,10 +82,11 @@ public CrySLModelReader() throws MalformedURLException { * @param stream the {@link InputStream} holds the CrySL file content * @param virtualFileName the name needs following structure [HexHashedAbsoluteZipFilePath][SystemFileSeparator][ZipEntryName] * @return the {@link CrySLRule} - * @throws IllegalArgumentException, IOException - * @throws CryptoAnalysisException + * @throws IllegalArgumentException If the file for the rule cannot be found + * @throws IOException If there is a problem with reading the file + * @throws CryptoAnalysisException If the file is not a .crysl file */ - public CrySLRule readRule(InputStream stream, String virtualFileName) throws IllegalArgumentException, IOException, CryptoAnalysisException{ + public CrySLRule readRule(InputStream stream, String virtualFileName) throws IllegalArgumentException, IOException, CryptoAnalysisException { if (!virtualFileName.endsWith(cryslFileEnding)) { throw new CryptoAnalysisException ("The prefix of "+virtualFileName+" does not correspond to "+cryslFileEnding); } @@ -105,7 +106,7 @@ public CrySLRule readRule(InputStream stream, String virtualFileName) throws Ill * * @param ruleFile the CrySL file * @return the {@link CrySLRule} object - * @throws CryptoAnalysisException + * @throws CryptoAnalysisException If the file is not a .crysl file */ public CrySLRule readRule(File ruleFile) throws CryptoAnalysisException { final String fileName = ruleFile.getName(); diff --git a/CryptoAnalysis/src/main/java/crypto/cryslhandler/StateMachineGraphBuilder.java b/CryptoAnalysis/src/main/java/crypto/cryslhandler/StateMachineGraphBuilder.java index 2689d8b68..b84fd05bb 100644 --- a/CryptoAnalysis/src/main/java/crypto/cryslhandler/StateMachineGraphBuilder.java +++ b/CryptoAnalysis/src/main/java/crypto/cryslhandler/StateMachineGraphBuilder.java @@ -20,7 +20,7 @@ import de.darmstadt.tu.crossing.crySL.RequiredBlock; /** - * This class will build a {@FiniteStateMachine} for a given ORDER expression from crysl rules. + * This class will build a {@link crypto.interfaces.FiniteStateMachine} for a given ORDER expression from crysl rules. * @author marvinvogel * */ diff --git a/CryptoAnalysis/src/main/java/crypto/predicates/PredicateHandler.java b/CryptoAnalysis/src/main/java/crypto/predicates/PredicateHandler.java index fbda58ec2..da084479e 100644 --- a/CryptoAnalysis/src/main/java/crypto/predicates/PredicateHandler.java +++ b/CryptoAnalysis/src/main/java/crypto/predicates/PredicateHandler.java @@ -144,10 +144,7 @@ public boolean addNewPred(IAnalysisSeed seedObj, Statement statement, Val variab existingPredicatesObjectBased.put(statement, seedObj, predsObjBased); return added; } - - /** - * @return the existingPredicates - */ + public Set getExistingPredicates(Statement stmt, Val seed) { Set set = existingPredicates.get(stmt, seed); if (set == null) { diff --git a/CryptoAnalysis/src/main/java/crypto/providerdetection/ProviderDetection.java b/CryptoAnalysis/src/main/java/crypto/providerdetection/ProviderDetection.java index 9a2d90185..ed63103b2 100644 --- a/CryptoAnalysis/src/main/java/crypto/providerdetection/ProviderDetection.java +++ b/CryptoAnalysis/src/main/java/crypto/providerdetection/ProviderDetection.java @@ -56,18 +56,10 @@ public class ProviderDetection { private static final String[] PROVIDER_VALUES = new String[] {"BC", "BCPQC", "BCJSSE"}; private static final Set SUPPORTED_PROVIDERS = new HashSet<>(Arrays.asList(PROVIDER_VALUES)); - /** - * Returns the detected provider. - * - */ public String getProvider() { return provider; } - - /** - * Returns the rules directory of the detected provider. - * - */ + public String getRulesDirectory() { return rulesDirectory; } @@ -83,10 +75,11 @@ protected void setRulesDirectory(String rulesDirectory) { * provider after the analysis is finished. If no Provider is detected, * then it will return null value, meaning that there was no provider used. * - * @param observableDynamicICFG + * @param observableDynamicICFG observableDynamicICFG * - * @param rootRulesDirectory + * @param rootRulesDirectory directory for the rules * + * @return the detected provider */ public String doAnalysis(ObservableICFG observableDynamicICFG, String rootRulesDirectory) { @@ -157,7 +150,8 @@ else if (providerType.matches("java.lang.String")) { * This method returns the type of Provider detected, since * it can be either `java.security.Provider` or `java.lang.String`. * - * @param providerValue + * @param providerValue the value for the provider + * @return the provider type */ private String getProviderType(Value providerValue) { String providerType = providerValue.getType().toString(); @@ -168,14 +162,15 @@ private String getProviderType(Value providerValue) { /** * This method return the provider used when Provider detected is of type `java.security.Provider`. * - * @param statement + * @param statement statement * - * @param sootMethod + * @param sootMethod soot method * - * @param providerValue + * @param providerValue provider value * - * @param icfg + * @param icfg icfg * + * @return the provider */ private String getProviderWhenTypeProvider(JAssignStmt statement, SootMethod sootMethod, Value providerValue, ObservableICFG observableDynamicICFG) { String provider = null; @@ -242,11 +237,11 @@ else if (map.size() > 1) { /** * This method return the provider used when Provider detected is of type `java.lang.String`. * - * @param providerValue - * - * @param body - * - i.e. the ActiveBody + * @param providerValue value for the provider * + * @param body - i.e. the ActiveBody + * + * @return the provider */ private String getProviderWhenTypeString(Value providerValue, Body body) { for(Unit unit : body.getUnits()) { @@ -273,11 +268,12 @@ private String getProviderWhenTypeString(Value providerValue, Body body) { * static analysis. In case it has more than one allocation site, this method * return true. * - * @param providerValue - * - * @param body - * - i.e. the ActiveBody + * @param providerValue value for the provider * + * @param body - i.e. the ActiveBody + * + * @return true if the provider has only one allocation site and flows not + * through IF-ELSE statements or TERNARY operators */ private boolean checkIfStmt(Value providerValue, Body body) { String value = providerValue.toString(); @@ -302,11 +298,12 @@ private boolean checkIfStmt(Value providerValue, Body body) { * provider can not be correctly detected through the use of static analysis. * In case it has more than one allocation site, this method return true. * - * @param providerValue + * @param providerValue value for the provider * - * @param body - * - i.e. the ActiveBody + * @param body - i.e. the ActiveBody * + * @return true if the provider detected has only one allocation site + * and it is not flowing through SWITCH statements */ private boolean checkSwitchStmt(Value providerValue, Body body) { String value = providerValue.toString(); @@ -326,8 +323,9 @@ private boolean checkSwitchStmt(Value providerValue, Body body) { /** * This method is used to check if the CryptSL rules from the detected Provider do exist. * - * @param providerRulesDirectory + * @param providerRulesDirectory the path to the crysl rules * + * @return true if the CryptSL rules from the detected Provider do exist */ private boolean rulesExist(String providerRulesDirectory) { File rulesDirectory = new File(providerRulesDirectory); @@ -342,8 +340,9 @@ private boolean rulesExist(String providerRulesDirectory) { * This method is used to choose the CryptSL rules in a directory from the detected provider and should * be called after the `doAnalysis()` method. * - * @param providerRulesDirectory - * + * @param providerRulesDirectory the path to the crysl rules + * + * @return CryptSL rules from the detected provider */ public List chooseRules(String providerRulesDirectory) { List rules = Lists.newArrayList(); @@ -361,8 +360,9 @@ public List chooseRules(String providerRulesDirectory) { * This method is used to choose the CryptSL rules in a zip file from the detected provider and should * be called after the `doAnalysis()` method. * - * @param providerRulesZip + * @param providerRulesZip the path to the zip file * + * @return list of crysl rules in the zip file */ public List chooseRulesZip(String providerRulesZip) { List rules = Lists.newArrayList(); diff --git a/CryptoAnalysis/src/main/java/crypto/reporting/CSVReporter.java b/CryptoAnalysis/src/main/java/crypto/reporting/CSVReporter.java index a510a30b0..8cf5faa2f 100644 --- a/CryptoAnalysis/src/main/java/crypto/reporting/CSVReporter.java +++ b/CryptoAnalysis/src/main/java/crypto/reporting/CSVReporter.java @@ -58,9 +58,9 @@ private enum StatisticHeaders { * * @param reportDir A {@link String} path giving the location of the report directory. * The reportPath should end without an ending file separator. - * @param softwareID A {@link String} for the analyzed software. + * @param softwareId A {@link String} for the analyzed software. * @param rules A {@link List} of {@link CrySLRule} containing the rules the program is analyzed with. - * @param callgraphConstructionTime The time in milliseconds for the construction of the callgraph. + * @param callGraphConstructionTime The time in milliseconds for the construction of the callgraph. * @param includeStatistics Set this value to true, if the analysis report should contain some * analysis statistics (e.g. the callgraph construction time). If this value is set * to false, no statistics will be output. diff --git a/CryptoAnalysis/src/main/java/crypto/reporting/CSVSummaryReporter.java b/CryptoAnalysis/src/main/java/crypto/reporting/CSVSummaryReporter.java index abb5b9422..5b07fc65f 100644 --- a/CryptoAnalysis/src/main/java/crypto/reporting/CSVSummaryReporter.java +++ b/CryptoAnalysis/src/main/java/crypto/reporting/CSVSummaryReporter.java @@ -57,9 +57,9 @@ private enum Headers { * * @param reportDir A {@link String} path giving the location of the report directory. * The reportPath should end without an ending file separator. - * @param softwareID A {@link String} for the analyzed software. + * @param softwareId A {@link String} for the analyzed software. * @param rules A {@link List} of {@link CrySLRule} containing the rules the program is analyzed with. - * @param callgraphConstructionTime The time in milliseconds for the construction of the callgraph. + * @param callGraphConstructionTime The time in milliseconds for the construction of the callgraph. * @param includeStatistics Set this value to true, if the analysis report should contain some * analysis statistics (e.g. the callgraph construction time). If this value is set * to false, no statistics will be output. diff --git a/CryptoAnalysis/src/main/java/crypto/reporting/CommandLineReporter.java b/CryptoAnalysis/src/main/java/crypto/reporting/CommandLineReporter.java index bad0f2d54..de0f6310c 100644 --- a/CryptoAnalysis/src/main/java/crypto/reporting/CommandLineReporter.java +++ b/CryptoAnalysis/src/main/java/crypto/reporting/CommandLineReporter.java @@ -26,8 +26,6 @@ public CommandLineReporter(String reportDir, List rules) { * Subclass of {@link Reporter}. Creates an instance of {@link CommandLineReporter}, which * can be used to print an analysis report to stdout. * - * @param reportDir A {@link String} path giving the location of the report directory. - * The reportPath should end without an ending file separator. * @param softwareID A {@link String} for the analyzed software. * @param rules A {@link List} of {@link CrySLRule} containing the rules the program is analyzed with. * @param callgraphConstructionTime The time in milliseconds for the construction of the callgraph. diff --git a/CryptoAnalysis/src/main/java/crypto/reporting/Reporter.java b/CryptoAnalysis/src/main/java/crypto/reporting/Reporter.java index adb25eeed..2aa953737 100644 --- a/CryptoAnalysis/src/main/java/crypto/reporting/Reporter.java +++ b/CryptoAnalysis/src/main/java/crypto/reporting/Reporter.java @@ -23,7 +23,7 @@ * Superclass for all reporters. * * This class is used to define and implement the basic parts, which all reporter should be able to support. This includes - * the computation of all statistics for the analysis and the basic logic for methods defined in the {@link ICrySLResultsListener}. + * the computation of all statistics for the analysis and the basic logic for methods defined in the {@link crypto.analysis.ICrySLResultsListener}. * * This class is abstract. Subclasses have to call the constructor and overwrite the method handleAnalysisResults(), which is called * after the analysis is finished. @@ -50,7 +50,7 @@ public abstract class Reporter extends ErrorMarkerListener { * The constructor to initialize all attributes. Since this class is abstract, all subclasses * have to call this constructor. * - * @param reportDir A {@link String} path giving the location of the report directory. + * @param outputFolder A {@link File} for the location of the report directory. * The reportPath should end without an ending file separator. * @param softwareID A {@link String} for the analyzed software. * @param rules A {@link List} of {@link CrySLRule} containing the rules the program is analyzed with. diff --git a/CryptoAnalysis/src/main/java/crypto/reporting/SARIFReporter.java b/CryptoAnalysis/src/main/java/crypto/reporting/SARIFReporter.java index a17384fa9..2f214eea6 100644 --- a/CryptoAnalysis/src/main/java/crypto/reporting/SARIFReporter.java +++ b/CryptoAnalysis/src/main/java/crypto/reporting/SARIFReporter.java @@ -48,7 +48,7 @@ public class SARIFReporter extends Reporter { * * @param reportDir A {@link String} path giving the location of the report directory. * The reportPath should end without an ending file separator. - * @param softwareID A {@link String} for the analyzed software. + * @param softwareId A {@link String} for the analyzed software. * @param rules A {@link List} of {@link CrySLRule} containing the rules the program is analyzed with. * @param callgraphConstructionTime The time in milliseconds for the construction of the callgraph. * @param includeStatistics Set this value to true, if the analysis report should contain some diff --git a/CryptoAnalysis/src/main/java/crypto/rules/CrySLRuleReader.java b/CryptoAnalysis/src/main/java/crypto/rules/CrySLRuleReader.java index e85ada98e..6c6b82cc0 100644 --- a/CryptoAnalysis/src/main/java/crypto/rules/CrySLRuleReader.java +++ b/CryptoAnalysis/src/main/java/crypto/rules/CrySLRuleReader.java @@ -94,7 +94,7 @@ public static List readFromDirectory(File directory, boolean recursiv * Returns a {@link List} of {@link CrySLRule} objects read from a Zip {@link File}. * @param file Zip that contains the CrySL files * @return the {@link List} with {@link CrySLRule} objects. If no rules are found it returns an empty list. - * @throws CryptoAnalysisException + * @throws CryptoAnalysisException If the directory is not a zip file */ public static List readFromZipFile(File file) throws CryptoAnalysisException { if (!file.exists() || !file.isFile() || !file.getName().endsWith(".zip")) diff --git a/CryptoAnalysis/src/main/java/crypto/typestate/ExtendedIDEALAnaylsis.java b/CryptoAnalysis/src/main/java/crypto/typestate/ExtendedIDEALAnaylsis.java index ba6b1c045..03e430079 100644 --- a/CryptoAnalysis/src/main/java/crypto/typestate/ExtendedIDEALAnaylsis.java +++ b/CryptoAnalysis/src/main/java/crypto/typestate/ExtendedIDEALAnaylsis.java @@ -114,7 +114,8 @@ public Collection> computeSeeds(SootMet /** * Only use this method for testing - * @return + * + * @return map with the forward query */ public Map, ForwardBoomerangResults> run() { Set> seeds = new HashSet<>(); diff --git a/pom.xml b/pom.xml index da2e4d3f7..c20d47924 100644 --- a/pom.xml +++ b/pom.xml @@ -82,19 +82,6 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - 3.6.0 - - - attach-javadoc - - jar - - - - org.apache.maven.plugins maven-release-plugin @@ -156,6 +143,21 @@ + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.6.0 + + + attach-javadoc + + jar + + + +