Showing 205 of 205 total issues
Function wl_test_lemmatize_models
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def wl_test_lemmatize_models(lang, lemmatizer, test_sentence, tokens, results, lang_exceptions = None):
Avoid deeply nested control flow statements. Open
Open
if any((text in tr for text in [])):
# Flag translation as unfinished to be reviewed manually
unfinished = True
Avoid deeply nested control flow statements. Open
Open
for word in wl_word_tokenization.wl_word_tokenize_flat(main, tr, lang):
add_val_to_trs(trs_lexicon, word, vals)
else:
Avoid deeply nested control flow statements. Open
Open
if re_match(search_term, token_search.display_text(), flags = re_flags):
search_results.add(token)
# Match inflected forms of search terms and search results
if settings['match_inflected_forms']:
Avoid deeply nested control flow statements. Open
Open
for sentence_seg in sentence:
for i, token in enumerate(sentence_seg):
# Convert to strings to ignore tags and punctuation marks, if any, when checking for stop words
if str(token) in stop_words:
sentence_seg[i] = wl_texts.Wl_Token('')
Avoid deeply nested control flow statements. Open
Open
for sentence_seg in sentence:
for i, token in enumerate(sentence_seg):
# Convert to strings to ignore tags and punctuation marks, if any, when checking for stop words
if token.lower() in stop_words:
sentence_seg[i] = wl_texts.Wl_Token('')
Avoid deeply nested control flow statements. Open
Open
for sentence_seg in sentence:
for i, token in enumerate(sentence_seg):
if token.istitle():
sentence_seg[i] = wl_texts.Wl_Token('')
else:
Avoid deeply nested control flow statements. Open
Open
if not self.isRowHidden(row):
item = self.model().item(row, col)
item.setText(f'{item.val:.{precision_decimals}}')
# Percentages
Avoid deeply nested control flow statements. Open
Open
if settings_limit_searching == _tr('Wl_Worker_Colligation_Extractor', 'None'):
tags_left = text.tags[max(0, i + window_left) : i]
tags_right = text.tags[i + ngram_size : i + ngram_size + window_right]
else:
# Span positions (Left)
Avoid deeply nested control flow statements. Open
Open
if settings_limit_searching == _tr('Wl_Worker_Colligation_Extractor', 'None'):
tags_left = text.tags[max(0, i + window_left) : max(0, i + window_right + 1)]
else:
# Span positions (Left)
for position in range(max(0, i + window_left), max(0, i + window_right + 1)):
Avoid deeply nested control flow statements. Open
Open
for k, ngram in enumerate(wl_nlp_utils.ngrams(text.get_tokens_flat(), len_search_term)):
if ngram == search_term:
points.append([x_start + k, i])
Avoid deeply nested control flow statements. Open
Open
if len_raw_temp_tokens == len_processed_temp_tokens:
results_modified.extend(results_temp)
elif len_raw_temp_tokens < len_processed_temp_tokens:
results_modified.extend(results_temp[:len_raw_temp_tokens])
elif len_raw_temp_tokens > len_processed_temp_tokens:
Avoid deeply nested control flow statements. Open
Open
if not file_name:
wl_msg_boxes.Wl_Msg_Box_Warning(
self.main,
title = self.tr('Empty File Name'),
text = self.tr('''
Avoid deeply nested control flow statements. Open
Open
for node in nodes:
len_node = len(node)
for j, ngram in enumerate(wl_nlp_utils.ngrams(parallel_unit, len_node)):
if ngram == tuple(node):
Avoid deeply nested control flow statements. Open
Open
if settings['generation_settings']['context_len_unit'] == self.tr('Character'):
len_context_left = 0
len_context_right = 0
left_tokens_raw = []
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Avoid deeply nested control flow statements. Open
Open
if not self.isRowHidden(row):
item = self.model().item(row, col)
val_cum += item.val
item.setText(f'{val_cum:.{precision_decimals}}')
Avoid deeply nested control flow statements. Open
Open
for i, token in enumerate(sentence_seg):
if wl_checks_tokens.is_word_alphabetic(token):
sentence_seg[i] = wl_texts.Wl_Token('')
# Numerals
Avoid deeply nested control flow statements. Open
Open
for j, count in enumerate(counts):
self.set_item_num(
row = self.model().rowCount() - 2,
col = j,
val = count
Avoid deeply nested control flow statements. Open
Open
if i != item_row and item_text == text:
wl_msg_boxes.Wl_Msg_Box_Warning(
self.main,
title = _tr('wl_lists', 'Duplicates Found'),
text = _tr('wl_lists', '''