RasaHQ/rasa_core

View on GitHub

Showing 243 of 245 total issues

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 __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 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

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

              with open(fname, "r") as f:
                  for l in f:
                      recovered.append(Event.from_parameters(json.loads(l)))
          Severity: Major
          Found in tests/core/test_broker.py and 1 other location - About 1 hr to fix
          tests/core/test_broker.py on lines 56..58

          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 38.

          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 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 __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 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 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

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

                      with open(fname, "r") as f:
                          for l in f:
                              recovered.append(Event.from_parameters(json.loads(l)))
                  Severity: Major
                  Found in tests/core/test_broker.py and 1 other location - About 1 hr to fix
                  tests/core/test_broker.py on lines 75..77

                  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 38.

                  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 __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 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 _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 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 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 _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 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 _fingerprint has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def _fingerprint(config=["test"], domain=["test"],
                  Severity: Major
                  Found in tests/core/test_model.py - About 50 mins to fix

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

                        def __init__(self,
                    Severity: Major
                    Found in rasa/core/domain.py - About 50 mins to fix

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

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