Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 84 additions & 28 deletions javascript/ql/src/semmlecode.javascript.dbscheme
Original file line number Diff line number Diff line change
@@ -1,26 +1,82 @@
/*** Standard fragments ***/
/**
* Dynamic
*/

// CPU Profiles

profile_nodes(
unique int id: @profile_node,
string fnName: string ref,
string scriptId: string ref,
string file: string ref,
int lineNumber: int ref,
int columnNumber: int ref,
int hitCount: int ref
)

profile_node_children(
int parent: @profile_node ref,
int child: @profile_node ref
)

#keyset[node, line]
position_ticks(
int node: @profile_node ref,
int line: int ref,
int ticks: int ref
)

samples(
int number: int ref,
int node: @profile_node ref,
int delta: int ref
)

// Memory Profiles

mem_profile_nodes(
unique int id: @mem_profile_node,
string fnName: string ref,
string scriptId: string ref,
string file: string ref,
int lineNumber: int ref,
int columnNumber: int ref,
int selfSize: int ref
)

mem_node_children(
int parent: @mem_profile_node ref,
int child: @mem_profile_node ref
)

mem_profile_sample(
unique int id: @mem_profile_sample,
int size: int ref,
int node: @mem_profile_node ref,
int ordinal: int ref
)

/** Files and folders **/

@location = @location_default;

locations_default(unique int id: @location_default,
int file: @file ref,
int beginLine: int ref,
int beginColumn: int ref,
int endLine: int ref,
int endColumn: int ref
);

@sourceline = @locatable;

numlines(int element_id: @sourceline ref,
int num_lines: int ref,
int num_code: int ref,
int num_comment: int ref
);


/*
fromSource(0) = unknown,
fromSource(1) = from source,
Expand All @@ -31,15 +87,15 @@ files(unique int id: @file,
varchar(900) simple: string ref,
varchar(900) ext: string ref,
int fromSource: int ref);

folders(unique int id: @folder,
varchar(900) name: string ref,
varchar(900) simple: string ref);


@container = @folder | @file ;


containerparent(int parent: @container ref,
unique int child: @container ref);

Expand All @@ -49,14 +105,14 @@ duplicateCode(
unique int id : @duplication,
varchar(900) relativePath : string ref,
int equivClass : int ref);

similarCode(
unique int id : @similarity,
varchar(900) relativePath : string ref,
int equivClass : int ref);

@duplication_or_similarity = @duplication | @similarity;

tokens(
int id : @duplication_or_similarity ref,
int offset : int ref,
Expand All @@ -73,9 +129,9 @@ externalData(
int column: int ref,
varchar(900) value : string ref
);

snapshotDate(unique date snapshotDate : date ref);

sourceLocationPrefix(varchar(900) prefix : string ref);

/** Version control data **/
Expand All @@ -87,18 +143,18 @@ svnentries(
date revisionDate : date ref,
int changeSize : int ref
);

svnaffectedfiles(
int id : @svnentry ref,
int file : @file ref,
varchar(500) action : string ref
);

svnentrymsg(
int id : @svnentry ref,
varchar(500) message : string ref
);

svnchurn(
int commit : @svnentry ref,
int file : @file ref,
Expand Down Expand Up @@ -144,15 +200,15 @@ xml_element_parent_expression(

// statements
#keyset[parent, idx]
stmts (unique int id: @stmt,
stmts (unique int id: @stmt,
int kind: int ref,
int parent: @stmt_parent ref,
int parent: @stmt_parent ref,
int idx: int ref,
varchar(900) tostring: string ref);

stmt_containers (unique int stmt: @stmt ref,
int container: @stmt_container ref);

jump_targets (unique int jump: @stmt ref,
int target: @stmt ref);

Expand Down Expand Up @@ -227,7 +283,7 @@ exprs (unique int id: @expr,
literals (varchar(900) value: string ref,
varchar(900) raw: string ref,
unique int expr: @expr_or_type ref);

enclosing_stmt (unique int expr: @expr_or_type ref,
int stmt: @stmt ref);

Expand Down Expand Up @@ -441,7 +497,7 @@ case @scope.kind of

scopenodes (unique int node: @ast_node ref,
int scope: @scope ref);

scopenesting (unique int inner: @scope ref,
int outer: @scope ref);

Expand Down Expand Up @@ -662,7 +718,7 @@ has_asserts_keyword(int node: @predicate_typeexpr ref);

@typed_ast_node = @expr | @typeexpr | @function;
ast_node_type(
unique int node: @typed_ast_node ref,
unique int node: @typed_ast_node ref,
int typ: @type ref);

declared_function_signature(
Expand Down Expand Up @@ -841,15 +897,15 @@ js_parse_errors (unique int id: @js_parse_error,
int toplevel: @toplevel ref,
varchar(900) message: string ref,
varchar(900) line: string ref);

// regular expressions
#keyset[parent, idx]
regexpterm (unique int id: @regexpterm,
int kind: int ref,
int parent: @regexpparent ref,
int idx: int ref,
varchar(900) tostring: string ref);

@regexpparent = @regexpterm | @regexp_literal | @string_literal;

case @regexpterm.kind of
Expand Down Expand Up @@ -967,7 +1023,7 @@ case @json_value.kind of
// locations
@ast_node = @toplevel | @stmt | @expr | @property | @typeexpr;

@locatable = @file
@locatable = @file
| @ast_node
| @comment
| @line
Expand Down