jabesq / netatmo-api-python

Simple API to access Netatmo weather station data from any python script (for Netatmo information, see www.netatmo.com)
MIT License
10 stars 34 forks source link

Add trends for weather stations and modules #118

Closed cgtobi closed 4 years ago

sourcery-ai[bot] commented 4 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 2.68 ⭐ 2.75 ⭐ 0.07 👎
Method Length 67.36 🙂 68.54 🙂 1.18 👎
Working memory 10.43 😞 10.50 😞 0.07 👎
Quality 74.35% 🙂 74.15% 🙂 -0.20% 👎
Other metrics Before After Change
Lines 709 719 10
Changed files Quality Before Quality After Quality Change
src/pyatmo/weather_station.py 73.39% 🙂 72.97% 🙂 -0.42% 👎
tests/test_pyatmo_weatherstation.py 75.08% ⭐ 75.03% ⭐ -0.05% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
src/pyatmo/weather_station.py WeatherStationData.__init__.get_module_names.get_modules.get_monitored_conditions.get_last_data 19 😞 217 ⛔ 12 😞 36.39% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/pyatmo/weather_station.py WeatherStationData.__init__.get_module_names.get_modules.get_monitored_conditions 13 🙂 155 😞 11 😞 48.12% 😞 Try splitting into smaller methods. Extract out complex expressions
src/pyatmo/weather_station.py WeatherStationData.__init__ 18 🙂 157 😞 7 🙂 52.38% 🙂 Try splitting into smaller methods
tests/test_pyatmo_weatherstation.py test_weather_station_get_monitored_conditions 0 95 🙂 34 ⛔ 53.76% 🙂 Extract out complex expressions
tests/test_pyatmo_weatherstation.py test_weather_station_get_modules 0 97 🙂 29 ⛔ 54.04% 🙂 Extract out complex expressions

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!

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