mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
`py/summary/lines-of-code` is just a port of the C++/JS queries added in: - https://github.com/github/codeql/pull/5271 (C++) - https://github.com/github/codeql/pull/5304 (JS) We are the first to implement the `lines-of-user-code` query, so nothing to compare with in other languages -- but it makes a lot of sense to do for Python 👍
27 lines
632 B
Python
27 lines
632 B
Python
"""
|
|
module level docstring
|
|
|
|
is not included
|
|
"""
|
|
# this line is not code
|
|
|
|
# `tty` was chosen for stability over python versions (so we don't get diffrent results
|
|
# on different computers, that has different versions of Python).
|
|
#
|
|
# According to https://github.com/python/cpython/tree/master/Lib (at 2021-04-23) `tty`
|
|
# was last changed in 2001, so chances of this being changed in the future are slim.
|
|
import tty
|
|
|
|
s = """
|
|
all these lines are code
|
|
"""
|
|
|
|
print(s)
|
|
|
|
def func():
|
|
"""
|
|
this string is a doc-string. Although the module-level docstring is not considered
|
|
code, this one apparently is ¯\_(ツ)_/¯
|
|
"""
|
|
pass
|