File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ enum AnalysisLevel {
29
29
SYSTEM_DEPENDENCY_GRAPH = 4
30
30
}
31
31
32
- const analysisLevelMap = {
32
+ const analysisLevelMap : Record < string , AnalysisLevel > = {
33
33
"symbol table" : AnalysisLevel . SYMBOL_TABLE ,
34
34
"call graph" : AnalysisLevel . CALL_GRAPH ,
35
35
"program dependency graph" : AnalysisLevel . PROGRAM_DEPENDENCY_GRAPH ,
@@ -64,8 +64,11 @@ export class JavaAnalysis {
64
64
}
65
65
66
66
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 } ` ] ;
69
72
const command = [ ...this . getCodeAnalyzerExec ( ) , ...extraArgs ] ;
70
73
log . info ( "Running command:" , command . join ( " " ) ) ;
71
74
try {
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ import * as os from 'os';
24
24
import * as https from 'https' ;
25
25
import extract from 'extract-zip' ;
26
26
import * as rimraf from 'rimraf' ;
27
- import * as pkgJson from '../package.json' ;
28
27
29
28
/**
30
29
* A quick function to download and extract a zip file from a URL.
You can’t perform that action at this time.
0 commit comments