RasaHQ/rasa_core

View on GitHub

Showing 243 of 245 total issues

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

    def explicit_events(self,
                        domain: Domain,
                        should_append_final_listen: bool = True) -> List[Event]:
        """Returns events contained in the story step
            including implicit events.
Severity: Minor
Found in rasa/core/training/structures.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 as_story_string has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def as_story_string(self, flat=False, e2e=False):
        story_content = ""

        # initialize helper for first story step
        story_string_helper = StoryStringHelper()
Severity: Minor
Found in rasa/core/training/structures.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 _merge_annotated_and_original_entities has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _merge_annotated_and_original_entities(parse_annotated, parse_original):
    # overwrite entities which have already been
    # annotated in the original annotation to preserve
    # additional entity parser information
    entities = parse_annotated.get("entities", [])[:]
Severity: Minor
Found in rasa/core/training/interactive.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