-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathXmldocMissing.ql
More file actions
27 lines (24 loc) · 879 Bytes
/
XmldocMissing.ql
File metadata and controls
27 lines (24 loc) · 879 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
/**
* @name Missing documentation for public class or method
* @description A public class, method or constructor that does not have a documentation comment affects
* maintainability.
* @kind problem
* @problem.severity recommendation
* @precision medium
* @id cs/xmldoc/missing-xmldoc
* @tags maintainability
*/
import Documentation
/** Generate a user-friendly string for the declaration */
string declarationDescription(Declaration d)
{
d instanceof Class and result="class" or
d instanceof Interface and result="interface" or
d instanceof Method and result="method" or
d instanceof Constructor and result="constructor" or
d instanceof Struct and result="struct"
}
from Declaration decl
where isDocumentationNeeded(decl)
and not declarationHasXmlComment(decl)
select decl, "Public " + declarationDescription(decl) + " should be documented."