BLKSerene/Wordless

View on GitHub

Showing 206 of 206 total issues

Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Minor
Found in wordless/wl_widgets/wl_lists.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                for col in cols:
                                    if self.table.model().item(row, col):
                                        cell_text = self.table.model().item(row, col).text()
                                    else:
                                        cell_text = self.table.indexWidget(self.table.model().index(row, col)).text()
    Severity: Major
    Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if not self.isRowHidden(row):
                                      item = self.model().item(row, col)
      
                                      val_cum += item.val
                                      item.setText(f'{val_cum:.{precision_decimals}}')
      Severity: Major
      Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if not self.isRowHidden(row):
                                        item = self.model().item(row, col)
        
                                        item.setText(str(item.val))
                            # Floats
        Severity: Major
        Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          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:
          Severity: Major
          Found in wordless/wl_nlp/wl_nlp_utils.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    for sentence in wl_sentence_tokenization.wl_sentence_split(self.main, text_no_tags):
                                        self.tokens_multilevel[-1].append([])
            
                                        for sentence_seg in wl_sentence_tokenization.wl_sentence_seg_tokenize_tokens(
                                            self.main,
            Severity: Major
            Found in wordless/wl_nlp/wl_texts.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      for token in sentence_seg:
                                          head = token.head
                                          head_ref = None
              
                                          for i_sentence_seg, sentence_seg in enumerate(sentence):
              Severity: Major
              Found in wordless/wl_nlp/wl_texts.py - About 45 mins to fix

                Function wl_test_pos_tag_models has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def wl_test_pos_tag_models(lang, pos_tagger, test_sentence, tokens, results, results_universal):
                Severity: Minor
                Found in tests/tests_nlp/test_pos_tagging.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  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)
                  Severity: Major
                  Found in utils/wl_trs_translate.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        for i, langs in enumerate(langs_nlp_utils):
                                            # Sentence/word tokenization
                                            if i <= 1:
                                                if lang_code_639_3 in langs:
                                                    doc_supported_lang += '|✔'
                    Severity: Major
                    Found in tests/wl_test_doc.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                      for j, cell in enumerate(row):
                                          for cell_tr, trs in ACKS_TRS.items():
                                              if cell == cell_tr:
                                                  row[j] = trs[i - 1]
                      
                      
                      Severity: Major
                      Found in utils/wl_generate_acks.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if token.lemma_:
                                                lemmas.append(token.lemma_)
                                            else:
                                                lemmas.append(token.text)
                            # Stanza
                        Severity: Major
                        Found in wordless/wl_nlp/wl_lemmatization.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          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,
                          Severity: Major
                          Found in wordless/wl_colligation_extractor.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if tuple(tokens[i + j : i + j + len(search_term)]) == tuple(search_term):
                                                    incl_matched = True
                            
                                                    break
                                # Search terms to be included not found in texts
                            Severity: Major
                            Found in wordless/wl_nlp/wl_matching.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if settings_limit_searching == _tr('Wl_Worker_Colligation_Extractor', 'None'):
                                                              tags_right = text.tags[i + ngram_size + window_left - 1 : i + ngram_size + window_right]
                                                          else:
                                                              # Span positions (Right)
                                                              for position in range(i + ngram_size + window_left - 1, i + ngram_size + window_right):
                              Severity: Major
                              Found in wordless/wl_colligation_extractor.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                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))
                                Severity: Major
                                Found in wordless/wl_concordancer_parallel.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if line and line not in items_cur:
                                                              items_to_imp.append(line)
                                  
                                  
                                  Severity: Major
                                  Found in wordless/wl_widgets/wl_lists.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if token_properties:
                                                            i_tag_start += len(doc)
                                    
                                    
                                    Severity: Major
                                    Found in wordless/wl_nlp/wl_dependency_parsing.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if not file_name:
                                                                  wl_msg_boxes.Wl_Msg_Box_Warning(
                                                                      self.main,
                                                                      title = self.tr('Empty File Name'),
                                                                      text = self.tr('''
                                      Severity: Major
                                      Found in wordless/wl_file_area.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                    for j in range(10):
                                                                        self.set_item_num(row + j, i, 0)
                                        
                                        
                                        Severity: Major
                                        Found in wordless/wl_profiler.py - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language