Showing 134 of 263 total issues
Function _eval_line
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _eval_line(self, line):
if line.startswith("file "):
full_file = line[5:]
file1 = os.path.basename(full_file)
file2 = os.path.splitext(file1)[0]
- 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
Avoid too many return
statements within this function. Open
return ["clear"]
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "Pending charge"
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return int(float(match[self._match_number]))
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return is_psl(module)
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return ["clouds"]
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return False
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "Pending discharge"
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "unknown"
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return state
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "wheel-down"
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "Fully charged"
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return ["sleet"]
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return self._status
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "update"
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return "n/a"
- Create a ticketCreate a ticket
Function _check_for_refresh
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _check_for_refresh(self):
if self._feeds_to_update:
# Update one feed at a time to not overload this update cycle
url = self._feeds_to_update.pop()
self._update_items_from_feed(url)
- 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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update(self):
database_loc = self.parameter(
"database", "~/.local/share/activitywatch/aw-server/peewee-sqlite.v2.db"
)
home = os.path.expanduser("~")
- 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"