Skip to content

Commit 2f77b92

Browse files
authored
QL: Merge pull request #107 from github/missing-qldoc
Add ql/missing-qldoc query.
2 parents e862dfd + ecf27ff commit 2f77b92

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* @name Missing QLDoc.
3+
* @description Library classes should have QLDoc.
4+
* @kind problem
5+
* @problem.severity recommendation
6+
* @id ql/missing-qldoc
7+
* @tags maintainability
8+
* @precision high
9+
*/
10+
11+
import ql
12+
13+
from File f, Class c
14+
where
15+
f = c.getLocation().getFile() and
16+
not exists(c.getQLDoc()) and // no QLDoc
17+
f.getExtension() = "qll" and // in a library
18+
not c.isPrivate() and // class is public
19+
not exists(Module m |
20+
m.getAMember*() = c and
21+
m.isPrivate() // modules containing the class are public
22+
) and
23+
not exists(c.getAliasType()) and // class is not just an alias
24+
not f.getParentContainer*().getBaseName().toLowerCase() = ["internal", "experimental", "test"] // exclusions
25+
select c, "This library class should have QLDoc."

0 commit comments

Comments
 (0)