Skip to content

Commit 238fba9

Browse files
authored
QL: Merge pull request #82 from github/esbena/codeql-action-on-other-repos
2 parents ce3a531 + b0cbb31 commit 238fba9

4,666 files changed

Lines changed: 715469 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ql/src/codeql-suites/ql-all.qls

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- description: All Code Scanning queries for QL
2+
- queries: .
3+
- include:
4+
kind:
5+
- problem
6+
- path-problem
7+
- alert
8+
- path-alert

ql/src/codeql-suites/ql-code-scanning.qls

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,13 @@
66
- path-problem
77
- alert
88
- path-alert
9+
precision:
10+
- high
11+
- very-high
12+
problem.severity:
13+
- error
14+
- warning
15+
- exclude:
16+
deprecated: //
17+
- exclude:
18+
query path: /^experimental\/.*/

ql/src/queries/style/ImplicitThis.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @name Using implicit `this`
33
* @description Writing member predicate calls with an implicit `this` can be confusing
44
* @kind problem
5-
* @problem.severity warning
5+
* @problem.severity recommendation
66
* @precision very-high
77
* @id ql/implicit-this
88
* @tags maintainability

repo-tests/codeql-go.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
abe3f2148b92b1a94a0a3676cb4dab7d9211076f
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name: legacy-libraries-go
2+
version: 0.0.0
3+
libraryPathDependencies: codeql-go
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: codeql/go-examples
2+
version: 0.0.2
3+
dependencies:
4+
codeql/go-all: ^0.0.2
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* @name Call to built-in function
3+
* @description Finds calls to the built-in `len` function.
4+
* @id go/examples/calltolen
5+
* @tags call
6+
* function
7+
* len
8+
* built-in
9+
*/
10+
11+
import go
12+
13+
from DataFlow::CallNode call
14+
where call = Builtin::len().getACall()
15+
select call
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* @name Call to library function
3+
* @description Finds calls to "fmt.Println".
4+
* @id go/examples/calltoprintln
5+
* @tags call
6+
* function
7+
* println
8+
*/
9+
10+
import go
11+
12+
from Function println, DataFlow::CallNode call
13+
where
14+
println.hasQualifiedName("fmt", "Println") and
15+
call = println.getACall()
16+
select call
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @name Call to method
3+
* @description Finds calls to the `Get` method of type `Header` from the `net/http` package.
4+
* @id go/examples/calltoheaderget
5+
* @tags call
6+
* function
7+
* net/http
8+
* Header
9+
* strings
10+
*/
11+
12+
import go
13+
14+
from Method get, DataFlow::CallNode call
15+
where
16+
get.hasQualifiedName("net/http", "Header", "Get") and
17+
call = get.getACall()
18+
select call
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @name Compile-time constant
3+
* @description Finds compile-time constants with value zero.
4+
* @id go/examples/zeroconstant
5+
* @tags expression
6+
* numeric value
7+
* constant
8+
*/
9+
10+
import go
11+
12+
from DataFlow::Node zero
13+
where zero.getNumericValue() = 0
14+
select zero

0 commit comments

Comments
 (0)