Showing 543 of 559 total issues

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

def train_comparison_models(
    story_file: Text,
    domain: Text,
    output_path: Text = "",
    exclusion_percentages: Optional[List] = None,
Severity: Minor
Found in rasa/core/train.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

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

    def _create_new_entity(
        tag_names: List[Text],
        entity_tag: Text,
        group_tag: Text,
        role_tag: Text,
Severity: Minor
Found in rasa/nlu/extractors/extractor.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

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

def _migrate_form_slots(
    domain: Dict[Text, Any]
) -> Tuple[Dict[Any, Dict[str, Any]], Optional[Any]]:
    updated_slots = domain.get(KEY_SLOTS, {})
    forms = domain.get(KEY_FORMS, {})
Severity: Minor
Found in rasa/core/migrate.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

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

    def _should_extract_entities(
        entity_tags: List[List[Dict[Text, List[Features]]]]
    ) -> bool:
        for turns_tags in entity_tags:
            for turn_tags in turns_tags:
Severity: Minor
Found in rasa/core/policies/ted_policy.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

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

    def _check_analyzer(self) -> None:
        if self.analyzer != "word":
            if self.OOV_token is not None:
                logger.warning(
                    "Analyzer is set to character, "
Severity: Minor
Found in rasa/nlu/featurizers/sparse_featurizer/count_vectors_featurizer.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

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

    def publish(
        self,
        event: Dict[Text, Any],
        retries: int = 60,
        retry_delay_in_seconds: float = 5,
Severity: Minor
Found in rasa/core/brokers/kafka.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

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

    def __init__(
        self,
        domain: Optional[Domain] = None,
        dialect: Text = "sqlite",
        host: Optional[Text] = None,
Severity: Minor
Found in rasa/core/tracker_store.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 await result if isawaitable(result) else result
Severity: Major
Found in rasa/server.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return 0
    Severity: Major
    Found in scripts/publish_gh_release_notes.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return 5
      Severity: Major
      Found in scripts/publish_gh_release_notes.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return decorated
        Severity: Major
        Found in rasa/server.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return await result if isawaitable(result) else result
          Severity: Major
          Found in rasa/server.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return None
            Severity: Major
            Found in rasa/shared/core/training_data/story_writer/yaml_story_writer.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return self._line_number_for_path(current, tail) or this_line
              Severity: Major
              Found in rasa/shared/utils/validation.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return self.process_active_loop(event)
                Severity: Major
                Found in rasa/shared/core/training_data/story_writer/yaml_story_writer.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return this_line
                  Severity: Major
                  Found in rasa/shared/utils/validation.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return None
                    Severity: Major
                    Found in rasa/nlu/persistor.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return response.text("success")
                      Severity: Major
                      Found in rasa/core/channels/facebook.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                            return
                        Severity: Major
                        Found in rasa/core/channels/socketio.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return fb_webhook
                          Severity: Major
                          Found in rasa/core/channels/facebook.py - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language