LoopTrader icon indicating copy to clipboard operation
LoopTrader copied to clipboard

Offset Sold Puts/Calls

Open pattertj opened this issue 2 years ago • 1 comments

pattertj avatar Feb 07 '22 00:02 pattertj

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 4.35 ⭐ 4.39 ⭐ 0.04 👎
Method Length 60.98 ⭐ 62.36 🙂 1.38 👎
Working memory 8.36 🙂 8.79 🙂 0.43 👎
Quality 68.91% 🙂 68.75% 🙂 -0.16% 👎
Other metrics Before After Change
Lines 3596 4347 751
Changed files Quality Before Quality After Quality Change
looptrader/main.py 58.52% 🙂 45.06% 😞 -13.46% 👎
looptrader/basetypes/Broker/tdaBroker.py 65.46% 🙂 70.17% 🙂 4.71% 👍
looptrader/basetypes/Database/abstractDatabase.py 97.01% ⭐ 97.01% ⭐ 0.00%
looptrader/basetypes/Database/ormDatabase.py 69.35% 🙂 68.30% 🙂 -1.05% 👎
looptrader/basetypes/Mediator/abstractMediator.py 98.02% ⭐ 98.13% ⭐ 0.11% 👍
looptrader/basetypes/Mediator/botMediator.py 85.08% ⭐ 85.23% ⭐ 0.15% 👍
looptrader/basetypes/Mediator/reqRespTypes.py 39.75% 😞 39.75% 😞 0.00%
looptrader/basetypes/Notifier/telegramnotifier.py 80.41% ⭐ 80.24% ⭐ -0.17% 👎
looptrader/basetypes/Strategy/helpers.py 81.23% ⭐ 82.15% ⭐ 0.92% 👍
looptrader/basetypes/Strategy/singlebydeltastrategy.py 67.81% 🙂 65.33% 🙂 -2.48% 👎
looptrader/basetypes/Strategy/spreadsbydeltastrategy.py 69.28% 🙂 68.53% 🙂 -0.75% 👎
test/broker/test_tdaBroker.py % % %

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

File Function Complexity Length Working Memory Quality Recommendation
looptrader/basetypes/Strategy/singlebydeltastrategy.py SingleByDeltaStrategy.get_best_strike_and_quantity_v2 12 🙂 148 😞 22 ⛔ 38.27% 😞 Try splitting into smaller methods. Extract out complex expressions
looptrader/basetypes/Strategy/spreadsbydeltastrategy.py SpreadsByDeltaStrategy.build_new_order 9 🙂 186 😞 11 😞 48.84% 😞 Try splitting into smaller methods. Extract out complex expressions
looptrader/basetypes/Strategy/singlebydeltastrategy.py SingleByDeltaStrategy.get_best_strike_and_quantity 9 🙂 110 🙂 15 😞 51.00% 🙂 Extract out complex expressions
looptrader/basetypes/Strategy/singlebydeltastrategy.py SingleByDeltaStrategy.place_order 8 ⭐ 170 😞 11 😞 51.19% 🙂 Try splitting into smaller methods. Extract out complex expressions
looptrader/basetypes/Strategy/singlebydeltastrategy.py SingleByDeltaStrategy.get_offsetting_strike 8 ⭐ 130 😞 13 😞 52.11% 🙂 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

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!

sourcery-ai[bot] avatar May 27 '22 16:05 sourcery-ai[bot]