File tree Expand file tree Collapse file tree
java/ql/src/utils/model-generator Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111language = "java"
1212
13- def printHelp ():
14- print (f"""Usage:
13+ class Generator :
14+ def __init__ (self , language ):
15+ self .language = language
16+
17+ def printHelp (self ):
18+ print (f"""Usage:
1519python3 GenerateFlowModel.py <library-database> <outputQll> [--with-sinks] [--with-sources] [--with-summaries] [--dry-run]
1620
1721This generates summary, source and sink models for the code in the database.
18- The files will be placed in `{ language } /ql/lib/semmle/code/{ language } /frameworks/<outputQll>` where
22+ The files will be placed in `{ self . language } /ql/lib/semmle/code/{ self . language } /frameworks/<outputQll>` where
1923outputQll is the name (and path) of the output QLL file. Usually, models are grouped by their
2024respective frameworks.
2125
@@ -32,11 +36,12 @@ def printHelp():
3236$ python3 GenerateFlowModel.py /tmp/dbs/my_library_db "mylibrary/FrameworkSinks.qll" --with-sinks
3337
3438Requirements: `codeql` should both appear on your path.
35- """ )
39+ """ )
3640
41+ generator = Generator (language )
3742
3843if any (s == "--help" for s in sys .argv ):
39- printHelp ()
44+ generator . printHelp ()
4045 sys .exit (0 )
4146
4247generateSinks = False
@@ -64,7 +69,7 @@ def printHelp():
6469 generateSinks = generateSources = generateSummaries = True
6570
6671if len (sys .argv ) != 3 :
67- printHelp ()
72+ generator . printHelp ()
6873 sys .exit (1 )
6974
7075codeQlRoot = subprocess .check_output (
You can’t perform that action at this time.
0 commit comments