medulla-tech / medulla

Medulla RMM is a radically simple IT automation and lifecycle management tool that offers the ability to handle repetitive tasks, quickly deploy applications, operating system and proactively manage them all where ever they are.
https://www.siveo.net
GNU General Public License v2.0
22 stars 3 forks source link

Sourcery refactored xmppmaster branch #442

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Branch xmppmaster refactored by Sourcery.

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

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 xmppmaster branch, then run:

git fetch origin sourcery/xmppmaster
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 0.24%.

Quality metrics Before After Change
Complexity 19.86 😞 19.63 😞 -0.23 👍
Method Length 80.14 🙂 79.88 🙂 -0.26 👍
Working memory 8.97 🙂 9.16 🙂 0.19 👎
Quality 59.81% 🙂 59.57% 🙂 -0.24% 👎
Other metrics Before After Change
Lines 38688 38744 56
Changed files Quality Before Quality After Quality Change
agent/backup-tools/cdlist 66.11% 🙂 70.58% 🙂 4.47% 👍
agent/bin/mds-report 89.22% ⭐ 89.21% ⭐ -0.01% 👎
agent/bin/mmc-helper 53.03% 🙂 54.29% 🙂 1.26% 👍
agent/contrib/scripts/usertoken-example 74.39% 🙂 69.27% 🙂 -5.12% 👎
agent/mmc/agent.py 70.67% 🙂 70.43% 🙂 -0.24% 👎
agent/mmc/ssl.py 66.59% 🙂 67.33% 🙂 0.74% 👍
agent/mmc/client/async.py 79.40% ⭐ 79.82% ⭐ 0.42% 👍
agent/mmc/client/sync.py 75.81% ⭐ 75.48% ⭐ -0.33% 👎
agent/mmc/core/audit/__init__.py 83.05% ⭐ 83.05% ⭐ 0.00%
agent/mmc/core/audit/readers.py 25.21% 😞 27.65% 😞 2.44% 👍
agent/mmc/core/audit/record.py 27.27% 😞 26.97% 😞 -0.30% 👎
agent/mmc/core/audit/writers.py 77.79% ⭐ 77.82% ⭐ 0.03% 👍
agent/mmc/core/signals/dispatcher.py 70.28% 🙂 73.16% 🙂 2.88% 👍
agent/mmc/core/signals/saferef.py 75.77% ⭐ 74.79% 🙂 -0.98% 👎
agent/mmc/core/tasks/__init__.py 77.91% ⭐ 77.00% ⭐ -0.91% 👎
agent/mmc/core/tasks/cron.py 42.44% 😞 44.78% 😞 2.34% 👍
agent/mmc/database/config.py 38.94% 😞 38.92% 😞 -0.02% 👎
agent/mmc/database/database_helper.py 60.14% 🙂 59.43% 🙂 -0.71% 👎
agent/mmc/database/ddl.py 78.13% ⭐ 75.99% ⭐ -2.14% 👎
agent/mmc/database/sqlalchemy_tests.py 96.96% ⭐ 98.33% ⭐ 1.37% 👍
agent/mmc/database/utilities.py 69.56% 🙂 71.26% 🙂 1.70% 👍
agent/mmc/plugins/admin/configuration.py 82.51% ⭐ 82.52% ⭐ 0.01% 👍
agent/mmc/plugins/base/__init__.py 72.21% 🙂 72.41% 🙂 0.20% 👍
agent/mmc/plugins/base/auth.py 85.68% ⭐ 84.71% ⭐ -0.97% 👎
agent/mmc/plugins/base/computers.py 88.25% ⭐ 88.14% ⭐ -0.11% 👎
agent/mmc/plugins/base/externalldap.py 75.31% ⭐ 75.20% ⭐ -0.11% 👎
agent/mmc/plugins/base/ldapconnect.py 57.89% 🙂 57.84% 🙂 -0.05% 👎
agent/mmc/plugins/base/output.py 67.10% 🙂 67.98% 🙂 0.88% 👍
agent/mmc/plugins/base/provisioning.py 74.26% 🙂 73.07% 🙂 -1.19% 👎
agent/mmc/plugins/base/status.py 85.53% ⭐ 88.37% ⭐ 2.84% 👍
agent/mmc/plugins/base/subscription.py 67.48% 🙂 66.46% 🙂 -1.02% 👎
agent/mmc/plugins/dashboard/manager.py 91.27% ⭐ 91.22% ⭐ -0.05% 👎
agent/mmc/plugins/dashboard/panel.py 80.71% ⭐ 81.28% ⭐ 0.57% 👍
agent/mmc/plugins/ppolicy/__init__.py 74.00% 🙂 75.00% 🙂 1.00% 👍
agent/mmc/plugins/report/__init__.py 77.70% ⭐ 77.72% ⭐ 0.02% 👍
agent/mmc/plugins/report/config.py 56.98% 🙂 56.88% 🙂 -0.10% 👎
agent/mmc/plugins/report/database.py 77.85% ⭐ 76.88% ⭐ -0.97% 👎
agent/mmc/plugins/report/output.py 73.52% 🙂 73.85% 🙂 0.33% 👍
agent/mmc/plugins/report/schema.py 72.10% 🙂 72.10% 🙂 0.00%
agent/mmc/plugins/services/manager.py 69.35% 🙂 68.65% 🙂 -0.70% 👎
agent/mmc/plugins/services/panel.py 79.86% ⭐ 79.99% ⭐ 0.13% 👍
agent/mmc/support/cache.py 81.86% ⭐ 81.39% ⭐ -0.47% 👎
agent/mmc/support/config.py 79.09% ⭐ 80.15% ⭐ 1.06% 👍
agent/mmc/support/errorObj.py 87.47% ⭐ 89.10% ⭐ 1.63% 👍
agent/mmc/support/mmcException.py 67.20% 🙂 68.46% 🙂 1.26% 👍
agent/mmc/support/mmctools.py 79.67% ⭐ 81.28% ⭐ 1.61% 👍
agent/scripts/extractor.py 87.02% ⭐ 87.89% ⭐ 0.87% 👍
packaging/rpm/rhel/SOURCES/output.py 67.10% 🙂 67.98% 🙂 0.88% 👍
services/bin/medulla-generate-update-package.py 40.88% 😞 35.94% 😞 -4.94% 👎
services/bin/medulla-mariadb-move-update-package.py 47.45% 😞 43.92% 😞 -3.53% 👎
services/bin/pulse2-connect-machine-backuppc 70.94% 🙂 72.55% 🙂 1.61% 👍
services/bin/pulse2-create-group 85.61% ⭐ 85.09% ⭐ -0.52% 👎
services/bin/pulse2-dbupdate 75.39% ⭐ 75.07% ⭐ -0.32% 👎
services/bin/pulse2-debug 67.47% 🙂 66.92% 🙂 -0.55% 👎
services/bin/pulse2-disconnect-machine-backuppc 71.82% 🙂 73.67% 🙂 1.85% 👍
services/bin/pulse2-dlp-server 39.49% 😞 39.47% 😞 -0.02% 👎
services/bin/pulse2-extract-glpi-search-options 38.57% 😞 37.38% 😞 -1.19% 👎
services/bin/pulse2-generation_package.py 70.81% 🙂 70.52% 🙂 -0.29% 👎
services/bin/pulse2-inscription_packages_in_base.py 77.32% ⭐ 77.24% ⭐ -0.08% 👎
services/bin/pulse2-inventory-clean-database 54.47% 🙂 54.25% 🙂 -0.22% 👎
services/bin/pulse2-inventory-server 62.26% 🙂 63.92% 🙂 1.66% 👍
services/bin/pulse2-inventory-ssl-proxy-win32.py 91.25% ⭐ 91.28% ⭐ 0.03% 👍
services/bin/pulse2-load-defaults 80.81% ⭐ 81.24% ⭐ 0.43% 👍
services/bin/pulse2-msc-clean-database 54.19% 🙂 55.57% 🙂 1.38% 👍
services/bin/pulse2-output-wrapper 64.13% 🙂 64.08% 🙂 -0.05% 👎
services/bin/pulse2-package-server-register-imaging 71.84% 🙂 72.80% 🙂 0.96% 👍
services/bin/pulse2-package-server-win32.py 78.93% ⭐ 78.72% ⭐ -0.21% 👎
services/bin/pulse2-packageparser.py 60.25% 🙂 60.14% 🙂 -0.11% 👎
services/bin/pulse2-register-pxe.py 24.65% ⛔ 24.39% ⛔ -0.26% 👎
services/bin/pulse2-scheduler 87.03% ⭐ 86.79% ⭐ -0.24% 👎
services/bin/pulse2-scheduler-manager 84.93% ⭐ 84.56% ⭐ -0.37% 👎
services/bin/pulse2-scheduler-proxy 81.43% ⭐ 83.05% ⭐ 1.62% 👍
services/bin/pulse2-setup 73.52% 🙂 72.70% 🙂 -0.82% 👎
services/bin/pulse2-uuid-resolver 85.44% ⭐ 85.08% ⭐ -0.36% 👎
services/clients/generate-agents 83.78% ⭐ 83.45% ⭐ -0.33% 👎
services/clients/agent/setup.py 88.97% ⭐ 87.89% ⭐ -1.08% 👎
services/clients/agent/pulse2agent/_config.py 73.32% 🙂 72.89% 🙂 -0.43% 👎
services/clients/agent/pulse2agent/connect.py 90.36% ⭐ 88.97% ⭐ -1.39% 👎
services/clients/agent/pulse2agent/control.py 74.01% 🙂 74.84% 🙂 0.83% 👍
services/clients/agent/pulse2agent/inventory.py 69.19% 🙂 70.17% 🙂 0.98% 👍
services/clients/agent/pulse2agent/parse.py 85.39% ⭐ 85.30% ⭐ -0.09% 👎
services/clients/agent/pulse2agent/pexceptions.py 99.47% ⭐ 98.39% ⭐ -1.08% 👎
services/clients/agent/pulse2agent/ptypes.py 91.42% ⭐ 91.41% ⭐ -0.01% 👎
services/clients/agent/pulse2agent/shell.py 78.20% ⭐ 77.64% ⭐ -0.56% 👎
services/clients/agent/pulse2agent/vpn.py 77.00% ⭐ 75.90% ⭐ -1.10% 👎
services/clients/agent/pulse2agent/tests/_config.py 78.75% ⭐ 78.68% ⭐ -0.07% 👎
services/clients/agent/pulse2agent/tests/connect.py 81.48% ⭐ 81.39% ⭐ -0.09% 👎
services/clients/agent/pulse2agent/tests/types.py 89.61% ⭐ 89.53% ⭐ -0.08% 👎
services/clients/agent/pulse2agent/tests/vpn.py 82.52% ⭐ 82.42% ⭐ -0.10% 👎
services/conf/pulse2/inventory-server/xml-fix/02_ATI_consistency.py 36.19% 😞 40.43% 😞 4.24% 👍
services/conf/pulse2/inventory-server/xml-fix/04_Adobe_consistency.py 41.94% 😞 45.52% 😞 3.58% 👍
services/conf/pulse2/inventory-server/xml-fix/06_Laptop_type.py 42.23% 😞 45.81% 😞 3.58% 👍
services/conf/pulse2/inventory-server/xml-fix/07_Virtual_machine_type.py 12.06% ⛔ 14.03% ⛔ 1.97% 👍
services/conf/pulse2/inventory-server/xml-fix/08_Microsoft_consistency.py 7.34% ⛔ 7.38% ⛔ 0.04% 👍
services/conf/pulse2/inventory-server/xml-fix/99_Strip_leading_trailing_spaces.py 76.14% ⭐ 79.07% ⭐ 2.93% 👍
services/contrib/test-xmlrpc.py 49.74% 😞 51.88% 🙂 2.14% 👍
services/contrib/inventory/pulse2-inventory-purge-from-date 50.94% 🙂 50.67% 🙂 -0.27% 👎
services/contrib/msc/analysis/command_evolution_from_coh_table.py 75.97% ⭐ 85.53% ⭐ 9.56% 👍
services/contrib/msc/analysis/command_evolution_using_logs.py 18.71% ⛔ 17.59% ⛔ -1.12% 👎
services/contrib/msc/analysis/pulse2_stats.py 33.04% 😞 30.90% 😞 -2.14% 👎
services/contrib/msc/analysis/scheduler_health_using_logs.py 19.88% ⛔ 18.56% ⛔ -1.32% 👎
services/contrib/package-server/tests/pserver-max-dl 90.40% ⭐ 89.14% ⭐ -1.26% 👎
services/contrib/package-server/tests/pserver-plist 90.57% ⭐ 89.25% ⭐ -1.32% 👎
services/contrib/xmppmaster/script_monitoring/template_alert_email.py 45.93% 😞 46.74% 😞 0.81% 👍
services/mmc/plugins/backuppc/bpc.py 52.42% 🙂 50.32% 🙂 -2.10% 👎
services/mmc/plugins/backuppc/report/__init__.py 90.08% ⭐ 92.22% ⭐ 2.14% 👍
services/mmc/plugins/dyngroup/__init__.py 82.25% ⭐ 81.86% ⭐ -0.39% 👎
services/mmc/plugins/dyngroup/bool_equations.py 87.00% ⭐ 87.90% ⭐ 0.90% 👍
services/mmc/plugins/dyngroup/config.py 75.24% ⭐ 75.96% ⭐ 0.72% 👍
services/mmc/plugins/dyngroup/database.py 70.59% 🙂 70.81% 🙂 0.22% 👍
services/mmc/plugins/dyngroup/plugin_sql.py 77.24% ⭐ 77.20% ⭐ -0.04% 👎
services/mmc/plugins/dyngroup/qmanager.py 59.53% 🙂 65.55% 🙂 6.02% 👍
services/mmc/plugins/dyngroup/querymanager/__init__.py 91.81% ⭐ 90.70% ⭐ -1.11% 👎
services/mmc/plugins/glpi/GLPIClient.py 81.72% ⭐ 81.73% ⭐ 0.01% 👍
services/mmc/plugins/glpi/__init__.py 89.84% ⭐ 90.60% ⭐ 0.76% 👍
services/mmc/plugins/glpi/auth.py 79.42% ⭐ 79.59% ⭐ 0.17% 👍
services/mmc/plugins/glpi/computers.py 62.96% 🙂 63.84% 🙂 0.88% 👍
services/mmc/plugins/glpi/config.py 24.33% ⛔ 24.31% ⛔ -0.02% 👎
services/mmc/plugins/glpi/database_084.py 48.85% 😞 48.84% 😞 -0.01% 👎
services/mmc/plugins/glpi/database_100.py 48.98% 😞 48.92% 😞 -0.06% 👎
services/mmc/plugins/glpi/database_92.py 48.98% 😞 48.92% 😞 -0.06% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
services/mmc/plugins/glpi/database_084.py Glpi084.__formatMachines 104 ⛔ 740 ⛔ 25 ⛔ 2.09% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
services/mmc/plugins/glpi/database_100.py Glpi100.__formatMachines 104 ⛔ 740 ⛔ 25 ⛔ 2.09% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
services/mmc/plugins/glpi/database_92.py Glpi92.__formatMachines 104 ⛔ 740 ⛔ 25 ⛔ 2.09% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
services/mmc/plugins/glpi/database_100.py Glpi100.get_machines_list 90 ⛔ 1535 ⛔ 24 ⛔ 2.54% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
services/mmc/plugins/glpi/database_92.py Glpi92.get_machines_list 89 ⛔ 1531 ⛔ 23 ⛔ 2.93% ⛔ 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!