BLKSerene/Wordless

View on GitHub

Showing 205 of 205 total issues

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

def wl_test_lemmatize_models(lang, lemmatizer, test_sentence, tokens, results, lang_exceptions = None):
Severity: Minor
Found in tests/tests_nlp/test_lemmatization.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                    if any((text in tr for text in [])):
                        # Flag translation as unfinished to be reviewed manually
                        unfinished = True
    
    
    Severity: Major
    Found in utils/wl_trs_translate.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  for word in wl_word_tokenization.wl_word_tokenize_flat(main, tr, lang):
                                      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 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):
                                      # Convert to strings to ignore tags and punctuation marks, if any, when checking for stop words
                                      if str(token) in stop_words:
                                          sentence_seg[i] = wl_texts.Wl_Token('')
          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):
                                        # Convert to strings to ignore tags and punctuation marks, if any, when checking for stop words
                                        if token.lower() in stop_words:
                                            sentence_seg[i] = wl_texts.Wl_Token('')
            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] = wl_texts.Wl_Token('')
                  else:
              Severity: Major
              Found in wordless/wl_nlp/wl_token_processing.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_decimals}}')
                                    # Percentages
                Severity: Major
                Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

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

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

                                                  for k, ngram in enumerate(wl_nlp_utils.ngrams(text.get_tokens_flat(), len_search_term)):
                                                      if ngram == search_term:
                                                          points.append([x_start + k, i])
                      
                      
                      Severity: Major
                      Found in wordless/wl_concordancer.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if len_raw_temp_tokens == len_processed_temp_tokens:
                                                results_modified.extend(results_temp)
                                            elif len_raw_temp_tokens < len_processed_temp_tokens:
                                                results_modified.extend(results_temp[:len_raw_temp_tokens])
                                            elif len_raw_temp_tokens > len_processed_temp_tokens:
                        Severity: Major
                        Found in wordless/wl_nlp/wl_nlp_utils.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if not file_name:
                                                      wl_msg_boxes.Wl_Msg_Box_Warning(
                                                          self.main,
                                                          title = self.tr('Empty File Name'),
                                                          text = self.tr('''
                          Severity: Major
                          Found in wordless/wl_file_area.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        for node in nodes:
                                                            len_node = len(node)
                            
                                                            for j, ngram in enumerate(wl_nlp_utils.ngrams(parallel_unit, len_node)):
                                                                if ngram == tuple(node):
                            Severity: Major
                            Found in wordless/wl_concordancer_parallel.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if settings['generation_settings']['context_len_unit'] == self.tr('Character'):
                                                              len_context_left = 0
                                                              len_context_right = 0
                              
                                                              left_tokens_raw = []
                              Severity: Major
                              Found in wordless/wl_concordancer.py - About 45 mins to fix

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

                                    def __init__(
                                Severity: Minor
                                Found in wordless/wl_widgets/wl_lists.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_decimals}}')
                                  Severity: Major
                                  Found in wordless/wl_widgets/wl_tables.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_word_alphabetic(token):
                                                                sentence_seg[i] = wl_texts.Wl_Token('')
                                    
                                        # 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 j, count in enumerate(counts):
                                                                      self.set_item_num(
                                                                          row = self.model().rowCount() - 2,
                                                                          col = j,
                                                                          val = count
                                      Severity: Major
                                      Found in wordless/wl_profiler.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if i != item_row and item_text == text:
                                                                    wl_msg_boxes.Wl_Msg_Box_Warning(
                                                                        self.main,
                                                                        title = _tr('wl_lists', 'Duplicates Found'),
                                                                        text = _tr('wl_lists', '''
                                        Severity: Major
                                        Found in wordless/wl_widgets/wl_lists.py - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language