-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cad90ee
commit 19685b5
Showing
8 changed files
with
112 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/scala/com/github/plume/oss/util/DataFlowEngineUtil.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.github.plume.oss.util | ||
|
||
import io.joern.dataflowengineoss.queryengine.{EngineConfig, EngineContext, ResultTable} | ||
import io.joern.dataflowengineoss.semanticsloader.{FlowSemantic, Semantics} | ||
|
||
import java.nio.file.{Path, Paths} | ||
|
||
/** Helper methods for setting up the data flow engine execution context. | ||
*/ | ||
object DataFlowEngineUtil { | ||
|
||
/** Sets the context for the data-flow engine when performing | ||
* [[com.github.plume.oss.drivers.OverflowDbDriver.flowsBetween()]] queries. | ||
* | ||
* @param maxCallDepth the new method call depth. | ||
* @param methodSemantics the file containing method semantics for external methods. | ||
* @param initialCache an initializer for the data-flow cache containing pre-calculated paths. | ||
* @param shareCacheBetweenTasks enables the sharing of cache between data flow tasks. | ||
*/ | ||
def setDataflowContext( | ||
maxCallDepth: Int, | ||
methodSemantics: Semantics, | ||
initialCache: Option[ResultTable], | ||
shareCacheBetweenTasks: Boolean | ||
): EngineContext = { | ||
EngineContext( | ||
methodSemantics, | ||
EngineConfig(maxCallDepth, initialCache, shareCacheBetweenTasks) | ||
) | ||
} | ||
} | ||
|
||
case class DataFlowCacheConfig( | ||
methodSemantics: Option[List[FlowSemantic]] = None, | ||
dataFlowCacheFile: Option[Path] = Some(Paths.get("dataFlowCache.cbor")), | ||
compressDataFlowCache: Boolean = true, | ||
maxCallDepth: Int = 2, | ||
maxCachedPaths: Int = 1_000, | ||
shareCacheBetweenTasks: Boolean = false | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters