编译数据库时不能有中文字符

    CodeQL CLI的版本与CodeQL Lib的版本如果不一致可能会导致查询失败

    公司项目编译失败
    image.png
    有一次是因为测试用例的原因,可以排除对测试用例的编译

    1. codeql database create ehrweb-ql -l java --command="mvn clean package -Dmaven.test.skip=true -P test3"

    还有一次是改用了pre环境就行可以了

    下载的时候,下载其他分支的代码

    image.png

    1. [2021-09-24 17:58:28] [javac-extractor-30292] [WARN] Skipping Lombok-ed source file: C:\Users\loulan\Downloads\okr-develop(1)\okr-develop\okrsapi\src\main\java\com\lucky\okrs\user\dto\group\AddGroupDTO.java

    先用lombok delombok一下
    https://github.com/github/codeql/issues/4984
    https://github.com/github/codeql-cli-binaries/issues/27

    当某个值不存在时,但是声明了这个值时,那么这个语句会永远为否。
    如下所示,当没有myVarAccess这个Expr时,where里面即使使用了or any(),依旧查询不出来任何东西

    1. from MyVarAccess myVarAccess, MyMethod myMethod
    2. where
    3. myVarAccess.getEnclosingCallable() = m
    4. or
    5. any()
    6. select myMethod

    对于这种情景,可以用下面这种写法,即可解决

    1. from MyMethod myMethod
    2. where
    3. exists(MyVarAccess myVarAccess| myVarAccess.getEnclosingCallable() = m)
    4. or
    5. any()
    6. select myMethod