tpaviot / ProcessScheduler

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

Sourcery refactored resource-tasks-distance branch #90

Closed sourcery-ai[bot] closed 3 years ago

sourcery-ai[bot] commented 3 years ago

Branch resource-tasks-distance refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the resource-tasks-distance branch, then run:

git fetch origin sourcery/resource-tasks-distance
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

sourcery-ai[bot] commented 3 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 8.58 🙂 8.09 ⭐ -0.49 👍
Method Length 71.99 🙂 71.38 🙂 -0.61 👍
Working memory 9.88 😞 9.83 🙂 -0.05 👍
Quality 61.45% 🙂 61.84% 🙂 0.39% 👍
Other metrics Before After Change
Lines 3499 3453 -46
Changed files Quality Before Quality After Quality Change
benchmark/benchmark_dev_team.py 48.16% 😞 48.16% 😞 0.00%
benchmark/benchmark_mixed.py 38.18% 😞 40.42% 😞 2.24% 👍
processscheduler/base.py 86.75% ⭐ 87.70% ⭐ 0.95% 👍
processscheduler/cost.py 83.67% ⭐ 85.13% ⭐ 1.46% 👍
processscheduler/jupyter_ui.py 71.52% 🙂 71.89% 🙂 0.37% 👍
processscheduler/problem.py 71.32% 🙂 72.23% 🙂 0.91% 👍
processscheduler/resource_constraint.py 50.47% 🙂 49.94% 😞 -0.53% 👎
processscheduler/solution.py 41.45% 😞 40.10% 😞 -1.35% 👎
processscheduler/solver.py 40.92% 😞 41.78% 😞 0.86% 👍
processscheduler/task_constraint.py 72.68% 🙂 73.24% 🙂 0.56% 👍
test/test_indicator.py 74.01% 🙂 74.01% 🙂 0.00%
test/test_solver.py 75.22% ⭐ 75.16% ⭐ -0.06% 👎

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 42 ⛔ 544 ⛔ 20 ⛔ 9.40% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
processscheduler/solver.py SchedulingSolver.build_solution 41 ⛔ 371 ⛔ 12 😞 19.77% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
processscheduler/solver.py SchedulingSolver.solve_optimize_incremental 29 😞 290 ⛔ 15 😞 22.30% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
processscheduler/solution.py SchedulingSolution.render_gantt_plotly 22 😞 283 ⛔ 16 ⛔ 25.54% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
processscheduler/solver.py SchedulingSolver.__init__ 19 😞 290 ⛔ 12 😞 32.75% 😞 Refactor to reduce nesting. 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!