Bug 316901

Summary: Incorrect imports also listed as undefined variables
Product: [Developer tools] kdev-python Reporter: Todd <toddrme2178>
Component: Language supportAssignee: Sven Brauch <mail>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.4.0 / 1.4.1 (stable)   
Target Milestone: 1.4.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Todd 2013-03-17 11:39:40 UTC
Currently, when kdev-python cannot find an import, it is labeled as a problem.  This makes sense, since it is a problem.  

However, it also makes it so that all uses of that import are labeled as "Undefined variable".  This is a redundant message, it provides no additional information to the user.  It only serves to fill up the problems list and makes it harder to find the root cause of the problem.  

Further, with all the false positives for incorrect imports, it can lead to a large number of false problems, making it harder to notice real problems.

Reproducible: Always

Steps to Reproduce:
1.  Add these lines:

import spammerspam
eggs = 1
a = spammerspam(eggs)
Actual Results:  
Module spammerspam not found
Undefined variable spammerspam

Expected Results:  
Module spammerspam not found
Comment 1 Sven Brauch 2015-10-10 15:47:19 UTC
Git commit 7f29899339bd8fa13b42f3ee4c01600008920e7a by Sven Brauch.
Committed on 10/10/2015 at 15:47.
Pushed by brauch into branch 'master'.

do not additionally report not-found imports as undefined variables

M  +1    -0    duchain/declarationbuilder.cpp
M  +9    -0    duchain/declarationbuilder.h
M  +15   -10   duchain/usebuilder.cpp
M  +4    -1    duchain/usebuilder.h
M  +1    -1    pythonparsejob.cpp

http://commits.kde.org/kdev-python/7f29899339bd8fa13b42f3ee4c01600008920e7a