Skip to content

Commit

Permalink
Fix some code quality and bug-risk issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pnijhara committed May 2, 2020
1 parent ebaf21d commit 7279fb0
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 6 deletions.
19 changes: 19 additions & 0 deletions .deepsource.toml
@@ -0,0 +1,19 @@
version = 1

test_patterns = [
"*/test/**",
"*/test/**/*.py"
]

exclude_patterns = [
"twisted/plugins/**",
"examples/**"
]

[[analyzers]]
name = "python"
enabled = true

[analyzers.meta]
runtime_version = "3.x.x"

2 changes: 1 addition & 1 deletion autobahn/asyncio/component.py
Expand Up @@ -55,7 +55,7 @@ def _unique_list(seq):

def _camel_case_from_snake_case(snake):
parts = snake.split('_')
return parts[0] + ''.join([s.capitalize() for s in parts[1:]])
return parts[0] + ''.join(s.capitalize() for s in parts[1:])


def _create_transport_factory(loop, transport, session_factory):
Expand Down
2 changes: 1 addition & 1 deletion autobahn/asyncio/websocket.py
Expand Up @@ -93,7 +93,7 @@ def _consume(self):
self.waiter = Future(loop=self.factory.loop or txaio.config.loop)

def process(_):
while len(self.receive_queue):
while self.receive_queue:
data = self.receive_queue.popleft()
if self.transport:
self._dataReceived(data)
Expand Down
2 changes: 1 addition & 1 deletion autobahn/twisted/component.py
Expand Up @@ -67,7 +67,7 @@ def _unique_list(seq):

def _camel_case_from_snake_case(snake):
parts = snake.split('_')
return parts[0] + ''.join([s.capitalize() for s in parts[1:]])
return parts[0] + ''.join(s.capitalize() for s in parts[1:])


def _create_transport_factory(reactor, transport, session_factory):
Expand Down
2 changes: 1 addition & 1 deletion autobahn/wamp/auth.py
Expand Up @@ -579,7 +579,7 @@ def generate_wcs(length=14):
:rtype: bytes
"""
assert(type(length) == int)
return "".join([random.choice(WCS_SECRET_CHARSET) for _ in range(length)]).encode('ascii')
return "".join(random.choice(WCS_SECRET_CHARSET) for _ in range(length)).encode('ascii')


@public
Expand Down
4 changes: 3 additions & 1 deletion autobahn/wamp/component.py
Expand Up @@ -268,9 +268,11 @@ def __init__(self, idx, kind, url, endpoint, serializers,
retry_delay_growth=1.5,
retry_delay_jitter=0.1,
proxy=None,
options=dict()):
options=None):
"""
"""
if options is None:
options = dict()
self.idx = idx

self.type = kind
Expand Down
2 changes: 1 addition & 1 deletion autobahn/wamp/cryptosign.py
Expand Up @@ -183,7 +183,7 @@ def _read_ssh_ed25519_privkey(keydata):

ssh_end = keydata.find(SSH_END)
keydata = keydata[len(SSH_BEGIN):ssh_end]
keydata = ''.join([x.strip() for x in keydata.split()])
keydata = ''.join(x.strip() for x in keydata.split())
blob = binascii.a2b_base64(keydata)

blob = blob[len(OPENSSH_KEY_V1):]
Expand Down

0 comments on commit 7279fb0

Please sign in to comment.