BLKSerene/Wordless

View on GitHub
wordless/wl_nlp/wl_matching.py

Summary

Maintainability
C
1 day
Test Coverage

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

                        if tuple(tokens[i + j : i + j + len(search_term)]) == tuple(search_term):
                            incl_matched = True
    
                            break
        # Search terms to be included 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

                          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

                            if re_match(search_term, token_search.display_text(), flags = re_flags):
                                search_results.add(token)
        
                    # Match inflected forms of search terms and search results
                    if settings['match_inflected_forms']:
        Severity: Major
        Found in wordless/wl_nlp/wl_matching.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):
                                      tokens_matched[search_term_token].add(token)
          
          
          Severity: Major
          Found in wordless/wl_nlp/wl_matching.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 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

                Function match_search_terms_context has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def match_search_terms_context(
                Severity: Minor
                Found in wordless/wl_nlp/wl_matching.py - About 35 mins to fix

                  Function check_context has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def check_context(
                  Severity: Minor
                  Found in wordless/wl_nlp/wl_matching.py - About 35 mins to fix

                    Function match_tokens has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def match_tokens(
                    Severity: Minor
                    Found in wordless/wl_nlp/wl_matching.py - About 35 mins to fix

                      Function match_search_terms_tokens has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def match_search_terms_tokens(
                      Severity: Minor
                      Found in wordless/wl_nlp/wl_matching.py - About 35 mins to fix

                        Function match_ngrams has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def match_ngrams(
                        Severity: Minor
                        Found in wordless/wl_nlp/wl_matching.py - About 35 mins to fix

                          Function match_search_terms_ngrams has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def match_search_terms_ngrams(
                          Severity: Minor
                          Found in wordless/wl_nlp/wl_matching.py - About 35 mins to fix

                            There are no issues that match your filters.

                            Category
                            Status