Florian-DELRIEU / HOI4_Calculator

Land battle simulator for Heart of Iron IV and Warhammer 40k
1 stars 0 forks source link

Update W40K/main #53

Closed Florian-DELRIEU closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

This PR has an average code quality of 62.20%

Quality metrics Before After Change
Complexity 5.48 ⭐
Method Length 91.38 🙂
Working memory 10.67 😞
Quality % 62.20% 🙂 %
Other metrics Before After Change
Lines 1816
Changed files Quality Before Quality After Quality Change
W40K/Run.py 74.49% 🙂
W40K/CSVs/Saver.py 37.31% 😞
W40K/Class/Battle.py 54.91% 🙂
W40K/Class/Company.py 74.08% 🙂
W40K/Class/Leader.py 84.39% ⭐
W40K/Class/Regiment.py 71.78% 🙂
W40K/Class/Tactics.py 70.08% 🙂
W40K/Class/Terrain.py 79.06% ⭐
W40K/Class/Unit.py 68.07% 🙂
W40K/Class/Weapons.py 75.94% ⭐
W40K/Functions/Company_bonuses.py 75.50% ⭐
W40K/Functions/Functions.py 87.91% ⭐
W40K/Functions/Leader_func.py 80.15% ⭐
W40K/Functions/Stats_Functions.py 46.75% 😞
W40K/Functions/Tactics_func.py 71.27% 🙂
W40K/Functions/Terrain_func.py 88.61% ⭐
W40K/Functions/Units_bonuses.py 45.84% 😞
W40K/Functions/Upgrades_bonuses.py 59.92% 🙂
W40K/Functions/Weapons_bonuses.py 37.76% 😞
W40K/Lists/Companies_list.py 63.47% 🙂
W40K/Lists/Tactics_list.py 47.89% 😞
W40K/Lists/Terrain_list.py 81.75% ⭐
W40K/Lists/Unit_list.py 54.32% 🙂

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

File Function Complexity Length Working Memory Quality Recommendation
W40K/Functions/Weapons_bonuses.py apply_WeaponsType 19 😞 331 ⛔ 20 ⛔ 22.86% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
W40K/Functions/Stats_Functions.py setHardness 28 😞 171 😞 23 ⛔ 24.19% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
W40K/Functions/Units_bonuses.py apply_Vehicule 19 😞 205 ⛔ 22 ⛔ 27.50% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
W40K/Functions/Stats_Functions.py setBreakthrought 21 😞 170 😞 25 ⛔ 27.85% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
W40K/Functions/Stats_Functions.py setDefense 21 😞 170 😞 23 ⛔ 28.54% 😞 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:

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!