edsonportosilva / OptiCommPy

Simulate optical communications systems with Python.
https://opticommpy.readthedocs.io/en/latest/index.html
GNU General Public License v3.0
116 stars 43 forks source link

EDFA model and examples updated. #10

Closed adophobr closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 23.77 😞 17.60 🙂 -6.17 👍
Method Length 363.60 ⛔ 249.31 ⛔ -114.29 👍
Working memory 28.94 ⛔ 26.06 ⛔ -2.88 👍
Quality 23.71% 31.83% 😞 8.12% 👍
Other metrics Before After Change
Lines 553 671 118
Changed files Quality Before Quality After Quality Change
examples/basic_EDFA.py 39.01% 😞 50.24% 🙂 11.23% 👍
optic/amplification.py 20.13% ⛔ 28.61% 😞 8.48% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
optic/amplification.py edfaSM 35 ⛔ 1577 ⛔ 43 ⛔ 7.38% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
optic/amplification.py edfParams 13 🙂 501 ⛔ 22 ⛔ 24.49% ⛔ Try splitting into smaller methods. Extract out complex expressions
optic/amplification.py edfaArgs 3 ⭐ 310 ⛔ 9 🙂 51.96% 🙂 Try splitting into smaller methods
optic/amplification.py get_mode_radius 6 ⭐ 131 😞 14 😞 52.50% 🙂 Try splitting into smaller methods. Extract out complex expressions
optic/amplification.py OSA 1 ⭐ 154 😞 13 😞 56.30% 🙂 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!