mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Python: Fix underlying problem of not using Alias
This commit is contained in:
@@ -163,12 +163,13 @@ module NotExposed {
|
||||
newOrExistingModeling(spec).getASubclass*().getAValueReachableFromSource().asExpr() and
|
||||
importMember.getScope() = mod and
|
||||
loc = importMember.getLocation() and
|
||||
(
|
||||
mod.isPackageInit() and
|
||||
newAliasFullyQualified = mod.getPackageName() + "." + importMember.getName()
|
||||
exists(Alias alias, string base |
|
||||
mod.isPackageInit() and base = mod.getPackageName()
|
||||
or
|
||||
not mod.isPackageInit() and
|
||||
newAliasFullyQualified = mod.getName() + "." + importMember.getName()
|
||||
not mod.isPackageInit() and base = mod.getName()
|
||||
|
|
||||
alias.getValue() = importMember and
|
||||
newAliasFullyQualified = base + "." + alias.getAsname()
|
||||
) and
|
||||
(
|
||||
not hasAllStatement(mod)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
| Django.Views.View~Subclass | find_subclass_test | Member[View] |
|
||||
| Django.Views.View~Subclass | find_subclass_test | Member[clash2] |
|
||||
| Django.Views.View~Subclass | find_subclass_test | Member[clash3] |
|
||||
| Django.Views.View~Subclass | find_subclass_test | Member[clash] |
|
||||
| flask.MethodView~Subclass | find_subclass_test | Member[C] |
|
||||
| flask.View~Subclass | find_subclass_test | Member[A] |
|
||||
@@ -7,6 +8,7 @@
|
||||
| flask.View~Subclass | find_subclass_test | Member[ViewAliasInTry] |
|
||||
| flask.View~Subclass | find_subclass_test | Member[ViewAlias] |
|
||||
| flask.View~Subclass | find_subclass_test | Member[View] |
|
||||
| flask.View~Subclass | find_subclass_test | Member[clash2] |
|
||||
| flask.View~Subclass | find_subclass_test | Member[clash3] |
|
||||
| flask.View~Subclass | find_subclass_test | Member[clash] |
|
||||
| flask.View~Subclass | find_subclass_test | Member[complete_module_alias] |
|
||||
|
||||
@@ -21,18 +21,18 @@ except:
|
||||
if cond:
|
||||
from flask.views import View as clash
|
||||
else:
|
||||
from django.views.generic import View as clash # $ SPURIOUS: View=Django.Views.View~Subclass
|
||||
from django.views.generic import View as clash
|
||||
|
||||
if cond:
|
||||
from flask.views import View as clash2 # $ MISSING
|
||||
from flask.views import View as clash2
|
||||
else:
|
||||
from django.views.generic import View as clash2 # $ MISSING
|
||||
from django.views.generic import View as clash2
|
||||
print(clash2)
|
||||
|
||||
if cond:
|
||||
from flask.views import View as clash3
|
||||
else:
|
||||
from django.views.generic import View as clash3 # $ MISSING
|
||||
from django.views.generic import View as clash3
|
||||
print(clash3)
|
||||
|
||||
import flask.views as containing_module_alias # $ MISSING
|
||||
|
||||
Reference in New Issue
Block a user