RecoverForJavaScriptFile

io.joern.jssrc2cpg.passes.RecoverForJavaScriptFile
class RecoverForJavaScriptFile(cpg: Cpg, cu: File, builder: DiffGraphBuilder, globalTable: SymbolTable[GlobalKey], addedNodes: Set[(Long, String)]) extends RecoverForXCompilationUnit[File]

Attributes

Graph
Supertypes
class RecoverForXCompilationUnit[File]
class RecursiveTask[Unit]
class ForkJoinTask[Unit]
trait Serializable
trait Future[Unit]
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Inherited methods

protected def assignTypesToCall(x: Call, types: Set[String]): Set[String]

Given a LHS call, will retrieve its symbol to the given types.

Given a LHS call, will retrieve its symbol to the given types.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def assignments: Traversal[Assignment]

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def associateInterproceduralTypes(i: Identifier, fieldFullName: String, fieldName: String, globalTypes: Set[String], baseTypes: Set[String]): Set[String]

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def associateInterproceduralTypes(i: Identifier, base: Identifier, fi: FieldIdentifier, fieldName: String, baseTypes: Set[String]): Set[String]

Similar to associateTypes but used in the case where there is some kind of field load.

Similar to associateTypes but used in the case where there is some kind of field load.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def associateTypes(symbol: LocalVar, fa: FieldAccess, types: Set[String]): Set[String]

Associates the types with the identifier. This may sometimes be an identifier that should be considered a field which this method uses isField to determine.

Associates the types with the identifier. This may sometimes be an identifier that should be considered a field which this method uses isField to determine.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def associateTypes(i: Identifier, types: Set[String]): Set[String]

Associates the types with the identifier. This may sometimes be an identifier that should be considered a field which this method uses isField to determine.

Associates the types with the identifier. This may sometimes be an identifier that should be considered a field which this method uses isField to determine.

Attributes

Inherited from:
RecoverForXCompilationUnit
def cancel(x$0: Boolean): Boolean

Attributes

Inherited from:
ForkJoinTask
final def compareAndSetForkJoinTaskTag(x$0: Short, x$1: Short): Boolean

Attributes

Inherited from:
ForkJoinTask
def complete(x$0: Unit): Unit

Attributes

Inherited from:
ForkJoinTask
def completeExceptionally(x$0: Throwable): Unit

Attributes

Inherited from:
ForkJoinTask
override def compute(): Unit

Attributes

Definition Classes
RecoverForXCompilationUnit -> RecursiveTask
Inherited from:
RecoverForXCompilationUnit
final def fork(): ForkJoinTask[V]

Attributes

Inherited from:
ForkJoinTask
final def get(x$0: Long, x$1: TimeUnit): V

Attributes

Inherited from:
ForkJoinTask
final def get(): V

Attributes

Inherited from:
ForkJoinTask
final def getException(): Throwable

Attributes

Inherited from:
ForkJoinTask
protected def getFieldBaseType(baseName: String, fieldName: String): Set[String]

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def getFieldBaseType(base: Identifier, fi: FieldIdentifier): Set[String]

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def getFieldName(fa: FieldAccess, prefix: String, suffix: String): String

Extracts a string representation of the name of the field within this field access.

Extracts a string representation of the name of the field within this field access.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def getFieldParents(fa: FieldAccess): Set[String]

Returns the appropriate field parent scope.

Returns the appropriate field parent scope.

Attributes

Inherited from:
RecoverForXCompilationUnit
final def getForkJoinTaskTag(): Short

Attributes

Inherited from:
ForkJoinTask
protected def getIndexAccessTypes(ia: Call): Set[String]

Will attempt to retrieve index access types otherwise will return dummy value.

Will attempt to retrieve index access types otherwise will return dummy value.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def getLiteralType(l: Literal): Set[String]

Not all frontends populate typeFullName for literals so we allow this to be overridden.

Not all frontends populate typeFullName for literals so we allow this to be overridden.

Attributes

Inherited from:
RecoverForXCompilationUnit
final def getRawResult(): V

Attributes

Inherited from:
RecursiveTask
protected def getSymbolFromCall(c: Call): (LocalKey, Set[GlobalKey])

Tries to identify the underlying symbol from the call operation as it is used on the LHS of an assignment. The second element is a list of any associated global keys if applicable.

Tries to identify the underlying symbol from the call operation as it is used on the LHS of an assignment. The second element is a list of any associated global keys if applicable.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def getTypesFromCall(c: Call): Set[String]

Given a call operation, will attempt to retrieve types from it.

Given a call operation, will attempt to retrieve types from it.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def importNodes(cu: AstNode): Traversal[AstNode]

Attributes

Returns:

the import nodes of this compilation unit.

Inherited from:
RecoverForXCompilationUnit
protected def indexAccessToCollectionVar(c: Call): Option[CollectionVar]

Generates an identifier for collection/index-access operations in the symbol table.

Generates an identifier for collection/index-access operations in the symbol table.

Attributes

Inherited from:
RecoverForXCompilationUnit
final def invoke(): V

Attributes

Inherited from:
ForkJoinTask
final def isCancelled(): Boolean

Attributes

Inherited from:
ForkJoinTask
final def isCompletedAbnormally(): Boolean

Attributes

Inherited from:
ForkJoinTask
final def isCompletedNormally(): Boolean

Attributes

Inherited from:
ForkJoinTask
final def isDone(): Boolean

Attributes

Inherited from:
ForkJoinTask
final def join(): V

Attributes

Inherited from:
ForkJoinTask
protected def members: Traversal[Member]

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def methodReturnValues(methodFullNames: Seq[String]): Set[String]

Will attempt to find the return values of a method if in the CPG, otherwise will give a dummy value.

Will attempt to find the return values of a method if in the CPG, otherwise will give a dummy value.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def postVisitImports(): Unit

The initial import setting is over-approximated, so this step checks the CPG for any matches and prunes against these findings. If there are no findings, it will leave the table as is. The latter is significant for external types or methods.

The initial import setting is over-approximated, so this step checks the CPG for any matches and prunes against these findings. If there are no findings, it will leave the table as is. The latter is significant for external types or methods.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def prepopulateSymbolTable(): Unit

Provides an entrypoint to add known symbols and their possible types.

Provides an entrypoint to add known symbols and their possible types.

Attributes

Inherited from:
RecoverForXCompilationUnit
final def quietlyComplete(): Unit

Attributes

Inherited from:
ForkJoinTask
final def quietlyInvoke(): Unit

Attributes

Inherited from:
ForkJoinTask
final def quietlyJoin(): Unit

Attributes

Inherited from:
ForkJoinTask
def reinitialize(): Unit

Attributes

Inherited from:
ForkJoinTask
protected def setCallMethodFullNameFromBase(c: Call): Set[String]

Will build a call full path using the call base node. This method assumes the base node is in the symbol table.

Will build a call full path using the call base node. This method assumes the base node is in the symbol table.

Attributes

Inherited from:
RecoverForXCompilationUnit
final def setForkJoinTaskTag(x$0: Short): Short

Attributes

Inherited from:
ForkJoinTask
protected def setTypeInformation(): Unit

Using an entry from the symbol table, will queue the CPG modification to persist the recovered type information.

Using an entry from the symbol table, will queue the CPG modification to persist the recovered type information.

Attributes

Inherited from:
RecoverForXCompilationUnit
def tryUnfork(): Boolean

Attributes

Inherited from:
ForkJoinTask
protected def visitAssignments(a: Assignment): Set[String]

Using assignment and import information (in the global symbol table), will propagate these types in the symbol table.

Using assignment and import information (in the global symbol table), will propagate these types in the symbol table.

Attributes

a

assignment call pointer.

Inherited from:
RecoverForXCompilationUnit
protected def visitCall(call: Call): Unit

For each call that contains the returnValue directive, attempt to replace the return value by the dynamic

For each call that contains the returnValue directive, attempt to replace the return value by the dynamic

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitCallAssignedToBlock(c: Call, b: Block): Set[String]

Visits a call operation being assigned to the result of some operation.

Visits a call operation being assigned to the result of some operation.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitCallAssignedToCall(x: Call, y: Call): Set[String]

Visits a call assigned to the return value of a call. This is often when there are operators involved.

Visits a call assigned to the return value of a call. This is often when there are operators involved.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitCallAssignedToIdentifier(c: Call, i: Identifier): Set[String]

Visits a call assigned to an identifier. This is often when there are operators involved.

Visits a call assigned to an identifier. This is often when there are operators involved.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitCallAssignedToLiteral(c: Call, l: Literal): Set[String]

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitCallAssignedToMethodRef(c: Call, m: MethodRef): Set[String]

Handles a call operation assigned to a method/function pointer.

Handles a call operation assigned to a method/function pointer.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitIdentifierAssignedToBlock(i: Identifier, b: Block): Set[String]

Visits an identifier being assigned to the result of some operation.

Visits an identifier being assigned to the result of some operation.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitIdentifierAssignedToCallRetVal(i: Identifier, c: Call): Set[String]

Visits an identifier being assigned to a call's return value.

Visits an identifier being assigned to a call's return value.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitIdentifierAssignedToFieldLoad(i: Identifier, fa: FieldAccess): Set[String]

Will handle an identifier being assigned to a field value.

Will handle an identifier being assigned to a field value.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitIdentifierAssignedToIdentifier(x: Identifier, y: Identifier): Set[String]

Visits an identifier being assigned to the value held by another identifier. This is a weak copy.

Visits an identifier being assigned to the value held by another identifier. This is a weak copy.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitIdentifierAssignedToIndexAcess(i: Identifier, c: Call): Set[String]

Visits an identifier being assigned to the result of an index access operation.

Visits an identifier being assigned to the result of an index access operation.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitIdentifierAssignedToLiteral(i: Identifier, l: Literal): Set[String]

Will handle literal value assignments. Override if special handling is required.

Will handle literal value assignments. Override if special handling is required.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitIdentifierAssignedToMethodRef(i: Identifier, m: MethodRef): Set[String]

Will handle an identifier holding a function pointer.

Will handle an identifier holding a function pointer.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitIdentifierAssignedToOperator(i: Identifier, c: Call, operation: String): Set[String]

Visits an identifier being assigned to an operator call.

Visits an identifier being assigned to an operator call.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitIdentifierAssignedToTypeRef(i: Identifier, t: TypeRef): Set[String]

Will handle an identifier holding a type pointer.

Will handle an identifier holding a type pointer.

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitImport(i: Call): Unit

Refers to the declared import information. This is for legacy import notation.

Refers to the declared import information. This is for legacy import notation.

Attributes

i

the call that imports entities into this scope.

Inherited from:
RecoverForXCompilationUnit
protected def visitImports(procedureDeclarations: Traversal[AstNode]): Unit

Using import information and internally defined procedures, will generate a mapping between how functions and types are aliased and called and themselves.

Using import information and internally defined procedures, will generate a mapping between how functions and types are aliased and called and themselves.

Attributes

procedureDeclarations

imports to types or functions and internally defined methods themselves.

Inherited from:
RecoverForXCompilationUnit
protected def visitParameter(param: MethodParameterIn): Unit

Attributes

Inherited from:
RecoverForXCompilationUnit
protected def visitStatementsInBlock(b: Block): Set[String]

Process each statement but only assign the type of the last statement to the identifier

Process each statement but only assign the type of the last statement to the identifier

Attributes

Inherited from:
RecoverForXCompilationUnit

Inherited fields

protected val logger: Logger

Attributes

Inherited from:
RecoverForXCompilationUnit
protected val symbolTable: SymbolTable[LocalKey]

Stores type information for local structures that live within this compilation unit, e.g. local variables.

Stores type information for local structures that live within this compilation unit, e.g. local variables.

Attributes

Inherited from:
RecoverForXCompilationUnit