github / github/codeql

CodeQL integration with Visual Studio 2022

Đang mở
#15,196 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
question
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
141

Mô tả

Hello all,

I was trying to run Codeql from Visual studio2022, steps given below.

1-downloaded codeql-bundle-win64 from git >> set Path for Codeql
2-Open My sample C# application
3- Created Batch file with "codeql database create D:\csharp-database1057 --language=csharp --overwrite"
4- set as Prebuild event
5- Created Batch file with "codeql database analyze D:\csharp-database1057 csharp-code-scanning.qls --sarif-category=javascript-typescript --format=sarif-latest --output=C:\Output\xyz.sarif"
6- Build the solution

o/p: exception from step3
2023-12-22 18:29:48] Exception caught at top level: D:\csharp-database1057 is not a recognized CodeQL database.
com.semmle.cli2.database.DatabaseLayout.(DatabaseLayout.java:189)
com.semmle.cli2.database.DatabaseLayout.load(DatabaseLayout.java:136)
com.semmle.cli2.database.DatabaseLayout.loadAndSetupLogging(DatabaseLayout.java:237)
com.semmle.cli2.database.MultiDatabaseOptions.resolveDatabases(MultiDatabaseOptions.java:68)
com.semmle.cli2.database.MultiDatabaseOptions.resolveDatabases(MultiDatabaseOptions.java:60)
com.semmle.cli2.database.FinalizeCommand.executeSubcommand(FinalizeCommand.java:120)
com.semmle.cli2.picocli.SubcommandCommon.lambda$executeSubcommandWithMessages$5(SubcommandCommon.java:803)
com.semmle.cli2.picocli.SubcommandCommon.withCompilationMessages(SubcommandCommon.java:442)
com.semmle.cli2.picocli.SubcommandCommon.executeSubcommandWithMessages(SubcommandCommon.java:801)
com.semmle.cli2.picocli.PlumbingRunner.run(PlumbingRunner.java:119)
com.semmle.cli2.picocli.SubcommandCommon.runPlumbingInProcess(SubcommandCommon.java:199)
com.semmle.cli2.database.CreateCommand.executeSubcommand(CreateCommand.java:199)
com.semmle.cli2.picocli.SubcommandCommon.lambda$executeSubcommandWithMessages$5(SubcommandCommon.java:803)
com.semmle.cli2.picocli.SubcommandCommon.withCompilationMessages(SubcommandCommon.java:442)
com.semmle.cli2.picocli.SubcommandCommon.executeSubcommandWithMessages(SubcommandCommon.java:801)
com.semmle.cli2.picocli.SubcommandCommon.toplevelMain(SubcommandCommon.java:685)
com.semmle.cli2.picocli.SubcommandCommon.call(SubcommandCommon.java:666)
com.semmle.cli2.picocli.SubcommandMaker.runMain(SubcommandMaker.java:237)
com.semmle.cli2.picocli.SubcommandMaker.runMain(SubcommandMaker.java:247)
com.semmle.cli2.CodeQL.main(CodeQL.java:115)

Can someone provide suggestion how I can go about this CodeQL integration with Vs2022? Any suggestions will be greatly appreciated.

It is working fine with individual command execution from Command Prompt for Database Creation /database analyze.

Thanks,
Avdhesh

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.