RasaHQ/rasa_core

View on GitHub

Showing 243 of 245 total issues

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

    def __init__(self,
Severity: Minor
Found in rasa/core/channels/channel.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if self.remove_duplicates:
                                hashed = self._hash_example(sliced_states,
                                                            event.action_name)
    
                                # only continue with tracker_states that created a
    Severity: Major
    Found in rasa/core/featurizers.py - About 45 mins to fix

      Function test_core has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def test_core(model: Text, stories: Text, endpoints: Text = None,
      Severity: Minor
      Found in rasa/test.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if online:
                                    logger.info("Original stories are "
                                                "different for {} -- {}\n"
                                                "Memorized the new ones for "
                                                "now. Delete contradicting "
        Severity: Major
        Found in rasa/core/policies/memoization.py - About 45 mins to fix

          Function _split_conversation_at_restarts has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def _split_conversation_at_restarts(
              evts: List[Dict[Text, Any]]
          ) -> List[List[Dict[Text, Any]]]:
              """Split a conversation at restart events.
          
          
          Severity: Minor
          Found in rasa/core/training/interactive.py - About 45 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 deeply nested control flow statements.
          Open

                              if (graph.has_node(j) and
                                      _nodes_are_equivalent(graph, i, j, max_history)):
                                  # make sure we keep special styles
                                  _transfer_style(graph.nodes(data=True)[j],
                                                  graph.nodes(data=True)[i])
          Severity: Major
          Found in rasa/core/training/visualization.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (self.story_string_helper.form_validation and
                                            s.action_name ==
                                            self.story_string_helper.active_form):
                                        result += self._bot_string(
                                            ActionExecuted(ACTION_LISTEN_NAME))
            Severity: Major
            Found in rasa/core/training/structures.py - About 45 mins to fix

              Function _remove_auxiliary_nodes has a Cognitive Complexity of 8 (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/core/training/visualization.py - About 45 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 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def create(obj, endpoint=None):
                      if isinstance(obj, NaturalLanguageInterpreter):
                          return obj
              
                      if not isinstance(obj, str):
              Severity: Minor
              Found in rasa/core/interpreter.py - About 45 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_to_store has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def add_to_store(
              Severity: Minor
              Found in rasa/core/test.py - About 45 mins to fix

                Function _add_edge has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def _add_edge(graph, u, v, key, label=None, **kwargs):
                Severity: Minor
                Found in rasa/core/training/visualization.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          for cp in step.start_checkpoints:
                                              if cp.name == original_cp:
                                                  if k == e:
                                                      cp_name = source_cp_name
                                                  else:
                  Severity: Major
                  Found in rasa/core/training/structures.py - About 45 mins to fix

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

                        def __init__(
                    Severity: Minor
                    Found in rasa/core/test.py - About 45 mins to fix

                      Function add_to_store has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def add_to_store(
                                  self,
                                  action_predictions: Optional[List[str]] = None,
                                  action_targets: Optional[List[str]] = None,
                                  intent_predictions: Optional[List[str]] = None,
                      Severity: Minor
                      Found in rasa/core/test.py - About 45 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

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                      def test_json_parse_agent():
                          # DOCS MARKER AgentUttered
                          evt = \
                              {
                                  'event': 'agent',
                      Severity: Major
                      Found in tests/core/test_events.py and 2 other locations - About 40 mins to fix
                      tests/core/test_events.py on lines 232..240
                      tests/core/test_events.py on lines 263..271

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 34.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                          assert set(js["actions"][0].keys()) == {"action",
                                                                  "predicted",
                                                                  "confidence",
                                                                  "policy"}
                      Severity: Minor
                      Found in tests/core/test_server.py and 1 other location - About 40 mins to fix
                      tests/core/test_server.py on lines 209..213

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 34.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                          assert set(js["actions"][0].keys()) == {
                              "action",
                              "predicted",
                              "confidence",
                              "policy"}
                      Severity: Minor
                      Found in tests/core/test_server.py and 1 other location - About 40 mins to fix
                      tests/core/test_server.py on lines 284..287

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 34.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                      def test_json_parse_followup():
                          # DOCS MARKER FollowupAction
                          evt = \
                              {
                                  'event': 'followup',
                      Severity: Major
                      Found in tests/core/test_events.py and 2 other locations - About 40 mins to fix
                      tests/core/test_events.py on lines 263..271
                      tests/core/test_events.py on lines 274..282

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 34.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 3 locations. Consider refactoring.
                      Open

                      def test_json_parse_action():
                          # DOCS MARKER ActionExecuted
                          evt = \
                              {
                                  'event': 'action',
                      Severity: Major
                      Found in tests/core/test_events.py and 2 other locations - About 40 mins to fix
                      tests/core/test_events.py on lines 232..240
                      tests/core/test_events.py on lines 274..282

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 34.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

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

                          def __init__(self, name,
                      Severity: Minor
                      Found in rasa/core/slots.py - About 35 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language