Skip to content

Commit

Permalink
Adapt Javadoc for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
smeyer198 committed Nov 9, 2023
1 parent b565af0 commit fc0708a
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<CrySLRule> makeFromRuleset(String rulesBasePath, RuleFormat ruleFormat, Ruleset... set) throws CryptoAnalysisException {

Expand All @@ -59,11 +59,13 @@ public static List<CrySLRule> 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<CrySLRule> makeFromRulesetString(String rulesBasePath, RuleFormat ruleFormat,
String rulesetString) throws CryptoAnalysisException {
Expand Down Expand Up @@ -111,7 +113,7 @@ private static List<CrySLRule> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,6 @@ protected Map<String, CallSiteWithExtractedValue> 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<String, CallSiteWithExtractedValue> extractSootArray(CallSiteWithParamIndex callSite, ExtractedValue allocSite){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<EnsuredCrySLPredicate> getExistingPredicates(Statement stmt, Val seed) {
Set<EnsuredCrySLPredicate> set = existingPredicates.get(stmt, seed);
if (set == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,10 @@ public class ProviderDetection {
private static final String[] PROVIDER_VALUES = new String[] {"BC", "BCPQC", "BCJSSE"};
private static final Set<String> 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;
}
Expand All @@ -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<Unit, SootMethod> observableDynamicICFG, String rootRulesDirectory) {

Expand Down Expand Up @@ -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();
Expand All @@ -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<Unit, SootMethod> observableDynamicICFG) {
String provider = null;
Expand Down Expand Up @@ -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()) {
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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);
Expand All @@ -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<CrySLRule> chooseRules(String providerRulesDirectory) {
List<CrySLRule> rules = Lists.newArrayList();
Expand All @@ -361,8 +360,9 @@ public List<CrySLRule> 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<CrySLRule> chooseRulesZip(String providerRulesZip) {
List<CrySLRule> rules = Lists.newArrayList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public CommandLineReporter(String reportDir, List<CrySLRule> 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.
Expand Down
4 changes: 2 additions & 2 deletions CryptoAnalysis/src/main/java/crypto/reporting/Reporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static List<CrySLRule> 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<CrySLRule> readFromZipFile(File file) throws CryptoAnalysisException {
if (!file.exists() || !file.isFile() || !file.getName().endsWith(".zip"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ public Collection<WeightedForwardQuery<TransitionFunction>> computeSeeds(SootMet

/**
* Only use this method for testing
* @return
*
* @return map with the forward query
*/
public Map<WeightedForwardQuery<TransitionFunction>, ForwardBoomerangResults<TransitionFunction>> run() {
Set<WeightedForwardQuery<TransitionFunction>> seeds = new HashSet<>();
Expand Down
28 changes: 15 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand Down Expand Up @@ -156,6 +143,21 @@
</execution>
</executions>
</plugin>
<plugin>
<!-- This plugin is required for releases to Maven Central. If Javadoc is used,
it has to be correct. -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit fc0708a

Please sign in to comment.