Skip to content

Commit

Permalink
Merge pull request #956 from github/charisk/remove-file-size-fields
Browse files Browse the repository at this point in the history
Remove unused file size fields from RunQueryResult
  • Loading branch information
charisk authored Jan 9, 2024
2 parents d156ffc + 26d4a6f commit bf1cbb8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
7 changes: 1 addition & 6 deletions dist/query.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions src/codeql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ export interface RunQueryResult {
sourceLocationPrefix: string;
metadataFilePath: string;
bqrsFilePath: string;
bqrsFileSize: number;
sarifFilePath?: string;
sarifFileSize?: number;
}

// Must be a valid value for "-t=kind" when doing "codeql bqrs interpret"
Expand Down Expand Up @@ -84,8 +82,6 @@ export async function runQuery(
const tempBqrsFilePath = getBqrsFile(databaseName);
fs.renameSync(tempBqrsFilePath, bqrsFilePath);

const bqrsFileSize = fs.statSync(bqrsFilePath).size;

const bqrsInfo = await getBqrsInfo(codeql, bqrsFilePath);
const compatibleQueryKinds = bqrsInfo.compatibleQueryKinds;
const queryMetadata = await getQueryMetadata(
Expand All @@ -100,7 +96,6 @@ export async function runQuery(
);
let resultCount: number;
let sarifFilePath: string | undefined;
let sarifFileSize: number | undefined;
if (sarifOutputType !== undefined) {
const sarif = await generateSarif(
codeql,
Expand All @@ -115,7 +110,6 @@ export async function runQuery(
resultCount = getSarifResultCount(sarif);
sarifFilePath = path.join("results", "results.sarif");
fs.writeFileSync(sarifFilePath, JSON.stringify(sarif));
sarifFileSize = fs.statSync(sarifFilePath).size;
} else {
resultCount = getBqrsResultCount(bqrsInfo);
}
Expand All @@ -135,9 +129,7 @@ export async function runQuery(
sourceLocationPrefix,
metadataFilePath,
bqrsFilePath,
bqrsFileSize,
sarifFilePath,
sarifFileSize,
};
}

Expand Down

0 comments on commit bf1cbb8

Please sign in to comment.