Showing 22,315 of 22,315 total issues
Incorrect end of line character(s) found. Open
Open
class Meta:
- Exclude checks
Incorrect end of line character(s) found. Open
Open
"id",
- Exclude checks
Incorrect end of line character(s) found. Open
Open
)
- Exclude checks
Incorrect end of line character(s) found. Open
Open
request = self.context.get("request")
- Exclude checks
Incorrect end of line character(s) found. Open
Open
if request and hasattr(request, "user"):
- Exclude checks
Incorrect end of line character(s) found. Open
Open
{
- Exclude checks
Incorrect end of line character(s) found. Open
Open
fields = (
- Exclude checks
Incorrect end of line character(s) found. Open
Open
author = UserListSerializer(required=False)
- Exclude checks
Incorrect end of line character(s) found. Open
Open
"author",
- Exclude checks
Incorrect end of line character(s) found. Open
Open
"num_civis",
- Exclude checks
Incorrect end of line character(s) found. Open
Open
else:
- Exclude checks
Either remove or fill this block of code. Open
Open
pass
- Read upRead up
- Exclude checks
Most of the time a block of code is empty when a piece of code is really missing. So such empty block must be either filled or removed.
Noncompliant Code Example
for i in range(3): pass
Exceptions
When a block contains a comment, this block is not considered to be empty.
Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed. Open
Open
def upload_civi_image(request):
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Either remove or fill this block of code. Open
Open
pass
- Read upRead up
- Exclude checks
Most of the time a block of code is empty when a piece of code is really missing. So such empty block must be either filled or removed.
Noncompliant Code Example
for i in range(3): pass
Exceptions
When a block contains a comment, this block is not considered to be empty.
Merge this if statement with the enclosing one. Open
Open
if category_id != "all":
- Read upRead up
- Exclude checks
Merging collapsible if
statements increases the code's readability.
Noncompliant Code Example
if condition1: if condition2: # ...
Compliant Solution
if condition1 and condition2: # ...