rasa/core/featurizers/tracker_featurizers.py

Summary

Maintainability
F
3 days
Test Coverage
A
96%

File tracker_featurizers.py has 936 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from __future__ import annotations
from pathlib import Path
from collections import defaultdict
from abc import abstractmethod
import jsonpickle
Severity: Major
Found in rasa/core/featurizers/tracker_featurizers.py - About 2 days to fix

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

        def create_state_features(
    Severity: Major
    Found in rasa/core/featurizers/tracker_featurizers.py - About 1 hr to fix

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

          def prediction_states(
      Severity: Major
      Found in rasa/core/featurizers/tracker_featurizers.py - About 50 mins to fix

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

            def prediction_states(
        Severity: Major
        Found in rasa/core/featurizers/tracker_featurizers.py - About 50 mins to fix

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

              def prediction_states(
          Severity: Major
          Found in rasa/core/featurizers/tracker_featurizers.py - About 50 mins to fix

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

                def prediction_states(
            Severity: Major
            Found in rasa/core/featurizers/tracker_featurizers.py - About 50 mins to fix

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

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

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

                    def _extract_examples(
                Severity: Minor
                Found in rasa/core/featurizers/tracker_featurizers.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 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 _extract_examples has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def _extract_examples(
                      Severity: Minor
                      Found in rasa/core/featurizers/tracker_featurizers.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 _remove_user_text_if_intent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def _remove_user_text_if_intent(trackers_as_states: List[List[State]]) -> None:
                                  """Deletes user text from state dictionaries if intent is present.
                          
                                  Only featurizing either the intent or user text is currently supported. When
                                  both are present in a state, the user text is removed so that only the intent
                          Severity: Minor
                          Found in rasa/core/featurizers/tracker_featurizers.py - About 25 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

                          There are no issues that match your filters.

                          Category
                          Status