@@ -17,8 +17,9 @@ The analysis entry point is the [runAnalysis] method. To call it, you have to pr
1717* ` graph ` — an application graph that is used for analysis. To obtain this graph, one should call the [ newApplicationGraphForAnalysis] method.
1818* ` unitResolver ` — an object that groups methods into units. Choose one from ` UnitResolversLibrary ` .
1919Note that, in general, larger units mean more precise but also more resource-consuming analysis.
20- * ` ifdsUnitRunner ` — an [ IfdsUnitRunner] instance, which is used to analyze each unit. This is what defines concrete analysis.
21- Ready-to-use runners are located in ` RunnersLibrary ` .
20+ * ` ifdsUnitRunnerFactory ` — an [ IfdsUnitRunnerFactory] instance, that can create runners. Runners are used to analyze each unit.
21+ So this factory is what define concrete analysis.
22+ Ready-to-use runner factories are located in ` RunnersLibrary ` .
2223* ` methods ` — a list of methods to analyze.
2324
2425For example, to detect the unused variables in the given ` analyzedClass ` methods, you may run the following code
@@ -31,9 +32,9 @@ val applicationGraph = runBlocking {
3132
3233val methodsToAnalyze = analyzedClass.declaredMethods
3334val unitResolver = MethodUnitResolver
34- val runner = UnusedVariableRunner
35+ val runnerFactory = UnusedVariableRunnerFactory
3536
36- runAnalysis(applicationGraph, unitResolver, runner , methodsToAnalyze)
37+ runAnalysis(applicationGraph, unitResolver, runnerFactory , methodsToAnalyze)
3738```
3839
3940## Implemented runners
@@ -47,29 +48,28 @@ By now, the following runners are implemented:
4748
4849## Implementing your own analysis
4950
50- To implement a simple one-pass analysis, use [ IfdsBaseUnitRunner ] .
51+ To implement a simple one-pass analysis, use [ IfdsBaseUnitRunnerFactory ] .
5152To instantiate it, you need an [ AnalyzerFactory] instance, which is an object that can create [ Analyzer] via
5253[ JcApplicationGraph] .
5354
5455To instantiate an [ Analyzer] interface, you have to specify the following:
5556
5657* ` flowFunctions ` , which describe the dataflow facts and their transmissions during the analysis;
5758
58- * how these facts produce vulnerabilities , i.e., you have to implement ` getSummaryFacts ` and
59- ` getSummaryFactsPostIfds ` methods.
59+ * semantics for these dataflow facts , i.e. how these facts produce vulnerabilities, summaries, etc.
60+ This should be done by implementing ` handleNewEdge ` , ` handleNewCrossUnitCall ` and ` handleIfdsResult ` methods.
6061
61- To implement bidirectional analysis, you may use composite [ SequentialBidiIfdsUnitRunner ] and [ ParallelBidiIfdsUnitRunner ] .
62+ To implement bidirectional analysis, you may use composite [ BidiIfdsUnitRunnerFactory ] .
6263
6364<!-- - MODULE jacodb-analysis -->
6465<!-- - INDEX org.jacodb.analysis -->
6566
6667[ runAnalysis ] : https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis/run-analysis.html
6768[ newApplicationGraphForAnalysis ] : https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.graph/new-application-graph-for-analysis.html
68- [ IfdsUnitRunner ] : https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-ifds-unit-runner/index.html
69+ [ IfdsUnitRunnerFactory ] : https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-ifds-unit-runner-factory /index.html
6970[ JcClasspath ] : https://jacodb.org/docs/jacodb-api/org.jacodb.api/-jc-classpath/index.html
70- [ IfdsBaseUnitRunner ] : https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-ifds-base-unit-runner/index.html
71+ [ IfdsBaseUnitRunnerFactory ] : https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-ifds-base-unit-runner-factory /index.html
7172[ AnalyzerFactory ] : https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-analyzer-factory/index.html
7273[ Analyzer ] : https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-analyzer/index.html
7374[ JcApplicationGraph ] : https://jacodb.org/docs/jacodb-api/org.jacodb.api.analysis/-jc-application-graph/index.html
74- [ SequentialBidiIfdsUnitRunner ] : https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-sequential-bidi-ifds-unit-runner/index.html
75- [ ParallelBidiIfdsUnitRunner ] : https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-parallel-bidi-ifds-unit-runner/index.html
75+ [ BidiIfdsUnitRunnerFactory ] : https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-bidi-ifds-unit-runner-factory/index.html
0 commit comments