jina-ai / jina

☁️ Build multimodal AI applications with cloud-native stack
https://docs.jina.ai
Apache License 2.0
20.56k stars 2.21k forks source link

refactor: simplify code in module importer #6077

Closed postironix closed 8 months ago

postironix commented 9 months ago

improved cyclomatic difficulty from level C to level A in importer.py exit (checked with radon)

JoanFM commented 9 months ago

Hey @BouFFaNTCRiB ,

Could you have a detailed explanation of what is being fixed here? Is there any test that can be added?

codecov[bot] commented 8 months ago

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (8cea02a) 76.80% compared to head (f9619dd) 76.84%. Report is 6 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #6077 +/- ## ========================================== + Coverage 76.80% 76.84% +0.04% ========================================== Files 145 145 Lines 13989 14005 +16 ========================================== + Hits 10744 10762 +18 + Misses 3245 3243 -2 ``` | [Flag](https://app.codecov.io/gh/jina-ai/jina/pull/6077/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai) | Coverage Δ | | |---|---|---| | [jina](https://app.codecov.io/gh/jina-ai/jina/pull/6077/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai) | `76.84% <82.00%> (+0.04%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/jina-ai/jina/pull/6077?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai) | Coverage Δ | | |---|---|---| | [jina/importer.py](https://app.codecov.io/gh/jina-ai/jina/pull/6077?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai#diff-amluYS9pbXBvcnRlci5weQ==) | `89.32% <82.00%> (+1.96%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/jina-ai/jina/pull/6077/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jina-ai)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.