Skip to content

Commit

Permalink
Rename functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Or-Geva committed Nov 26, 2023
1 parent 465bcd7 commit daae70d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/main/scanLogic/scanManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ export class ScanManager implements ExtensionComponent {
progressManager,
await new SupportedScans(this._connectionManager, this._logManager).getSupportedScans()
);
const jasRunners: JasRunner[] = await entitledJasRunnerFactory.createConfigurableJasRunner();
const jasRunners: JasRunner[] = await entitledJasRunnerFactory.createJasRunner();
progressManager.startStep('🔎 Scanning for issues', ScanManager.calculateNumberOfTasks(jasRunners, workspaceDescriptors));
checkCanceled();
await Promise.all([
...this.runDependenciesScans(workspaceDescriptors, root, checkCanceled, scanResults, progressManager, entitledJasRunnerFactory),
...this.runAMScans(jasRunners)
...this.runSourceCodeScans(jasRunners)
]);
UsageUtils.sendUsageReport(entitledJasRunnerFactory.uniqFeatures, workspaceDescriptors, this.connectionManager);
}
Expand Down Expand Up @@ -91,7 +91,7 @@ export class ScanManager implements ExtensionComponent {
return scansPromises;
}

private runAMScans(jasRunners: JasRunner[]): Promise<void>[] {
private runSourceCodeScans(jasRunners: JasRunner[]): Promise<void>[] {
const scansPromises: Promise<void>[] = [];
for (const runner of jasRunners) {
if (runner.shouldRun()) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/scanLogic/scanRunners/jasRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export abstract class JasRunner {
*/
public abstract scan(): Promise<void>;

public get config() {
return this._config;
}

/**
* Run the executeBinary method with the provided request path
* @param yamlConfigPath - Path to the request
Expand Down
8 changes: 4 additions & 4 deletions src/main/scanLogic/sourceCodeScan/jasRunnerFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class JasRunnerFactory {
}

// Jas scanner support JFrog config file. Applicability is not supported by jfrog config so we create a default runner to run on the workspace.
public async createConfigurableJasRunner(): Promise<JasRunner[]> {
public async createJasRunner(): Promise<JasRunner[]> {
let jasRunners: JasRunner[] = [];

jasRunners.push(...this.createSastRunners());
Expand All @@ -55,7 +55,7 @@ export class JasRunnerFactory {
this._logManager.logMessage('Static Application Security scanner is not entitled to scan workspace ', 'INFO');
return sastRunners;
}
for (const configModule of this.getModulesFromConfig()) {
for (const configModule of this.createModulesConfig()) {
sastRunners.push(
new SastRunner(
this.scanResults,
Expand All @@ -80,7 +80,7 @@ export class JasRunnerFactory {
this._logManager.logMessage('Infrastructure as Code scanner is not entitled to scan workspace', 'INFO');
return iacRunners;
}
for (const configModule of this.getModulesFromConfig()) {
for (const configModule of this.createModulesConfig()) {
iacRunners.push(
new IacRunner(
this.scanResults,
Expand All @@ -105,7 +105,7 @@ export class JasRunnerFactory {
this._logManager.logMessage('Secrets scanner is not entitled to scan workspace', 'INFO');
return secretsRunners;
}
for (const configModule of this.getModulesFromConfig()) {
for (const configModule of this.createModulesConfig()) {
secretsRunners.push(
new SecretsRunner(
this.scanResults,
Expand Down

0 comments on commit daae70d

Please sign in to comment.