Python: Fix underlying problem of not using Alias

This commit is contained in:
Rasmus Wriedt Larsen
2023-10-20 11:13:48 +02:00
parent ef693ea0aa
commit b7f43354fa
3 changed files with 13 additions and 10 deletions

View File

@@ -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)