Showing 4 of 6 total issues
Function create_comment
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_comment(self, author, content, commit=True, *, status=None,
Function create_conversation
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_conversation(self, question, title, author, *, commit=True, **kwargs):
Function conversation_detail
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def conversation_detail(request, slug, category_slug):
conversation = get_object_or_404(models.Conversation, slug=slug)
if conversation.category.slug != category_slug:
raise Http404
comment = conversation.get_next_comment(request.user, 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 set_limits
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def set_limits(self, limits=None, commit=True, **kwargs):
"""
Sets the limit object for conversation.
It accepts a simple :cls:`Limits` object, its name as a string or a
- 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"