Function _next_alpha_version
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _next_alpha_version(next_stable_version: str, list_of_tags: typing.List[Tag]) -> str:
next_alpha_version_quantifier = 1
if list_of_tags:
for tag in list_of_tags:
if not tag.is_alpha:
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, tag_str: str) -> None:
self._tag_str = tag_str
self._tag: typing.Optional[typing.Match[str]] = self._re_tag.match(self._tag_str)
if not self._tag:
raise ValueError(f'Wrong value for tag string: {self._tag_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 _next_stable_version
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _next_stable_version(calver: str, list_of_tags: typing.List[Tag]) -> str:
next_version_quantifier = 1
if list_of_tags:
for tag in list_of_tags:
if tag.is_alpha:
- 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"