Skip to content

Commit

Permalink
Update Api reference + update Navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
lehvolk committed Jul 28, 2023
1 parent 2fd15a1 commit 0a09fdb
Show file tree
Hide file tree
Showing 4,568 changed files with 15,112 additions and 19,036 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion backend/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.springframework.boot.gradle.tasks.bundling.BootJar

val coroutinesVersion: String by rootProject
val jacodbVersion: String = "1.0.0"
val jacodbVersion: String = "1.1.5"

plugins {
id("org.springframework.boot") version "2.7.5"
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main/kotlin/org/jacodb/impl/http/HttpHook.kt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ open class Application {
open class WebConfig : WebMvcConfigurer {

override fun addViewControllers(registry: ViewControllerRegistry) {
SitemapController.urls.forEach {
Navigation.urls.forEach {
registry.addViewController(it).setViewName("forward:$it/index.html")
}
registry.addViewController("/404").setViewName("forward:/404/index.html")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.jacodb.impl.http.resources

object Navigation {
private val documentation = listOf(
"installation",
"basic-usage",
"database-features",
"classpath-features",
"instructions",
"graphs",
"migration",
"ifds"
).map { "/documentation/$it" }

private val usageExamples = listOf(
"type-solving",
"approximations",
"symbolic-execution"
).map { "/usage-examples/$it" }

private val about = listOf(
"about-the-project",
"benchmarking"
).map { "/about/$it" }

val urls = documentation + about + usageExamples

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,13 @@ import java.time.format.DateTimeFormatter
@RestController
@RequestMapping("/sitemap.xml")
class SitemapController {
companion object {
private val documentation = listOf(
"installation",
"basic-usage",
"database-features",
"classpath-features",
"instructions",
"graphs",
"migration"
).map { "/documentation/$it" }


private val usageExamples = listOf(
"type-solving",
"approximations",
"symbolic-execution",
"ifds"
).map { "/usage-examples/$it" }

private val about = listOf(
"about-the-project",
"benchmarking"
).map { "/about/$it" }


val urls = documentation + about + usageExamples
}

private val domain = "https://jacodb.org"

@GetMapping(produces = ["application/xml"])
fun main(): XmlUrlSet {
val xmlUrlSet = XmlUrlSet()
for (eachLink in urls) {
for (eachLink in Navigation.urls) {
create(xmlUrlSet, eachLink)
}
return xmlUrlSet
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</a>
</div>
<div>
1.1.0 </div>
1.1-SNAPSHOT </div>
<div class="pull-right d-flex">
<button id="theme-toggle-button"><span id="theme-toggle"></span></button>
<div id="searchBar"></div>
Expand All @@ -64,7 +64,7 @@ <h2 class="">All modules:</h2>
<div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div><span class="brief-comment">
<p class="paragraph">Module for custom analysis</p>
<p class="paragraph">Analysis module allows launching dataflow analyses of applications. It contains API to write custom analyses, along with several implemented ready-to-use analyses.</p>
</span></div>
</div>
</div>
Expand Down
41 changes: 20 additions & 21 deletions docs/jacodb-analysis/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
<div class="library-name">
<a href="../index.html">
<span>jacodb</span> </a> </div>
<div>1.1.0
</div>
<div>1.1.5</div>
<div class="pull-right d-flex">
<button id="theme-toggle-button"><span id="theme-toggle"></span></button>
<div id="searchBar"></div>
Expand All @@ -50,7 +49,7 @@
<div class="breadcrumbs"></div>
<div class="cover ">
<h1 class="cover"><span><span>jacodb-analysis</span></span></h1>
<div class="platform-hinted UnderCoverText" data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":jacodb-analysis:dokkaHtmlPartial/main"><p class="paragraph">Module for custom analysis</p><h2 class=""> IFDS</h2><p class="paragraph">TODO</p><h2 class=""> Points To</h2><p class="paragraph">TODO</p></div></div>
<div class="platform-hinted UnderCoverText" data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":jacodb-analysis:dokkaHtmlPartial/main"><p class="paragraph">Analysis module allows launching dataflow analyses of applications. It contains API to write custom analyses, along with several implemented ready-to-use analyses.</p><h2 class=""> Concept of units</h2><p class="paragraph">The <a href="https://dx.doi.org/10.1145/199448.199462">IFDS</a> framework is used as the basis for this module. However, in order to be scalable, the analyzed code is split into so-called units, so that the framework can analyze them concurrently. Information is shared between the units via summaries, but the lifecycle of each unit is controlled separately.</p><h2 class=""> Get started</h2><p class="paragraph">The entry point of the analysis is the <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis/run-analysis.html">runAnalysis</a> method. In order to call it, you have to provide:</p><ul><li><p class="paragraph"><code class="lang-kotlin">graph</code> — an application graph that is used for analysis. To obtain this graph, one should call the <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis/new-application-graph-for-analysis.html">newApplicationGraphForAnalysis</a> method.</p></li><li><p class="paragraph"><code class="lang-kotlin">unitResolver</code> — an object that groups methods into units. Choose one from <code class="lang-kotlin">UnitResolversLibrary</code>. Note that in general, larger units mean more precise but also more resource-consuming analysis.</p></li><li><p class="paragraph"><code class="lang-kotlin">ifdsUnitRunner</code> — an <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-ifds-unit-runner/index.html">IfdsUnitRunner</a> instance, which is used to analyze each unit. This is what defines concrete analysis. Ready-to-use runners are located in <code class="lang-kotlin">RunnersLibrary</code>.</p></li><li><p class="paragraph"><code class="lang-kotlin">methods</code> — a list of methods to analyze.</p></li></ul><p class="paragraph">For example, to detect unused variables in the given <code class="lang-kotlin">analyzedClass</code> methods, you may run the following code (assuming that <code class="lang-kotlin">classpath</code> is an instance of <a href="https://jacodb.org/docs/jacodb-api/org.jacodb.api/-jc-classpath/index.html">JcClasspath</a>):</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">val applicationGraph = runBlocking { <br> classpath.newApplicationGraphForAnalysis()<br>}<br><br>val methodsToAnalyze = analyzedClass.declaredMethods<br>val unitResolver = MethodUnitResolver<br>val runner = UnusedVariableRunner<br><br>runAnalysis(applicationGraph, unitResolver, runner, methodsToAnalyze)</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><h2 class=""> Implemented runners</h2><p class="paragraph">By now, the following runners are implemented:</p><ul><li><p class="paragraph"><code class="lang-kotlin">UnusedVariableRunner</code> that can detect issues like unused variable declaration, unused return value, etc.</p></li><li><p class="paragraph"><code class="lang-kotlin">NpeRunner</code> that can find instructions with possible null-value dereference.</p></li><li><p class="paragraph">Generic <code class="lang-kotlin">TaintRunner</code> that can perform taint analysis.</p></li><li><p class="paragraph"><code class="lang-kotlin">SqlInjectionRunner</code> which find places vulnerable to sql injections, thus performing a specific kind of taint analysis.</p></li></ul><h2 class=""> Implementing your own analysis</h2><p class="paragraph">To implement a simple one-pass analysis, use <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-ifds-base-unit-runner/index.html">IfdsBaseUnitRunner</a>. To instantiate it, you need an <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-analyzer-factory/index.html">AnalyzerFactory</a> instance, which is an object that can create <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-analyzer/index.html">Analyzer</a> via <a href="https://jacodb.org/docs/jacodb-api/org.jacodb.api.analysis/-jc-application-graph/index.html">JcApplicationGraph</a>.</p><p class="paragraph">To instantiate an <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-analyzer/index.html">Analyzer</a> interface, you have to specify the following:</p><ul><li><p class="paragraph"><code class="lang-kotlin">flowFunctions</code> which describe dataflow facts and their transmissions during the analysis.</p></li><li><p class="paragraph">How vulnerabilities are produced by these facts, i.e. you have to implement <code class="lang-kotlin">getSummaryFacts</code> and <code class="lang-kotlin">getSummaryFactsPostIfds</code> methods.</p></li></ul><p class="paragraph">To implement bidirectional analysis, you may use composite <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-sequential-bidi-ifds-base-unit-runner/index.html">SequentialBidiIfdsUnitRunner</a> and <a href="https://jacodb.org/docs/jacodb-analysis/org.jacodb.analysis.engine/-parallel-bidi-ifds-base-unit-runner/index.html">ParallelBidiIfdsUnitRunner</a>.</p><!-- MODULE jacodb-analysis --><!-- INDEX org.jacodb.analysis --></div></div>
</div>
<h2 class="">Packages</h2>
<div class="table"><a data-name="-725659743%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis" id="-725659743%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
Expand All @@ -67,83 +66,83 @@ <h2 class="">Packages</h2>
<div></div>
</div>
</div>
<a data-name="-1333342144%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis.analyzers" id="-1333342144%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
<a data-name="-840486605%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis.engine" id="-840486605%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
<div class="table-row" data-filterable-current=":jacodb-analysis:dokkaHtmlPartial/main" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main">
<div>
<div class="main-subrow ">
<div class=""><span class="inline-flex">
<div><a href="org.jacodb.analysis.analyzers/index.html">org.jacodb.analysis.analyzers</a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1333342144%2FPackages%2F1000453906"></span>
<div><a href="org.jacodb.analysis.engine/index.html">org.jacodb.analysis.engine</a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-840486605%2FPackages%2F1000453906"></span>
<div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div class="pull-right"></div>
</div>
<div></div>
</div>
</div>
<a data-name="-840486605%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis.engine" id="-840486605%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
<a data-name="1258625601%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis.graph" id="1258625601%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
<div class="table-row" data-filterable-current=":jacodb-analysis:dokkaHtmlPartial/main" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main">
<div>
<div class="main-subrow ">
<div class=""><span class="inline-flex">
<div><a href="org.jacodb.analysis.engine/index.html">org.jacodb.analysis.engine</a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-840486605%2FPackages%2F1000453906"></span>
<div><a href="org.jacodb.analysis.graph/index.html">org.jacodb.analysis.graph</a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1258625601%2FPackages%2F1000453906"></span>
<div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div class="pull-right"></div>
</div>
<div></div>
</div>
</div>
<a data-name="1258625601%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis.graph" id="1258625601%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
<a data-name="-72439822%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis.impl.custom" id="-72439822%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
<div class="table-row" data-filterable-current=":jacodb-analysis:dokkaHtmlPartial/main" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main">
<div>
<div class="main-subrow ">
<div class=""><span class="inline-flex">
<div><a href="org.jacodb.analysis.graph/index.html">org.jacodb.analysis.graph</a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1258625601%2FPackages%2F1000453906"></span>
<div><a href="org.jacodb.analysis.impl.custom/index.html">org.jacodb.analysis.impl.custom</a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-72439822%2FPackages%2F1000453906"></span>
<div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div class="pull-right"></div>
</div>
<div></div>
</div>
</div>
<a data-name="-72439822%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis.impl.custom" id="-72439822%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
<a data-name="-2065187026%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis.library" id="-2065187026%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
<div class="table-row" data-filterable-current=":jacodb-analysis:dokkaHtmlPartial/main" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main">
<div>
<div class="main-subrow ">
<div class=""><span class="inline-flex">
<div><a href="org.jacodb.analysis.impl.custom/index.html">org.jacodb.analysis.impl.custom</a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-72439822%2FPackages%2F1000453906"></span>
<div><a href="org.jacodb.analysis.library/index.html">org.jacodb.analysis.library</a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-2065187026%2FPackages%2F1000453906"></span>
<div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div class="pull-right"></div>
</div>
<div></div>
</div>
</div>
<a data-name="-56741407%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis.paths" id="-56741407%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
<a data-name="2049373069%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis.library.analyzers" id="2049373069%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
<div class="table-row" data-filterable-current=":jacodb-analysis:dokkaHtmlPartial/main" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main">
<div>
<div class="main-subrow ">
<div class=""><span class="inline-flex">
<div><a href="org.jacodb.analysis.paths/index.html">org.jacodb.analysis.paths</a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-56741407%2FPackages%2F1000453906"></span>
<div><a href="org.jacodb.analysis.library.analyzers/index.html">org.jacodb.analysis.library.analyzers</a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="2049373069%2FPackages%2F1000453906"></span>
<div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div class="pull-right"></div>
</div>
<div></div>
</div>
</div>
<a data-name="1498829090%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis.points2" id="1498829090%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
<a data-name="-56741407%2FPackages%2F1000453906" anchor-label="org.jacodb.analysis.paths" id="-56741407%2FPackages%2F1000453906" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main"></a>
<div class="table-row" data-filterable-current=":jacodb-analysis:dokkaHtmlPartial/main" data-filterable-set=":jacodb-analysis:dokkaHtmlPartial/main">
<div>
<div class="main-subrow ">
<div class=""><span class="inline-flex">
<div><a href="org.jacodb.analysis.points2/index.html">org.jacodb.analysis.points2</a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1498829090%2FPackages%2F1000453906"></span>
<div><a href="org.jacodb.analysis.paths/index.html">org.jacodb.analysis.paths</a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-56741407%2FPackages%2F1000453906"></span>
<div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div class="pull-right"></div>
Expand Down
Loading

0 comments on commit 0a09fdb

Please sign in to comment.