Skip to content

Commit d461137

Browse files
makubackimergify[bot]
authored andcommitted
BaseTools/Plugin/CodeQL: Enable 30 queries
Updates the CodeQL queries opted into by edk2 to a set of queries from the standard CodeQL query package `codeql/cpp-queries`. After testing a large number of queries the included set here were found to be the most useful with the least number of false positives. Some queries had a number of issues that led to them being placed on the exclusion list so that they are not considered in the future without the notes there being taken into account. General details about queries available in the pack are available here: https://codeql.github.com/codeql-query-help/cpp/ The issues found by these queries will need to be fixed over time. In the meantime, the results will show to those that have permission in the repo's GitHub Code Scanning area. The build will not fail due to CodeQL issues (since they are not all fixed) but that can be enabled in the future. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
1 parent a3e8efc commit d461137

File tree

1 file changed

+50
-7
lines changed

1 file changed

+50
-7
lines changed

BaseTools/Plugin/CodeQL/CodeQlQueries.qls

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,71 @@
88
# Queries
99
##########################################################################################
1010

11-
## Enable When Time is Available to Fix Issues
12-
# Hundreds of issues. Most appear valid. Type: Recommendation.
13-
#- include:
14-
# id: cpp/missing-null-test
15-
1611
## Errors
1712
- include:
18-
id: cpp/overrunning-write
13+
id: cpp/badoverflowguard
14+
- include:
15+
id: cpp/infiniteloop
16+
- include:
17+
id: cpp/likely-bugs/memory-management/v2/conditionally-uninitialized-variable
18+
- include:
19+
id: cpp/missing-null-test
1920
- include:
20-
id: cpp/overrunning-write-with-float
21+
id: cpp/missing-return
22+
- include:
23+
id: cpp/no-space-for-terminator
2124
- include:
2225
id: cpp/pointer-overflow-check
26+
- include:
27+
id: cpp/redundant-null-check-simple
28+
- include:
29+
id: cpp/sizeof/const-int-argument
30+
- include:
31+
id: cpp/sizeof/sizeof-or-operation-as-argument
32+
- include:
33+
id: cpp/unguardednullreturndereferenc
2334
- include:
2435
id: cpp/very-likely-overrunning-write
2536

2637
## Warnings
38+
- include:
39+
id: cpp/comparison-with-wider-type
2740
- include:
2841
id: cpp/conditionallyuninitializedvariable
42+
- include:
43+
id: cpp/comparison-precedence
44+
- include:
45+
id: cpp/implicit-bitfield-downcast
2946
- include:
3047
id: cpp/infinite-loop-with-unsatisfiable-exit-condition
48+
- include:
49+
id: cpp/offset-use-before-range-check
3150
- include:
3251
id: cpp/overflow-buffer
52+
- include:
53+
id: cpp/overflow-calculated
54+
- include:
55+
id: cpp/overflow-destination
56+
- include:
57+
id: cpp/paddingbyteinformationdisclosure
58+
- include:
59+
id: cpp/return-stack-allocated-memory
60+
- include:
61+
id: cpp/static-buffer-overflow
62+
- include:
63+
id: cpp/unsigned-comparison-zero
64+
- include:
65+
id: cpp/uselesstest
66+
67+
## Recommendations
68+
- include:
69+
id: cpp/missing-header-guard
70+
- include:
71+
id: cpp/unused-local-variable
72+
- include:
73+
id: cpp/unused-static-function
74+
- include:
75+
id: cpp/unused-static-variable
3376

3477
# Note: Some queries above are not active by default with the below filter.
3578
# Update the filter and run the queries again to get all results.

0 commit comments

Comments
 (0)