From bf232f05827222226e32232884281acafef97339 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Mon, 21 Dec 2020 10:39:11 +0100 Subject: [PATCH 1/2] Update formatting for CodeQL 2.4.1 --- .../controlflow/internal/ControlFlowGraphImpl.qll | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll b/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll index f9a1716b212..1b446dcf145 100644 --- a/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll +++ b/ql/src/codeql_ruby/controlflow/internal/ControlFlowGraphImpl.qll @@ -1067,9 +1067,8 @@ module Trees { // completion from the body c = any(NestedEnsureCompletion nec | - this - .lastEnsure(last, nec.getAnInnerCompatibleCompletion(), nec.getOuterCompletion(), - nec.getNestLevel()) + this.lastEnsure(last, nec.getAnInnerCompatibleCompletion(), nec.getOuterCompletion(), + nec.getNestLevel()) ) or not exists(this.getBodyChild(_, _)) and From d4874641a32577c0fc268cb681f0780bde4ff15d Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Mon, 21 Dec 2020 10:36:34 +0100 Subject: [PATCH 2/2] Revert "Add duplicate code tables to dbscheme" This reverts commit 4c699fcb32c7751eb290e9f6c7c7305f810f0fbe. --- generator/src/main.rs | 132 ------------------------------------------ ql/src/ruby.dbscheme | 23 -------- 2 files changed, 155 deletions(-) diff --git a/generator/src/main.rs b/generator/src/main.rs index c79a2397e9a..c9a59dbb871 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -275,141 +275,9 @@ fn convert_nodes<'a>(nodes: &'a node_types::NodeTypeMap) -> Vec Vec> { - vec![ - // duplicateCode( - // unique int id: @duplication, - // string relativePath: string ref, - // int equivClass: int ref); - dbscheme::Entry::Table(dbscheme::Table { - name: "duplicateCode", - keysets: None, - columns: vec![ - dbscheme::Column { - db_type: dbscheme::DbColumnType::Int, - name: "id", - unique: true, - ql_type: ql::Type::AtType("duplication"), - ql_type_is_ref: false, - }, - dbscheme::Column { - db_type: dbscheme::DbColumnType::String, - name: "relativePath", - unique: false, - ql_type: ql::Type::String, - ql_type_is_ref: true, - }, - dbscheme::Column { - db_type: dbscheme::DbColumnType::Int, - name: "equivClass", - unique: false, - ql_type: ql::Type::Int, - ql_type_is_ref: true, - }, - ], - }), - // similarCode( - // unique int id: @similarity, - // string relativePath: string ref, - // int equivClass: int ref); - dbscheme::Entry::Table(dbscheme::Table { - name: "similarCode", - keysets: None, - columns: vec![ - dbscheme::Column { - db_type: dbscheme::DbColumnType::Int, - name: "id", - unique: true, - ql_type: ql::Type::AtType("similarity"), - ql_type_is_ref: false, - }, - dbscheme::Column { - db_type: dbscheme::DbColumnType::String, - name: "relativePath", - unique: false, - ql_type: ql::Type::String, - ql_type_is_ref: true, - }, - dbscheme::Column { - db_type: dbscheme::DbColumnType::Int, - name: "equivClass", - unique: false, - ql_type: ql::Type::Int, - ql_type_is_ref: true, - }, - ], - }), - // @duplication_or_similarity = @duplication | @similarity - dbscheme::Entry::Union(dbscheme::Union { - name: "duplication_or_similarity", - members: ["duplication", "similarity"].iter().cloned().collect(), - }), - // 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); - dbscheme::Entry::Table(dbscheme::Table { - name: "tokens", - keysets: None, - columns: vec![ - dbscheme::Column { - db_type: dbscheme::DbColumnType::Int, - name: "id", - unique: false, - ql_type: ql::Type::AtType("duplication_or_similarity"), - ql_type_is_ref: true, - }, - dbscheme::Column { - db_type: dbscheme::DbColumnType::Int, - name: "offset", - unique: false, - ql_type: ql::Type::Int, - ql_type_is_ref: true, - }, - dbscheme::Column { - db_type: dbscheme::DbColumnType::Int, - name: "beginLine", - unique: false, - ql_type: ql::Type::Int, - ql_type_is_ref: true, - }, - dbscheme::Column { - db_type: dbscheme::DbColumnType::Int, - name: "beginColumn", - unique: false, - ql_type: ql::Type::Int, - ql_type_is_ref: true, - }, - dbscheme::Column { - db_type: dbscheme::DbColumnType::Int, - name: "endLine", - unique: false, - ql_type: ql::Type::Int, - ql_type_is_ref: true, - }, - dbscheme::Column { - db_type: dbscheme::DbColumnType::Int, - name: "endColumn", - unique: false, - ql_type: ql::Type::Int, - ql_type_is_ref: true, - }, - ], - }), - ] -} - fn create_tokeninfo<'a>( token_kinds: Map<&'a str, usize>, ) -> (dbscheme::Case<'a>, dbscheme::Table<'a>) { diff --git a/ql/src/ruby.dbscheme b/ql/src/ruby.dbscheme index 26fccce8280..bc791968207 100644 --- a/ql/src/ruby.dbscheme +++ b/ql/src/ruby.dbscheme @@ -1483,26 +1483,3 @@ case @token.kind of @ast_node_parent = @ast_node | @file -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 -); -