BLKSerene/Wordless

View on GitHub
wordless/wl_nlp/wl_token_processing.py

Summary

Maintainability
B
6 hrs
Test Coverage

Avoid deeply nested control flow statements.
Open

                    for i, token in enumerate(sentence_seg):
                        if wl_checks_tokens.is_word_alphabetic(token):
                            sentence_seg[i] = ''

    # Numerals
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_seg in sentence:
                            for i, token in enumerate(sentence_seg):
                                if token in stop_words:
                                    sentence_seg[i] = ''
            else:
    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_seg in sentence:
                              for i, token in enumerate(sentence_seg):
                                  if token.isupper():
                                      sentence_seg[i] = ''
              # Title Case
      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_seg in sentence:
                                for i, token in enumerate(sentence_seg):
                                    if token.lower() in stop_words:
                                        sentence_seg[i] = ''
        
        
        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_seg in sentence:
                                  for i, token in enumerate(sentence_seg):
                                      if token.islower():
                                          sentence_seg[i] = ''
                  # Uppercase
          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_seg in sentence:
                                    for i, token in enumerate(sentence_seg):
                                        if token.istitle():
                                            sentence_seg[i] = ''
                else:
            Severity: Major
            Found in wordless/wl_nlp/wl_token_processing.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  for i, token in enumerate(sentence_seg):
                                      if wl_checks_tokens.is_num(token):
                                          sentence_seg[i] = ''
              
                  # Filter stop words
              Severity: Major
              Found in wordless/wl_nlp/wl_token_processing.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    for token in sentence_seg:
                                        token.tag = token.tag.lower()
                
                    # Words
                    if settings['words']:
                Severity: Major
                Found in wordless/wl_nlp/wl_token_processing.py - About 45 mins to fix

                  There are no issues that match your filters.

                  Category
                  Status