BLKSerene/Wordless

View on GitHub

Showing 204 of 204 total issues

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

                        if re_match(search_term, dependency_relation.display_text(), flags = re_flags):
                            search_results.add(dependency_relation)
            else:
    Severity: Major
    Found in wordless/wl_nlp/wl_matching.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          for sentence_seg in sentence:
                              for i, token in enumerate(sentence_seg):
                                  if token in stop_words:
                                      sentence_seg[i] = ''
              else:
      Severity: Major
      Found in wordless/wl_nlp/wl_token_processing.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            for sentence in doc.sents:
                                htmls.append(spacy.displacy.render(
                                    sentence,
                                    style = 'dep',
                                    minify = True,
        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 self.isRowHidden(row):
                                          item = self.model().item(row, col)
          
                                          val_cum += item.val
                                          item.setText(f'{val_cum:.{precision_pcts}%}')
          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(f'{item.val:.{precision_decimals}}')
                                # Percentages
            Severity: Major
            Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          for word in wl_word_tokenization.wl_word_tokenize_flat(main, tr, lang):
                                              add_val_to_trs(trs_lexicon, word, vals)
                                      else:
              Severity: Major
              Found in utils/wl_generate_vader_dicts.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if self.settings_tags == 'body_tag_settings' and tag_name == '*':
                                            opening_tag_text = opening_tag_text.replace('*', _tr('wl_settings_files', 'TAG'))
                                            closing_tag_text = self.model().item(row, 3).text().replace('*', _tr('wl_settings_files', 'TAG'))
                                            preview.setText(opening_tag_text + _tr('wl_settings_files', 'token') + closing_tag_text)
                                        else:
                Severity: Major
                Found in wordless/wl_settings/wl_settings_files.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if (para := para[tag_last_end:]):
                                              tags_tokens = self.add_tags_splitting(para, tags_tokens)
                  
                              # Add empty tags for untagged files
                              if not self.tagged:
                  Severity: Major
                  Found in wordless/wl_nlp/wl_texts.py - About 45 mins to fix

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

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

                        Avoid deeply nested control flow statements.
                        Open

                                                    for k, ngram in enumerate(wl_nlp_utils.ngrams(tokens, len_search_term)):
                                                        if ngram == search_term:
                                                            points.append([x_start + k / text.num_tokens * len_tokens_total, y_start - j])
                                                            # Total
                                                            points.append([x_start_total + k, 0])
                        Severity: Major
                        Found in wordless/wl_concordancer.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      if (
                                                          (
                                                              (
                                                                  not settings['search_settings']['match_dependency_relations']
                                                                  and (token in search_terms or head in search_terms)
                          Severity: Major
                          Found in wordless/wl_dependency_parser.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        for j, collocate in enumerate(reversed(tokens_left)):
                                                            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_collocation_extractor.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if ngram == tuple(search_term):
                                                          self.dialog.items_found.append([table, row, col])
                              
                              
                              Severity: Major
                              Found in wordless/wl_results/wl_results_search.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                            for j, collocate in enumerate(tokens_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_collocation_extractor.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          for file in glob.glob(os.path.join(
                                                              self.settings_custom['general']['imp']['temp_files']['default_path'], '*.*'
                                                          )):
                                                              os.remove(file)
                                  
                                  
                                  Severity: Major
                                  Found in wordless/wl_main.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                if settings_limit_searching == _tr('wl_collocation_extractor', 'None'):
                                                                    tokens_left = tokens[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)):
                                    Severity: Major
                                    Found in wordless/wl_collocation_extractor.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                  if ngram == search_term:
                                                                      collocations_freqs_file_filtered[(node, collocate)] = freqs
                                      
                                      
                                      Severity: Major
                                      Found in wordless/wl_collocation_extractor.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                    if _tr('wl_wordlist_generator', 'No language support') in tokens_syllabified:
                                                                        self.set_item_err(i, 2, tokens_syllabified, alignment_hor = 'left')
                                                                    else:
                                                                        self.model().setItem(i, 2, wl_tables.Wl_Table_Item(tokens_syllabified))
                                        
                                        
                                        Severity: Major
                                        Found in wordless/wl_wordlist_generator.py - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language