Skip to content

Commit

Permalink
fix: enable checksum metric for local scans
Browse files Browse the repository at this point in the history
  • Loading branch information
YairZ101 committed Nov 30, 2021
1 parent 33f890f commit c48fdde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/cli/commands/test/iac-local-execution/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { computeCustomRulesBundleChecksum } from './file-utils';
export function addIacAnalytics(
formattedResults: FormattedResult[],
ignoredIssuesCount: number,
isLocalCustomRules: boolean,
): void {
let totalIssuesCount = 0;
const customRulesIdsFoundInIssues: { [customRuleId: string]: true } = {};
Expand Down Expand Up @@ -49,12 +48,10 @@ export function addIacAnalytics(
'iac-custom-rules-issues-percentage',
calculatePercentage(issuesFromCustomRulesCount, totalIssuesCount),
);
if (!isLocalCustomRules) {
analytics.add(
'iac-custom-rules-checksum',
computeCustomRulesBundleChecksum(),
);
}
analytics.add(
'iac-custom-rules-checksum',
computeCustomRulesBundleChecksum(),
);
analytics.add('iac-custom-rules-coverage-count', uniqueCustomRulesCount);
}

Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/test/iac-local-execution/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export async function test(
// run their tests by squashing the error.
}

addIacAnalytics(filteredIssues, ignoreCount, !!customRulesPath);
addIacAnalytics(filteredIssues, ignoreCount);

// TODO: add support for proper typing of old TestResult interface.
return {
Expand Down

0 comments on commit c48fdde

Please sign in to comment.