amor71 / LiuAlgoTrader

Framework for algorithmic trading
MIT License
784 stars 129 forks source link

refactor build process -> switch to PDM #383

Closed amor71 closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 4.41 ⭐ 4.58 ⭐ 0.17 👎
Method Length 63.52 🙂 65.38 🙂 1.86 👎
Working memory 6.11 ⭐ 6.17 ⭐ 0.06 👎
Quality 73.04% 🙂 72.50% 🙂 -0.54% 👎
Other metrics Before After Change
Lines 429 430 1
Changed files Quality Before Quality After Quality Change
liualgotrader/__init__.py 100.00% ⭐ % %
liualgotrader/common/market_data.py 66.41% 🙂 65.38% 🙂 -1.03% 👎
tests/test_alpaca_basic.py 90.10% ⭐ 90.10% ⭐ 0.00%
tests/test_market_data.py 71.83% 🙂 71.83% 🙂 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
liualgotrader/common/market_data.py sp500_historical_constituents 21 😞 245 ⛔ 10 😞 36.94% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
tests/test_market_data.py test_get_trading_day 10 🙂 244 ⛔ 6 ⭐ 54.96% 🙂 Try splitting into smaller methods
tests/test_market_data.py test_load_sp500_data 0 ⭐ 211 ⛔ 8 🙂 61.88% 🙂 Try splitting into smaller methods
tests/test_market_data.py test_load_sp500_data_minute 0 ⭐ 207 ⛔ 8 🙂 62.16% 🙂 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!

sonarcloud[bot] commented 1 year 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