/*
* This dbscheme is auto-generated by 'semmle/dbscheme_gen.py'.
* Run "make dbscheme" in python/extractor/ to regenerate.
* WARNING: Any modifications to this file will be lost.
* Relations can be changed by modifying master.py or
* by adding rules to dbscheme.template
*/
/* This is a dummy line to alter the dbscheme, so we can make a database upgrade
* without actually changing any of the dbscheme predicates. It contains a date
* to allow for such updates in the future as well.
*
* 2020-07-02
*
* DO NOT remove this comment carelessly, since it can revert the dbscheme back to a
* previously seen state (matching a previously seen SHA), which would make the upgrade
* mechanism not work properly.
*/
/*- DEPRECATED: External defects and metrics -*/
externalDefects(
unique int id : @externalDefect,
varchar(900) queryPath : string ref,
int location : @location ref,
varchar(900) message : string ref,
float severity : float ref
);
externalMetrics(
unique int id : @externalMetric,
varchar(900) queryPath : string ref,
int location : @location ref,
float value : float ref
);
/*- External data -*/
/**
* External data, loaded from CSV files during snapshot creation. See
* [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data)
* for more information.
*/
externalData(
int id : @externalDataElement,
string path : string ref,
int column: int ref,
string value : string ref
);
/*- Database metadata -*/
/**
* The CLI will automatically emit applicable tuples for this table,
* such as `databaseMetadata("isOverlay", "true")` when building an
* overlay database.
*/
databaseMetadata(
string metadataKey: string ref,
string value: string ref
);
/*- Overlay support -*/
/**
* The CLI will automatically emit tuples for each new/modified/deleted file
* when building an overlay database.
*/
overlayChangedFiles(
string path: string ref
);
/*- DEPRECATED: Snapshot date -*/
snapshotDate(unique date snapshotDate : date ref);
/*- Source location prefix -*/
/**
* The source location of the snapshot.
*/
sourceLocationPrefix(string prefix : string ref);
/*- DEPRECATED: Duplicate code -*/
duplicateCode(
unique int id : @duplication,
string relativePath : string ref,
int equivClass : int ref
);
similarCode(
unique int id : @similarity,
string relativePath : string ref,
int equivClass : int ref
);
@duplication_or_similarity = @duplication | @similarity
tokens(
int id : @duplication_or_similarity ref,
int offset : int ref,
int beginLine : int ref,
int beginColumn : int ref,
int endLine : int ref,
int endColumn : int ref
);
/*- DEPRECATED: Version control data -*/
svnentries(
unique int id : @svnentry,
string revision : string ref,
string author : string ref,
date revisionDate : date ref,
int changeSize : int ref
)
svnaffectedfiles(
int id : @svnentry ref,
int file : @file ref,
string action : string ref
)
svnentrymsg(
unique int id : @svnentry ref,
string message : string ref
)
svnchurn(
int commit : @svnentry ref,
int file : @file ref,
int addedLines : int ref,
int deletedLines : int ref
)
/*- Lines of code -*/
numlines(
int element_id: @sourceline ref,
int num_lines: int ref,
int num_code: int ref,
int num_comment: int ref
);
/*- Files and folders -*/
/**
* The location of an element.
* The location spans column `startcolumn` of line `startline` to
* column `endcolumn` of line `endline` in file `file`.
* For more information, see
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
*/
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
);
files(
unique int id: @file,
string name: string ref
);
folders(
unique int id: @folder,
string name: string ref
);
@container = @file | @folder
containerparent(
int parent: @container ref,
unique int child: @container ref
);
/*- XML Files -*/
xmlEncoding(
unique int id: @file ref,
string encoding: string ref
);
xmlDTDs(
unique int id: @xmldtd,
string root: string ref,
string publicId: string ref,
string systemId: string ref,
int fileid: @file ref
);
xmlElements(
unique int id: @xmlelement,
string name: string ref,
int parentid: @xmlparent ref,
int idx: int ref,
int fileid: @file ref
);
xmlAttrs(
unique int id: @xmlattribute,
int elementid: @xmlelement ref,
string name: string ref,
string value: string ref,
int idx: int ref,
int fileid: @file ref
);
xmlNs(
int id: @xmlnamespace,
string prefixName: string ref,
string URI: string ref,
int fileid: @file ref
);
xmlHasNs(
int elementId: @xmlnamespaceable ref,
int nsId: @xmlnamespace ref,
int fileid: @file ref
);
xmlComments(
unique int id: @xmlcomment,
string text: string ref,
int parentid: @xmlparent ref,
int fileid: @file ref
);
xmlChars(
unique int id: @xmlcharacters,
string text: string ref,
int parentid: @xmlparent ref,
int idx: int ref,
int isCDATA: int ref,
int fileid: @file ref
);
@xmlparent = @file | @xmlelement;
@xmlnamespaceable = @xmlelement | @xmlattribute;
xmllocations(
int xmlElement: @xmllocatable ref,
int location: @location_default ref
);
@xmllocatable = @xmlcharacters | @xmlelement | @xmlcomment | @xmlattribute | @xmldtd | @file | @xmlnamespace;
/*- YAML -*/
#keyset[parent, idx]
yaml (unique int id: @yaml_node,
int kind: int ref,
int parent: @yaml_node_parent ref,
int idx: int ref,
string tag: string ref,
string tostring: string ref);
case @yaml_node.kind of
0 = @yaml_scalar_node
| 1 = @yaml_mapping_node
| 2 = @yaml_sequence_node
| 3 = @yaml_alias_node
;
@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node;
@yaml_node_parent = @yaml_collection_node | @file;
yaml_anchors (unique int node: @yaml_node ref,
string anchor: string ref);
yaml_aliases (unique int alias: @yaml_alias_node ref,
string target: string ref);
yaml_scalars (unique int scalar: @yaml_scalar_node ref,
int style: int ref,
string value: string ref);
yaml_comments (unique int id: @yaml_comment,
string text: string ref,
string tostring: string ref);
yaml_errors (unique int id: @yaml_error,
string message: string ref);
yaml_locations(unique int locatable: @yaml_locatable ref,
int location: @location_default ref);
@yaml_locatable = @yaml_node | @yaml_error | @yaml_comment;
/*- Python dbscheme -*/
/*
* Line metrics
*/
py_codelines(int id : @py_scope ref,
int count : int ref);
py_commentlines(int id : @py_scope ref,
int count : int ref);
py_docstringlines(int id : @py_scope ref,
int count : int ref);
py_alllines(int id : @py_scope ref,
int count : int ref);
/****************************
Python dbscheme
****************************/
@sourceline = @file | @py_Module | @xmllocatable;
@location = @location_ast | @location_default ;
locations_ast(unique int id: @location_ast,
int module: @py_Module ref,
int beginLine: int ref,
int beginColumn: int ref,
int endLine: int ref,
int endColumn: int ref);
file_contents(unique int file: @file ref, string contents: string ref);
py_module_path(int module: @py_Module ref, int file: @container ref);
variable(unique int id : @py_variable,
int scope : @py_scope ref,
varchar(1) name : string ref);
py_line_lengths(unique int id : @py_line,
int file: @py_Module ref,
int line : int ref,
int length : int ref);
py_extracted_version(int module : @py_Module ref,
varchar(1) version : string ref);
/* AUTO GENERATED PART STARTS HERE */
/* AnnAssign.location = 0, location */
/* AnnAssign.value = 1, expr */
/* AnnAssign.annotation = 2, expr */
/* AnnAssign.target = 3, expr */
/* Assert.location = 0, location */
/* Assert.test = 1, expr */
/* Assert.msg = 2, expr */
/* Assign.location = 0, location */
/* Assign.value = 1, expr */
/* Assign.targets = 2, expr_list */
/* AssignExpr.location = 0, location */
/* AssignExpr.parenthesised = 1, bool */
/* AssignExpr.value = 2, expr */
/* AssignExpr.target = 3, expr */
/* Attribute.location = 0, location */
/* Attribute.parenthesised = 1, bool */
/* Attribute.value = 2, expr */
/* Attribute.attr = 3, str */
/* Attribute.ctx = 4, expr_context */
/* AugAssign.location = 0, location */
/* AugAssign.operation = 1, BinOp */
/* Await.location = 0, location */
/* Await.parenthesised = 1, bool */
/* Await.value = 2, expr */
/* BinaryExpr.location = 0, location */
/* BinaryExpr.parenthesised = 1, bool */
/* BinaryExpr.left = 2, expr */
/* BinaryExpr.op = 3, operator */
/* BinaryExpr.right = 4, expr */
/* BinaryExpr = AugAssign */
/* BoolExpr.location = 0, location */
/* BoolExpr.parenthesised = 1, bool */
/* BoolExpr.op = 2, boolop */
/* BoolExpr.values = 3, expr_list */
/* Break.location = 0, location */
/* Bytes.location = 0, location */
/* Bytes.parenthesised = 1, bool */
/* Bytes.s = 2, bytes */
/* Bytes.prefix = 3, bytes */
/* Bytes.implicitly_concatenated_parts = 4, StringPart_list */
/* Call.location = 0, location */
/* Call.parenthesised = 1, bool */
/* Call.func = 2, expr */
/* Call.positional_args = 3, expr_list */
/* Call.named_args = 4, dict_item_list */
/* Case.location = 0, location */
/* Case.pattern = 1, pattern */
/* Case.guard = 2, expr */
/* Case.body = 3, stmt_list */
/* Class.name = 0, str */
/* Class.body = 1, stmt_list */
/* Class = ClassExpr */
/* ClassExpr.location = 0, location */
/* ClassExpr.parenthesised = 1, bool */
/* ClassExpr.name = 2, str */
/* ClassExpr.bases = 3, expr_list */
/* ClassExpr.keywords = 4, dict_item_list */
/* ClassExpr.inner_scope = 5, Class */
/* ClassExpr.type_parameters = 6, type_parameter_list */
/* Compare.location = 0, location */
/* Compare.parenthesised = 1, bool */
/* Compare.left = 2, expr */
/* Compare.ops = 3, cmpop_list */
/* Compare.comparators = 4, expr_list */
/* Continue.location = 0, location */
/* Delete.location = 0, location */
/* Delete.targets = 1, expr_list */
/* Dict.location = 0, location */
/* Dict.parenthesised = 1, bool */
/* Dict.items = 2, dict_item_list */
/* DictComp.location = 0, location */
/* DictComp.parenthesised = 1, bool */
/* DictComp.function = 2, Function */
/* DictComp.iterable = 3, expr */
/* DictUnpacking.location = 0, location */
/* DictUnpacking.value = 1, expr */
/* Ellipsis.location = 0, location */
/* Ellipsis.parenthesised = 1, bool */
/* ExceptGroupStmt.location = 0, location */
/* ExceptGroupStmt.type = 1, expr */
/* ExceptGroupStmt.name = 2, expr */
/* ExceptGroupStmt.body = 3, stmt_list */
/* ExceptStmt.location = 0, location */
/* ExceptStmt.type = 1, expr */
/* ExceptStmt.name = 2, expr */
/* ExceptStmt.body = 3, stmt_list */
/* Exec.location = 0, location */
/* Exec.body = 1, expr */
/* Exec.globals = 2, expr */
/* Exec.locals = 3, expr */
/* ExprStmt.location = 0, location */
/* ExprStmt.value = 1, expr */
/* Filter.location = 0, location */
/* Filter.parenthesised = 1, bool */
/* Filter.value = 2, expr */
/* Filter.filter = 3, expr */
/* For.location = 0, location */
/* For.target = 1, expr */
/* For.iter = 2, expr */
/* For.body = 3, stmt_list */
/* For.orelse = 4, stmt_list */
/* For.is_async = 5, bool */
/* FormattedValue.location = 0, location */
/* FormattedValue.parenthesised = 1, bool */
/* FormattedValue.value = 2, expr */
/* FormattedValue.conversion = 3, str */
/* FormattedValue.format_spec = 4, JoinedStr */
/* Function.name = 0, str */
/* Function.args = 1, parameter_list */
/* Function.vararg = 2, expr */
/* Function.kwonlyargs = 3, expr_list */
/* Function.kwarg = 4, expr */
/* Function.body = 5, stmt_list */
/* Function.is_async = 6, bool */
/* Function.type_parameters = 7, type_parameter_list */
/* Function = FunctionParent */
/* FunctionExpr.location = 0, location */
/* FunctionExpr.parenthesised = 1, bool */
/* FunctionExpr.name = 2, str */
/* FunctionExpr.args = 3, arguments */
/* FunctionExpr.returns = 4, expr */
/* FunctionExpr.inner_scope = 5, Function */
/* GeneratorExp.location = 0, location */
/* GeneratorExp.parenthesised = 1, bool */
/* GeneratorExp.function = 2, Function */
/* GeneratorExp.iterable = 3, expr */
/* Global.location = 0, location */
/* Global.names = 1, str_list */
/* Guard.location = 0, location */
/* Guard.parenthesised = 1, bool */
/* Guard.test = 2, expr */
/* If.location = 0, location */
/* If.test = 1, expr */
/* If.body = 2, stmt_list */
/* If.orelse = 3, stmt_list */
/* IfExp.location = 0, location */
/* IfExp.parenthesised = 1, bool */
/* IfExp.test = 2, expr */
/* IfExp.body = 3, expr */
/* IfExp.orelse = 4, expr */
/* Import.location = 0, location */
/* Import.names = 1, alias_list */
/* Import.is_lazy = 2, bool */
/* ImportExpr.location = 0, location */
/* ImportExpr.parenthesised = 1, bool */
/* ImportExpr.level = 2, int */
/* ImportExpr.name = 3, str */
/* ImportExpr.top = 4, bool */
/* ImportStar.location = 0, location */
/* ImportStar.module = 1, expr */
/* ImportStar.is_lazy = 2, bool */
/* ImportMember.location = 0, location */
/* ImportMember.parenthesised = 1, bool */
/* ImportMember.module = 2, expr */
/* ImportMember.name = 3, str */
/* Fstring.location = 0, location */
/* Fstring.parenthesised = 1, bool */
/* Fstring.values = 2, expr_list */
/* Fstring = FormattedValue */
/* JoinedTemplateString.location = 0, location */
/* JoinedTemplateString.parenthesised = 1, bool */
/* JoinedTemplateString.strings = 2, TemplateString_list */
/* KeyValuePair.location = 0, location */
/* KeyValuePair.value = 1, expr */
/* KeyValuePair.key = 2, expr */
/* Lambda.location = 0, location */
/* Lambda.parenthesised = 1, bool */
/* Lambda.args = 2, arguments */
/* Lambda.inner_scope = 3, Function */
/* List.location = 0, location */
/* List.parenthesised = 1, bool */
/* List.elts = 2, expr_list */
/* List.ctx = 3, expr_context */
/* ListComp.location = 0, location */
/* ListComp.parenthesised = 1, bool */
/* ListComp.function = 2, Function */
/* ListComp.iterable = 3, expr */
/* ListComp.generators = 4, comprehension_list */
/* ListComp.elt = 5, expr */
/* MatchStmt.location = 0, location */
/* MatchStmt.subject = 1, expr */
/* MatchStmt.cases = 2, stmt_list */
/* MatchAsPattern.location = 0, location */
/* MatchAsPattern.parenthesised = 1, bool */
/* MatchAsPattern.pattern = 2, pattern */
/* MatchAsPattern.alias = 3, expr */
/* MatchCapturePattern.location = 0, location */
/* MatchCapturePattern.parenthesised = 1, bool */
/* MatchCapturePattern.variable = 2, expr */
/* MatchClassPattern.location = 0, location */
/* MatchClassPattern.parenthesised = 1, bool */
/* MatchClassPattern.class = 2, expr */
/* MatchClassPattern.class_name = 3, expr */
/* MatchClassPattern.positional = 4, pattern_list */
/* MatchClassPattern.keyword = 5, pattern_list */
/* MatchDoubleStarPattern.location = 0, location */
/* MatchDoubleStarPattern.parenthesised = 1, bool */
/* MatchDoubleStarPattern.target = 2, pattern */
/* MatchKeyValuePattern.location = 0, location */
/* MatchKeyValuePattern.parenthesised = 1, bool */
/* MatchKeyValuePattern.key = 2, pattern */
/* MatchKeyValuePattern.value = 3, pattern */
/* MatchKeywordPattern.location = 0, location */
/* MatchKeywordPattern.parenthesised = 1, bool */
/* MatchKeywordPattern.attribute = 2, expr */
/* MatchKeywordPattern.value = 3, pattern */
/* MatchLiteralPattern.location = 0, location */
/* MatchLiteralPattern.parenthesised = 1, bool */
/* MatchLiteralPattern.literal = 2, expr */
/* MatchMappingPattern.location = 0, location */
/* MatchMappingPattern.parenthesised = 1, bool */
/* MatchMappingPattern.mappings = 2, pattern_list */
/* MatchOrPattern.location = 0, location */
/* MatchOrPattern.parenthesised = 1, bool */
/* MatchOrPattern.patterns = 2, pattern_list */
/* MatchSequencePattern.location = 0, location */
/* MatchSequencePattern.parenthesised = 1, bool */
/* MatchSequencePattern.patterns = 2, pattern_list */
/* MatchStarPattern.location = 0, location */
/* MatchStarPattern.parenthesised = 1, bool */
/* MatchStarPattern.target = 2, pattern */
/* MatchValuePattern.location = 0, location */
/* MatchValuePattern.parenthesised = 1, bool */
/* MatchValuePattern.value = 2, expr */
/* MatchWildcardPattern.location = 0, location */
/* MatchWildcardPattern.parenthesised = 1, bool */
/* Module.name = 0, str */
/* Module.hash = 1, str */
/* Module.body = 2, stmt_list */
/* Module.kind = 3, str */
/* Name.location = 0, location */
/* Name.parenthesised = 1, bool */
/* Name.variable = 2, variable */
/* Name.ctx = 3, expr_context */
/* Name = ParameterList */
/* Nonlocal.location = 0, location */
/* Nonlocal.names = 1, str_list */
/* Num.location = 0, location */
/* Num.parenthesised = 1, bool */
/* Num.n = 2, number */
/* Num.text = 3, number */
/* ParamSpec.location = 0, location */
/* ParamSpec.name = 1, expr */
/* ParamSpec.default = 2, expr */
/* Pass.location = 0, location */
/* PlaceHolder.location = 0, location */
/* PlaceHolder.parenthesised = 1, bool */
/* PlaceHolder.variable = 2, variable */
/* PlaceHolder.ctx = 3, expr_context */
/* Print.location = 0, location */
/* Print.dest = 1, expr */
/* Print.values = 2, expr_list */
/*