BLKSerene/Wordless

View on GitHub
wordless/wl_concordancer.py

Summary

Maintainability
A
3 hrs
Test Coverage

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

                                if settings['token_settings']['punc_marks']:
                                    node_tokens_search = list(ngram)
    
                                    # Remove empty tokens for searching in results
                                    left_tokens_search = [token for token in copy.deepcopy(left_tokens_raw) if token]
    Severity: Major
    Found in wordless/wl_concordancer.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

                                    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])
        
        
        Severity: Major
        Found in wordless/wl_concordancer.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

            There are no issues that match your filters.

            Category
            Status