Showing 205 of 205 total issues
Avoid deeply nested control flow statements. Open
Open
if line and line not in items_cur:
items_to_imp.append(line)
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Avoid deeply nested control flow statements. Open
Open
for encoding, trs in TRS_ENCODINGS.items():
if encoding in tr:
tr = tr.replace(encoding, trs[0])
break
Avoid deeply nested control flow statements. Open
Open
for token in sentence_seg:
refs = head_refs[i_token]
if refs is not None:
token.head = self.tokens_multilevel[refs[0]][refs[1]][refs[2]][refs[3]]
Avoid deeply nested control flow statements. Open
Open
for token in copy.deepcopy(parallel_unit):
parallel_unit_tokens_search.append(token)
if token.punc_mark:
parallel_unit_tokens_search.append(wl_texts.Wl_Token(token.punc_mark, lang = token.lang))
Avoid deeply nested control flow statements. Open
Open
if lens.any():
self.set_item_num(row, i, numpy.mean(lens))
self.set_item_num(row + 1, i, numpy.std(lens))
self.set_item_num(row + 2, i, numpy.var(lens))
self.set_item_num(row + 3, i, numpy.min(lens))
Avoid deeply nested control flow statements. Open
Open
for util, trs in TRS_NLP_UTILS.items():
# Only replace language utility names after language names or at the end of text
if f' - {util}' in tr or tr.endswith(util):
if f' - {util}' in tr:
tr = tr.replace(f' - {util}', f' - {trs[0]}', 1)
Avoid deeply nested control flow statements. Open
Open
for j, collocate in enumerate(reversed(tags_left)):
if wl_matching.check_context(
i, tokens,
context_settings = settings['search_settings']['context_settings'],
search_terms_incl = search_terms_incl,
Avoid deeply nested control flow statements. Open
Open
if tuple(tokens[i + j : i + j + len(search_term)]) == tuple(search_term):
excl_matched = False
break
# Search terms to be excluded not found in texts
Avoid deeply nested control flow statements. Open
Open
for sentence in doc.sents:
displacy_dict = spacy.displacy.parse_deps(sentence, options = options)
if token_properties:
for token, word in zip(sentence, displacy_dict['words']):
Function wl_test_pos_tag_models
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def wl_test_pos_tag_models(lang, pos_tagger, test_sentence, tokens, results, results_universal):
Avoid deeply nested control flow statements. Open
Open
for j, cell in enumerate(row):
for cell_tr, trs in ACKS_TRS.items():
if cell == cell_tr:
row[j] = trs[i - 1]
Avoid deeply nested control flow statements. Open
Open
if ngram == search_term:
colligations_freqs_file_filtered[(node, collocate)] = freqs
Avoid deeply nested control flow statements. Open
Open
for item in range(100):
item = wl_texts.Wl_Token(str(item))
freq_1, freq_2 = random.sample(range(100), 2)
freq_files_items[item] = [
Avoid deeply nested control flow statements. Open
Open
if token.lemma_:
lemmas.append(token.lemma_)
else:
lemmas.append(token.text)
# Stanza
Avoid deeply nested control flow statements. Open
Open
for file_type, trs in TRS_FILE_TYPES.items():
if tr == file_type:
tr = trs[0]
break
Avoid deeply nested control flow statements. Open
Open
for token, lemma_search in set(zip(tokens, lemmas_search)):
if re_match(lemma_matched, lemma_search, flags = re_flags):
search_results.add(token)
Avoid deeply nested control flow statements. Open
Open
if tr_raw != tr:
# Do not replace parentheses in file type filters
if element_src.text not in TRS_FILE_TYPES:
# Parentheses
tr = re.sub(r'\s*\(', r'(', tr)
Avoid deeply nested control flow statements. Open
Open
if self.settings_tags == 'body_tag_settings' and tag_name == '*':
opening_tag_text = opening_tag_text.replace('*', _tr('Wl_Table_Tags', 'TAG'))
closing_tag_text = self.model().item(row, 3).text().replace('*', _tr('Wl_Table_Tags', 'TAG'))
preview.setText(opening_tag_text + _tr('Wl_Table_Tags', 'token') + closing_tag_text)
else:
Avoid deeply nested control flow statements. Open
Open
for j, collocate in enumerate(tags_right):
if wl_matching.check_context(
i, tokens,
context_settings = settings['search_settings']['context_settings'],
search_terms_incl = search_terms_incl,