MySQL-AutoXtraBackup icon indicating copy to clipboard operation
MySQL-AutoXtraBackup copied to clipboard

Major refactorings - iteration 1

Open ShahriyarR opened this issue 3 years ago • 1 comments

ShahriyarR avatar Apr 09 '22 14:04 ShahriyarR

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 11.58%.

Quality metrics Before After Change
Complexity 6.28 ⭐ 2.47 ⭐ -3.81 👍
Method Length 59.29 ⭐ 36.09 ⭐ -23.20 👍
Working memory 8.80 🙂 7.08 🙂 -1.72 👍
Quality 68.93% 🙂 80.51% 11.58% 👍
Other metrics Before After Change
Lines 2954 1035 -1919
Changed files Quality Before Quality After Quality Change
changes/make_history.py 36.02% 😞 36.02% 😞 0.00%
docs/conf.py 73.00% 🙂 73.00% 🙂 0.00%
mysql_autoxtrabackup/init.py 100.00% ⭐ 100.00% ⭐ 0.00%
mysql_autoxtrabackup/autoxtrabackup.py 45.55% 😞 84.77% ⭐ 39.22% 👍
mysql_autoxtrabackup/api/main.py 93.44% ⭐ 93.44% ⭐ 0.00%
mysql_autoxtrabackup/api/controller/controller.py 85.77% ⭐ 85.77% ⭐ 0.00%
mysql_autoxtrabackup/process_runner/errors.py 95.95% ⭐ 96.04% ⭐ 0.09% 👍
mysql_autoxtrabackup/process_runner/process_runner.py 70.99% 🙂 74.97% 🙂 3.98% 👍
tests/conftest.py 98.67% ⭐ 87.90% ⭐ -10.77% 👎
tests/test_backup.py 88.77% ⭐ 88.77% ⭐ 0.00%
tests/test_helpers.py 89.46% ⭐ 89.46% ⭐ 0.00%
tests/test_mysql_cli.py 96.05% ⭐ 96.05% ⭐ 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
mysql_autoxtrabackup/autoxtrabackup.py all_procedure 0 ⭐ 238 ⛔ 41 ⛔ 39.67% 😞 Try splitting into smaller methods. Extract out complex expressions
mysql_autoxtrabackup/process_runner/process_runner.py ProcessHandler.summarize_process 7 ⭐ 85 🙂 12 😞 60.59% 🙂 Extract out complex expressions
mysql_autoxtrabackup/autoxtrabackup.py _handle_backup_pid_exception 2 ⭐ 83 🙂 14 😞 62.80% 🙂 Extract out complex expressions
mysql_autoxtrabackup/autoxtrabackup.py _build_callables_map 4 ⭐ 54 ⭐ 12 😞 68.24% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

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!

sourcery-ai[bot] avatar Apr 13 '22 09:04 sourcery-ai[bot]