Bug 173601 - False positives in pygtk code
Summary: False positives in pygtk code
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: pylint
Version: 4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Konstantin Ryabitsev
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-11-18 15:55 UTC by Toshio Kuratomi
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-11-28 15:54:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Python class making heavy use of pygtk -- testcase (14.66 KB, text/plain)
2005-11-23 16:28 UTC, Toshio Kuratomi
no flags Details

Description Toshio Kuratomi 2005-11-18 15:55:56 UTC
Description of problem:
With the latest update to 0.8.1, pylint has started to generate so many false
positives in pygtk code that it is unusable.  Plus my code rating has dropped
precipitiously :-)

Version-Release number of selected component (if applicable):
0.8.1-1

How reproducible:
Whenever checking pygtk code

Steps to Reproduce:
1.
2.
3.
  
Actual results:
[badger@katahdin src]$ pylint review.py
Problem importing module: similar.py
Problem importing module: similar.pyc
************* Module review
W0511:278: FIXME: Figure out whether we want to hide the display *Box's before
E0611: 18: No name 'textwrap' in module 'optik'
W0403: 22: Relative import 'qaglobals'
W0401: 22: Wildcard import
W0403: 23: Relative import 'checklist'
W0403: 24: Relative import 'gpg'
W0403: 25: Relative import 'error'
R0902: 27:Review: Too many instance attributes (10/7)
E0611: 27:Review: No name 'VBox' in module 'gtk'
F0203: 34:Review.__init__: Unable to resolve gtk.VBox
E0611: 43:Review.__init__: No name 'VBox' in module 'gtk'
E0611: 56:Review.__init__: No name 'Label' in module 'gtk'
E0611: 61:Review.__init__: No name 'Label' in module 'gtk'
E0611: 69:Review.__init__: No name 'Label' in module 'gtk'
R0914: 88:Review.publish: Too many local variables (18/15)
E0611: 99:Review.publish: No name 'MessageDialog' in module 'gtk'
E0611:100:Review.publish: No name 'DIALOG_DESTROY_WITH_PARENT' in module 'gtk'
E0611:101:Review.publish: No name 'MESSAGE_WARNING' in module 'gtk'
E0611:102:Review.publish: No name 'BUTTONS_CLOSE' in module 'gtk'
E0611:109:Review.publish: No name 'RESPONSE_CLOSE' in module 'gtk'
E0611:161:Review.publish: No name 'MessageDialog' in module 'gtk'
E0611:162:Review.publish: No name 'DIALOG_DESTROY_WITH_PARENT' in module 'gtk'
E0611:163:Review.publish: No name 'MESSAGE_WARNING' in module 'gtk'
E0611:164:Review.publish: No name 'BUTTONS_CLOSE' in module 'gtk'
E0611:170:Review.publish: No name 'RESPONSE_CLOSE' in module 'gtk'
E0611:175:Review.publish: No name 'MessageDialog' in module 'gtk'
E0611:176:Review.publish: No name 'DIALOG_DESTROY_WITH_PARENT' in module 'gtk'
E0611:177:Review.publish: No name 'MESSAGE_WARNING' in module 'gtk'
E0611:178:Review.publish: No name 'BUTTONS_CLOSE' in module 'gtk'
E0611:188:Review.publish: No name 'RESPONSE_CLOSE' in module 'gtk'
E0611:193:Review.publish: No name 'MessageDialog' in module 'gtk'
E0611:194:Review.publish: No name 'DIALOG_DESTROY_WITH_PARENT' in module 'gtk'
E0611:195:Review.publish: No name 'MESSAGE_WARNING' in module 'gtk'
E0611:196:Review.publish: No name 'BUTTONS_CLOSE' in module 'gtk'
E0611:204:Review.publish: No name 'RESPONSE_CLOSE' in module 'gtk'
R0912: 88:Review.publish: Too many branches (16/12)
R0915: 88:Review.publish: Too many statements (60/50)
W0612:171:Review.publish: Unused variable 'response'
E0611:256:Review.__sync_checklist: No name 'Label' in module 'gtk'
W0704:271:Review.__sync_checklist: Except doesn't do anything
E0611:275:Review.__sync_checklist: No name 'VBox' in module 'gtk'
E0611:350:Review.__update_data: No name 'Label' in module 'gtk'
R0912:292:Review.__update_data: Too many branches (14/12)
W0201:248:Review.__sync_checklist: Attribute 'displayList' defined outside __init__
W0201:236:Review.set_model: Attribute 'checklist' defined outside __init__
W0201:266:Review.__sync_checklist: Attribute 'lastEntry' defined outside __init__
W0201:247:Review.__sync_checklist: Attribute 'entries' defined outside __init__
E0201:289:Review.__sync_checklist: Access to undefined member 'add_with_properties'
E0201: 86:Review.show: Access to undefined member 'show_all'
E0201:270:Review.__sync_checklist: Access to undefined member 'remove'
E0201: 57:Review.__init__: Access to undefined member 'add'
E0201: 63:Review.__init__: Access to undefined member 'add'
E0201: 70:Review.__init__: Access to undefined member 'add'
E0201: 75:Review.__init__: Access to undefined member 'set_property'
W0611: 22: Unused import HUMANPROGRAMNAME
W0611: 22: Unused import VERSION
W0611: 22: Unused import PROGRAMNAME
W0611: 22: Unused import lastReviewDir


Report
======
191 statements analysed.

Raw metrics
-----------

type      number %     previous difference
:::::::::::::::::::::::::::::::::::::::::::
code      220    66.27 220      =
docstring 71     21.39 71       =
comment   24     7.23  24       =
empty     17     5.12  17       =


External dependencies
---------------------
::


      \-checklist (review)
      \-gpg (review)
      \-error (review)
    optparse (review)
    gtk (review)
    textwrap (review)
    optik (review)
    gconf (review)
    gobject (review)



Statistics by type
------------------

type     number old number difference %documented %badname
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
module   1      1          =          100.00      0.00
class    1      1          =          100.00      0.00
method   7      7          =          100.00      0.00
function 0      0          =          0.00        0.00


Total errors / warnings
-----------------------

type       number previous difference
::::::::::::::::::::::::::::::::::::::
convention 0      0        =
refactor   5      5        =
warning    16     11       +5.00
error      36     9        +27.00


Messages
--------

message id occurences
::::::::::::::::::::::
E0611      29
E0201      7
W0611      4
W0403      4
W0201      4
R0912      2
W0704      1
W0612      1
W0511      1
W0401      1
R0915      1
R0914      1
R0902      1
F0203      1


Global evaluation
-----------------
Your code has been rated at -0.52/10 (previous run: 6.81/10)
You have to do something quick !


Expected results:


Additional info:

I'll downgrade and post my output from the previous version later -- but the
large number of spurious errors and the decrease in rating with no code changes
(6.81 -> -0.52) shows that something has changed.

Comment 1 Toshio Kuratomi 2005-11-18 20:10:58 UTC
Output from 0.7::

************* Module review
W0511:278: FIXME: Figure out whether we want to hide the display *Box's before
W0403: 22: Relative import 'qaglobals'
W0401: 22: Wildcard import
W0403: 23: Relative import 'checklist'
W0403: 24: Relative import 'gpg'
W0403: 25: Relative import 'error'
R0902: 27:Review: Too many instance attributes (10/7)
F0203: 34:Review.__init__: Unable to resolve gtk.VBox
R0914: 88:Review.publish: Too many local variables (18/15)
W0612:171:Review.publish: Unused variable 'response'
R0912: 88:Review.publish: Too many branches (16/12)
R0915: 88:Review.publish: Too many statements (60/50)
W0704:271:Review.__sync_checklist: Except doesn't do anything
R0912:292:Review.__update_data: Too many branches (14/12)
W0201:248:Review.__sync_checklist: Attribute 'displayList' defined outside __init__
W0201:236:Review.set_model: Attribute 'checklist' defined outside __init__
W0201:266:Review.__sync_checklist: Attribute 'lastEntry' defined outside __init__
W0201:247:Review.__sync_checklist: Attribute 'entries' defined outside __init__
E0201:289:Review.__sync_checklist: Access to undefined member 'add_with_properties'
E0201: 86:Review.show: Access to undefined member 'show_all'
E0201:270:Review.__sync_checklist: Access to undefined member 'remove'
E0201: 57:Review.__init__: Access to undefined member 'add'
E0201: 63:Review.__init__: Access to undefined member 'add'
E0201: 70:Review.__init__: Access to undefined member 'add'
E0201: 75:Review.__init__: Access to undefined member 'set_property'
W0611: 22: Unused import lastReviewDir
W0611: 22: Unused import VERSION
W0611: 22: Unused import PROGRAMNAME
W0611: 22: Unused import HUMANPROGRAMNAME


Report
======
191 statements analysed.

Duplication
-----------

                         now   previous difference
:::::::::::::::::::::::::::::::::::::::::::::::::::
nb duplicated lines      0     0        =
percent duplicated lines 0.000 0.000    =


Raw metrics
-----------

type      number %     previous difference
:::::::::::::::::::::::::::::::::::::::::::
code      220    66.27 220      =
docstring 71     21.39 71       =
comment   24     7.23  24       =
empty     17     5.12  17       =


External dependencies
---------------------
::


      \-checklist (review)
      \-gpg (review)
      \-error (review)
    optparse (review)
    gtk (review)
    textwrap (review)
    optik (review)
    gconf (review)
    gobject (review)



Statistics by type
------------------

type     number old number difference %documented %badname
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
module   1      1          =          100.00      0.00
class    1      1          =          100.00      0.00
method   7      7          =          100.00      0.00
function 0      0          =          0.00        0.00


Total errors / warnings
-----------------------

type       number previous difference
::::::::::::::::::::::::::::::::::::::
convention 0      0        =
refactor   5      5        =
warning    16     16       =
error      7      7        =


Messages
--------

message id occurences
::::::::::::::::::::::
E0201      7
W0611      4
W0403      4
W0201      4
R0912      2
W0704      1
W0612      1
W0511      1
W0401      1
R0915      1
R0914      1
R0902      1
F0203      1


Global evaluation
-----------------
Your code has been rated at 7.07/10 (previous run: 7.07/10)
If you commit now, people should not be making nasty comments about you on c.l.py


Comment 2 Konstantin Ryabitsev 2005-11-23 03:06:58 UTC
There were some problems caused by an older version of python-logilab-common.
Are you still seeing the same behaviour with the latest updates?

Comment 3 Toshio Kuratomi 2005-11-23 16:20:02 UTC
Yep -- just updated and I'm still having many spurious errors.  It doesn't have
the "similar.py" error at the top, though.

Looks like pylint used to either not descend into imported packages or if it was
a C extension and so couldn't descend, it would not generate errors related to
that code.  In the current incarnation it's flagging every gtk.SOMETHING as
referencing an unknown and therefore an error.

If upstream had a bug tracker, I'd post this there instead.  Since they don't,
does it make sense to point them here?  (I'm not on any pylint mailing lists.)

Comment 4 Toshio Kuratomi 2005-11-23 16:28:22 UTC
Created attachment 121406 [details]
Python class making heavy use of pygtk -- testcase

Here's my testcase.

Comment 5 Toshio Kuratomi 2005-11-23 16:31:35 UTC
Versions I have installed on my system:

pylint-0.8.1-1.fc4
python-astng-0.13.1-2.fc4
python-logilab-common-0.12.0-1.fc4
pygtk2-2.6.2-0.fc4.4


Comment 6 Konstantin Ryabitsev 2005-11-23 16:44:50 UTC
I'm on the logilab list, so I'll send an email there to see if this is expected
behaviour, or if it's a bug. Thanks!

Comment 7 Konstantin Ryabitsev 2005-11-28 15:54:51 UTC
It's a known upstream bug, apparently, having to do with C modules. Hopefully
it'll get fixed before long. I'm going to resolve it as "CANTFIX" since, well, I
can't. :)

Comment 8 Toshio Kuratomi 2005-11-29 16:41:08 UTC
Welp -- If upstream knows about it I guess that's all we can ask for :-)


Note You need to log in before you can comment on or make changes to this bug.