Florian-DELRIEU / HOI4_Calculator

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

Hoi/name convention (Sourcery refactored) #48

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Pull Request #47 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

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:

Review changes via command line

To manually merge these changes, make sure you're on the HOI/NameConvention branch, then run:

git fetch origin sourcery/HOI/NameConvention
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 2.59 ⭐ 2.63 ⭐ 0.04 👎
Method Length 109.38 🙂 112.41 🙂 3.03 👎
Working memory 8.49 🙂 9.30 🙂 0.81 👎
Quality 64.90% 🙂 62.92% 🙂 -1.98% 👎
Other metrics Before After Change
Lines 507 500 -7
Changed files Quality Before Quality After Quality Change
HOI/Class.py 71.52% 🙂 70.31% 🙂 -1.21% 👎
HOI/Comparator.py 70.49% 🙂 62.39% 🙂 -8.10% 👎
W40K/CSVs/Saver.py 37.31% 😞 40.83% 😞 3.52% 👍
W40K/Class/Battle.py 56.44% 🙂 53.35% 🙂 -3.09% 👎
W40K/Class/Company.py 73.98% 🙂 74.18% 🙂 0.20% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
W40K/Class/Battle.py Battle._Round 10 🙂 479 ⛔ 13 😞 35.43% 😞 Try splitting into smaller methods. Extract out complex expressions
HOI/Comparator.py Compare_Bataillon 0 ⭐ 366 ⛔ 11 😞 49.68% 😞 Try splitting into smaller methods. Extract out complex expressions
W40K/Class/Company.py Company.HOI4_Profil 1 ⭐ 285 ⛔ 11 😞 50.84% 🙂 Try splitting into smaller methods. Extract out complex expressions
HOI/Comparator.py Compare_Division 0 ⭐ 282 ⛔ 11 😞 51.96% 🙂 Try splitting into smaller methods. Extract out complex expressions
HOI/Class.py Bataillon.__init__ 0 ⭐ 109 🙂 17 ⛔ 57.81% 🙂 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!