/* * This dbscheme is auto-generated by 'semmle/dbscheme_gen.py'. * WARNING: Any modifications to this file will be lost. * Relations can be changed by modifying master.py or * by adding rules to dbscheme.template */ /* * External artifacts */ 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 ); externalData( int id : @externalDataElement, varchar(900) queryPath : string ref, int column: int ref, varchar(900) data : string ref ); snapshotDate(unique date snapshotDate : date ref); sourceLocationPrefix(varchar(900) prefix : string ref); /* * Duplicate code */ 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, int beginLine : int ref, int beginColumn : int ref, int endLine : int ref, int endColumn : int ref); /* * 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); /* * Version history */ svnentries( int id : @svnentry, varchar(500) revision : string ref, varchar(500) author : string ref, 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, int churnedLines : int ref ) /**************************** Python dbscheme ****************************/ /* fromSource(0) = unknown, fromSource(1) = from source, fromSource(2) = from library */ files(unique int id: @file, varchar(900) name: string ref, 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); @sourceline = @file | @py_Module; numlines(int element_id: @sourceline ref, int num_lines: int ref, int num_code: int ref, int num_comment: int ref ); @location = @location_ast | @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); 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); py_module_path(int module: @py_Module ref, int file: @file 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); /* AUTO GENERATED PART STARTS HERE */ /* 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 */ /* Attribute.location = 0, location */ /* Attribute.value = 1, expr */ /* Attribute.attr = 2, str */ /* Attribute.ctx = 3, expr_context */ /* AugAssign.location = 0, location */ /* AugAssign.operation = 1, BinOp */ /* BinaryExpr.location = 0, location */ /* BinaryExpr.left = 1, expr */ /* BinaryExpr.op = 2, operator */ /* BinaryExpr.right = 3, expr */ /* BinaryExpr = AugAssign */ /* BoolExpr.location = 0, location */ /* BoolExpr.op = 1, boolop */ /* BoolExpr.values = 2, expr_list */ /* Break.location = 0, location */ /* Bytes.location = 0, location */ /* Bytes.s = 1, bytes */ /* Call.location = 0, location */ /* Call.func = 1, expr */ /* Call.args = 2, expr_list */ /* Call.keywords = 3, keyword_list */ /* Call.starargs = 4, expr */ /* Call.kwargs = 5, expr */ /* Class.name = 0, str */ /* Class.body = 1, stmt_list */ /* Class = ClassExpr */ /* ClassExpr.location = 0, location */ /* ClassExpr.name = 1, str */ /* ClassExpr.bases = 2, expr_list */ /* ClassExpr.keywords = 3, keyword_list */ /* ClassExpr.starargs = 4, expr */ /* ClassExpr.kwargs = 5, expr */ /* ClassExpr.inner_scope = 6, Class */ /* Compare.location = 0, location */ /* Compare.left = 1, expr */ /* Compare.ops = 2, cmpop_list */ /* Compare.comparators = 3, expr_list */ /* Continue.location = 0, location */ /* Delete.location = 0, location */ /* Delete.targets = 1, expr_list */ /* Dict.location = 0, location */ /* Dict.keys = 1, expr_list */ /* Dict.values = 2, expr_list */ /* DictComp.location = 0, location */ /* DictComp.function = 1, Function */ /* DictComp.iterable = 2, expr */ /* Ellipsis.location = 0, location */ /* 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 */ /* For.location = 0, location */ /* For.target = 1, expr */ /* For.iter = 2, expr */ /* For.body = 3, stmt_list */ /* For.orelse = 4, stmt_list */ /* Function.name = 0, str */ /* Function.args = 1, parameter_list */ /* Function.vararg = 2, expr */ /* Function.kwonlyargs = 3, str_list */ /* Function.kwarg = 4, expr */ /* Function.body = 5, stmt_list */ /* Function = FunctionParent */ /* FunctionExpr.location = 0, location */ /* FunctionExpr.name = 1, str */ /* FunctionExpr.args = 2, arguments */ /* FunctionExpr.returns = 3, expr */ /* FunctionExpr.inner_scope = 4, Function */ /* GeneratorExp.location = 0, location */ /* GeneratorExp.function = 1, Function */ /* GeneratorExp.iterable = 2, expr */ /* Global.location = 0, location */ /* Global.names = 1, str_list */ /* If.location = 0, location */ /* If.test = 1, expr */ /* If.body = 2, stmt_list */ /* If.orelse = 3, stmt_list */ /* IfExp.location = 0, location */ /* IfExp.test = 1, expr */ /* IfExp.body = 2, expr */ /* IfExp.orelse = 3, expr */ /* Import.location = 0, location */ /* Import.names = 1, alias_list */ /* ImportExpr.location = 0, location */ /* ImportExpr.level = 1, int */ /* ImportExpr.name = 2, str */ /* ImportExpr.top = 3, bool */ /* ImportStar.location = 0, location */ /* ImportStar.module = 1, expr */ /* ImportMember.location = 0, location */ /* ImportMember.module = 1, expr */ /* ImportMember.name = 2, str */ /* Lambda.location = 0, location */ /* Lambda.args = 1, arguments */ /* Lambda.inner_scope = 2, Function */ /* List.location = 0, location */ /* List.elts = 1, expr_list */ /* List.ctx = 2, expr_context */ /* ListComp.location = 0, location */ /* ListComp.function = 1, Function */ /* ListComp.iterable = 2, expr */ /* ListComp.generators = 3, comprehension_list */ /* ListComp.elt = 4, expr */ /* Module.name = 0, str */ /* Module.hash = 1, str */ /* Module.body = 2, stmt_list */ /* Module.kind = 3, str */ /* Name.location = 0, location */ /* Name.variable = 1, variable */ /* Name.ctx = 2, expr_context */ /* Name = ParameterList */ /* Nonlocal.location = 0, location */ /* Nonlocal.names = 1, str_list */ /* Num.location = 0, location */ /* Num.n = 1, number */ /* Num.text = 2, number */ /* Pass.location = 0, location */ /* Print.location = 0, location */ /* Print.dest = 1, expr */ /* Print.values = 2, expr_list */ /* Print.nl = 3, bool */ /* Raise.location = 0, location */ /* Raise.exc = 1, expr */ /* Raise.cause = 2, expr */ /* Raise.type = 3, expr */ /* Raise.inst = 4, expr */ /* Raise.tback = 5, expr */ /* Repr.location = 0, location */ /* Repr.value = 1, expr */ /* Return.location = 0, location */ /* Return.value = 1, expr */ /* Set.location = 0, location */ /* Set.elts = 1, expr_list */ /* SetComp.location = 0, location */ /* SetComp.function = 1, Function */ /* SetComp.iterable = 2, expr */ /* Slice.location = 0, location */ /* Slice.start = 1, expr */ /* Slice.stop = 2, expr */ /* Slice.step = 3, expr */ /* Starred.location = 0, location */ /* Starred.value = 1, expr */ /* Starred.ctx = 2, expr_context */ /* Str.location = 0, location */ /* Str.s = 1, str */ /* Subscript.location = 0, location */ /* Subscript.value = 1, expr */ /* Subscript.index = 2, expr */ /* Subscript.ctx = 3, expr_context */ /* Try.location = 0, location */ /* Try.body = 1, stmt_list */ /* Try.orelse = 2, stmt_list */ /* Try.handlers = 3, stmt_list */ /* Try.finalbody = 4, stmt_list */ /* Tuple.location = 0, location */ /* Tuple.elts = 1, expr_list */ /* Tuple.ctx = 2, expr_context */ /* Tuple = ParameterList */ /* UnaryExpr.location = 0, location */ /* UnaryExpr.op = 1, unaryop */ /* UnaryExpr.operand = 2, expr */ /* While.location = 0, location */ /* While.test = 1, expr */ /* While.body = 2, stmt_list */ /* While.orelse = 3, stmt_list */ /* With.location = 0, location */ /* With.context_expr = 1, expr */ /* With.optional_vars = 2, expr */ /* With.body = 3, stmt_list */ /* Yield.location = 0, location */ /* Yield.value = 1, expr */ /* YieldFrom.location = 0, location */ /* YieldFrom.value = 1, expr */ /* Alias.value = 0, expr */ /* Alias.asname = 1, expr */ /* Alias = AliasList */ /* AliasList = Import */ /* Arguments.kw_defaults = 0, expr_list */ /* Arguments.defaults = 1, expr_list */ /* Arguments.annotations = 2, expr_list */ /* Arguments.varargannotation = 3, expr */ /* Arguments.kwargannotation = 4, expr */ /* Arguments = ArgumentsParent */ /* boolean = BoolParent */ /* Boolop = BoolExpr */ /* string = Bytes */ /* Cmpop = CmpopList */ /* CmpopList = Compare */ /* Comprehension.iter = 0, expr */ /* Comprehension.target = 1, expr */ /* Comprehension.ifs = 2, expr_list */ /* Comprehension = ComprehensionList */ /* ComprehensionList = ListComp */ /* Expr.location = 0, location */ /* Expr = ExprParent */ /* ExprContext = ExprContextParent */ /* ExprList = ExprListParent */ /* int = ImportExpr */ /* Keyword.arg = 0, str */ /* Keyword.value = 1, expr */ /* Keyword = KeywordList */ /* KeywordList = KeywordListParent */ /* Location = ExprOrStmt */ /* string = Num */ /* Operator = BinaryExpr */ /* ParameterList = Function */ /* Stmt.location = 0, location */ /* Stmt = StmtList */ /* StmtList = StmtListParent */ /* string = StrParent */ /* StringList = StrListParent */ /* Unaryop = UnaryExpr */ /* Variable = Name */ py_Classes(unique int id : @py_Class, unique int parent : @py_ClassExpr ref); py_Functions(unique int id : @py_Function, int parent : @py_Function_parent ref, int idx : int ref); py_Modules(unique int id : @py_Module); py_aliases(unique int id : @py_alias, int parent : @py_alias_list ref, int idx : int ref); py_alias_lists(unique int id : @py_alias_list, unique int parent : @py_Import ref); py_arguments(unique int id : @py_arguments, int parent : @py_arguments_parent ref, int idx : int ref); py_bools(boolean id : boolean ref, unique int parent : @py_bool_parent ref); py_boolops(unique int id : @py_boolop, int kind: int ref, unique int parent : @py_BoolExpr ref); py_bytes(varchar(1) id : string ref, unique int parent : @py_Bytes ref); py_cmpops(unique int id : @py_cmpop, int kind: int ref, int parent : @py_cmpop_list ref, int idx : int ref); py_cmpop_lists(unique int id : @py_cmpop_list, unique int parent : @py_Compare ref); py_comprehensions(unique int id : @py_comprehension, int parent : @py_comprehension_list ref, int idx : int ref); py_comprehension_lists(unique int id : @py_comprehension_list, unique int parent : @py_ListComp ref); py_exprs(unique int id : @py_expr, int kind: int ref, int parent : @py_expr_parent ref, int idx : int ref); py_expr_contexts(unique int id : @py_expr_context, int kind: int ref, int parent : @py_expr_context_parent ref, int idx : int ref); py_expr_lists(unique int id : @py_expr_list, int parent : @py_expr_list_parent ref, int idx : int ref); py_ints(int id : int ref, unique int parent : @py_ImportExpr ref); py_keywords(unique int id : @py_keyword, int parent : @py_keyword_list ref, int idx : int ref); py_keyword_lists(unique int id : @py_keyword_list, unique int parent : @py_keyword_list_parent ref); py_locations(unique int id : @location ref, unique int parent : @py_expr_or_stmt ref); py_numbers(varchar(1) id : string ref, int parent : @py_Num ref, int idx : int ref); py_operators(unique int id : @py_operator, int kind: int ref, unique int parent : @py_BinaryExpr ref); py_parameter_lists(unique int id : @py_parameter_list, unique int parent : @py_Function ref); py_stmts(unique int id : @py_stmt, int kind: int ref, int parent : @py_stmt_list ref, int idx : int ref); py_stmt_lists(unique int id : @py_stmt_list, int parent : @py_stmt_list_parent ref, int idx : int ref); py_strs(varchar(1) id : string ref, int parent : @py_str_parent ref, int idx : int ref); py_str_lists(unique int id : @py_str_list, int parent : @py_str_list_parent ref, int idx : int ref); py_unaryops(unique int id : @py_unaryop, int kind: int ref, unique int parent : @py_UnaryExpr ref); py_variables(int id : @py_variable ref, unique int parent : @py_Name ref); @py_Function_parent = @py_DictComp | @py_FunctionExpr | @py_GeneratorExp | @py_Lambda | @py_ListComp | @py_SetComp; @py_arguments_parent = @py_FunctionExpr | @py_Lambda; @py_ast_node = @py_Class | @py_Function | @py_Module | @py_expr | @py_stmt; @py_bool_parent = @py_ImportExpr | @py_Print; case @py_boolop.kind of 0 = @py_And | 1 = @py_Or; case @py_cmpop.kind of 0 = @py_Eq | 1 = @py_Gt | 2 = @py_GtE | 3 = @py_In | 4 = @py_Is | 5 = @py_IsNot | 6 = @py_Lt | 7 = @py_LtE | 8 = @py_NotEq | 9 = @py_NotIn; case @py_expr.kind of 0 = @py_Attribute | 1 = @py_BinaryExpr | 2 = @py_BoolExpr | 3 = @py_Bytes | 4 = @py_Call | 5 = @py_ClassExpr | 6 = @py_Compare | 7 = @py_Dict | 8 = @py_DictComp | 9 = @py_Ellipsis | 10 = @py_FunctionExpr | 11 = @py_GeneratorExp | 12 = @py_IfExp | 13 = @py_ImportExpr | 14 = @py_ImportMember | 15 = @py_Lambda | 16 = @py_List | 17 = @py_ListComp | 18 = @py_Name | 19 = @py_Num | 20 = @py_Repr | 21 = @py_Set | 22 = @py_SetComp | 23 = @py_Slice | 24 = @py_Starred | 25 = @py_Str | 26 = @py_Subscript | 27 = @py_Tuple | 28 = @py_UnaryExpr | 29 = @py_Yield | 30 = @py_YieldFrom; case @py_expr_context.kind of 0 = @py_AugLoad | 1 = @py_AugStore | 2 = @py_Del | 3 = @py_Load | 4 = @py_Param | 5 = @py_Store; @py_expr_context_parent = @py_Attribute | @py_List | @py_Name | @py_Starred | @py_Subscript | @py_Tuple; @py_expr_list_parent = @py_Assign | @py_BoolExpr | @py_Call | @py_ClassExpr | @py_Compare | @py_Delete | @py_Dict | @py_List | @py_Print | @py_Set | @py_Tuple | @py_arguments | @py_comprehension; @py_expr_or_stmt = @py_expr | @py_stmt; @py_expr_parent = @py_Assert | @py_Assign | @py_Attribute | @py_AugAssign | @py_BinaryExpr | @py_Call | @py_ClassExpr | @py_Compare | @py_DictComp | @py_ExceptStmt | @py_Exec | @py_Expr_stmt | @py_For | @py_Function | @py_FunctionExpr | @py_GeneratorExp | @py_If | @py_IfExp | @py_ImportMember | @py_ImportStar | @py_ListComp | @py_Print | @py_Raise | @py_Repr | @py_Return | @py_SetComp | @py_Slice | @py_Starred | @py_Subscript | @py_UnaryExpr | @py_While | @py_With | @py_Yield | @py_YieldFrom | @py_alias | @py_arguments | @py_comprehension | @py_expr_list | @py_keyword | @py_parameter_list; @py_keyword_list_parent = @py_Call | @py_ClassExpr; case @py_operator.kind of 0 = @py_Add | 1 = @py_BitAnd | 2 = @py_BitOr | 3 = @py_BitXor | 4 = @py_Div | 5 = @py_FloorDiv | 6 = @py_LShift | 7 = @py_Mod | 8 = @py_Mult | 9 = @py_Pow | 10 = @py_RShift | 11 = @py_Sub; @py_parameter = @py_Name | @py_Tuple; @py_scope = @py_Class | @py_Function | @py_Module; case @py_stmt.kind of 0 = @py_Assert | 1 = @py_Assign | 2 = @py_AugAssign | 3 = @py_Break | 4 = @py_Continue | 5 = @py_Delete | 6 = @py_ExceptStmt | 7 = @py_Exec | 8 = @py_Expr_stmt | 9 = @py_For | 10 = @py_Global | 11 = @py_If | 12 = @py_Import | 13 = @py_ImportStar | 14 = @py_Nonlocal | 15 = @py_Pass | 16 = @py_Print | 17 = @py_Raise | 18 = @py_Return | 19 = @py_Try | 20 = @py_While | 21 = @py_With; @py_stmt_list_parent = @py_Class | @py_ExceptStmt | @py_For | @py_Function | @py_If | @py_Module | @py_Try | @py_While | @py_With; @py_str_list_parent = @py_Function | @py_Global | @py_Nonlocal; @py_str_parent = @py_Attribute | @py_Class | @py_ClassExpr | @py_Function | @py_FunctionExpr | @py_ImportExpr | @py_ImportMember | @py_Module | @py_Str | @py_keyword | @py_str_list; case @py_unaryop.kind of 0 = @py_Invert | 1 = @py_Not | 2 = @py_UAdd | 3 = @py_USub; /* * End of auto-generated part */ /* Map relative names to absolute names for imports */ py_absolute_names(int module : @py_Module ref, varchar(1) relname : string ref, varchar(1) absname : string ref); py_exports(int id : @py_Module ref, varchar(1) name : string ref); /* Successor information */ py_successors(int predecessor : @py_flow_node ref, int successor : @py_flow_node ref); py_true_successors(int predecessor : @py_flow_node ref, int successor : @py_flow_node ref); py_exception_successors(int predecessor : @py_flow_node ref, int successor : @py_flow_node ref); py_false_successors(int predecessor : @py_flow_node ref, int successor : @py_flow_node ref); py_flow_bb_node(unique int flownode : @py_flow_node, int realnode : @py_ast_node ref, int basicblock : @py_flow_node ref, int index : int ref); py_scope_flow(int flow : @py_flow_node ref, int scope : @py_scope ref, int kind : int ref); py_idoms(unique int node : @py_flow_node ref, int immediate_dominator : @py_flow_node ref); py_ssa_phi(int phi : @py_ssa_var ref, int arg: @py_ssa_var ref); py_ssa_var(unique int id : @py_ssa_var, int var : @py_variable ref); py_ssa_use(int node: @py_flow_node ref, int var : @py_ssa_var ref); py_ssa_defn(unique int id : @py_ssa_var ref, int node: @py_flow_node ref); @py_base_var = @py_variable | @py_ssa_var; py_scopes(unique int node : @py_expr_or_stmt ref, int scope : @py_scope ref); py_scope_location(unique int id : @location ref, unique int scope : @py_scope ref); py_flags(unique varchar(1) name : string ref, varchar(1) value : string ref); py_syntax_error(unique int id : @location ref, varchar(1) message : string ref); py_comments(unique int id : @py_comment, varchar(1) text : string ref, unique int location : @location ref); /* Type information support */ py_cobjects(unique int obj : @py_cobject, int typeof : @py_cobject ref); py_cmembers(int object : @py_cobject ref, varchar(1) name : string ref, int member : @py_cobject ref); py_citems(int object : @py_cobject ref, int index : int ref, int member : @py_cobject ref); py_cobjectnames(unique int obj : @py_cobject ref, varchar(1) name : string ref); py_special_objects(unique int obj : @py_cobject ref, unique varchar(1) name : string ref); py_decorated_object(int object : @py_object ref, int level: int ref); @py_object = @py_cobject | @py_flow_node; @py_source_element = @py_ast_node | @container; /* XML Files */ xmlEncoding (unique int id: @file ref, varchar(900) encoding: string ref); xmlDTDs (unique int id: @xmldtd, varchar(900) root: string ref, varchar(900) publicId: string ref, varchar(900) systemId: string ref, int fileid: @file ref); xmlElements (unique int id: @xmlelement, varchar(900) name: string ref, int parentid: @xmlparent ref, int idx: int ref, int fileid: @file ref); xmlAttrs (unique int id: @xmlattribute, int elementid: @xmlelement ref, varchar(900) name: string ref, varchar(3600) value: string ref, int idx: int ref, int fileid: @file ref); xmlNs (int id: @xmlnamespace, varchar(900) prefixName: string ref, varchar(900) 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, varchar(3600) text: string ref, int parentid: @xmlparent ref, int fileid: @file ref); xmlChars (unique int id: @xmlcharacters, varchar(3600) 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;