github / github/codeql

How can I use codeql cli without metadata?

Đang mở
#14,872 1 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ả

This is a snippets from codeql's example:

```
/**
* @id java/examples/method-call
* @name Call to method
* @description Finds calls to com.example.Class.methodName
* @tags call
* method
*/

import java

from MethodAccess call, Method method
where
call.getMethod() = method and
method.hasName("methodName") and
method.getDeclaringType().hasQualifiedName("com.example", "Class")
select call, method
```

When I try to run it, codeql give me this error

```
Error was: Cannot process query metadata for a query without the '@kind' metadata property. To learn more, see https://codeql.github.com/docs/writing-codeql-queries/metadata-for-codeql-queries/ [NO_KIND_SPECIFIED]
```

I understand that this is because I didn't add a `@kind` in the metadata. So I added ` @kind problem` and received a new error:

```
Error was: Expected result pattern(s) are not present for problem query: Expected at least 2 columns. [INVALID_RESULT_PATTERNS]
```

My problem is: I don't care about the metadata at all. I just want to use it like a database query and I just want to get the raw result as a csv file.

Is there anyway that I can draft my own query without bothering the metadata?

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.