javaparsingcodeql

Choose database from folder Code QL on Visual Studio Code


I would like to use Code QL in Visual Studio Code to parse a Java project and I am selecting the source folder of my java project after clicking on the icon "choose database from folder". My project's folder looks like this: enter image description here

I am receiving the error 'c:\Users\mouna\git\chess\java-chess' does not contain a dataset directory. , how can I fix this? what am I doing wrong?


Solution

  • First of all you have to install the codeQL package in your machine. Makesure codeql command is accessible from your command line by adding it in environment variable PATH. Then follow the instruction here and create a database for your codebase

    ex : codeql database  create projectName-database --language=java
          --command="mvn clean install" --source-root="C:\code\projectFolder"
    

    Then upload the newly created database to VS code. Follow the instructions here to to run your analysis