rasa/nlu/test.py

Summary

Maintainability
F
4 days
Test Coverage
A
95%

File test.py has 1593 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import copy
import itertools
import os
import logging
import structlog
Severity: Major
Found in rasa/nlu/test.py - About 4 days to fix

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

    def evaluate_entities(
    Severity: Major
    Found in rasa/nlu/test.py - About 50 mins to fix

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

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

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

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

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

          def plot_entity_confidences(
          Severity: Minor
          Found in rasa/nlu/test.py - About 35 mins to fix

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

            def _calculate_report(
            Severity: Minor
            Found in rasa/nlu/test.py - About 35 mins to fix

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

              def plot_attribute_confidences(
              Severity: Minor
              Found in rasa/nlu/test.py - About 35 mins to fix

                Function remove_empty_response_examples has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def remove_empty_response_examples(
                    response_results: List[ResponseSelectionEvaluationResult],
                ) -> List[ResponseSelectionEvaluationResult]:
                    """Remove those examples without a response.
                
                
                Severity: Minor
                Found in rasa/nlu/test.py - About 35 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 remove_empty_intent_examples has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def remove_empty_intent_examples(
                    intent_results: List[IntentEvaluationResult],
                ) -> List[IntentEvaluationResult]:
                    """Remove those examples without an intent.
                
                
                Severity: Minor
                Found in rasa/nlu/test.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