QL: Add ql/missing-qldoc query.

This commit is contained in:
Geoffrey White
2021-10-14 15:36:58 +01:00
parent 1762394b9b
commit ecf27ff24b

View File

@@ -0,0 +1,25 @@
/**
* @name Missing QLDoc.
* @description Library classes should have QLDoc.
* @kind problem
* @problem.severity recommendation
* @id ql/missing-qldoc
* @tags maintainability
* @precision high
*/
import ql
from File f, Class c
where
f = c.getLocation().getFile() and
not exists(c.getQLDoc()) and // no QLDoc
f.getExtension() = "qll" and // in a library
not c.isPrivate() and // class is public
not exists(Module m |
m.getAMember*() = c and
m.isPrivate() // modules containing the class are public
) and
not exists(c.getAliasType()) and // class is not just an alias
not f.getParentContainer*().getBaseName().toLowerCase() = ["internal", "experimental", "test"] // exclusions
select c, "This library class should have QLDoc."