Skip to content

Commit 2b6d57d

Browse files
authored
Merge pull request #7982 from jketema/remove-legacy-relations
2 parents 9b4dbb9 + 7f4913d commit 2b6d57d

File tree

12 files changed

+8488
-2774
lines changed

12 files changed

+8488
-2774
lines changed

cpp/downgrades/7455933b9d8832b7c385cfca8cf43bddc25b6d0f/old.dbscheme

Lines changed: 2082 additions & 0 deletions
Large diffs are not rendered by default.

cpp/downgrades/7455933b9d8832b7c385cfca8cf43bddc25b6d0f/semmlecode.cpp.dbscheme

Lines changed: 2136 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
description: Remove unused legacy relations.
2+
compatibility: backwards
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: deprecated
3+
---
4+
* The `ExternalArtifact.ExternalData` class has been deprecated.

cpp/ql/lib/external/ExternalArtifact.qll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@
44

55
import cpp
66

7+
private newtype TExternalDataElement = MKExternalDataElement()
8+
79
/**
10+
* DEPRECATED: This class is no longer used.
11+
*
812
* An external data item.
913
*/
10-
class ExternalData extends @externalDataElement {
14+
class ExternalData extends TExternalDataElement {
1115
/** Gets the path of the file this data was loaded from. */
12-
string getDataPath() { externalData(this, result, _, _) }
16+
string getDataPath() { none() }
1317

1418
/**
1519
* Gets the path of the file this data was loaded from, with its
@@ -18,10 +22,10 @@ class ExternalData extends @externalDataElement {
1822
string getQueryPath() { result = this.getDataPath().regexpReplaceAll("\\.[^.]*$", ".ql") }
1923

2024
/** Gets the number of fields in this data item. */
21-
int getNumFields() { result = 1 + max(int i | externalData(this, _, i, _) | i) }
25+
int getNumFields() { none() }
2226

2327
/** Gets the value of the `i`th field of this data item. */
24-
string getField(int i) { externalData(this, _, i, result) }
28+
string getField(int i) { none() }
2529

2630
/** Gets the integer value of the `i`th field of this data item. */
2731
int getFieldAsInt(int i) { result = this.getField(i).toInt() }

cpp/ql/lib/semmlecode.cpp.dbscheme

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -122,65 +122,11 @@ compilation_finished(
122122
float elapsed_seconds : float ref
123123
);
124124

125-
126-
/**
127-
* External data, loaded from CSV files during snapshot creation. See
128-
* [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data)
129-
* for more information.
130-
*/
131-
externalData(
132-
int id : @externalDataElement,
133-
string path : string ref,
134-
int column: int ref,
135-
string value : string ref
136-
);
137-
138-
/**
139-
* The date of the snapshot.
140-
*/
141-
snapshotDate(unique date snapshotDate : date ref);
142-
143125
/**
144126
* The source location of the snapshot.
145127
*/
146128
sourceLocationPrefix(string prefix : string ref);
147129

148-
/**
149-
* Data used by the 'duplicate code' detection.
150-
*/
151-
duplicateCode(
152-
unique int id : @duplication,
153-
string relativePath : string ref,
154-
int equivClass : int ref
155-
);
156-
157-
/**
158-
* Data used by the 'similar code' detection.
159-
*/
160-
similarCode(
161-
unique int id : @similarity,
162-
string relativePath : string ref,
163-
int equivClass : int ref
164-
);
165-
166-
/**
167-
* Data used by the 'duplicate code' and 'similar code' detection.
168-
*/
169-
@duplication_or_similarity = @duplication | @similarity
170-
171-
/**
172-
* Data used by the 'duplicate code' and 'similar code' detection.
173-
*/
174-
#keyset[id, offset]
175-
tokens(
176-
int id : @duplication_or_similarity ref,
177-
int offset : int ref,
178-
int beginLine : int ref,
179-
int beginColumn : int ref,
180-
int endLine : int ref,
181-
int endColumn : int ref
182-
);
183-
184130
/**
185131
* Information about packages that provide code used during compilation.
186132
* The `id` is just a unique identifier.

0 commit comments

Comments
 (0)