-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcode_smell.py
43 lines (31 loc) · 916 Bytes
/
code_smell.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# flake8: noqa
class StockAllocator:
pass
class PriceCalculator:
pass
class CustomerScoreChecker:
pass
class MailSender:
pass
class OrderAllocator:
def __init__(self) -> None:
...
def allocate(self) -> None:
stock_allocator = StockAllocator()
price_calculator = PriceCalculator()
customer_score_checker = CustomerScoreChecker()
mail_sender = MailSender()
class OrderAllocator2:
def __init__(
self,
stock_allocator: StockAllocator,
price_calculator: PriceCalculator,
customer_score_checker: CustomerScoreChecker,
main_sender: MailSender,
) -> None:
self._stock_allocator = stock_allocator
self._price_calculator = price_calculator
self._customer_score_checker = customer_score_checker
self._main_sender = main_sender
def allocate(self) -> None:
...