Showing 543 of 559 total issues

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

    def load(
Severity: Minor
Found in rasa/core/policies/policy.py - About 35 mins to fix

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

        def training_states_labels_and_entities(
    Severity: Minor
    Found in rasa/core/featurizers/tracker_featurizers.py - About 35 mins to fix

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

      def main():
          tag_name = os.environ.get("GITHUB_TAG")
          if not tag_name:
              print("environment variable GITHUB_TAG not set", file=sys.stderr)
              return 1
      Severity: Minor
      Found in scripts/publish_gh_release_notes.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 _prepare_sequence_sentence_concat has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def _prepare_sequence_sentence_concat(
              self, attribute: Text, config: Dict[Text, Any]
          ) -> None:
              """Sets up combining sentence- and sequence-level features (if needed).
      
      
      Severity: Minor
      Found in rasa/utils/tensorflow/rasa_layers.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 are_directories_equal has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def are_directories_equal(dir1: Path, dir2: Path) -> bool:
          """Compares two directories recursively.
      
          Files in each directory are
          assumed to be equal if their names and contents are equal.
      Severity: Minor
      Found in rasa/utils/io.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 chat has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def chat(
          model_path: Optional[Text] = None,
          endpoints: Optional[Text] = None,
          agent: Optional["Agent"] = None,
      ) -> None:
      Severity: Minor
      Found in rasa/jupyter.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 _fix_matplotlib_backend has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def _fix_matplotlib_backend() -> None:
          """Tries to fix a broken matplotlib backend."""
          try:
              backend = matplotlib.get_backend()
          except Exception:  # skipcq:PYL-W0703
      Severity: Minor
      Found in rasa/utils/plotting.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 number_of_examples_per_entity has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def number_of_examples_per_entity(self) -> Dict[Text, int]:
              """Calculates the number of examples per entity."""
              entities = []
      
              def _append_entity(entity: Dict[Text, Any], attribute: Text) -> None:
      Severity: Minor
      Found in rasa/shared/nlu/training_data/training_data.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 _reset_intent_flags has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def _reset_intent_flags(intent: Dict[Text, Any]) -> None:
              for intent_property in intent.values():
                  if (
                      USE_ENTITIES_KEY in intent_property.keys()
                      and not intent_property[USE_ENTITIES_KEY]
      Severity: Minor
      Found in rasa/shared/core/domain.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 _remove_auxiliary_nodes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def _remove_auxiliary_nodes(
          graph: "networkx.MultiDiGraph", special_node_idx: int
      ) -> None:
          """Remove any temporary or unused nodes."""
          graph.remove_node(TMP_NODE_ID)
      Severity: Minor
      Found in rasa/shared/core/training_data/visualization.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 print_run_or_instructions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def print_run_or_instructions(args: argparse.Namespace) -> None:
          from rasa.core import constants
          import questionary
      
          should_run = (
      Severity: Minor
      Found in rasa/cli/scaffold.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 deserialise_events has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def deserialise_events(serialized_events: List[Dict[Text, Any]]) -> List["Event"]:
          """Convert a list of dictionaries to a list of corresponding events.
      
          Example format:
              [{"event": "slot", "value": 5, "name": "my_slot"}]
      Severity: Minor
      Found in rasa/shared/core/events.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 _length_of_common_action_prefix has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def _length_of_common_action_prefix(this: List[Event], other: List[Event]) -> int:
          """Calculate number of actions that two conversations have in common."""
          num_common_actions = 0
          t_cleaned = cast(
              List[Union[ActionExecuted, UserUttered]],
      Severity: Minor
      Found in rasa/shared/core/training_data/visualization.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 _undo_till_previous_loop_execution has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def _undo_till_previous_loop_execution(
              loop_action_name: Text, done_events: List[Event]
          ) -> None:
              offset = 0
              for e in reversed(done_events[:]):
      Severity: Minor
      Found in rasa/shared/core/trackers.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_correct_entity_annotations has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_correct_entity_annotations(training_data: TrainingData) -> None:
              """Check if entities are correctly annotated in the training data.
      
              If the start and end values of an entity do not match any start and end values
              of the respected token, we define an entity as misaligned and log a warning.
      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 _sanitize_user_message has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def _sanitize_user_message(
              text: Text, uids_to_remove: Optional[List[Text]]
          ) -> Text:
              """Remove superfluous/wrong/problematic tokens from a message.
      
      
      Severity: Minor
      Found in rasa/core/channels/slack.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 filter_trainable_entities has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def filter_trainable_entities(
              self, entity_examples: List[Message]
          ) -> List[Message]:
              """Filters out untrainable entity annotations.
      
      
      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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(
              self,
              text: Optional[Text] = None,
              output_channel: Optional["OutputChannel"] = None,
              sender_id: Optional[Text] = None,
      Severity: Minor
      Found in rasa/core/channels/channel.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 _random_response_for has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def _random_response_for(
              self, utter_action: Text, output_channel: Text, filled_slots: Dict[Text, Any]
          ) -> Optional[Dict[Text, Any]]:
              """Select random response for the utter action from available ones.
      
      
      Severity: Minor
      Found in rasa/core/nlg/response.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 remove_empty_response_examples has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def remove_empty_response_examples(
          response_results: List[ResponseSelectionEvaluationResult],
      ) -> List[ResponseSelectionEvaluationResult]:
          """Remove those examples without a response.
      
      
      Severity: Minor
      Found in rasa/nlu/test.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

      Severity
      Category
      Status
      Source
      Language