RasaHQ/rasa_core

View on GitHub

Showing 216 of 245 total issues

Function _collect_messages has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _collect_messages(evts: List[Dict[Text, Any]]) -> List[Message]:
    """Collect the message text and parsed data from the UserMessage events
    into a list"""
    from rasa_nlu.extractors.duckling_http_extractor import \
        DucklingHTTPExtractor
Severity: Minor
Found in rasa/core/training/interactive.py - About 1 hr 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 _emulate_form_rejection has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _emulate_form_rejection(processor, partial_tracker):
    from rasa.core.policies import FormPolicy
    if partial_tracker.active_form.get("name"):
        for p in processor.policy_ensemble.policies:
            if isinstance(p, FormPolicy):
Severity: Minor
Found in rasa/core/test.py - About 1 hr 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 _collect_user_uttered_predictions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _collect_user_uttered_predictions(event,
                                      partial_tracker,
                                      fail_on_prediction_errors):
    from rasa.core.utils import (
        pad_list_to_size)
Severity: Minor
Found in rasa/core/test.py - About 1 hr 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 add_checkpoint has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def add_checkpoint(self,
                       name: Text,
                       conditions: Optional[Dict[Text, Any]]) -> None:

        # Depending on the state of the story part this
Severity: Minor
Found in rasa/core/training/dsl.py - About 1 hr 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 configure_app has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

def configure_app(input_channels=None,
Severity: Major
Found in rasa/core/run.py - About 1 hr to fix

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

        def __init__(self,
    Severity: Major
    Found in rasa/core/tracker_store.py - About 1 hr to fix

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

          def __init__(self,
      Severity: Major
      Found in rasa/core/tracker_store.py - About 1 hr to fix

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

            def __init__(self,
        Severity: Major
        Found in rasa/core/policies/keras_policy.py - About 1 hr to fix

          Function log_evaluation_table has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def log_evaluation_table(golds, name,
          Severity: Major
          Found in rasa/core/test.py - About 1 hr to fix

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

                def __init__(
            Severity: Major
            Found in rasa/core/training/generator.py - About 1 hr to fix

              Function plot_story_evaluation has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def plot_story_evaluation(test_y, predictions,
              Severity: Major
              Found in rasa/core/test.py - About 1 hr to fix

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

                    def __init__(self,
                Severity: Major
                Found in rasa/core/test.py - About 1 hr to fix

                  Function chat has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def chat(model_path: Text = None, agent: 'Agent' = None,
                           interpreter: NaturalLanguageInterpreter = None) -> None:
                      """Chat to the bot within a Jupyter notebook.
                  
                      Args:
                  Severity: Minor
                  Found in rasa/jupyter.py - About 55 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 __call__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def __call__(self, attn_inputs, scores, scores_state, mask):
                          # apply exponential moving average with interpolation gate weight
                          # to scores from previous time which are equal to probs at this point
                          # different from original NTM where it is applied after softmax
                          i_g = self._inter_gate(attn_inputs)
                  Severity: Minor
                  Found in rasa/core/policies/tf_utils.py - About 55 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 _collect_action_executed_predictions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _collect_action_executed_predictions(processor, partial_tracker, event,
                                                           fail_on_prediction_errors):
                      from rasa.core.policies import FormPolicy
                  
                      action_executed_eval_store = EvaluationStore()
                  Severity: Minor
                  Found in rasa/core/test.py - About 55 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 _fingerprint_node has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _fingerprint_node(graph, node, max_history):
                      """Fingerprint a node in a graph.
                  
                      Can be used to identify nodes that are similar and can be merged within the
                      graph.
                  Severity: Minor
                  Found in rasa/core/training/visualization.py - About 55 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 topological_sort has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def topological_sort(
                          graph: Dict[Text, Set[Text]]
                      ) -> Tuple[deque, Set[Tuple[Text, Text]]]:
                          """Creates a top sort of a directed graph. This is an unstable sorting!
                  
                  
                  Severity: Minor
                  Found in rasa/core/training/structures.py - About 55 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 update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def update(self, event: Event, skip_states: bool = False) -> None:
                          """Modify the state of the tracker according to an ``Event``. """
                  
                          # if `skip_states` is `True`, this function behaves exactly like the
                          # normal update of the `DialogueStateTracker`
                  Severity: Minor
                  Found in rasa/core/training/generator.py - About 55 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 add_user_messages has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def add_user_messages(self, messages):
                          self.ensure_current_steps()
                  
                          if len(messages) == 1:
                              # If there is only one possible intent, we'll keep things simple
                  Severity: Minor
                  Found in rasa/core/training/dsl.py - About 55 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 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def _create_attn_cell(self,
                  Severity: Major
                  Found in rasa/core/policies/embedding_policy.py - About 50 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language