python-gsoc / python-blogs

Python Software Foundation GSoC Blog Platform. This system was used until 2024 but is no longer maintained.
http://python-gsoc.org/
GNU Affero General Public License v3.0
41 stars 60 forks source link

GSoC 2019 - prospector errors #107

Closed botanicvelious closed 5 years ago

botanicvelious commented 5 years ago

Lots of errors need to be fixed.

C:\Users\matthew\python-blogs>prospector
Messages
========

gsoc\__init__.py
  Line: 4
    pylint: unused-argument / Unused argument 'kwargs'
    pylint: unused-argument / Unused argument 'sender' (col 26)
  Line: 10
    pep8: E305 / expected 2 blank lines after class or function definition, found 1 (col 1)
    pylint: mixed-line-endings / Mixed line endings LF and CRLF

gsoc\admin.py
  Line: 14
    pylint: unused-import / Unused NewsBlogConfig imported from aldryn_newsblog.cms_appconfig
  Line: 41
    pep8: E306 / expected 1 blank line before a nested definition, found 0 (col 5)
  Line: 176
    pylint: undefined-variable / Undefined variable 'form' (col 61)
  Line: 184
    pylint: no-else-return / Unnecessary "else" after "return" (col 4)
  Line: 195
    pep8: E305 / expected 2 blank lines after class or function definition, found 1 (col 1)
  Line: 226
    pylint: no-else-return / Unnecessary "else" after "return" (col 8)
  Line: 235
    pep8: E305 / expected 2 blank lines after class or function definition, found 1 (col 1)

gsoc\cms_toolbars.py
  Line: 24
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 11)
  Line: 25
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 27
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 30)
  Line: 33
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 25)
  Line: 35
    pylint: undefined-variable / Undefined variable 'ADMIN_SITES_BREAK' (col 33)
  Line: 41
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 44
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 45
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 48
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 49
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 56
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 12)
  Line: 59
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 12)
  Line: 62
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 12)
  Line: 65
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 66
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 67
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 69
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 72
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 31)
  Line: 74
    pep8: E305 / expected 2 blank lines after class or function definition, found 1 (col 1)
  Line: 77
    pylint: too-many-locals / Too many local variables (19/15)
    mccabe: MC0001 / populate is too complex (18)
  Line: 78
    pylint: protected-access / Access to a protected member _NewsBlogToolbar__get_newsblog_config of a client class (col 13)
  Line: 164
    pep8: E305 / expected 2 blank lines after class or function definition, found 1 (col 1)

gsoc\cms_wizards.py
  Line: 17
    pylint: unused-argument / Unused argument 'kwargs'
    pylint: unused-argument / Unused argument 'self' (col 28)
  Line: 36
    pep8: E305 / expected 2 blank lines after class or function definition, found 1 (col 1)
  Line: 46
    pylint: unused-variable / Unused variable 'app_configs' (col 4)
  Line: 59
    pylint: unused-argument / Unused argument 'commit' (col 15)
  Line: 77
    pep8: E305 / expected 2 blank lines after class or function definition, found 1 (col 1)

gsoc\common\utils\commands.py
  Line: 1
    pylint: unused-import / Unused import time
  Line: 6
    pylint: unused-argument / Unused argument 'scheduler' (col 15)
    pylint: unused-argument / Unused argument 'scheduler' (col 15)
  Line: 10
    pylint: useless-return / Useless return at end of function or method
    pylint: useless-return / Useless return at end of function or method
  Line: 21
    pylint: useless-return / Useless return at end of function or method
    pylint: useless-return / Useless return at end of function or method

gsoc\common\utils\irc.py
  Line: 28
    pylint: arguments-differ / Parameters differ from overridden 'handle_error' method (col 4)
    pylint: arguments-differ / Parameters differ from overridden 'handle_error' method (col 4)

gsoc\forms.py
  Line: 3
    pylint: unused-import / Unused CheckboxSelectMultiple imported from django.forms
  Line: 25
    pylint: mixed-line-endings / Mixed line endings LF and CRLF

gsoc\management\commands\runcron.py
  Line: 2
    pylint: redefined-builtin / Redefining built-in 'TimeoutError'
  Line: 5
    pylint: unused-import / Unused CommandError imported from django.core.management.base
  Line: 45
    pylint: unused-argument / Unused argument 'options' (col 26)
  Line: 88
    pylint: unused-variable / Unused variable 'e' (col 12)

gsoc\models.py
  Line: 55
    pylint: expression-not-assigned / Expression "self.userprofile_set.get(role=3).accepted_proposal_pdf.path" is assigned to nothing (col 8)
  Line: 57
    pylint: bare-except / No exception type(s) specified (col 4)
  Line: 75
    pep8: E305 / expected 2 blank lines after class or function definition, found 1 (col 1)
  Line: 81
    pylint: unused-argument / Unused argument 'kwargs'
    pylint: unused-argument / Unused argument 'sender' (col 35)
  Line: 94
    pylint: unused-argument / Unused argument 'kwargs'
    pylint: unused-argument / Unused argument 'sender' (col 35)
  Line: 120
    pylint: arguments-differ / Parameters differ from overridden 'save' method (col 4)
  Line: 156
    pep8: W605 / invalid escape sequence '\.' (col -146)
    pep8: W605 / invalid escape sequence '\.' (col -70)
  Line: 163
    pylint: bare-except / No exception type(s) specified (col 12)
  Line: 182
    pylint: bare-except / No exception type(s) specified (col 12)
  Line: 185
    pylint: unused-argument / Unused argument 'text' (col 33)

gsoc\router.py
  Line: 1
    pylint: unused-import / Unused settings imported from django.conf
  Line: 2
    pylint: unused-import / Unused PageUser imported from cms.models
  Line: 3
    pylint: unused-import / Unused PageUserGroup imported from cms.models
  Line: 6
    pylint: useless-object-inheritance / Class 'DatabaseAppsRouter' inherits from object, can be safely removed from bases in python3
  Line: 58
    pylint: mixed-line-endings / Mixed line endings LF and CRLF

gsoc\settings.py
  Line: 14
    pylint: unused-import / Unused django.utils.timezone imported as tz
  Line: 16
    pylint: unused-import / Unused import datetime
  Line: 28
    dodgy: secret / Possible hardcoded secret key
  Line: 54
    dodgy: password / Possible hardcoded password
  Line: 407
    pylint: trailing-newlines / Trailing newlines

gsoc\templatetags\app_tag.py
  Line: 5
    pyflakes: F401 / 'dateutil.relativedelta.*' imported but unused (col 1)
  Line: 6
    pyflakes: F401 / 'django.shortcuts.render' imported but unused (col 1)
  Line: 28
    pyflakes: F841 / local variable 'localDate' is assigned to but never used (col 5)
  Line: 29
    pyflakes: F841 / local variable 'utcDate' is assigned to but never used (col 5)

gsoc\urls.py
  Line: 9
    pylint: unused-import / Unused views imported from django.contrib.auth as auth_views
  Line: 13
    pylint: reimported / Reimport 'include' (imported line 6)
    pyflakes: F811 / redefinition of unused 'include' from line 6 (col 1)

gsoc\views.py
  Line: 7
    pylint: unused-import / Unused UserProfile imported from models
  Line: 46
    pylint: bare-except / No exception type(s) specified (col 4)
  Line: 94
    pylint: inconsistent-return-statements / Either all return statements in a function should return an expression, or none of them should.
    pylint: too-many-statements / Too many statements (63/60)
    mccabe: MC0001 / register_view is too complex (19)
  Line: 162
    pylint: no-else-return / Unnecessary "else" after "return" (col 8)

Check Information
=================
         Started: 2019-04-07 00:01:54.739456
        Finished: 2019-04-07 00:02:07.745776
      Time Taken: 13.01 seconds
       Formatter: grouped
        Profiles: default, no_doc_warnings, no_test_warnings, strictness_medium, strictness_high, strictness_veryhigh, no_member_warnings
      Strictness: None
  Libraries Used: django
       Tools Run: dodgy, mccabe, pep8, profile-validator, pyflakes, pylint
naccht commented 5 years ago

Hi, I am working on this. I have fixed some of the issues and below is my current output of prospector.

Messages
========

gsoc/__init__.py
  Line: 1
    pylint: trailing-newlines / Trailing newlines

gsoc/cms_toolbars.py
  Line: 25
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 11)
  Line: 26
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 28
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 30)
  Line: 34
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 25)
  Line: 36
    pylint: undefined-variable / Undefined variable 'ADMIN_SITES_BREAK' (col 33)
  Line: 42
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 45
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 46
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 49
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 50
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 57
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 12)
  Line: 60
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 12)
  Line: 63
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 12)
  Line: 66
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 67
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 68
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 70
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 8)
  Line: 73
    pylint: protected-access / Access to a protected member _admin_menu of a client class (col 31)
  Line: 75
    pep8: E305 / expected 2 blank lines after class or function definition, found 1 (col 1)
  Line: 78
    pylint: too-many-locals / Too many local variables (19/15)
    mccabe: MC0001 / populate is too complex (18)
  Line: 79
    pylint: protected-access / Access to a protected member _NewsBlogToolbar__get_newsblog_config of a client class (col 13)
  Line: 165
    pep8: E305 / expected 2 blank lines after class or function definition, found 1 (col 1)

gsoc/cms_wizards.py
  Line: 17
    pylint: unused-argument / Unused argument 'kwargs'
    pylint: unused-argument / Unused argument 'self' (col 28)
  Line: 48
    pylint: unused-variable / Unused variable 'app_configs' (col 4)
  Line: 62
    pylint: unused-argument / Unused argument 'commit' (col 15)

gsoc/common/utils/commands.py
  Line: 7
    pylint: unused-argument / Unused argument 'scheduler' (col 15)
    pylint: unused-argument / Unused argument 'scheduler' (col 15)
  Line: 12
    pylint: useless-return / Useless return at end of function or method
    pylint: useless-return / Useless return at end of function or method
  Line: 24
    pylint: useless-return / Useless return at end of function or method
    pylint: useless-return / Useless return at end of function or method

gsoc/common/utils/irc.py
  Line: 30
    pylint: arguments-differ / Parameters differ from overridden 'handle_error' method (col 4)
    pylint: arguments-differ / Parameters differ from overridden 'handle_error' method (col 4)

gsoc/management/commands/runcron.py
  Line: 2
    pylint: redefined-builtin / Redefining built-in 'TimeoutError'
  Line: 46
    pylint: unused-argument / Unused argument 'options' (col 26)

gsoc/models.py
  Line: 55
    pylint: expression-not-assigned / Expression "self.userprofile_set.get(role=3).accepted_proposal_pdf.path" is assigned to nothing (col 8)
  Line: 57
    pylint: bare-except / No exception type(s) specified (col 4)
  Line: 84
    pylint: unused-argument / Unused argument 'kwargs'
    pylint: unused-argument / Unused argument 'sender' (col 35)
  Line: 98
    pylint: unused-argument / Unused argument 'kwargs'
    pylint: unused-argument / Unused argument 'sender' (col 35)
  Line: 124
    pylint: arguments-differ / Parameters differ from overridden 'save' method (col 4)
  Line: 160
    pep8: W605 / invalid escape sequence '\.' (col -146)
    pep8: W605 / invalid escape sequence '\.' (col -70)
  Line: 167
    pylint: bare-except / No exception type(s) specified (col 12)
  Line: 187
    pylint: bare-except / No exception type(s) specified (col 12)
  Line: 191
    pylint: unused-argument / Unused argument 'text' (col 33)

gsoc/router.py
  Line: 1
    pylint: unused-import / Unused settings imported from django.conf
  Line: 2
    pylint: unused-import / Unused PageUser imported from cms.models
  Line: 3
    pylint: unused-import / Unused PageUserGroup imported from cms.models
  Line: 6
    pylint: useless-object-inheritance / Class 'DatabaseAppsRouter' inherits from object, can be safely removed from bases in python3
  Line: 58
    pylint: mixed-line-endings / Mixed line endings LF and CRLF

gsoc/settings.py
  Line: 26
    dodgy: secret / Possible hardcoded secret key
  Line: 52
    dodgy: password / Possible hardcoded password
  Line: 405
    pylint: trailing-newlines / Trailing newlines

gsoc/views.py
  Line: 49
    pylint: bare-except / No exception type(s) specified (col 4)
  Line: 98
    pylint: inconsistent-return-statements / Either all return statements in a function should return an expression, or none of them should.
    pylint: too-many-statements / Too many statements (62/60)
    mccabe: MC0001 / register_view is too complex (19)

Check Information
=================
         Started: 2019-04-07 23:26:24.197950
        Finished: 2019-04-07 23:26:32.311920
      Time Taken: 8.11 seconds
       Formatter: grouped
        Profiles: default, no_doc_warnings, no_test_warnings, strictness_medium, strictness_high, strictness_veryhigh, no_member_warnings
      Strictness: None
  Libraries Used: django
       Tools Run: dodgy, mccabe, pep8, profile-validator, pyflakes, pylint
  Messages Found: 62

The errors associated to _admin_menu access would imply to refactor it such that it becomes part of the public interface of the containing class and I do not know if this would be acceptable.

I should be able to submit a pull request within tomorrow