Some clumsy coding related fixes reported by SonarQube.

This commit is contained in:
Aditya Toshniwal
2020-06-15 15:59:37 +05:30
committed by Akshay Joshi
parent a23fad0ba8
commit 641f7bbe9d
17 changed files with 181 additions and 205 deletions

View File

@@ -306,12 +306,12 @@ def suggest_based_on_last_token(token, stmt):
require_last_table=True,
local_tables=stmt.local_tables),)
elif p.token_first().value.lower() == 'select':
# If the lparen is preceeded by a space chances are we're about to
# do a sub-select.
if last_word(stmt.text_before_cursor,
'all_punctuations').startswith('('):
return (Keyword(),)
# If the lparen is preceeded by a space chances are we're about to
# do a sub-select.
elif p.token_first().value.lower() == 'select' and \
last_word(stmt.text_before_cursor,
'all_punctuations').startswith('('):
return (Keyword(),)
prev_prev_tok = prev_tok and p.token_prev(p.token_index(prev_tok))[1]
if prev_prev_tok and prev_prev_tok.normalized == 'INTO':
return (