Sourcery refactored master branch#2
Conversation
| for idx, col in enumerate(cursor.description): | ||
| d[col[0]] = row[idx] | ||
| return d | ||
| return {col[0]: row[idx] for idx, col in enumerate(cursor.description)} |
There was a problem hiding this comment.
Function dict_factory refactored with the following changes:
- Convert for loop into dictionary comprehension (
dict-comprehension) - Inline variable that is immediately returned (
inline-immediately-returned-variable)
| return True | ||
| else: | ||
| return False | ||
| return self._task['datetime'] < now |
There was a problem hiding this comment.
Function TaskWrapper.expired refactored with the following changes:
- Simplify conditional into return statement (
return-identity)
| result = self.cr.execute("SELECT * from Ideas LIMIT {} OFFSET {}".format(limit, offset)) | ||
| ideas = result.fetchall() | ||
| return ideas | ||
| return result.fetchall() |
There was a problem hiding this comment.
Function IdeaModel.load_ideas refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| idea = result.fetchone() | ||
| return idea | ||
| return result.fetchone() |
There was a problem hiding this comment.
Function IdeaModel.load_idea refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| idea = result.fetchone() | ||
| return idea | ||
| return result.fetchone() |
There was a problem hiding this comment.
Function IdeaModel.load_idea_by_task_id refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| result = self.cr.execute("SELECT * from Tasks LIMIT ? OFFSET ?", (limit, offset)) | ||
| tasks = result.fetchall() | ||
| return tasks | ||
| return result.fetchall() |
There was a problem hiding this comment.
Function TaskModel.load_tasks refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| tasks = result.fetchall() | ||
| return tasks | ||
| return result.fetchall() |
There was a problem hiding this comment.
Function TaskModel.load_tasks_period refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| task = result.fetchone() | ||
| return task | ||
| return result.fetchone() |
There was a problem hiding this comment.
Function TaskModel.load_task refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
Sourcery Code Quality Report (beta)✅ Merging this PR will increase code quality in the affected files by 0.02 out of 10.
Here are some functions in these files that still need a tune-up:
Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Let us know what you think of it by mentioning @sourcery-ai in a comment. |
Branch
masterrefactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
masterbranch, then run: