Showing 543 of 559 total issues
File lexical_syntactic_featurizer.py
has 465 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
import logging
from collections import OrderedDict
import scipy.sparse
File train_utils.py
has 461 lines of code (exceeds 250 allowed). Consider refactoring. Open
from pathlib import Path
import numpy as np
from typing import Optional, Text, Dict, Any, Union, List, Tuple, TYPE_CHECKING
import rasa.shared.utils.common
File importer.py
has 457 lines of code (exceeds 250 allowed). Consider refactoring. Open
from abc import ABC, abstractmethod
from functools import reduce
from typing import Text, Optional, List, Dict, Set, Any, Tuple, Type, Union, cast
import logging
File agent.py
has 446 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
from asyncio import AbstractEventLoop, CancelledError
import functools
import logging
import os
Function with_cycles_removed
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def with_cycles_removed(self) -> "StoryGraph":
"""Create a graph with the cyclic edges removed from this graph."""
story_end_checkpoints = self.story_end_checkpoints.copy()
cyclic_edge_ids = self.cyclic_edge_ids
# we need to remove the start steps and replace them with steps ending
- Read upRead up
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
File default_recipe_validator.py
has 440 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
from collections import defaultdict
from typing import Iterable, List, Dict, Text, Any, Set, Type, cast
from rasa.core.featurizers.precomputation import CoreFeaturizationInputConverter
Function format_tracker_states
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def format_tracker_states(states: List[Dict]) -> Text:
"""Format tracker states to human readable format on debug log.
Args:
states: list of tracker states dicts
- Read upRead up
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
File common.py
has 434 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import inspect
import logging
import logging.config
import logging.handlers
File memoization.py
has 431 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
import copy
import zlib
import base64
Function process_user_utterance
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def process_user_utterance(
user_utterance: UserUttered, is_test_story: bool = False
) -> OrderedDict:
"""Converts a single user utterance into an ordered dict.
- Read upRead up
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
File message.py
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Any, Optional, Tuple, Text, Dict, Set, List
import typing
import copy
Function visualize_neighborhood
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def visualize_neighborhood(
current: Optional[List[Event]],
event_sequences: List[List[Event]],
output_file: Optional[Text] = None,
max_history: int = 2,
- Read upRead up
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
File model_training.py
has 389 lines of code (exceeds 250 allowed). Consider refactoring. Open
import time
from pathlib import Path
from typing import Text, NamedTuple, Optional, List, Union, Dict, Any
import randomname
File model_data_utils.py
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
import typing
import copy
import numpy as np
import scipy.sparse
from collections import defaultdict, OrderedDict
File extractor.py
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
import abc
from typing import Any, Dict, List, NamedTuple, Text, Tuple, Optional
import rasa.shared.utils.io
from rasa.shared.constants import DOCS_URL_TRAINING_DATA_NLU
File caching.py
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
import abc
import logging
import os
File model_testing.py
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import logging
import os
from typing import (
Text,
File slots.py
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Optional, Text, Type
import rasa.shared.core.constants
Function requires_auth
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def requires_auth(
app: Sanic, token: Optional[Text] = None
) -> Callable[["SanicView"], "SanicView"]:
"""Wraps a request handler with token authentication."""
- Read upRead up
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
File crf.py
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
import tensorflow as tf
from tensorflow import TensorShape
from tensorflow.types.experimental import TensorLike
from typing import Tuple, Any, List, Union, Optional