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

Output class does work now (Sourcery refactored) #11

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Oct 26, 2020

Pull Request #10 refactored by Sourcery.

Since the original Pull Request was opened as a fork in a contributor's
repository, we are unable to create a Pull Request branching from it.

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to
    the original Pull Request

    Incorporate changes via command line
    git fetch https://github.com/schnipdip/Dump pull/10/head
    git merge --ff-only FETCH_HEAD
    git push

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

@sourcery-ai sourcery-ai bot requested a review from j-freimuth October 26, 2020 20:17
@sourcery-ai
Copy link
Author

sourcery-ai bot commented Oct 26, 2020

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.55%.

Quality metrics Before After Change
Complexity 2.85 ⭐ 3.38 ⭐ 0.53 👎
Method Length 70.65 🙂 71.19 🙂 0.54 👎
Working memory 8.50 🙂 8.67 🙂 0.17 👎
Quality 74.93% 🙂 74.38% 🙂 -0.55% 👎
Other metrics Before After Change
Lines 460 477 17
Changed files Quality Before Quality After Quality Change
linux/dumper/dumper_lcd.py 73.84% 🙂 73.49% 🙂 -0.35% 👎
linux/dumper/dumper_no_lcd.py 76.25% ⭐ 75.37% ⭐ -0.88% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
linux/dumper/dumper_lcd.py mount_usb 4 ⭐ 141 😞 14 😞 53.30% 🙂 Try splitting into smaller methods. Extract out complex expressions
linux/dumper/dumper_no_lcd.py mount_usb 4 ⭐ 111 🙂 12 😞 59.92% 🙂 Extract out complex expressions
linux/dumper/dumper_no_lcd.py make_udev_rules 0 108 🙂 13 😞 62.72% 🙂 Extract out complex expressions
linux/dumper/dumper_no_lcd.py verify_usb 5 ⭐ 105 🙂 10 😞 63.36% 🙂 Extract out complex expressions
linux/dumper/dumper_no_lcd.py handle_input_args 3 ⭐ 58 ⭐ 11 😞 70.33% 🙂 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!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@@ -4,7 +4,7 @@ After=mnt-source.mount

[Service]
Type=idle
ExecStart=/usr/bin/sudo /usr/bin/python3 /home/pi/dump/linux/dumper/dumper_no_lcd.py
ExecStart=/usr/bin/sudo /usr/bin/python3 /home/pi/dump/linux/dumper/dumper.py monitor
Copy link
Owner

Choose a reason for hiding this comment

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

We are going to remove this functionality. We don't have to make any changes, in fact we should probably just remove these no_lcd. files.

Copy link
Owner

@schnipdip schnipdip left a comment

Choose a reason for hiding this comment

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

Take a look at the comments, don't forget his has to be under the development branch.

lcd = character_lcd.Character_LCD_RGB_I2C(i2c, lcd_columns, lcd_rows)

return lcd
return character_lcd.Character_LCD_RGB_I2C(i2c, lcd_columns, lcd_rows)
Copy link
Owner

Choose a reason for hiding this comment

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

This actually has to return lcd because it's what allows you to generate messages. Unless since we are decoupling that from main, we can instantiate the LCD in another file.

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.

2 participants