BLKSerene/Wordless

View on GitHub
wordless/wl_collocation_extractor.py

Summary

Maintainability
B
6 hrs
Test Coverage

Avoid deeply nested control flow statements.
Open

                            if settings_limit_searching == _tr('Wl_Worker_Collocation_Extractor', 'Within sentence segments'):
                                offsets_unit = offsets_sentence_segs
                                len_unit = len_sentence_segs
                            elif settings_limit_searching == _tr('Wl_Worker_Collocation_Extractor', 'Within sentences'):
                                offsets_unit = offsets_sentences
Severity: Major
Found in wordless/wl_collocation_extractor.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 settings_limit_searching == _tr('Wl_Worker_Collocation_Extractor', 'None'):
                                      tokens_left = tokens[max(0, i + window_left) : i]
                                      tokens_right = tokens[i + ngram_size : i + ngram_size + window_right]
                                  else:
                                      # Span positions (Left)
      Severity: Major
      Found in wordless/wl_collocation_extractor.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

                                      if settings_limit_searching == _tr('Wl_Worker_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 settings_limit_searching == _tr('Wl_Worker_Collocation_Extractor', 'None'):
                                            tokens_right = tokens[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_collocation_extractor.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 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 == search_term:
                                                  collocations_freqs_file_filtered[(node, collocate)] = freqs
                  
                  
                  Severity: Major
                  Found in wordless/wl_collocation_extractor.py - About 45 mins to fix

                    There are no issues that match your filters.

                    Category
                    Status