Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcery refactored master branch #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Aug 11, 2020

Branch master refactored 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 master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

return urljoin(
self._url if urlparse(action_url).scheme else '',
self.action
)
return urljoin(self._url if urlparse(action_url).scheme else '', action_url)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FormWrapper.action_url refactored with the following changes:

  • Use previously assigned local variable (use-assigned-variable)

Comment on lines -144 to +141
for field in fields:
if field not in dict(self._lxml_form.inputs):
return False
return True
return all(field in dict(self._lxml_form.inputs) for field in fields)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FormWrapper.has_fields refactored with the following changes:

  • Use any() instead of for loop (use-any)
  • Invert any/all to simplify comparisons (invert-any-all)

if not headers[subindex] in table_dict[index]:
if headers[subindex] not in table_dict[index]:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function table_to_dict.process_row refactored with the following changes:

  • Simplify logical expression using De Morgan identities (de-morgan)

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Aug 11, 2020

Sourcery Code Quality Report (beta)

✅  Merging this PR will increase code quality in the affected files by 0.01 out of 10.

Quality metrics Before After Change
Complexity 3.68 3.57 -0.11 🔵
Method Length 37.72 37.58 -0.14 🔵
Quality 8.77 8.78 0.01 🔵
Other metrics Before After Change
Lines 317 311 -6
Changed files Quality Before Quality After Quality Change
delver/forms.py 9.29 9.31 0.02 🔵
delver/helpers.py 7.96 7.96 0.00

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Overall Recommendation
delver/helpers.py table_to_dict 32 176.93 3.63 Split out functionality

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants