Drop redundant columns from files and folders relations

This commit is contained in:
Tom Hvitved
2021-08-12 15:04:02 +02:00
committed by Arthur Baars
parent 32253aa868
commit 7f03b87142
4 changed files with 5 additions and 50 deletions

View File

@@ -155,7 +155,7 @@ abstract class Container extends @container {
/** A folder. */
class Folder extends Container, @folder {
override string getAbsolutePath() { folders(this, result, _) }
override string getAbsolutePath() { folders(this, result) }
/** Gets the URL of this folder. */
override string getURL() { result = "folder://" + getAbsolutePath() }
@@ -163,11 +163,11 @@ class Folder extends Container, @folder {
/** A file. */
class File extends Container, @file {
override string getAbsolutePath() { files(this, result, _, _, _) }
override string getAbsolutePath() { files(this, result) }
/** Gets the URL of this file. */
override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" }
/** Holds if this file was extracted from ordinary source code. */
predicate fromSource() { files(this, _, _, _, 1) }
predicate fromSource() { any() }
}

View File

@@ -23,16 +23,12 @@ numlines(
files(
unique int id: @file,
string name: string ref,
string simple: string ref,
string ext: string ref,
int fromSource: int ref
string name: string ref
);
folders(
unique int id: @folder,
string name: string ref,
string simple: string ref
string name: string ref
);
@container = @file | @folder