Showing 543 of 559 total issues

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

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

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

        def _validate_number_of_dimensions(
            number_of_dimensions: int, input_array: np.ndarray
        ) -> None:
            """Validates if the the input array has given number of dimensions.
    
    
    Severity: Minor
    Found in rasa/utils/tensorflow/model_data.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: "networkx.MultiDiGraph", node: int, max_history: int
    ) -> Set[Text]:
        """Fingerprint a node in a graph.
    
    
    Severity: Minor
    Found in rasa/shared/core/training_data/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 applied_events has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def applied_events(self) -> List[Event]:
            """Returns all actions that should be applied - w/o reverted events.
    
            Returns:
                The events applied to the tracker.
    Severity: Minor
    Found in rasa/shared/core/trackers.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,
            domain: Optional[Domain] = None,
        ) -> None:
    Severity: Minor
    Found in rasa/shared/core/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_events has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def add_events(self, events: List[Event]) -> None:
            """Adds next story steps with the specified list of events.
    
            Args:
                events: Events that need to be added.
    Severity: Minor
    Found in rasa/shared/core/training_data/story_reader/story_step_builder.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 _parse_nlu has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def _parse_nlu(self, nlu_data: Optional[List[Dict[Text, Any]]]) -> None:
    
            if not nlu_data:
                return
    
    
    Severity: Minor
    Found in rasa/shared/nlu/training_data/formats/rasa_yaml.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 _find_data_files_in_directory has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def _find_data_files_in_directory(
        directory: Text, filter_property: Callable[[Text], bool]
    ) -> Set[Text]:
        filtered_files = set()
    
    
    Severity: Minor
    Found in rasa/shared/data.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 generate_message has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def generate_message(message: Dict[Text, Any]) -> Text:
            """Generates text for a message object.
    
            Args:
                message: A message
    Severity: Minor
    Found in rasa/shared/nlu/training_data/formats/readerwriter.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, List[Tuple[Text, Text]]]:
            """Creates a top sort of a directed graph. This is an unstable sorting!
    
    
    Severity: Minor
    Found in rasa/shared/core/training_data/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 _extract_message has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def _extract_message(self, req: Request) -> Text:
    
            if req.json["type"] == "MESSAGE":
                message = req.json["message"]["text"]
    
    
    Severity: Minor
    Found in rasa/core/channels/hangouts.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 _pick_best_policy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def _pick_best_policy(predictions: List[PolicyPrediction]) -> PolicyPrediction:
            """Picks the best policy prediction based on probabilities and policy priority.
    
            Args:
                predictions: a list containing policy predictions
    Severity: Minor
    Found in rasa/core/policies/ensemble.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 serialise has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def serialise(self) -> Tuple[PredictionList, PredictionList]:
            """Turn targets and predictions to lists of equal size for sklearn."""
            texts = sorted(
                set(
                    [str(e.get("text", "")) for e in self.entity_targets]
    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 _add_nlu_predict_node_from_train has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _add_nlu_predict_node_from_train(
    Severity: Major
    Found in rasa/engine/recipes/default_recipe.py - About 50 mins to fix

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

          def _loss_margin(
      Severity: Major
      Found in rasa/utils/tensorflow/layers.py - About 50 mins to fix

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

            def _add_nlu_train_node(
        Severity: Major
        Found in rasa/engine/recipes/default_recipe.py - About 50 mins to fix

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

          def plot_confusion_matrix(
          Severity: Major
          Found in rasa/utils/plotting.py - About 50 mins to fix

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

            def create_data_generators(
            Severity: Major
            Found in rasa/utils/train_utils.py - About 50 mins to fix

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

                  def call(
              Severity: Major
              Found in rasa/utils/tensorflow/layers.py - About 50 mins to fix

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

                    def _loss_cross_entropy(
                Severity: Major
                Found in rasa/utils/tensorflow/layers.py - About 50 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language