Showing 193 of 242 total issues
Avoid too many return
statements within this function. Open
return self._type(val)
Avoid too many return
statements within this function. Open
return value
Avoid too many return
statements within this function. Open
return JSONEncoder.default(self, obj)
Avoid too many return
statements within this function. Open
return instance
Avoid too many return
statements within this function. Open
return value
Avoid too many return
statements within this function. Open
return boolify(value, return_string=True)
Avoid too many return
statements within this function. Open
return text_type(value)
Avoid too many return
statements within this function. Open
return boolify(value) if type_hint == bool else type_hint(value)
Function __getitem__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __getitem__(self, key):
key = key.lower()
if key in self._registered_env_keys:
from_env = os.getenv(make_env_key(self.appname, key))
from_sources = self._config_map.get(key)
- 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 validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate(self, instance, val):
"""
Returns:
True: if val is valid
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(cls, name, bases, attr):
super(FactoryType, cls).__init__(name, bases, attr)
if 'skip_registration' in cls.__dict__ and cls.skip_registration:
pass # we don't even care # pragma: no cover
elif cls.factory is 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 attach_stderr
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def attach_stderr(level=INFO):
has_stderr_handler = any(handler.name == 'stderr' for handler in root_log.handlers)
if not has_stderr_handler:
handler = StreamHandler(stderr)
handler.name = 'stderr'
- 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 _git_describe_tags
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _git_describe_tags(path):
try:
call("git update-index --refresh", path, raise_on_error=False)
except CalledProcessError as e:
# git is probably not installed
- 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"