Showing 543 of 559 total issues
File marker_base.py
has 759 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from __future__ import annotations
import os
from abc import ABC, abstractmethod
from typing import (
Dict,
File response_selector.py
has 747 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from __future__ import annotations
import copy
import logging
from rasa.nlu.featurizers.featurizer import Featurizer
File models.py
has 738 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import time
import random
import tensorflow as tf
import numpy as np
import logging
File yaml_story_reader.py
has 714 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import copy
import functools
import json
from json import JSONDecodeError
import logging
File generator.py
has 664 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from collections import defaultdict, namedtuple, deque
import copy
import logging
import random
File structures.py
has 650 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import json
import logging
from collections import deque, defaultdict
import uuid
File count_vectors_featurizer.py
has 636 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from __future__ import annotations
import logging
import re
import scipy.sparse
from typing import Any, Dict, List, Optional, Text, Tuple, Set, Type
File forms.py
has 588 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import copy
from typing import Text, List, Optional, Union, Any, Dict, Set
import itertools
import logging
import structlog
File lm_featurizer.py
has 579 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from __future__ import annotations
import numpy as np
import logging
from typing import Any, Text, List, Dict, Tuple, Type
File training_data.py
has 566 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import logging
import os
from pathlib import Path
import random
from collections import Counter, OrderedDict
Function _generate
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
Open
def _generate(
self, story_steps: List[StoryStep], is_rule_data: bool = False
) -> List[TrackerWithCachedStates]:
if not story_steps:
logger.debug(f"No {'rules' if is_rule_data else 'story blocks'} found.")
- 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 policy.py
has 553 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from __future__ import annotations
import abc
import copy
import logging
from enum import Enum
File crf_entity_extractor.py
has 522 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from __future__ import annotations
from collections import OrderedDict
from enum import Enum
import logging
File slack.py
has 510 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import asyncio
import hashlib
import hmac
from http import HTTPStatus
import json
File rasa_yaml.py
has 497 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import logging
from collections import OrderedDict
from pathlib import Path
from typing import Text, Any, List, Dict, Tuple, Union, Iterator, Optional, Callable
File visualization.py
has 492 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from collections import defaultdict, deque
import random
from typing import (
Any,
File transformer.py
has 490 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from typing import Optional, Text, Tuple, Union
import numpy as np
import tensorflow as tf
File graph.py
has 489 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from __future__ import annotations
import dataclasses
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
File io.py
has 485 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from collections import OrderedDict
import errno
import glob
from hashlib import md5
from io import StringIO
File validation.py
has 479 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import inspect
import logging
import typing
from typing import (
Optional,