-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathnumlines.ql
More file actions
38 lines (36 loc) · 1013 Bytes
/
numlines.ql
File metadata and controls
38 lines (36 loc) · 1013 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
31
32
33
34
35
36
37
38
import cpp
string functionName(Function f) {
exists(string name, string templateArgs, string args |
result = name + templateArgs + args and
name = f.getQualifiedName() and
(
if exists(f.getATemplateArgument())
then
templateArgs =
"<" +
concat(int i |
exists(f.getTemplateArgument(i))
|
f.getTemplateArgument(i).toString(), "," order by i
) + ">"
else templateArgs = ""
) and
args =
"(" +
concat(int i |
exists(f.getParameter(i))
|
f.getParameter(i).getType().toString(), "," order by i
) + ")"
)
}
from string resource, int ntotal, int ncode, int ncomment
where
exists(File f |
f.getShortName() = resource and numlines(unresolveElement(f), ntotal, ncode, ncomment)
)
or
exists(Function f |
functionName(f) = resource and numlines(unresolveElement(f), ntotal, ncode, ncomment)
)
select resource, ntotal, ncode, ncomment