BLKSerene/Wordless

View on GitHub

Showing 206 of 206 total issues

Avoid deeply nested control flow statements.
Open

                    for doc in nlp.pipe(docs):
                        for token in doc:
                            texts_tagged.append(token.text)

                            if tagset in ['default', 'raw']:
Severity: Major
Found in wordless/wl_nlp/wl_pos_tagging.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if freqs_totals[j][k]:
                                    self.set_item_num(i, cols_freqs_start[j] + k * 2 + 1, freq / freqs_totals[j][k])
                                else:
                                    self.set_item_num(i, cols_freqs_start[j] + k * 2 + 1, 0)
    
    
    Severity: Major
    Found in wordless/wl_colligation_extractor.py - About 45 mins to fix

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

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

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

            Avoid deeply nested control flow statements.
            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)
            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):
                                      excl_matched = False
              
                                      break
                  # Search terms to be excluded 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

                                    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('')
                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 sentences:
                                                  tokens_multilevel[-1].append(main.nltk_nist_tokenizer.international_tokenize(sentence))
                                          case 'nltk_nltk':
                  Severity: Major
                  Found in wordless/wl_nlp/wl_word_tokenization.py - About 45 mins to fix

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

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

                      Avoid deeply nested control flow statements.
                      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] = [
                      Severity: Major
                      Found in tests/tests_figs/test_figs_freqs.py - About 45 mins to fix

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

                            Avoid deeply nested control flow statements.
                            Open

                                                if prefer_raw:
                                                    # Always use original tokens
                                                    results_modified.extend(tokens_raw_temp)
                                                # eg. POS tagging
                                                else:
                            Severity: Major
                            Found in wordless/wl_nlp/wl_nlp_utils.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if settings['generation_settings']['context_len_unit'] == self.tr('Character'):
                                                              len_context_left = 0
                                                              len_context_right = 0
                              
                                                              left_tokens_raw = []
                              Severity: Major
                              Found in wordless/wl_concordancer.py - About 45 mins to fix

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

                                  Avoid deeply nested control flow statements.
                                  Open

                                                              if text.lang in self.main.settings_global['sentiment_analyzers']:
                                                                  sentiment_inputs.append(' '.join(
                                                                      [*left_tokens_search, *node_tokens_search, *right_tokens_search]
                                                                  ))
                                  
                                  
                                  Severity: Major
                                  Found in wordless/wl_concordancer.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                for j, count in enumerate(counts):
                                                                    self.set_item_num(
                                                                        row = self.model().rowCount() - 2,
                                                                        col = j,
                                                                        val = count
                                    Severity: Major
                                    Found in wordless/wl_profiler.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if re_match(lemma_matched, lemma_search, flags = re_flags):
                                                              tokens_matched[token_matched].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 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('')
                                        Severity: Major
                                        Found in wordless/wl_nlp/wl_token_processing.py - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language