SpunkyBot / spunkybot

Multi-platform administration and RCON tool for Urban Terror
https://spunkybot.de
MIT License
20 stars 24 forks source link

Dedicated cyclemaps #103

Closed Threeseven closed 3 years ago

Threeseven commented 3 years ago

Thank you for contributing a Pull Request!

Please follow the checklist:


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 setup.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.

sourcery-ai[bot] commented 3 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 480.42 ⛔ 504.54 ⛔ 24.12 👎
Method Length 140.62 😞 142.84 😞 2.22 👎
Working memory 106.83 ⛔ 108.12 ⛔ 1.29 👎
Quality 31.12% 😞 30.63% 😞 -0.49% 👎
Other metrics Before After Change
Lines 4032 4068 36
Changed files Quality Before Quality After Quality Change
spunky.py 31.12% 😞 30.63% 😞 -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 1367 ⛔ 13629 ⛔ 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

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.