-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathAV Rule 32.ql
More file actions
30 lines (28 loc) · 851 Bytes
/
AV Rule 32.ql
File metadata and controls
30 lines (28 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* @name Include header files only
* @description The #include pre-processor directive should only be used to include header files.
* @kind problem
* @problem.severity recommendation
* @precision high
* @id cpp/include-non-header
* @tags maintainability
* modularity
* readability
* external/jsf
*/
import cpp
import semmle.code.cpp.AutogeneratedFile
from Include i, File f, string extension
where
f = i.getIncludedFile() and
extension = f.getExtension().toLowerCase() and
extension != "def" and
extension != "inc" and
extension != "inl" and
extension != "tcc" and
extension != "tpp" and
extension != "txx" and
extension != "xpm" and
not f instanceof AutogeneratedFile and
not f instanceof HeaderFile
select i, "The #include pre-processor directive should only be used to include header files."