BLKSerene/Wordless

View on GitHub
wordless/wl_colligation_extractor.py

Summary

Maintainability
C
7 hrs
Test Coverage

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 settings_limit_searching == _tr('wl_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 settings_limit_searching == _tr('wl_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

                                    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

                                      if settings_limit_searching == _tr('wl_colligation_extractor', 'Within sentence segments'):
                                          offsets_unit = offsets_sentence_segs
                                          len_unit = len_sentence_segs
                                      elif settings_limit_searching == _tr('wl_colligation_extractor', 'Within sentences'):
                                          offsets_unit = offsets_sentences
          Severity: Major
          Found in wordless/wl_colligation_extractor.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if settings_limit_searching == _tr('wl_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

                                          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

                                            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 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

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

                      There are no issues that match your filters.

                      Category
                      Status