BLKSerene/Wordless

View on GitHub

Showing 205 of 205 total issues

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 sentence in wl_sentence_tokenization.wl_sentence_split(self.main, para):
                                self.tokens_multilevel[-1].append([])
    
                                for sentence_seg in wl_sentence_tokenization.wl_sentence_seg_tokenize_tokens(
                                    self.main,
    Severity: Major
    Found in wordless/wl_nlp/wl_texts.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              for tag in re.finditer(re_tags, para):
                                  tags_tokens = self.add_tags_splitting(para[i_tag_end:tag.start()], tags_tokens)
                                  tags_tokens[-1].append(tag.group())
      
                                  i_tag_end = tag.end()
      Severity: Major
      Found in wordless/wl_nlp/wl_texts.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

                                      for j in range(11):
                                          self.set_item_err(row + j, i, text = self.tr('No language support'), alignment_hor = 'right')
          
          
          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)
            
                                            val_cum += item.val
                                            item.setText(str(val_cum))
            Severity: Major
            Found in wordless/wl_widgets/wl_tables.py - About 45 mins to fix

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

              def wl_spin_boxes_min_max_sync(
              Severity: Minor
              Found in wordless/wl_widgets/wl_boxes.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

                                              if settings_limit_searching == _tr('Wl_Worker_Colligation_Extractor', 'Within sentence segments'):
                                                  offsets_unit = offsets_sentence_segs
                                                  len_unit = len_sentence_segs
                                              elif settings_limit_searching == _tr('Wl_Worker_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

                                            for sentence in wl_sentence_tokenization.wl_sentence_split(self.main, text_no_tags):
                                                self.tokens_multilevel[-1].append([])
                    
                                                for sentence_seg in wl_sentence_tokenization.wl_sentence_seg_tokenize_tokens(
                                                    self.main,
                    Severity: Major
                    Found in wordless/wl_nlp/wl_texts.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 doc in nlp.pipe(docs):
                                                for token in doc:
                                                    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 text.lang in self.main.settings_global['sentiment_analyzers']:
                                                          sentiment_inputs.append(' '.join(
                                                              [*left_tokens_search, *node_tokens_search, *right_tokens_search]
                                                          ))
                          
                          
                          Severity: Major
                          Found in wordless/wl_concordancer.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        if (
                                                            ngram in search_terms
                                                            and wl_matching.check_context(
                                                                j, tokens,
                                                                context_settings = settings['search_settings']['context_settings'],
                            Severity: Major
                            Found in wordless/wl_concordancer_parallel.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 k, ngram in enumerate(wl_nlp_utils.ngrams(tokens, len_search_term)):
                                                                if ngram == search_term:
                                                                    points.append([x_start + k / text.num_tokens * len_tokens_total, y_start - j])
                                                                    # Total
                                                                    points.append([x_start_total + k, 0])
                                Severity: Major
                                Found in wordless/wl_concordancer.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                              if (
                                                                  (
                                                                      (
                                                                          not settings['search_settings']['match_dependency_relations']
                                                                          and (token in search_terms or head in search_terms)
                                  Severity: Major
                                  Found in wordless/wl_dependency_parser.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        for collocate in range(10):
                                                            collocate = wl_texts.Wl_Token(str(collocate))
                                                            stat_files_items[(node, collocate)] = [
                                                                random.uniform(0, val_max),
                                                                random.uniform(0, val_max),
                                    Severity: Major
                                    Found in tests/tests_figs/test_figs_stats.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

                                                            if token_properties:
                                                                i_tag_start += len(doc)
                                                    else:
                                        Severity: Major
                                        Found in wordless/wl_nlp/wl_dependency_parsing.py - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language