FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql/python/ql/src/Metrics/DocStringRatio.qhelp at codeql-cli/v2.15.4 · github/codeql · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
github
/
codeql
Public
Notifications
You must be signed in to change notification settings
Fork
2.1k
Star
10k
Code
Issues
997
Pull requests
463
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql
/
python
/
ql
/
src
/
Metrics
/
DocStringRatio.qhelp
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (28 loc) · 1.44 KB
Breadcrumbs
codeql
/
python
/
ql
/
src
/
Metrics
/
DocStringRatio.qhelp
Copy path
File metadata and controls
35 lines (28 loc) · 1.44 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<!
DOCTYPE
qhelp
PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<
qhelp
>
<
overview
>
<
p
>This metric measures the percentage of lines in a file that contain a docstring. Note that this
metric ignores comments.
</
p
><
p
>Docstrings are a good way to associate documentation with a specific object in Python. For public
modules, functions, classes and methods docstrings are the preferred method of documentation because
the information can be inspected by the program at runtime, for example, as an interactive help system
or as metadata for a function.</
p
>
<
p
>Having a low percentage of docstrings is often an indication that a file has insufficient
documentation. However, the value for the related metric "Percentage of comments" should also be
considered because packages and non-public methods may be documented using comments. Undocumented
code is difficult to understand, modify, and reuse.</
p
>
</
overview
>
<
recommendation
>
<
p
>Add documentation to files with a low docstring ratio. It is most useful to start documenting
the public functions first.</
p
>
</
recommendation
>
<
references
>
<
li
>Python for Beginners: <
a
href
=
"
http://www.pythonforbeginners.com/basics/python-docstrings/
"
>
Python Docstrings</
a
>.</
li
>
<
li
>Python PEP 8: <
a
href
=
"
http://www.python.org/dev/peps/pep-0008/#documentation-strings
"
>Documentation
Strings</
a
>.</
li
>
<
li
>Python PEP 257: <
a
href
=
"
http://www.python.org/dev/peps/pep-0257/
"
>Docstring Conventions</
a
>.</
li
>
</
references
>
</
qhelp
>
Back
|
FazBrowse Home
|
New Git URL