Packages

class TestConsole extends Console[Project]

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TestConsole
  2. Console
  3. ScriptManager
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TestConsole(workspaceDir: String)

Type Members

  1. class ImportCode extends AnyRef
    Definition Classes
    Console
  2. implicit class ItExtend[X] extends AnyRef
    Definition Classes
    Console
  3. implicit class CpgScriptRunner extends AnyRef
    Definition Classes
    ScriptManager

Value Members

  1. implicit object ConsoleImageViewer extends ImageViewer
    Definition Classes
    Console
  2. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  3. final def ##(): Int
    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. def _runAnalyzer(overlayCreators: LayerCreator*): Cpg
    Definition Classes
    Console
  6. def applyDefaultOverlays(cpg: Cpg): Cpg
    Definition Classes
    Console
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def close: Option[Project]
    Definition Classes
    Console
  10. def close(name: String): Option[Project]
    Definition Classes
    Console
    Annotations
    @Doc("Close project by name", """|Close project. Resources are freed but the project remains on disk.
    |The project remains active, that is, calling `cpg` now raises an
    |exception. A different project can now be activated using `open`.
    |""".stripMargin
    , "close(projectName)")
  11. def config: ConsoleConfig
    Definition Classes
    TestConsoleConsole
  12. def console: Console[Project]
    Definition Classes
    Console
  13. implicit def cpg: Cpg
    Definition Classes
    Console
    Annotations
    @Doc("CPG of the active project", """
    |Upon importing code, a project is created that holds
    |an intermediate representation called `Code Property Graph`. This
    |graph is a composition of low-level program representations such
    |as abstract syntax trees and control flow graphs, but it can be arbitrarily
    |extended to hold any information relevant in your audit, information
    |about HTTP entry points, IO routines, information flows, or locations
    |of vulnerable code. Think of Ocular and Joern as a CPG editors.
    |
    |In practice, `cpg` is the root object of the query language, that is, all
    |query language constructs can be invoked starting from `cpg`. For example,
    |`cpg.method.l` lists all methods, while `cpg.finding.l` lists all findings
    |of potentially vulnerable code.
    |""".stripMargin
    , "cpg.method.l")
  14. val cpgGenerator: TestCpgGenerator
    Definition Classes
    TestConsoleConsole
  15. def cpgs: Iterator[Cpg]

    All cpgs loaded in the workspace

    All cpgs loaded in the workspace

    Definition Classes
    Console
  16. def defaultProjectNameIfEmpty(name: String): Option[String]
    Attributes
    protected
    Definition Classes
    Console
  17. def delete: Option[Unit]

    Delete the active project

    Delete the active project

    Definition Classes
    Console
  18. def delete(name: String): Option[Unit]

    Delete project from disk and remove it from the workspace manager.

    Delete project from disk and remove it from the workspace manager. Returns the (now invalid) project.

    name

    the name of the project

    Definition Classes
    Console
    Annotations
    @Doc("Close and remove project from disk", "", "delete(projectName)")
  19. def deriveNameFromInputPath(inputPath: String): String
    Attributes
    protected
    Definition Classes
    Console
  20. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  22. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  23. def fixProjectNameAndComplainOnFix(name: String): String
    Attributes
    protected
    Definition Classes
    Console
  24. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. def importCode: ImportCode
    Definition Classes
    Console
    Annotations
    @Doc("Create new project from code", """
    |importCode(<inputPath>, [projectName], [namespaces], [language])
    |
    |Type `importCode` alone to get a list of all supported languages
    |
    |Import code at `inputPath`. Creates a new project, generates a CPG,
    |and opens the project. Upon success, the CPG can be queried via the `cpg`
    |object. Default overlays are already applied to the newly created CPG.
    |Returns new CPG and ensures that `cpg` now refers to this new CPG.
    |
    |By default, `importCode` attempts to guess the source language of
    |the code you provide. You can also specify the source language
    |manually, by running `importCode.<language>`. For example, `importCode.c`
    |runs the C/C++ frontend.
    |
    |Type `importCode` alone to get an overview of all available language modules.
    |
    |Parameters:
    |
    |-----------
    |
    |inputPath: location on disk of the code to analyze. e.g., a directory
    |containing source code or a Java archive (JAR).
    |
    |projectName: a unique name used for project management. If this parameter
    |is omitted, the name will be derived from `inputPath`
    |
    |namespaces: the whitelist of namespaces to analyse. Specifying this
    |parameter is only effective if the language frontend supports it.
    |If the list is omitted or empty, namespace selection is performed
    |automatically via heuristics.
    |
    |language: the programming language which the code at `inputPath` is written in.
    |If `language` is empty, the language used is guessed by inspecting
    |the filename found and possibly by looking into the file/directory.
    |
    |""".stripMargin
    , """importCode("example.jar")""")
  27. def importCpg(inputPath: String, projectName: String = ""): Option[Cpg]
    Definition Classes
    Console
    Annotations
    @Doc("Create new project from existing CPG", """
    |importCpg(<inputPath>, [projectName])
    |
    |Import an existing CPG. The CPG is stored as part
    |of a new project and blanks are filled in by analyzing the CPG.
    |If we find that default overlays have not been applied, these
    |are applied to the CPG after loading it.
    |
    |Parameters:
    |
    |inputPath: path where the existing CPG (in overflowdb format)
    |is stored
    |
    |projectName: name of the new project. If this parameter
    |is omitted, the path is derived from `inputPath`
    |""".stripMargin
    , """importCpg("cpg.bin.zip")""")
  28. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  29. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  30. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  32. def open: Option[Project]

    Open the active project

    Open the active project

    Definition Classes
    Console
  33. def open(name: String): Option[Project]
    Definition Classes
    Console
    Annotations
    @Doc("Open project", """
    |open([projectName])
    |
    |Opens the project named `name` and make it the active project.
    |If `name` is not provided, the active project is opened. If `name`
    |is a path, the project name is derived from and a deprecation
    |warning is printed.
    |
    |Upon completion of this operation, the CPG stored in this project
    |can be queried via `cpg`. Returns an optional reference to the
    |project, which is empty on error.
    |""".stripMargin
    , """open("projectName")""")
  34. def project: Project
    Definition Classes
    Console
    Annotations
    @Doc("Currently active project", "", "project")
  35. def reload(name: String): Option[Project]

    Close the project and open it again.

    Close the project and open it again.

    name

    the name of the project

    Definition Classes
    Console
  36. def report(string: String): Unit
    Attributes
    protected
    Definition Classes
    Console
  37. def runCreator(creator: LayerCreator, overlayDirName: Option[String]): Unit
    Attributes
    protected
    Definition Classes
    Console
  38. def runScript(scriptName: String, parameters: Map[String, String], cpg: Cpg): Any
    Definition Classes
    ScriptManager
  39. def runScript(scriptName: String, parameters: Map[String, String], cpgFileName: String): Any
    Definition Classes
    ScriptManager
  40. def save: List[Project]
    Definition Classes
    Console
    Annotations
    @Doc("Write all changes to disk", """
    |Close and reopen all loaded CPGs. This ensures
    |that changes have been flushed to disk.
    |
    |Returns list of affected projects
    |""".stripMargin
    , "save")
  41. def scripts(): List[ScriptCollections]
    Definition Classes
    ScriptManager
  42. def switchWorkspace(pathName: String): Unit
    Definition Classes
    Console
    Annotations
    @Doc("Close current workspace and open a different one", """ | By default, the workspace in $INSTALL_DIR/workspace is used.
    | This method allows specifying a different workspace directory
    | via the `pathName` parameter.
    | Before changing the workspace, the current workspace will be
    | closed, saving any unsaved changes.
    | If `pathName` points to a non-existing directory, then a new
    | workspace is first created.
    |""".stripMargin
    , help.this.Doc.<init>$default$3)
  43. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  44. def toString(): String
    Definition Classes
    AnyRef → Any
  45. def undo: File
    Definition Classes
    Console
    Annotations
    @Doc("undo effects of analyzer", """|Undo the last change, that is, unapply the last
    |overlay applied to the active project.
    |""".stripMargin
    , "undo")
  46. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  47. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  48. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  49. def withScriptFile[T](scriptName: String)(f: (File) => IO[T]): IO[T]
    Attributes
    protected
    Definition Classes
    ScriptManager
  50. def workspace: WorkspaceManager[Project]
    Definition Classes
    Console
    Annotations
    @Doc("Access to the workspace directory", """
    |All auditing projects are stored in a workspace directory, and `workspace`
    |provides programmatic access to this directory. Entering `workspace` provides
    |a list of all projects, indicating which code the project makes accessible,
    |whether the project is open, and which analyzers have been run to produce it.
    |Multiple projects can be open at any given time, however, only one project
    |can be active. Queries and edit-operations are executed on the active project
    |only.
    |
    |Operations
    |
    |----------
    |
    |`workspace` provides low-level access to the workspace directory. In most cases,
    |it is a better idea to use higher-level operations such as `importCode`, `open`,
    |`close`, and `delete`, which make use of workspace operations internally.
    |
    |* workspace.open([name]): open project by name and make it the active project.
    | If `name` is omitted, the last project in the workspace list is opened. If
    | the project is already open, this has the same effect as `workspace.setActiveProject([name])`
    |
    |* workspace.close([name]): close project by name. Does not remove the project.
    |
    |* workspace.remove([name]): close and remove project by name.
    |
    |* workspace.reset: create a fresh workspace directory, deleting the current
    |workspace directory
    |
    |""".stripMargin
    , "workspace")
  51. var workspaceManager: WorkspaceManager[Project]
    Attributes
    protected
    Definition Classes
    Console
  52. def workspacePathName: String
    Attributes
    protected
    Definition Classes
    Console

Inherited from Console[Project]

Inherited from ScriptManager

Inherited from AnyRef

Inherited from Any

Ungrouped