Code quality #1773

Open
PeterSurda wants to merge 1 commits from PeterSurda/cq101 into v0.6
2 changed files with 10 additions and 2 deletions

View File

@ -44,7 +44,7 @@ else:
class TLSDispatcher(AdvancedDispatcher):
"""TLS functionality for classes derived from AdvancedDispatcher"""
# pylint: disable=too-many-instance-attributes, too-many-arguments
# pylint: disable=super-init-not-called
# pylint: disable=super-init-not-called, unused-argument
def __init__(self, _=None, sock=None, certfile=None, keyfile=None,
server_side=False, ciphers=sslProtocolCiphers):
self.want_read = self.want_write = True

View File

@ -21,7 +21,7 @@ class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes
port = 8444
def __init__(self, host=None, sock=None, announcing=False):
# pylint: disable=bad-super-call
# pylint: disable=bad-super-call, access-member-before-definition
super(BMProto, self).__init__(sock=sock)
g1itch commented 2021-08-09 11:26:10 +02:00 (Migrated from github.com)
Review
This is a bug: https://github.com/PyCQA/pylint/issues/2315
Jeroenvb3 commented 2022-12-21 11:12:00 +01:00 (Migrated from github.com)
Review

The linked bug has been fixed. The ignore shouldn't be needed anymore.

The linked bug has been fixed. The ignore shouldn't be needed anymore.
self.verackReceived = True
g1itch commented 2021-06-02 14:55:36 +02:00 (Migrated from github.com)
Review
super(UDPSocket, self).__init__(sock=sock)

?

```python super(UDPSocket, self).__init__(sock=sock) ``` ?
self.verackSent = True
@ -97,22 +97,30 @@ class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes
time.time()
return True
# override the protocol do ignore the following commands on UDP
# we do this mainly for security reasons
def bm_command_portcheck(self):
# pylint: disable=no-self-use
return True
def bm_command_ping(self):
# pylint: disable=no-self-use
return True
def bm_command_pong(self):
g1itch commented 2021-08-09 11:19:15 +02:00 (Migrated from github.com)
Review

This is more of inheritance flow. Maybe UDPSocket should inherit from some more basic class?

This is more of inheritance flow. Maybe `UDPSocket` should inherit from some more basic class?
PeterSurda commented 2021-08-09 12:27:09 +02:00 (Migrated from github.com)
Review

Perhaps.

Perhaps.
# pylint: disable=no-self-use
return True
def bm_command_verack(self):
# pylint: disable=no-self-use
return True
def bm_command_version(self):
# pylint: disable=no-self-use
return True
def handle_connect(self):
# pylint: disable=no-self-use
return
def writable(self):