fastkml icon indicating copy to clipboard operation
fastkml copied to clipboard

Add PhotoOverlay, Camera, LookAt, AbstractView support (Sourcery refactored)

Open sourcery-ai[bot] opened this issue 2 years ago β€’ 2 comments

Pull Request #158 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/cleder/fastkml pull/158/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] avatar Feb 03 '22 20:02 sourcery-ai[bot]

Hello @sourcery-ai[bot]! Thanks for updating this PR. We checked the lines you've touched for PEPΒ 8 issues, and found:

Line 140:21: W503 line break before binary operator Line 153:17: W503 line break before binary operator Line 424:21: E231 missing whitespace after ':' Line 424:22: E225 missing whitespace around operator Line 424:22: E999 SyntaxError: invalid syntax Line 1552:90: E501 line too long (92 > 89 characters) Line 1611:21: E231 missing whitespace after ':' Line 1611:22: E225 missing whitespace around operator Line 1615:21: E231 missing whitespace after ':' Line 1615:22: E225 missing whitespace around operator

Comment last updated at 2022-04-19 19:58:27 UTC

pep8speaks avatar Feb 03 '22 20:02 pep8speaks

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 2.42 ⭐ 3.11 ⭐ 0.69 πŸ‘Ž
Method Length 61.12 πŸ™‚ 54.96 ⭐ -6.16 πŸ‘
Working memory 6.14 ⭐ 6.16 ⭐ 0.02 πŸ‘Ž
Quality 76.41% ⭐ 75.97% ⭐ -0.44% πŸ‘Ž
Other metrics Before After Change
Lines 3504 4142 638
Changed files Quality Before Quality After Quality Change
fastkml/kml.py 72.04% πŸ™‚ 72.18% πŸ™‚ 0.14% πŸ‘
fastkml/test_main.py 78.94% ⭐ 79.29% ⭐ 0.35% πŸ‘

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

File Function Complexity Length Working Memory Quality Recommendation
fastkml/kml.py _Feature.from_element 22 😞 437 β›” 8 πŸ™‚ 35.64% 😞 Refactor to reduce nesting. Try splitting into smaller methods
fastkml/kml.py _Feature.etree_element 25 😞 332 β›” 6 ⭐ 40.21% 😞 Refactor to reduce nesting. Try splitting into smaller methods
fastkml/kml.py PhotoOverlay.from_element 23 😞 267 β›” 7 πŸ™‚ 41.16% 😞 Refactor to reduce nesting. Try splitting into smaller methods
fastkml/kml.py Placemark.from_element 7 ⭐ 244 β›” 10 😞 48.69% 😞 Try splitting into smaller methods. Extract out complex expressions
fastkml/kml.py _TimePrimitive.parse_str 6 ⭐ 146 😞 12 😞 53.78% πŸ™‚ Try splitting into smaller methods. 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!

sourcery-ai[bot] avatar Apr 19 '22 19:04 sourcery-ai[bot]