Skip to content

Commit ced2352

Browse files
committed
Fixed some type errors
Signed-off-by: Rahul Krishna <i.m.ralk@gmail.com>
1 parent 8af84b3 commit ced2352

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/analysis/java/JavaAnalysis.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ enum AnalysisLevel {
2929
SYSTEM_DEPENDENCY_GRAPH = 4
3030
}
3131

32-
const analysisLevelMap = {
32+
const analysisLevelMap: Record<string, AnalysisLevel> = {
3333
"symbol table": AnalysisLevel.SYMBOL_TABLE,
3434
"call graph": AnalysisLevel.CALL_GRAPH,
3535
"program dependency graph": AnalysisLevel.PROGRAM_DEPENDENCY_GRAPH,
@@ -64,8 +64,11 @@ export class JavaAnalysis {
6464
}
6565

6666
private init() {
67-
const projectPath = path.resolve(this.projectDir);
68-
const extraArgs = ["-i", projectPath, `--analysis-level=${this.analysisLevel}`];
67+
if (this.projectDir != null) {
68+
const projectPath = path.resolve(this.projectDir);
69+
const extraArgs = ["-i", projectPath, `--analysis-level=${this.analysisLevel}`];
70+
}
71+
const extraArgs = ["-s", this.sourceCode || "", `--analysis-level=${this.analysisLevel}`];
6972
const command = [...this.getCodeAnalyzerExec(), ...extraArgs];
7073
log.info("Running command:", command.join(" "));
7174
try {

test/setup.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import * as os from 'os';
2424
import * as https from 'https';
2525
import extract from 'extract-zip';
2626
import * as rimraf from 'rimraf';
27-
import * as pkgJson from '../package.json';
2827

2928
/**
3029
* A quick function to download and extract a zip file from a URL.

0 commit comments

Comments
 (0)