BoboTiG / python-mss

An ultra fast cross-platform multiple screenshots module in pure Python using ctypes.
https://pypi.org/project/mss/
MIT License
998 stars 88 forks source link

Bad cached BMP: gdi32.GetDIBits() failed (Sourcery refactored) #218

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Pull Request #211 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/BoboTiG/python-mss pull/211/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:

Help us improve this pull request!

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 1.36 ⭐ 1.41 ⭐ 0.05 👎
Method Length 94.25 🙂 89.27 🙂 -4.98 👍
Working memory 7.17 🙂 7.30 🙂 0.13 👎
Quality 72.17% 🙂 72.49% 🙂 0.32% 👍
Other metrics Before After Change
Lines 325 367 42
Changed files Quality Before Quality After Quality Change
mss/windows.py 67.21% 🙂 65.66% 🙂 -1.55% 👎
mss/tests/test_windows.py 83.80% ⭐ 81.29% ⭐ -2.51% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
mss/windows.py MSS._grab_impl 5 ⭐ 195 😞 12 😞 50.20% 🙂 Try splitting into smaller methods. Extract out complex expressions
mss/windows.py MSS._monitors_impl 0 ⭐ 131 😞 72.97% 🙂 Try splitting into smaller methods
mss/windows.py MSS.__init__ 1 ⭐ 137 😞 5 ⭐ 75.00% 🙂 Try splitting into smaller methods

Legend and Explanation

The emojis denote the absolute quality of the code:

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!