mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
Merge branch 'main' into django-rest-framework
This commit is contained in:
@@ -99,14 +99,14 @@ private ControlFlowNode get_a_call(Value callable) {
|
||||
|
||||
/** Gets the function object corresponding to the given class or function. */
|
||||
FunctionObject get_function_or_initializer_objectapi(Object func_or_cls) {
|
||||
result = func_or_cls.(FunctionObject)
|
||||
result = func_or_cls
|
||||
or
|
||||
result = func_or_cls.(ClassObject).declaredAttribute("__init__")
|
||||
}
|
||||
|
||||
/** Gets the function object corresponding to the given class or function. */
|
||||
FunctionValue get_function_or_initializer(Value func_or_cls) {
|
||||
result = func_or_cls.(FunctionValue)
|
||||
result = func_or_cls
|
||||
or
|
||||
result = func_or_cls.(ClassValue).declaredAttribute("__init__")
|
||||
}
|
||||
|
||||
@@ -210,9 +210,9 @@ class CommentedOutCodeBlock extends @py_comment {
|
||||
|
||||
/** Whether this commented-out code block is likely to be example code embedded in a larger comment. */
|
||||
predicate maybeExampleCode() {
|
||||
exists(CommentBlock block | block.contains(this.(Comment)) |
|
||||
exists(CommentBlock block | block.contains(this) |
|
||||
exists(int all_code |
|
||||
all_code = sum(CommentedOutCodeBlock code | block.contains(code.(Comment)) | code.length()) and
|
||||
all_code = sum(CommentedOutCodeBlock code | block.contains(code) | code.length()) and
|
||||
/* This ratio may need fine tuning */
|
||||
block.length() > all_code * 2
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user