Function render_standalone
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def render_standalone(self, max_length: int, prefix: str) -> str:
"""
For a Comment, returns the string for properly formatting this Comment
as a standalone comment (on its own line)
"""
- Read upRead up
- Create a ticketCreate a ticket
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 _split_before
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _split_before(cls, text: str, max_length: int) -> Iterator[str]:
"""
When rendering very long comments, we try to split them at the desired line
length and wrap them onto multiple lines. This method takes the contents of
a comment (without the marker) and a maximum length, and splits the original
- Read upRead up
- Create a ticketCreate a ticket
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 6 (exceeds 5 allowed). Consider refactoring. Open
def __str__(self) -> str:
"""
Returns the contents of the comment token plus a trailing newline,
without preceding whitespace, with a single space between the marker
and the comment text.
- Read upRead up
- Create a ticketCreate a ticket
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"