Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Sep 7, 2022

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

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

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from Matthew-Stacks September 7, 2022 01:34
@sourcery-ai
Copy link
Author

sourcery-ai bot commented Sep 7, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 12.35 🙂 12.63 🙂 0.28 👎
Method Length 89.91 🙂 89.74 🙂 -0.17 👍
Working memory 15.94 ⛔ 16.15 ⛔ 0.21 👎
Quality 54.34% 🙂 53.79% 🙂 -0.55% 👎
Other metrics Before After Change
Lines 605 595 -10
Changed files Quality Before Quality After Quality Change
chapter-03-codeguru-sample/sqli/middlewares.py 79.23% ⭐ 79.67% ⭐ 0.44% 👍
chapter-04/apps/product_catalog/app.py 76.39% ⭐ 76.13% ⭐ -0.26% 👎
chapter-07/config2secHub.py 60.16% 🙂 59.46% 🙂 -0.70% 👎
chapter-08/CatalogApp/product_catalog/app.py 76.44% ⭐ 76.18% ⭐ -0.26% 👎
chapter-09/CICD/lambda_code/import_findings_security_hub.py 23.26% ⛔ 23.26% ⛔ 0.00%
chapter-09/CICD/lambda_code/securityhub.py 62.83% 🙂 64.36% 🙂 1.53% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
chapter-09/CICD/lambda_code/import_findings_security_hub.py process_message 37 ⛔ 836 ⛔ 37 ⛔ 6.84% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
chapter-07/config2secHub.py map_config_findings_to_sh 5 ⭐ 177 😞 16 ⛔ 46.34% 😞 Try splitting into smaller methods. Extract out complex expressions
chapter-07/config2secHub.py parse_message 6 ⭐ 138 😞 18 ⛔ 47.45% 😞 Try splitting into smaller methods. Extract out complex expressions
chapter-09/CICD/lambda_code/securityhub.py import_finding_to_sh 1 ⭐ 142 😞 18 ⛔ 51.93% 🙂 Try splitting into smaller methods. Extract out complex expressions
chapter-04/apps/product_catalog/app.py MainClass.get 2 ⭐ 145 😞 6 ⭐ 70.54% 🙂 Try splitting into smaller methods

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!

Repository owner deleted a comment from sourcery-ai bot Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant