kiwicom / the-zoo

🐒 A service registry for humans
MIT License
93 stars 6 forks source link

feat(repos): index openapi endpoints #386

Closed aexvir closed 3 years ago

aexvir commented 3 years ago

the main feature of this pr is indexing and saving in our db all the openapi endpoints we're obtaining when we're parsing the openapi definitions

while implementing this I was facing numerous issues on the auditing analyzers so I also addressed those, this should clean up some of those annoying sentry errors, plus extending the support for newer / more advanced syntaxes of the things we're analyzing

please review commit by commit... it will be easier imo

lgtm-com[bot] commented 3 years ago

This pull request fixes 1 alert when merging 77f4129ee65ac614bd6d04047fc80a9ceed96e7f into 1f6a974eed989b52502f9f91ca91ba1e5f940bb7 - view on LGTM.com

fixed alerts:

sourcery-ai[bot] commented 3 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 3.21 ⭐ 3.14 ⭐ -0.07 👍
Method Length 50.18 ⭐ 54.54 ⭐ 4.36 👎
Working memory 8.88 🙂 9.31 🙂 0.43 👎
Quality 71.64% 🙂 69.97% 🙂 -1.67% 👎
Other metrics Before After Change
Lines 852 996 144
Changed files Quality Before Quality After Quality Change
test/dummy.py 94.50% ⭐ 83.89% ⭐ -10.61% 👎
test/analytics/test_gitlab_ci.py 85.65% ⭐ 79.27% ⭐ -6.38% 👎
test/repos/test_tasks.py 47.01% 😞 46.84% 😞 -0.17% 👎
test/repos/test_utils.py 71.68% 🙂 70.68% 🙂 -1.00% 👎
zoo/analytics/tasks/gitlab_ci.py 86.70% ⭐ 76.52% ⭐ -10.18% 👎
zoo/analytics/tasks/requirements_py.py 68.80% 🙂 68.72% 🙂 -0.08% 👎
zoo/base/redis.py 92.22% ⭐ 89.16% ⭐ -3.06% 👎
zoo/repos/models.py 91.99% ⭐ 89.02% ⭐ -2.97% 👎
zoo/repos/tasks.py 71.02% 🙂 67.34% 🙂 -3.68% 👎
zoo/repos/utils.py 63.56% 🙂 71.80% 🙂 8.24% 👍
zoo/services/views.py 74.67% 🙂 74.58% 🙂 -0.09% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
test/repos/test_tasks.py test_pull 0 ⭐ 381 ⛔ 14 😞 44.71% 😞 Try splitting into smaller methods. Extract out complex expressions
zoo/repos/tasks.py sync_repos.index_api 11 🙂 129 😞 11 😞 52.77% 🙂 Try splitting into smaller methods. Extract out complex expressions
zoo/analytics/tasks/requirements_py.py get_unhealthy_packages 9 🙂 93 🙂 12 😞 57.56% 🙂 Extract out complex expressions
zoo/services/views.py ServiceList.get_queryset 8 ⭐ 113 🙂 10 😞 59.42% 🙂 Extract out complex expressions
zoo/repos/tasks.py sync_repos.sync_zoo_file.update_or_create_service 2 ⭐ 144 😞 11 😞 59.67% 🙂 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.

sonarcloud[bot] commented 3 years ago

SonarCloud Quality Gate failed.

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 4 Code Smells

85.0% 85.0% Coverage
0.0% 0.0% Duplication

lgtm-com[bot] commented 3 years ago

This pull request fixes 1 alert when merging 318941fea2f69ab1640e6e802e570b2b35f3f5fb into 1f6a974eed989b52502f9f91ca91ba1e5f940bb7 - view on LGTM.com

fixed alerts:

ghost commented 3 years ago

DeepCode failed to analyze this pull request

Something went wrong despite trying multiple times, sorry about that. Please comment this pull request with "Retry DeepCode" to manually retry, or contact us so that a human can look into the issue.