DarkmatterVale/regex4dummies

View on GitHub

Showing 57 of 274 total issues

Avoid deeply nested control flow statements.
Open

                        for pattern in final_patterns:
                            if patterns[outer_pattern_index] in pattern:
                                outer_add_to_pattern = False

                            if patterns[inner_pattern_index] in pattern:
Severity: Major
Found in regex4dummies/literal_parsers/literal_parsing.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if end - length < 0:
                                break
    
    
    Severity: Major
    Found in regex4dummies/literal_parsers/literal_parsing.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if ' '.join(pattern) not in patterns and ' '.join(pattern) not in base_sentence_info:
                                  base_sentence_info += [str(' '.join(pattern))]
      
                                  sentence_information[str(' '.join(pattern))] = ['', '', '', [], 2, 0]
                              else:
      Severity: Major
      Found in regex4dummies/literal_parsers/literal_parsing.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if end - length < 0:
                                    break
        
        
        Severity: Major
        Found in regex4dummies/literal_parsers/literal_parsing.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if ' '.join(pattern) in str(test_string) and pattern != '' and pattern != []:
                                      if ' '.join(pattern) not in patterns and ' '.join(pattern) not in base_sentence_info:
                                          base_sentence_info += [str(' '.join(pattern))]
          
                                          sentence_information[str(' '.join(pattern))] = ['', '', '', [], 2, 0]
          Severity: Major
          Found in regex4dummies/literal_parsers/literal_parsing.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if inner_add_to_pattern == True and outer_add_to_pattern == True:
                                        if len( patterns[outer_pattern_index]) > len(patterns[inner_pattern_index] ):
                                            final_patterns.append(patterns[outer_pattern_index])
            
                                            try:
            Severity: Major
            Found in regex4dummies/literal_parsers/literal_parsing.py - About 45 mins to fix

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

                  def find_patterns(self, strings, current_index, literal_find, patterns_arg, parser_name):
              Severity: Minor
              Found in regex4dummies/compare.py - About 35 mins to fix

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

                    def find_previous_instance(self, instance_to_find, string_containing_instance, current_index, objects_to_fail, updated_object):
                Severity: Minor
                Found in regex4dummies/semantic_parsers/nltk_parser.py - About 35 mins to fix

                  Function get_reliability_score has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def get_reliability_score(self, pattern):
                          """
                          Used to return the reliability score of a pattern.
                          """
                  
                  
                  Severity: Minor
                  Found in regex4dummies/compare.py - About 35 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Avoid too many return statements within this function.
                  Open

                                  return self.return_pattern_dependencies(text=kwargs.get("text"))
                  Severity: Major
                  Found in regex4dummies/dependency.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return self.return_nltk_dependencies(text=kwargs.get("text"))
                    Severity: Major
                    Found in regex4dummies/dependency.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return self.return_pattern_dependencies(text=kwargs.get("text"))
                      Severity: Major
                      Found in regex4dummies/dependency.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                            return self.return_pattern_dependencies(text=kwargs.get("text"))
                        Severity: Major
                        Found in regex4dummies/dependency.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                              return self.return_pattern_dependencies(text=kwargs.get("text"))
                          Severity: Major
                          Found in regex4dummies/dependency.py - About 30 mins to fix

                            Function process_topics has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def process_topics(self, strings, correct_topics):
                                    """
                                    process_topics finds the topics of the given strings and returns the topic score.
                                    """
                            
                            
                            Severity: Minor
                            Found in examples/accuracy_tester/main.py - About 25 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function normalize_text has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def normalize_text(self, text):
                                    """
                                    Returns the normalized version
                                    of the passed text variable.
                                    """
                            Severity: Minor
                            Found in regex4dummies/phrase_extractor.py - About 25 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function process_raw_data_literal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def process_raw_data_literal(self, parser_name, strings, correct_patterns):
                                    """
                                    This function processes the raw data and turns it into useful information.
                                    That data provides useful statistics about the library's current "health".
                                    The function returns the overall score for the data, and specific statistics of the data.
                            Severity: Minor
                            Found in examples/accuracy_tester/main.py - About 25 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Severity
                            Category
                            Status
                            Source
                            Language