Showing 543 of 559 total issues
Function encode_entities
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def encode_entities(
self,
entity_data: Dict[Text, Any],
precomputations: Optional[MessageContainerForCoreFeaturization],
bilou_tagging: bool = False,
- 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
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
- 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
Function _load_model
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _load_model(
model_path: Union[Text, Path]
) -> Tuple[Text, ModelMetadata, GraphRunner]:
"""Unpacks a model from a given path using the graph model loader."""
try:
- 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"