Remove dead code

After removing all namespace imports, the dead code detection is now
more accurate, so we can remove some more dead code.
This commit is contained in:
Koen Vlaswinkel
2024-01-05 10:37:40 +01:00
parent 034bfc230c
commit 50df8cd376
3 changed files with 25 additions and 37 deletions

View File

@@ -55,16 +55,6 @@ const CSV_FORMAT = "csv";
*/
const LOGGING_FLAGS = ["-v", "--log-to-stderr"];
/**
* The expected output of `codeql resolve library-path`.
*/
export interface QuerySetup {
libraryPath: string[];
dbscheme: string;
relativeName?: string;
compilationCache?: string;
}
/**
* The expected output of `codeql resolve queries --format bylanguage`.
*/
@@ -92,7 +82,7 @@ export interface DbInfo {
/**
* The expected output of `codeql resolve upgrades`.
*/
export interface UpgradesInfo {
interface UpgradesInfo {
scripts: string[];
finalDbscheme: string;
matchesTarget?: boolean;
@@ -106,33 +96,33 @@ export type QlpacksInfo = { [name: string]: string[] };
/**
* The expected output of `codeql resolve languages`.
*/
export type LanguagesInfo = { [name: string]: string[] };
type LanguagesInfo = { [name: string]: string[] };
/** Information about an ML model, as resolved by `codeql resolve ml-models`. */
export type MlModelInfo = {
type MlModelInfo = {
checksum: string;
path: string;
};
/** The expected output of `codeql resolve ml-models`. */
export type MlModelsInfo = { models: MlModelInfo[] };
type MlModelsInfo = { models: MlModelInfo[] };
/** Information about a data extension predicate, as resolved by `codeql resolve extensions`. */
export type DataExtensionResult = {
type DataExtensionResult = {
predicate: string;
file: string;
index: number;
};
/** The expected output of `codeql resolve extensions`. */
export type ResolveExtensionsResult = {
type ResolveExtensionsResult = {
models: MlModelInfo[];
data: {
[path: string]: DataExtensionResult[];
};
};
export type GenerateExtensiblePredicateMetadataResult = {
type GenerateExtensiblePredicateMetadataResult = {
// There are other properties in this object, but they are
// not relevant for its use in the extension, so we omit them.
extensible_predicates: Array<{
@@ -144,7 +134,7 @@ export type GenerateExtensiblePredicateMetadataResult = {
/**
* The expected output of `codeql resolve qlref`.
*/
export type QlrefInfo = { resolvedPath: string };
type QlrefInfo = { resolvedPath: string };
// `codeql bqrs interpret` requires both of these to be present or
// both absent.
@@ -156,17 +146,17 @@ export interface SourceInfo {
/**
* The expected output of `codeql resolve queries`.
*/
export type ResolvedQueries = string[];
type ResolvedQueries = string[];
/**
* The expected output of `codeql resolve tests`.
*/
export type ResolvedTests = string[];
type ResolvedTests = string[];
/**
* A compilation message for a test message (either an error or a warning)
*/
export interface CompilationMessage {
interface CompilationMessage {
/**
* The text of the message
*/
@@ -209,7 +199,7 @@ interface BqrsDecodeOptions {
entities?: string[];
}
export type OnLineCallback = (
type OnLineCallback = (
line: string,
) => Promise<string | undefined> | string | undefined;
@@ -1714,7 +1704,7 @@ export function shouldDebugQueryServer() {
return isEnvTrue("QUERY_SERVER_JAVA_DEBUG");
}
export function shouldDebugCliServer() {
function shouldDebugCliServer() {
return isEnvTrue("CLI_SERVER_JAVA_DEBUG");
}

View File

@@ -45,7 +45,7 @@ export interface TrimCacheParams {
/**
* The result of trimming or clearing the cache.
*/
export interface ClearCacheResult {
interface ClearCacheResult {
/**
* A user friendly message saying what was or would be
* deleted.
@@ -92,19 +92,19 @@ export namespace QueryResultType {
export const DBSCHEME_NO_UPGRADE = 6;
}
export interface RegisterDatabasesParams {
interface RegisterDatabasesParams {
databases: string[];
}
export interface DeregisterDatabasesParams {
interface DeregisterDatabasesParams {
databases: string[];
}
export type RegisterDatabasesResult = {
type RegisterDatabasesResult = {
registeredDatabases: string[];
};
export type DeregisterDatabasesResult = {
type DeregisterDatabasesResult = {
registeredDatabases: string[];
};
@@ -130,22 +130,22 @@ export interface RunQueryParams {
extensionPacks?: string[];
}
export interface RunQueryResult {
interface RunQueryResult {
resultType: QueryResultType;
message?: string;
expectedDbschemeName?: string;
evaluationTime: number;
}
export interface UpgradeParams {
interface UpgradeParams {
db: string;
additionalPacks: string[];
}
export type UpgradeResult = Record<string, unknown>;
type UpgradeResult = Record<string, unknown>;
export type ClearPackCacheParams = Record<string, unknown>;
export type ClearPackCacheResult = Record<string, unknown>;
type ClearPackCacheParams = Record<string, unknown>;
type ClearPackCacheResult = Record<string, unknown>;
/**
* A position within a QL file.
@@ -156,9 +156,7 @@ export type Position = shared.Position;
* The way of compiling the query, as a normal query
* or a subset of it. Note that precisely one of the two options should be set.
*/
export type CompilationTarget = shared.CompilationTarget;
export type QuickEvalOptions = shared.QuickEvalOptions;
type CompilationTarget = shared.CompilationTarget;
export type WithProgressId<T> = shared.WithProgressId<T>;
export type ProgressMessage = shared.ProgressMessage;

View File

@@ -21,7 +21,7 @@ export interface Result extends ResultKeyBase {
/**
* Identifies one of the paths associated with a result.
*/
export interface Path extends ResultKeyBase {
interface Path extends ResultKeyBase {
pathIndex: number;
pathNodeIndex?: undefined;
}