Showing 543 of 559 total issues
Function process_training_data
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def process_training_data(self, training_data: TrainingData) -> TrainingData:
"""Tokenize all training data."""
for example in training_data.training_examples:
for attribute in MESSAGE_ATTRIBUTES:
if (
- 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 _replace_edge_labels_with_nodes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _replace_edge_labels_with_nodes(
graph: "networkx.MultiDiGraph", next_id: int, nlu_training_data: "TrainingData"
) -> None:
"""Replaces edge labels with nodes.
- 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 __init__
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
tracker_store: TrackerStore,
strategy: str,
count: Optional[int] = None,
- 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 _add_bilou_tags_to_entities
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _add_bilou_tags_to_entities(
bilou: List[Text],
entities: List[Tuple[int, int, Text]],
end_pos_to_token_idx: Dict[int, int],
start_pos_to_token_idx: Dict[int, int],
- 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 _check_OOV_present
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _check_OOV_present(self, all_tokens: List[List[Text]], attribute: Text) -> None:
"""Check if an OOV word is present."""
if not self.OOV_token or self.OOV_words or not all_tokens:
return
- 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 plot_paired_histogram
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_paired_histogram(
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function parse_changelog
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def parse_changelog(tag_name: Text) -> Text:
"""Read the changelog and extract the most recently release entry."""
p = Path(__file__).parent.parent / "CHANGELOG.mdx"
changelog_lines = p.read_text(encoding="UTF-8").splitlines()
- 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 __str__
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def __str__(self) -> Text:
msg = ""
if self.filename:
msg += f"Failed to validate '{self.filename}'. "
else:
- 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 __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function process
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def process(self, messages: List[Message]) -> List[Message]:
"""Tokenize the incoming messages."""
for message in messages:
for attribute in MESSAGE_ATTRIBUTES:
if isinstance(message.get(attribute), str):
- 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 get_data_files
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_data_files(
paths: Optional[Union[Text, List[Text]]], filter_predicate: Callable[[Text], bool]
) -> List[Text]:
"""Recursively collects all training files from a list of paths.
- 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 get_validated_path
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_validated_path(
current: Optional[Union["Path", Text]],
parameter: Text,
default: Optional[Union["Path", Text]] = None,
none_is_valid: 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 __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _get_trackers_for_training
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _get_trackers_for_training(
trackers: List[TrackerWithCachedStates],
) -> List[TrackerWithCachedStates]:
"""Filters out the list of trackers which should not be used for training.
- 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 _replace_with_oov_token
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _replace_with_oov_token(
self, tokens: List[Text], attribute: Text
) -> List[Text]:
"""Replace OOV words with OOV token."""
if self.OOV_token and self.analyzer == "word":
- 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 _create_unique_entity_mappings
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _create_unique_entity_mappings(self, domain: Domain) -> Set[Text]:
"""Finds mappings of type `from_entity` that uniquely set a slot.
For example in the following form:
some_form:
- 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 __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function load
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def load(
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(