RasaHQ/rasa_core

View on GitHub

Showing 243 of 245 total issues

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

    def load(cls,
Severity: Minor
Found in rasa/core/agent.py - About 35 mins to fix

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

        def __init__(self, correct_action, predicted_action,
    Severity: Minor
    Found in rasa/core/test.py - About 35 mins to fix

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

      def _add_message_edge(graph: 'networkx.MultiDiGraph',
      Severity: Minor
      Found in rasa/core/training/visualization.py - About 35 mins to fix

        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:
        Severity: Minor
        Found in rasa/core/events/__init__.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 as_feature has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def as_feature(self):
                r = [0.0] * self.feature_dimensionality()
        
                try:
                    for i, v in enumerate(self.values):
        Severity: Minor
        Found in rasa/core/slots.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_attn_cell has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def _create_attn_cell(self,
                                  cell: tf.contrib.rnn.RNNCell,
                                  embed_utter: tf.Tensor,
                                  embed_prev_action: tf.Tensor,
                                  real_length: tf.Tensor,
        Severity: Minor
        Found in rasa/core/policies/embedding_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 blueprint has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def blueprint(self, on_new_message):
                twilio_webhook = Blueprint('twilio_webhook', __name__)
        
                @twilio_webhook.route("/", methods=['GET'])
                async def health(request):
        Severity: Minor
        Found in rasa/core/channels/twilio.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 get_validated_path has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def get_validated_path(current: Optional[Text], parameter: Text,
                               default: Optional[Text] = None,
                               none_is_valid: bool = False) -> Optional[Text]:
            """Check whether a file path or its default value is valid and returns it.
        
        
        Severity: Minor
        Found in rasa/cli/utils.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 blueprint has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def blueprint(self, on_new_message):
                slack_webhook = Blueprint('slack_webhook', __name__)
        
                @slack_webhook.route("/", methods=['GET'])
                async def health(request):
        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 _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
        Severity: Minor
        Found in rasa/core/training/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 _remove_unused_generated_cps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def _remove_unused_generated_cps(
                self,
                story_steps: Dict[Text, StoryStep],
                overlapping_cps: Set[Text],
                story_end_checkpoints: Dict[Text, Text]
        Severity: Minor
        Found in rasa/core/training/structures.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 response.json(responses)
        Severity: Major
        Found in rasa/core/server.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return response.json(domain)
          Severity: Major
          Found in rasa/core/server.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/telegram.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return load_event_channel_from_module_string(broker_config)
              Severity: Major
              Found in rasa/core/broker.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

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

                  Avoid too many return statements within this function.
                  Open

                              return response.json(tracker.current_state(verbosity))
                  Severity: Major
                  Found in rasa/core/server.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return response.json(keys)
                    Severity: Major
                    Found in rasa/core/server.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

                        Avoid too many return statements within this function.
                        Open

                                return response.text(state)
                        Severity: Major
                        Found in rasa/core/server.py - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language