BLKSerene/Wordless

View on GitHub

Showing 206 of 206 total issues

Avoid deeply nested control flow statements.
Open

                            if ngram[i : i + len_search_term] == search_term:
                                ngrams_is_filtered.append((ngram, ngram_i))

                # Check context settings
                ngrams_is = (
Severity: Major
Found in wordless/wl_ngram_generator.py - About 45 mins to fix

    Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, main, title, width = 0, height = 0, resizable = True, no_buttons = False):
    Severity: Minor
    Found in wordless/wl_dialogs/wl_dialogs_errs.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              for token in sentence_seg:
                                  refs = head_refs[i_token]
      
                                  if refs is not None:
                                      token.head = self.tokens_multilevel[refs[0]][refs[1]][refs[2]][refs[3]]
      Severity: Major
      Found in wordless/wl_nlp/wl_texts.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            for tokens in wl_nlp_utils.split_token_list(main, texts, pos_tagger):
                                # The Japanese model do not have a tagger component and Japanese POS tags are taken directly from SudachiPy
                                # See: https://github.com/explosion/spaCy/discussions/9983#discussioncomment-1910117
                                if lang == 'jpn':
                                    docs.append(''.join(tokens))
        Severity: Major
        Found in wordless/wl_nlp/wl_pos_tagging.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      if not self.isRowHidden(row):
                                          item = self.model().item(row, col)
          
                                          val_cum += item.val
                                          item.setText(str(val_cum))
          Severity: Major
          Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if not self.isRowHidden(row):
                                            item = self.model().item(row, col)
            
                                            val_cum += item.val
                                            item.setText(f'{val_cum:.{precision_pcts}%}')
            Severity: Major
            Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

              Function wl_test_sentiment_analyze_models has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def wl_test_sentiment_analyze_models(lang, sentiment_analyzer, test_sentence, tokens, results, check_results = True):
              Severity: Minor
              Found in tests/tests_nlp/test_sentiment_analysis.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            for word in tr.split():
                                                add_val_to_trs(trs_lexicon, word, vals)
                                    else:
                Severity: Major
                Found in utils/wl_generate_vader_dicts.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

                    Avoid deeply nested control flow statements.
                    Open

                                        if token.lemma is not None:
                                            lemmas.append(token.lemma)
                                        else:
                                            lemmas.append(token.text)
                        else:
                    Severity: Major
                    Found in wordless/wl_nlp/wl_lemmatization.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          for token in sentence_seg:
                                              if token.tag is not None:
                                                  token.tag = token.tag.lower()
                      
                                              if token.lemma is not None:
                      Severity: Major
                      Found in wordless/wl_nlp/wl_token_processing.py - About 45 mins to fix

                        Function wl_pos_tag has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def wl_pos_tag(main, inputs, lang, pos_tagger = 'default', tagset = 'default', force = False):
                        Severity: Minor
                        Found in wordless/wl_nlp/wl_pos_tagging.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                          for file_type, trs in TRS_FILE_TYPES.items():
                                              if tr == file_type:
                                                  tr = trs[0]
                          
                                                  break
                          Severity: Major
                          Found in utils/wl_trs_translate.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                for sentence in doc.sentences:
                                                    for token in sentence.words:
                                                        texts_tagged.append(token.text)
                            
                                                        if tagset in ['default', 'raw']:
                            Severity: Major
                            Found in wordless/wl_nlp/wl_pos_tagging.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if lens.any():
                                                              self.set_item_num(row, i, numpy.mean(lens))
                                                              self.set_item_num(row + 1, i, numpy.std(lens))
                                                              self.set_item_num(row + 2, i, numpy.var(lens))
                                                              self.set_item_num(row + 3, i, numpy.min(lens))
                              Severity: Major
                              Found in wordless/wl_profiler.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                            if not self.isRowHidden(row):
                                                                item = self.model().item(row, col)
                                
                                                                item.setText(f'{item.val:.{precision_pcts}%}')
                                        elif self.header_orientation == 'vert':
                                Severity: Major
                                Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                  for lang, trs in TRS_LANGS.items():
                                                      # Language names
                                                      if tr == lang:
                                                          tr = trs[0]
                                                      elif f'{lang} (' in tr:
                                  Severity: Major
                                  Found in utils/wl_trs_translate.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                    for encoding, trs in TRS_ENCODINGS.items():
                                                        if encoding in tr:
                                                            tr = tr.replace(encoding, trs[0])
                                    
                                                            break
                                    Severity: Major
                                    Found in utils/wl_trs_translate.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 sentence_seg in sentence:
                                                                for i, token in enumerate(sentence_seg):
                                                                    if token.islower():
                                                                        sentence_seg[i] = wl_texts.Wl_Token('')
                                                # Uppercase
                                        Severity: Major
                                        Found in wordless/wl_nlp/wl_token_processing.py - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language