Bug 316901 - Incorrect imports also listed as undefined variables
Summary: Incorrect imports also listed as undefined variables
Alias: None
Product: kdev-python
Classification: Developer tools
Component: Language support (show other bugs)
Version: 1.4.0 / 1.4.1 (stable)
Platform: Other Linux
: NOR normal (vote)
Target Milestone: 1.4.0
Assignee: Sven Brauch
Depends on:
Reported: 2013-03-17 11:39 UTC by Todd
Modified: 2015-10-10 15:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
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