Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Apr 1, 2022

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
Copy link
Author

sourcery-ai bot commented Apr 1, 2022

Sourcery Code Quality Report

Merging this PR leaves code quality unchanged.

Quality metrics Before After Change
Complexity 12.37 🙂 11.81 🙂 -0.56 👍
Method Length 53.93 ⭐ 53.48 ⭐ -0.45 👍
Working memory 9.18 🙂 9.33 🙂 0.15 👎
Quality 62.75% 🙂 62.75% 🙂 0.00%
Other metrics Before After Change
Lines 12952 12882 -70
Changed files Quality Before Quality After Quality Change
appdaemon/apps/gsheets.py 60.76% 🙂 60.68% 🙂 -0.08% 👎
custom_components/average/sensor.py 48.76% 😞 48.62% 😞 -0.14% 👎
custom_components/braviatv_remote/remote.py 88.19% ⭐ 88.55% ⭐ 0.36% 👍
custom_components/climate_group/climate.py 71.91% 🙂 72.26% 🙂 0.35% 👍
custom_components/custom_generic_thermostat/climate.py 60.10% 🙂 60.18% 🙂 0.08% 👍
custom_components/generic_thermostat/climate.py 63.56% 🙂 63.77% 🙂 0.21% 👍
custom_components/hacs/init.py 58.23% 🙂 60.26% 🙂 2.03% 👍
custom_components/hacs/const.py 64.36% 🙂 64.36% 🙂 0.00%
custom_components/hacs/http.py 34.18% 😞 34.00% 😞 -0.18% 👎
custom_components/hacs/sensor.py 92.39% ⭐ 94.47% ⭐ 2.08% 👍
custom_components/hacs/setup.py 77.33% ⭐ 77.82% ⭐ 0.49% 👍
custom_components/hacs/ws_api_handlers.py 39.04% 😞 36.73% 😞 -2.31% 👎
custom_components/hacs/hacsbase/init.py 72.34% 🙂 73.42% 🙂 1.08% 👍
custom_components/hacs/hacsbase/backup.py 75.93% ⭐ 75.92% ⭐ -0.01% 👎
custom_components/hacs/hacsbase/data.py 52.07% 🙂 51.40% 🙂 -0.67% 👎
custom_components/hacs/handler/download.py 59.21% 🙂 59.71% 🙂 0.50% 👍
custom_components/hacs/helpers/download.py 49.22% 😞 50.97% 🙂 1.75% 👍
custom_components/hacs/helpers/filters.py 61.34% 🙂 61.42% 🙂 0.08% 👍
custom_components/hacs/helpers/get_defaults.py 80.24% ⭐ 80.77% ⭐ 0.53% 👍
custom_components/hacs/helpers/information.py 69.44% 🙂 68.18% 🙂 -1.26% 👎
custom_components/hacs/helpers/install.py 40.10% 😞 40.96% 😞 0.86% 👍
custom_components/hacs/helpers/misc.py 83.13% ⭐ 85.98% ⭐ 2.85% 👍
custom_components/hacs/helpers/register_repository.py 33.83% 😞 35.58% 😞 1.75% 👍
custom_components/hacs/helpers/validate_repository.py 36.26% 😞 36.07% 😞 -0.19% 👎
custom_components/hacs/repositories/appdaemon.py 78.43% ⭐ 78.74% ⭐ 0.31% 👍
custom_components/hacs/repositories/netdaemon.py 74.89% 🙂 77.36% ⭐ 2.47% 👍
custom_components/hacs/repositories/plugin.py 82.82% ⭐ 81.71% ⭐ -1.11% 👎
custom_components/hacs/repositories/python_script.py 77.28% ⭐ 78.98% ⭐ 1.70% 👍
custom_components/hacs/repositories/repository.py 72.57% 🙂 72.26% 🙂 -0.31% 👎
custom_components/hacs/repositories/theme.py 82.69% ⭐ 85.27% ⭐ 2.58% 👍
custom_components/hacs/repositories/helpers/methods/reinstall_if_needed.py 92.68% ⭐ 93.68% ⭐ 1.00% 👍
custom_components/hacs/repositories/helpers/properties/can_be_installed.py 87.05% ⭐ 95.36% ⭐ 8.31% 👍
custom_components/hacs/repositories/helpers/properties/pending_update.py 72.62% 🙂 75.23% ⭐ 2.61% 👍
custom_components/livebox/bridge.py 81.60% ⭐ 81.32% ⭐ -0.28% 👎
custom_components/livebox/device_tracker.py 91.70% ⭐ 91.69% ⭐ -0.01% 👎
custom_components/livebox/sensor.py 91.64% ⭐ 91.74% ⭐ 0.10% 👍
custom_components/netatmo/init.py 56.95% 🙂 56.04% 🙂 -0.91% 👎
custom_components/netatmo/camera.py 70.61% 🙂 71.55% 🙂 0.94% 👍
custom_components/netatmo/climate.py 51.77% 🙂 51.98% 🙂 0.21% 👍
custom_components/netatmo/data_handler.py 72.11% 🙂 72.26% 🙂 0.15% 👍
custom_components/netatmo/light.py 67.97% 🙂 68.74% 🙂 0.77% 👍
custom_components/netatmo/sensor.py 42.24% 😞 42.30% 😞 0.06% 👍
custom_components/netatmo/pyatmo/auth.py 54.53% 🙂 55.86% 🙂 1.33% 👍
custom_components/netatmo/pyatmo/camera.py 52.85% 🙂 51.93% 🙂 -0.92% 👎
custom_components/netatmo/pyatmo/helpers.py 92.14% ⭐ 92.12% ⭐ -0.02% 👎
custom_components/netatmo/pyatmo/home_coach.py 97.45% ⭐ 97.39% ⭐ -0.06% 👎
custom_components/netatmo/pyatmo/public_data.py 89.95% ⭐ 89.54% ⭐ -0.41% 👎
custom_components/netatmo/pyatmo/thermostat.py 56.43% 🙂 55.00% 🙂 -1.43% 👎
custom_components/netatmo/pyatmo/weather_station.py 64.28% 🙂 62.76% 🙂 -1.52% 👎
custom_components/spotcast/init.py 43.48% 😞 43.48% 😞 0.00%
custom_components/spotify-playlist-sensor/sensor.py 70.12% 🙂 70.70% 🙂 0.58% 👍
custom_components/tahoma/init.py 58.81% 🙂 58.75% 🙂 -0.06% 👎
custom_components/tahoma/binary_sensor.py 82.16% ⭐ 83.70% ⭐ 1.54% 👍
custom_components/tahoma/climate.py 64.43% 🙂 65.45% 🙂 1.02% 👍
custom_components/tahoma/config_flow.py 54.89% 🙂 57.00% 🙂 2.11% 👍
custom_components/tahoma/cover.py 68.57% 🙂 68.38% 🙂 -0.19% 👎
custom_components/tahoma/light.py 85.28% ⭐ 85.86% ⭐ 0.58% 👍
custom_components/tahoma/lock.py 90.10% ⭐ 90.96% ⭐ 0.86% 👍
custom_components/tahoma/scene.py 93.05% ⭐ 94.60% ⭐ 1.55% 👍
custom_components/tahoma/sensor.py 80.05% ⭐ 80.15% ⭐ 0.10% 👍
custom_components/tahoma/switch.py 92.48% ⭐ 93.85% ⭐ 1.37% 👍
custom_components/tahoma/tahoma_api.py 73.70% 🙂 73.89% 🙂 0.19% 👍
custom_components/tahoma/tahoma_device.py 92.47% ⭐ 92.31% ⭐ -0.16% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
custom_components/netatmo/sensor.py NetatmoSensor.async_update_callback 101 ⛔ 932 ⛔ 40 ⛔ 0.34% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
custom_components/netatmo/pyatmo/camera.py CameraData.__init__ 55 ⛔ 415 ⛔ 19 ⛔ 8.30% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
custom_components/average/sensor.py AverageSensor._update_state 55 ⛔ 436 ⛔ 18 ⛔ 8.84% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
custom_components/spotcast/init.py setup 44 ⛔ 656 ⛔ 14 😞 14.33% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
custom_components/hacs/ws_api_handlers.py hacs_repository 24 😞 367 ⛔ 24 ⛔ 16.83% ⛔ Refactor to reduce nesting. 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!

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.

1 participant