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 Dec 18, 2021

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^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from JakubAndrysek December 18, 2021 17:06
Comment on lines +28 to +36
elif sensor_number in all_sensors_status.keys():
# add sensor in on sensors
# print("\nAdd")
sensor_add_state(sensor_number, "ON")
all_sensors_status[sensor_number] = "ON"
reset_cutdown(sensor_number)
else:
# check that sensor is in database
if sensor_number in all_sensors_status.keys():
# add sensor in on sensors
# print("\nAdd")
sensor_add_state(sensor_number, "ON")
all_sensors_status[sensor_number] = "ON"
reset_cutdown(sensor_number)
else:
# not existting sensor
print("\nERROR - adding unexisting sensor -> {} -> {}".format(sensor_number, get_tiime()))
# not existting sensor
print("\nERROR - adding unexisting sensor -> {} -> {}".format(sensor_number, get_tiime()))
Copy link
Author

Choose a reason for hiding this comment

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

Function MyUDPHandler.handle refactored with the following changes:

This removes the following comments ( why? ):

# check that sensor is in database

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Dec 18, 2021

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.43%.

Quality metrics Before After Change
Complexity 4.22 ⭐ 3.82 ⭐ -0.40 👍
Method Length 49.00 ⭐ 49.00 ⭐ 0.00
Working memory 6.89 🙂 6.89 🙂 0.00
Quality 75.76% 76.19% 0.43% 👍
Other metrics Before After Change
Lines 124 122 -2
Changed files Quality Before Quality After Quality Change
Pletacka-server/main.py 75.76% ⭐ 76.19% ⭐ 0.43% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
Pletacka-server/main.py sensor_add_state 2 ⭐ 78 🙂 10 😞 70.15% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


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!

Help us improve this quality report!

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