torressa / cspy

A collection of algorithms for the (Resource) Constrained Shortest Path problem in Python / C++ / C#
https://torressa.github.io/cspy/
MIT License
77 stars 24 forks source link

Dev #86

Closed torressa closed 2 years ago

sourcery-ai[bot] commented 2 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 3.30 ⭐ 4.15 ⭐ 0.85 👎
Method Length 56.34 ⭐ 61.97 🙂 5.63 👎
Working memory 7.87 🙂 9.00 🙂 1.13 👎
Quality 74.02% 🙂 69.90% 🙂 -4.12% 👎
Other metrics Before After Change
Lines 1304 1433 129
Changed files Quality Before Quality After Quality Change
docs/conf.py 88.55% ⭐ 88.55% ⭐ 0.00%
src/python/preprocessing.py 55.65% 🙂 55.65% 🙂 0.00%
src/python/algorithms/bidirectional.py 67.01% 🙂 64.61% 🙂 -2.40% 👎
src/python/algorithms/grasp.py 75.07% ⭐ 70.59% 🙂 -4.48% 👎
src/python/algorithms/path_base.py 67.88% 🙂 67.96% 🙂 0.08% 👍
src/python/algorithms/psolgent.py 69.64% 🙂 58.45% 🙂 -11.19% 👎
test/python/tests_bidirectional.py 86.93% ⭐ 86.93% ⭐ 0.00%
test/python/tests_issue32.py 79.69% ⭐ 79.69% ⭐ 0.00%
test/python/tests_issue41.py 85.51% ⭐ 85.51% ⭐ 0.00%
test/python/tests_issue69.py 86.07% ⭐ 86.07% ⭐ 0.00%
test/python/tests_preprocessing.py 76.74% ⭐ 76.74% ⭐ 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
src/python/algorithms/bidirectional.py BiDirectional.__init__ 15 🙂 219 ⛔ 18 ⛔ 32.15% 😞 Try splitting into smaller methods. Extract out complex expressions
src/python/algorithms/psolgent.py PSOLGENT._update_best 4 ⭐ 232 ⛔ 22 ⛔ 38.93% 😞 Try splitting into smaller methods. Extract out complex expressions
src/python/preprocessing.py prune_graph 16 🙂 230 ⛔ 11 😞 39.61% 😞 Try splitting into smaller methods. Extract out complex expressions
src/python/algorithms/psolgent.py PSOLGENT._local_search_2opt 20 😞 210 ⛔ 9 🙂 41.84% 😞 Refactor to reduce nesting. Try splitting into smaller methods
src/python/algorithms/psolgent.py PSOLGENT.__init__ 1 ⭐ 197 😞 29 ⛔ 42.26% 😞 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!