Closed Threeseven closed 3 years ago
❌ Merging this PR will decrease code quality in the affected files by 0.49%.
Quality metrics | Before | After | Change |
---|---|---|---|
Complexity | 487.51 ⛔ | 511.83 ⛔ | 24.32 👎 |
Method Length | 140.60 😞 | 142.82 😞 | 2.22 👎 |
Working memory | 107.87 ⛔ | 109.16 ⛔ | 1.29 👎 |
Quality | 30.77% 😞 | 30.28% 😞 | -0.49% 👎 |
Other metrics | Before | After | Change |
---|---|---|---|
Lines | 4011 | 4047 | 36 |
Changed files | Quality Before | Quality After | Quality Change |
---|---|---|---|
spunky.py | 30.77% 😞 | 30.28% 😞 | -0.49% 👎 |
Here are some functions in these files that still need a tune-up:
File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
---|---|---|---|---|---|---|
spunky.py | LogParser.handle_say | 1373 ⛔ | 13670 ⛔ | 265 ⛔ | 0.00% | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
spunky.py | LogParser.__init__ | 76 ⛔ | 1370 ⛔ | 71 ⛔ | 0.69% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
spunky.py | LogParser.handle_kill | 122 ⛔ | 902 ⛔ | 29 ⛔ | 1.08% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
spunky.py | LogParser.handle_awards | 51 ⛔ | 534 ⛔ | 41 ⛔ | 3.49% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
spunky.py | LogParser.find_game_start | 45 ⛔ | 365 ⛔ | 29 ⛔ | 7.08% ⛔ | Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions |
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.
What is the purpose of your pull request:
Description:
Add different mapcycles for different game modes and tied to the commands that changes the mode.
I added lines in config/settings.conf to define different maps for each game mode. If empty, it takes "mapcyple.txt", wich is the default cyclemap of UrT. In spunky.py, read those configuration lines and add it to vars. In the switch gametype section I check for the dedicated cclemaps enabled and for dynamic cyclemaps enabled. If enabled dynamic cyclemaps, I ignore the dedicated cyclemaps. Then, set the cyclemap y print a message.
I'm not a dev, sorry if it's not the best way to do this. I have it running in my server and just want to share it.