amor71 / LiuAlgoTrader

Framework for algorithmic trading
MIT License
785 stars 130 forks source link

Tradier (Sourcery refactored) #325

Closed sourcery-ai[bot] closed 2 years ago

sourcery-ai[bot] commented 2 years ago

Pull Request #317 refactored by Sourcery.

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

NOTE: As code is pushed to the original Pull Request, Sourcery will re-run and update (force-push) this Pull Request with new refactorings as necessary. If Sourcery finds no refactorings at any point, this Pull Request will be closed automatically.

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 tradier branch, then run:

git fetch origin sourcery/tradier
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

sourcery-ai[bot] commented 2 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 7.24 ⭐ 7.23 ⭐ -0.01 👍
Method Length 89.07 🙂 88.87 🙂 -0.20 👍
Working memory 10.95 😞 10.99 😞 0.04 👎
Quality 60.13% 🙂 60.06% 🙂 -0.07% 👎
Other metrics Before After Change
Lines 1658 1645 -13
Changed files Quality Before Quality After Quality Change
liualgotrader/consumer.py 61.17% 🙂 61.17% 🙂 0.00%
liualgotrader/enhanced_backtest.py 54.44% 🙂 54.53% 🙂 0.09% 👍
liualgotrader/scanners_runner.py 71.04% 🙂 70.34% 🙂 -0.70% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
liualgotrader/enhanced_backtest.py do_strategy_result 16 🙂 267 ⛔ 15 😞 31.72% 😞 Try splitting into smaller methods. Extract out complex expressions
liualgotrader/consumer.py order_inflight 16 🙂 210 ⛔ 17 ⛔ 32.82% 😞 Try splitting into smaller methods. Extract out complex expressions
liualgotrader/enhanced_backtest.py backtest_day 12 🙂 195 😞 18 ⛔ 36.43% 😞 Try splitting into smaller methods. Extract out complex expressions
liualgotrader/consumer.py queue_consumer 18 🙂 175 😞 12 😞 40.41% 😞 Try splitting into smaller methods. Extract out complex expressions
liualgotrader/consumer.py handle_quote 14 🙂 222 ⛔ 10 😞 43.65% 😞 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!

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication