a-luna / vigorish

MLB data web scraper, Python CLI application
https://aaronluna.dev/projects/vigorish
MIT License
2 stars 2 forks source link

fix: decimal values for several pfx metrics #847

Closed a-luna closed 3 years ago

sourcery-ai[bot] commented 3 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.80 ⭐ 0.73 ⭐ -0.07 👍
Method Length 28.03 ⭐ 31.06 ⭐ 3.03 👎
Working memory 6.22 🙂 6.10 ⭐ -0.12 👍
Quality 87.63% 86.37% -1.26% 👎
Other metrics Before After Change
Lines 556 562 6
Changed files Quality Before Quality After Quality Change
src/vigorish/data/metrics/pitchfx/pitchfx_metrics.py 89.35% ⭐ 89.18% ⭐ -0.17% 👎
src/vigorish/models/batter_percentiles.py 78.61% ⭐ 75.91% ⭐ -2.70% 👎
src/vigorish/models/pitch_type_percentiles.py 71.61% 🙂 72.70% 🙂 1.09% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
src/vigorish/models/pitch_type_percentiles.py PitchTypePercentile.get_percentile_for_rhp_pos_stat 1 ⭐ 54 ⭐ 14 😞 68.24% 🙂 Extract out complex expressions
src/vigorish/models/pitch_type_percentiles.py PitchTypePercentile.get_percentile_for_lhp_pos_stat 1 ⭐ 54 ⭐ 14 😞 68.24% 🙂 Extract out complex expressions
src/vigorish/models/pitch_type_percentiles.py PitchTypePercentile.get_percentile_for_rhp_neg_stat 1 ⭐ 54 ⭐ 14 😞 68.24% 🙂 Extract out complex expressions
src/vigorish/models/pitch_type_percentiles.py PitchTypePercentile.get_percentile_for_lhp_neg_stat 1 ⭐ 54 ⭐ 14 😞 68.24% 🙂 Extract out complex expressions
src/vigorish/data/metrics/pitchfx/pitchfx_metrics.py PitchFxMetrics.get_plate_discipline_stats 4 ⭐ 65 🙂 11 😞 68.25% 🙂 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!

Help us improve this quality report!