tpaviot / ProcessScheduler

A Python package for automatic and optimized resource scheduling
https://processscheduler.github.io/
GNU General Public License v3.0
59 stars 19 forks source link

Review/fixes #111

Closed tpaviot closed 1 year ago

tpaviot commented 1 year ago

small clean-ups reported by pylint and codacy

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 14.46 🙂 13.97 🙂 -0.49 👍
Method Length 86.25 🙂 86.88 🙂 0.63 👎
Working memory 8.65 🙂 8.31 🙂 -0.34 👍
Quality 53.96% 🙂 54.00% 🙂 0.04% 👍
Other metrics Before After Change
Lines 3162 3127 -35
Changed files Quality Before Quality After Quality Change
benchmark/benchmark_logics.py 68.93% 🙂 67.86% 🙂 -1.07% 👎
processscheduler/base.py 84.77% ⭐ 83.11% ⭐ -1.66% 👎
processscheduler/buffer.py 79.37% ⭐ 79.37% ⭐ 0.00%
processscheduler/context.py 89.23% ⭐ 88.32% ⭐ -0.91% 👎
processscheduler/cost.py 83.27% ⭐ 83.02% ⭐ -0.25% 👎
processscheduler/objective.py 82.38% ⭐ 82.32% ⭐ -0.06% 👎
processscheduler/problem.py 65.90% 🙂 65.73% 🙂 -0.17% 👎
processscheduler/resource.py 67.10% 🙂 67.27% 🙂 0.17% 👍
processscheduler/resource_constraint.py 45.61% 😞 46.46% 😞 0.85% 👍
processscheduler/solution.py 32.56% 😞 32.52% 😞 -0.04% 👎
processscheduler/solver.py 28.88% 😞 29.17% 😞 0.29% 👍
processscheduler/task.py 60.00% 🙂 60.63% 🙂 0.63% 👍
processscheduler/task_constraint.py 67.68% 🙂 67.63% 🙂 -0.05% 👎
test/test_resource_tasks_distance.py 61.00% 🙂 61.00% 🙂 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
processscheduler/solution.py SchedulingSolution.render_gantt_matplotlib 50 ⛔ 808 ⛔ 4.78% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
processscheduler/solver.py SchedulingSolver.__init__ 54 ⛔ 798 ⛔ 16 ⛔ 9.94% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
processscheduler/solver.py SchedulingSolver.solve_optimize_incremental 33 ⛔ 336 ⛔ 16 ⛔ 17.96% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
processscheduler/solver.py SchedulingSolver.build_solution 42 ⛔ 514 ⛔ 12 😞 18.16% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
processscheduler/solution.py SchedulingSolution.render_gantt_plotly 23 😞 357 ⛔ 23.12% ⛔ Refactor to reduce nesting. Try splitting into smaller methods

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!