Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcery refactored master branch #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Feb 27, 2022

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

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

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from litepresence February 27, 2022 23:33
Copy link
Author

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery timed out performing refactorings.

Due to GitHub API limits, only the first 60 comments can be shown.

Comment on lines -99 to +104
if hb.strategy_name and hb.strategy_file_name:
if not all_configs_complete(hb.strategy_name):
hb.status()
if (
hb.strategy_name
and hb.strategy_file_name
and not all_configs_complete(hb.strategy_name)
):
hb.status()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function quick_start refactored with the following changes:

Comment on lines -138 to +142
if args.config_password is None:
if not login_prompt():
return
if args.config_password is None and not login_prompt():
return
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function main refactored with the following changes:

Comment on lines +3 to -6
import sys
if "hummingbot-dist" in __file__:
# Dist environment.
import os
import sys
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 6-15 refactored with the following changes:

Comment on lines -17 to +20
if isinstance(n, decimal.Decimal):
n = round(n, FLOAT_PRINTOUT_PRECISION)
return format(n.normalize(), 'f')
else:
if not isinstance(n, decimal.Decimal):
return str(n)
n = round(n, FLOAT_PRINTOUT_PRECISION)
return format(n.normalize(), 'f')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function format_decimal refactored with the following changes:

if self.placeholder_mode:
pass
else:
if not self.placeholder_mode:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function HummingbotApplication._handle_command refactored with the following changes:

This removes the following comments ( why? ):

# regular command

Comment on lines -183 to +189
for token, bal in bals.items():
rows.append({"Asset": token, "Amount": round(bal, 4)})
rows.extend(
{"Asset": token, "Amount": round(bal, 4)}
for token, bal in bals.items()
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BalanceCommand.ethereum_balances_df refactored with the following changes:

Comment on lines -194 to +204
rows = []
bals = await UserBalances.xdai_balances()
for token, bal in bals.items():
rows.append({"Asset": token, "Amount": round(bal, 4)})
rows = [
{"Asset": token, "Amount": round(bal, 4)}
for token, bal in bals.items()
]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BalanceCommand.xdai_balances_df refactored with the following changes:

Comment on lines -204 to +214
rows = []
for token, amount in asset_limit_conf.items():
rows.append({"Asset": token, "Limit": round(Decimal(amount), 4)})
rows = [
{"Asset": token, "Limit": round(Decimal(amount), 4)}
for token, amount in asset_limit_conf.items()
]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BalanceCommand.asset_limits_df refactored with the following changes:

Comment on lines -232 to +240
lines = [" " + line for line in df.to_string(index=False).split("\n")]
lines = [f" {line}" for line in df.to_string(index=False).split("\n")]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BalanceCommand.show_asset_limits refactored with the following changes:

Comment on lines -238 to +250
rows = []
for asset, balance in paper_balances.items():
rows.append({"Asset": asset, "Balance": round(Decimal(str(balance)), 4)})
rows = [
{"Asset": asset, "Balance": round(Decimal(str(balance)), 4)}
for asset, balance in paper_balances.items()
]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BalanceCommand.paper_acccount_balance_df refactored with the following changes:

Comment on lines -263 to +273
lines = [" " + line for line in df.to_string(index=False).split("\n")]
lines = [f" {line}" for line in df.to_string(index=False).split("\n")]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function BalanceCommand.show_paper_account_balance refactored with the following changes:

Comment on lines -90 to +116
lines = [" " + line for line in df.to_string(index=False, max_colwidth=50).split("\n")]
lines = [
f" {line}"
for line in df.to_string(index=False, max_colwidth=50).split("\n")
]

self._notify("\n".join(lines))

data = [[cv.key, cv.value] for cv in global_config_map.values()
if cv.key in color_settings_to_display and not cv.is_secure]
df = map_df_to_str(pd.DataFrame(data=data, columns=columns))
self._notify("\nColor Settings:")
lines = [" " + line for line in df.to_string(index=False, max_colwidth=50).split("\n")]
lines = [
f" {line}"
for line in df.to_string(index=False, max_colwidth=50).split("\n")
]

self._notify("\n".join(lines))

if self.strategy_name is not None:
data = [[cv.printable_key or cv.key, cv.value] for cv in self.strategy_config_map.values() if not cv.is_secure]
df = map_df_to_str(pd.DataFrame(data=data, columns=columns))
self._notify("\nStrategy Configurations:")
lines = [" " + line for line in df.to_string(index=False, max_colwidth=50).split("\n")]
lines = [
f" {line}"
for line in df.to_string(index=False, max_colwidth=50).split("\n")
]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ConfigCommand.list_configs refactored with the following changes:

Comment on lines -121 to +136
if password != Security.password:
self._notify("Invalid password, please try again.")
return False
else:
if password == Security.password:
return True
self._notify("Invalid password, please try again.")
return False
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ConfigCommand.check_password refactored with the following changes:

Comment on lines -180 to +194
if isinstance(self.strategy, PureMarketMakingStrategy) or \
isinstance(self.strategy, PerpetualMarketMakingStrategy):
if isinstance(
self.strategy,
(PureMarketMakingStrategy, PerpetualMarketMakingStrategy),
):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ConfigCommand._config_single_key refactored with the following changes:

Comment on lines -45 to +47
api_key_config = [c for c in exchange_configs if "api_key" in c.key]
if api_key_config:
if api_key_config := [
c for c in exchange_configs if "api_key" in c.key
]:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ConnectCommand.connect_exchange refactored with the following changes:

Comment on lines -131 to +134
lines = []
base, quote = trading_pair.split("-")
lines.extend(
[f"\n{market} / {trading_pair}"]
)

lines = list([f"\n{market} / {trading_pair}"])
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function HistoryCommand.report_performance_by_market refactored with the following changes:

Comment on lines -237 to +270
queried_trades = queried_trades + celo_trades
queried_trades += celo_trades
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function HistoryCommand.list_trades refactored with the following changes:

Comment on lines -60 to +69
example = f"{CONF_PREFIX}{short_strategy_name('pure_market_making')}_{1}.yml"
example = f'{CONF_PREFIX}{short_strategy_name("pure_market_making")}_1.yml'
file_name = await self.app.prompt(prompt=f'Enter path to your strategy file (e.g. "{example}") >>> ')
if self.app.to_stop_config:
return
file_path = os.path.join(CONF_FILE_PATH, file_name)
err_msg = validate_strategy_file(file_path)
if err_msg is not None:
self._notify(f"Error: {err_msg}")
return await self.prompt_a_file_name()
else:
if err_msg is None:
return file_name
self._notify(f"Error: {err_msg}")
return await self.prompt_a_file_name()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ImportCommand.prompt_a_file_name refactored with the following changes:

Comment on lines -50 to +53
text_lines = [" " + line for line in joined_df.to_string(index=False).split("\n")]
text_lines = [
f" {line}" for line in joined_df.to_string(index=False).split("\n")
]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function OrderBookCommand.show_order_book.get_order_book refactored with the following changes:

Comment on lines -85 to +95
for _ in range(0, 3):
for _ in range(3):
await self.cls_display_delay(self.display_alert())
hb_with_flower_1 = open(f"{RESOURCES_PATH}hb_with_flower_1.txt").readlines()
hb_with_flower_2 = open(f"{RESOURCES_PATH}hb_with_flower_2.txt").readlines()
hb_with_flower_up_close_1 = open(f"{RESOURCES_PATH}hb_with_flower_up_close_1.txt").readlines()
hb_with_flower_up_close_2 = open(f"{RESOURCES_PATH}hb_with_flower_up_close_2.txt").readlines()
for _ in range(0, 2):
for _ in range(0, 5):
for _ in range(2):
for _ in range(5):
await self.cls_display_delay(hb_with_flower_1, 0.125)
await self.cls_display_delay(hb_with_flower_2, 0.125)
for _ in range(0, 5):
for _ in range(5):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SillyCommands.silly_hummingbot refactored with the following changes:

Comment on lines -105 to +112
for _ in range(0, 3):
for _ in range(3):
await self.cls_display_delay(self.display_alert("roger"))
roger_1 = open(f"{RESOURCES_PATH}roger_1.txt").readlines()
roger_2 = open(f"{RESOURCES_PATH}roger_2.txt").readlines()
roger_3 = open(f"{RESOURCES_PATH}roger_3.txt").readlines()
roger_4 = open(f"{RESOURCES_PATH}roger_4.txt").readlines()
for _ in range(0, 2):
for _ in range(0, 3):
for _ in range(2):
for _ in range(3):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SillyCommands.silly_roger refactored with the following changes:

Comment on lines -134 to +135
for _ in range(0, 5):
for _ in range(0, 5):
for _ in range(5):
for _ in range(5):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SillyCommands.silly_victor refactored with the following changes:

Comment on lines -146 to +151
for _ in range(0, 2):
for _ in range(2):
await self.cls_display_delay(self.display_alert("rein"))
rein_1 = open(f"{RESOURCES_PATH}rein_1.txt").readlines()
rein_2 = open(f"{RESOURCES_PATH}rein_2.txt").readlines()
rein_3 = open(f"{RESOURCES_PATH}rein_3.txt").readlines()
for _ in range(0, 2):
for _ in range(2):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SillyCommands.silly_rein refactored with the following changes:

for _ in range(0, 1):
for _ in range(1):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SillyCommands.silly_dennis refactored with the following changes:

all_ready = all([market.ready for market in self.markets.values()])
all_ready = all(market.ready for market in self.markets.values())
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function StartCommand.wait_till_ready refactored with the following changes:

Comment on lines -108 to +111
if inclusive:
if min_value is not None and max_value is not None:
if min_value is not None and max_value is not None:
if inclusive:
if not (min_value <= int_value <= max_value):
return f"Value must be between {min_value} and {max_value}."
elif min_value is not None and not int_value >= min_value:
return f"Value cannot be less than {min_value}."
elif max_value is not None and not int_value <= max_value:
return f"Value cannot be more than {max_value}."
else:
if min_value is not None and max_value is not None:
if not (min_value < int_value < max_value):
return f"Value must be between {min_value} and {max_value} (exclusive)."
elif min_value is not None and not int_value > min_value:
return f"Value must be more than {min_value}."
elif max_value is not None and not int_value < max_value:
return f"Value must be less than {max_value}."
elif not (min_value < int_value < max_value):
return f"Value must be between {min_value} and {max_value} (exclusive)."
elif min_value is not None and int_value < min_value:
return f"Value cannot be less than {min_value}."
elif max_value is not None and int_value > max_value:
return f"Value cannot be more than {max_value}."
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function validate_int refactored with the following changes:

if self.required and (value is None or value == ""):
if self.required and (value is None or not value):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ConfigVar.validate refactored with the following changes:

Comment on lines -9 to +33
all_dict.update({f"{name}_percent_fee_token": new_fee_config_var(f"{name}_percent_fee_token", type_str="str")})
all_dict.update(
{f"{name}_maker_percent_fee": new_fee_config_var(f"{name}_maker_percent_fee", type_str="decimal")}
all_dict[f"{name}_percent_fee_token"] = new_fee_config_var(
f"{name}_percent_fee_token", type_str="str"
)
all_dict.update(
{f"{name}_taker_percent_fee": new_fee_config_var(f"{name}_taker_percent_fee", type_str="decimal")}

all_dict[f"{name}_maker_percent_fee"] = new_fee_config_var(
f"{name}_maker_percent_fee", type_str="decimal"
)

all_dict[f"{name}_taker_percent_fee"] = new_fee_config_var(
f"{name}_taker_percent_fee", type_str="decimal"
)

fee_application = f"{name}_buy_percent_fee_deducted_from_returns"
all_dict.update({fee_application: new_fee_config_var(fee_application, type_str="bool")})
all_dict.update(
{f"{name}_maker_fixed_fees": new_fee_config_var(f"{name}_maker_fixed_fees", type_str="list")}
all_dict[fee_application] = new_fee_config_var(
fee_application, type_str="bool"
)
all_dict.update(
{f"{name}_taker_fixed_fees": new_fee_config_var(f"{name}_taker_fixed_fees", type_str="list")}

all_dict[f"{name}_maker_fixed_fees"] = new_fee_config_var(
f"{name}_maker_fixed_fees", type_str="list"
)

all_dict[f"{name}_taker_fixed_fees"] = new_fee_config_var(
f"{name}_taker_fixed_fees", type_str="list"
)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function fee_overrides_dict refactored with the following changes:

vals = [random.choice(range(0, 256)) for i in range(0, 20)]
vals = [random.choice(range(256)) for _ in range(20)]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function generate_client_id refactored with the following changes:

Comment on lines -63 to +66
text_lines = ["" + line for line in joined_df.to_string(index=False).split("\n")]
text_lines = [
f"{line}" for line in joined_df.to_string(index=False).split("\n")
]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function OrderBookTab.display.get_order_book_text refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Feb 27, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 7.90 ⭐ 7.30 ⭐ -0.60 👍
Method Length 57.63 ⭐ 57.12 ⭐ -0.51 👍
Working memory 9.58 🙂 9.52 🙂 -0.06 👍
Quality 64.76% 🙂 65.12% 🙂 0.36% 👍
Other metrics Before After Change
Lines 30087 30301 214
Changed files Quality Before Quality After Quality Change
bin/hummingbot_quickstart.py 56.45% 🙂 57.79% 🙂 1.34% 👍
bin/path_util.py 85.50% ⭐ 85.82% ⭐ 0.32% 👍
hummingbot/client/init.py 87.67% ⭐ 88.37% ⭐ 0.70% 👍
hummingbot/client/hummingbot_application.py 56.32% 🙂 56.23% 🙂 -0.09% 👎
hummingbot/client/performance.py 60.11% 🙂 59.76% 🙂 -0.35% 👎
hummingbot/client/settings.py 68.92% 🙂 69.43% 🙂 0.51% 👍
hummingbot/client/command/balance_command.py 51.02% 🙂 48.98% 😞 -2.04% 👎
hummingbot/client/command/config_command.py 51.18% 🙂 51.47% 🙂 0.29% 👍
hummingbot/client/command/connect_command.py 43.45% 😞 43.38% 😞 -0.07% 👎
hummingbot/client/command/create_command.py 53.82% 🙂 54.70% 🙂 0.88% 👍
hummingbot/client/command/exit_command.py 79.85% ⭐ 79.97% ⭐ 0.12% 👍
hummingbot/client/command/export_command.py 67.97% 🙂 68.05% 🙂 0.08% 👍
hummingbot/client/command/gateway_command.py 59.25% 🙂 59.34% 🙂 0.09% 👍
hummingbot/client/command/history_command.py 57.95% 🙂 58.40% 🙂 0.45% 👍
hummingbot/client/command/import_command.py 72.31% 🙂 72.67% 🙂 0.36% 👍
hummingbot/client/command/order_book_command.py 55.37% 🙂 55.30% 🙂 -0.07% 👎
hummingbot/client/command/silly_commands.py 66.97% 🙂 67.15% 🙂 0.18% 👍
hummingbot/client/command/start_command.py 49.18% 😞 49.42% 😞 0.24% 👍
hummingbot/client/command/status_command.py 43.27% 😞 45.71% 😞 2.44% 👍
hummingbot/client/config/config_helpers.py 65.84% 🙂 65.66% 🙂 -0.18% 👎
hummingbot/client/config/config_validators.py 69.18% 🙂 77.89% ⭐ 8.71% 👍
hummingbot/client/config/config_var.py 71.55% 🙂 71.61% 🙂 0.06% 👍
hummingbot/client/config/fee_overrides_config_map.py 79.29% ⭐ 80.72% ⭐ 1.43% 👍
hummingbot/client/config/global_config_map.py 84.66% ⭐ 84.93% ⭐ 0.27% 👍
hummingbot/client/tab/order_book_tab.py 56.05% 🙂 56.05% 🙂 0.00%
hummingbot/client/ui/completer.py 59.43% 🙂 70.77% 🙂 11.34% 👍
hummingbot/client/ui/custom_widgets.py 58.08% 🙂 59.49% 🙂 1.41% 👍
hummingbot/client/ui/hummingbot_cli.py 74.22% 🙂 74.13% 🙂 -0.09% 👎
hummingbot/client/ui/interface_utils.py 45.66% 😞 48.70% 😞 3.04% 👍
hummingbot/client/ui/layout.py 64.94% 🙂 65.91% 🙂 0.97% 👍
hummingbot/client/ui/parser.py 50.46% 🙂 50.06% 🙂 -0.40% 👎
hummingbot/client/ui/style.py 48.22% 😞 49.27% 😞 1.05% 👍
hummingbot/connector/client_order_tracker.py 81.74% ⭐ 81.77% ⭐ 0.03% 👍
hummingbot/connector/markets_recorder.py 63.03% 🙂 62.97% 🙂 -0.06% 👎
hummingbot/connector/utils.py 85.00% ⭐ 84.25% ⭐ -0.75% 👎
hummingbot/connector/connector/balancer/balancer_connector.py 60.92% 🙂 61.53% 🙂 0.61% 👍
hummingbot/connector/connector/terra/terra_connector.py 69.26% 🙂 69.25% 🙂 -0.01% 👎
hummingbot/connector/connector/uniswap/uniswap_connector.py 60.82% 🙂 61.38% 🙂 0.56% 👍
hummingbot/connector/connector/uniswap_v3/uniswap_v3_connector.py 44.41% 😞 45.54% 😞 1.13% 👍
hummingbot/connector/derivative/binance_perpetual/binance_perpetual_api_order_book_data_source.py 69.70% 🙂 69.74% 🙂 0.04% 👍
hummingbot/connector/derivative/binance_perpetual/binance_perpetual_auth.py 85.77% ⭐ 86.11% ⭐ 0.34% 👍
hummingbot/connector/derivative/binance_perpetual/binance_perpetual_derivative.py 61.06% 🙂 61.31% 🙂 0.25% 👍
hummingbot/connector/derivative/binance_perpetual/binance_perpetual_user_stream_data_source.py 72.33% 🙂 71.66% 🙂 -0.67% 👎
hummingbot/connector/derivative/binance_perpetual/binance_perpetual_utils.py 81.96% ⭐ 81.73% ⭐ -0.23% 👎
hummingbot/connector/derivative/bybit_perpetual/bybit_perpetual_api_order_book_data_source.py 58.53% 🙂 58.41% 🙂 -0.12% 👎
hummingbot/connector/derivative/bybit_perpetual/bybit_perpetual_auth.py 80.58% ⭐ 80.51% ⭐ -0.07% 👎
hummingbot/connector/derivative/bybit_perpetual/bybit_perpetual_derivative.py 62.27% 🙂 63.13% 🙂 0.86% 👍
hummingbot/connector/derivative/bybit_perpetual/bybit_perpetual_order_book_tracker.py 90.06% ⭐ 89.29% ⭐ -0.77% 👎
hummingbot/connector/derivative/bybit_perpetual/bybit_perpetual_user_stream_data_source.py 66.43% 🙂 66.33% 🙂 -0.10% 👎
hummingbot/connector/derivative/bybit_perpetual/bybit_perpetual_utils.py 84.79% ⭐ 85.94% ⭐ 1.15% 👍
hummingbot/connector/derivative/bybit_perpetual/bybit_perpetual_websocket_adaptor.py 88.52% ⭐ 88.72% ⭐ 0.20% 👍
hummingbot/connector/derivative/dydx_perpetual/dydx_perpetual_api_order_book_data_source.py 70.83% 🙂 72.40% 🙂 1.57% 👍
hummingbot/connector/derivative/dydx_perpetual/dydx_perpetual_auth.py 87.82% ⭐ 90.59% ⭐ 2.77% 👍
hummingbot/connector/derivative/dydx_perpetual/dydx_perpetual_client_wrapper.py 86.96% ⭐ 87.06% ⭐ 0.10% 👍
hummingbot/connector/derivative/dydx_perpetual/dydx_perpetual_derivative.py 58.79% 🙂 59.30% 🙂 0.51% 👍
hummingbot/connector/derivative/dydx_perpetual/dydx_perpetual_order_book.py 76.67% ⭐ 82.27% ⭐ 5.60% 👍
hummingbot/connector/derivative/dydx_perpetual/dydx_perpetual_order_book_message.py 91.10% ⭐ 92.25% ⭐ 1.15% 👍
hummingbot/connector/derivative/dydx_perpetual/dydx_perpetual_user_stream_data_source.py 77.81% ⭐ 76.54% ⭐ -1.27% 👎
hummingbot/connector/derivative/dydx_perpetual/dydx_perpetual_utils.py 96.42% ⭐ 95.82% ⭐ -0.60% 👎
hummingbot/connector/derivative/perpetual_finance/perpetual_finance_derivative.py 63.99% 🙂 64.69% 🙂 0.70% 👍
hummingbot/connector/exchange/ascend_ex/ascend_ex_api_order_book_data_source.py 67.62% 🙂 67.22% 🙂 -0.40% 👎
hummingbot/connector/exchange/ascend_ex/ascend_ex_api_user_stream_data_source.py 65.34% 🙂 64.32% 🙂 -1.02% 👎
hummingbot/connector/exchange/ascend_ex/ascend_ex_exchange.py 63.53% 🙂 63.75% 🙂 0.22% 👍
hummingbot/connector/exchange/ascend_ex/ascend_ex_order_book_message.py 86.93% ⭐ 87.47% ⭐ 0.54% 👍
hummingbot/connector/exchange/beaxy/beaxy_api_order_book_data_source.py 72.25% 🙂 72.34% 🙂 0.09% 👍
hummingbot/connector/exchange/beaxy/beaxy_constants.py 86.13% ⭐ 85.83% ⭐ -0.30% 👎
hummingbot/connector/exchange/beaxy/beaxy_order_book_message.py 89.37% ⭐ 92.62% ⭐ 3.25% 👍
hummingbot/connector/exchange/beaxy/beaxy_order_book_tracker.py 51.68% 🙂 51.72% 🙂 0.04% 👍
hummingbot/connector/exchange/binance/binance_api_order_book_data_source.py 69.53% 🙂 69.41% 🙂 -0.12% 👎
hummingbot/connector/exchange/binance/binance_api_user_stream_data_source.py 71.43% 🙂 70.76% 🙂 -0.67% 👎
hummingbot/connector/exchange/binance/binance_auth.py 87.53% ⭐ 87.81% ⭐ 0.28% 👍
hummingbot/connector/exchange/binance/binance_exchange.py 60.83% 🙂 61.07% 🙂 0.24% 👍
hummingbot/connector/exchange/binance/binance_order_book_tracker.py 54.03% 🙂 53.02% 🙂 -1.01% 👎
hummingbot/connector/exchange/bitfinex/bitfinex_api_order_book_data_source.py 65.28% 🙂 65.58% 🙂 0.30% 👍
hummingbot/connector/exchange/bitfinex/bitfinex_auth.py 88.83% ⭐ 89.12% ⭐ 0.29% 👍
hummingbot/connector/exchange/bitfinex/bitfinex_order_book_tracker.py 52.99% 🙂 53.03% 🙂 0.04% 👍
hummingbot/connector/exchange/bitfinex/bitfinex_utils.py 87.62% ⭐ 88.34% ⭐ 0.72% 👍
hummingbot/connector/exchange/bitfinex/bitfinex_websocket.py 78.96% ⭐ 78.90% ⭐ -0.06% 👎
hummingbot/connector/exchange/bitmart/bitmart_api_order_book_data_source.py 53.61% 🙂 53.30% 🙂 -0.31% 👎
hummingbot/connector/exchange/bitmart/bitmart_api_user_stream_data_source.py 64.47% 🙂 64.50% 🙂 0.03% 👍
hummingbot/connector/exchange/bitmart/bitmart_auth.py 79.51% ⭐ 78.71% ⭐ -0.80% 👎
hummingbot/connector/exchange/bitmart/bitmart_exchange.py 64.14% 🙂 64.36% 🙂 0.22% 👍
hummingbot/connector/exchange/bitmart/bitmart_order_book_message.py 84.45% ⭐ 84.74% ⭐ 0.29% 👍
hummingbot/connector/exchange/bitmart/bitmart_utils.py 80.98% ⭐ 82.01% ⭐ 1.03% 👍
hummingbot/connector/exchange/bittrex/bittrex_api_order_book_data_source.py 71.96% 🙂 71.98% 🙂 0.02% 👍
hummingbot/connector/exchange/bittrex/bittrex_order_book_message.py 90.48% ⭐ 91.62% ⭐ 1.14% 👍
hummingbot/connector/exchange/bittrex/bittrex_order_book_tracker.py 54.97% 🙂 55.01% 🙂 0.04% 👍
hummingbot/connector/exchange/blocktane/blocktane_api_order_book_data_source.py 67.41% 🙂 67.22% 🙂 -0.19% 👎
hummingbot/connector/exchange/blocktane/blocktane_api_user_stream_data_source.py 82.06% ⭐ 81.91% ⭐ -0.15% 👎
hummingbot/connector/exchange/blocktane/blocktane_auth.py 91.69% ⭐ 94.08% ⭐ 2.39% 👍
hummingbot/connector/exchange/coinbase_pro/coinbase_pro_api_order_book_data_source.py 66.78% 🙂 66.97% 🙂 0.19% 👍
hummingbot/connector/exchange/coinbase_pro/coinbase_pro_api_user_stream_data_source.py 72.30% 🙂 73.35% 🙂 1.05% 👍
hummingbot/connector/exchange/coinbase_pro/coinbase_pro_order_book_tracker.py 40.23% 😞 40.34% 😞 0.11% 👍
hummingbot/connector/exchange/coinbase_pro/coinbase_pro_utils.py 91.91% ⭐ 91.48% ⭐ -0.43% 👎
hummingbot/connector/exchange/coinzoom/coinzoom_api_order_book_data_source.py 61.06% 🙂 61.00% 🙂 -0.06% 👎
hummingbot/connector/exchange/coinzoom/coinzoom_api_user_stream_data_source.py 80.97% ⭐ 81.02% ⭐ 0.05% 👍
hummingbot/connector/exchange/coinzoom/coinzoom_auth.py 94.00% ⭐ 95.07% ⭐ 1.07% 👍
hummingbot/connector/exchange/coinzoom/coinzoom_exchange.py 64.73% 🙂 64.86% 🙂 0.13% 👍
hummingbot/connector/exchange/coinzoom/coinzoom_order_book_message.py 88.72% ⭐ 89.46% ⭐ 0.74% 👍
hummingbot/connector/exchange/coinzoom/coinzoom_websocket.py 78.03% ⭐ 78.29% ⭐ 0.26% 👍
hummingbot/connector/exchange/crypto_com/crypto_com_exchange.py 67.64% 🙂 67.76% 🙂 0.12% 👍
hummingbot/connector/exchange/crypto_com/crypto_com_order_book_message.py 86.73% ⭐ 87.22% ⭐ 0.49% 👍
hummingbot/connector/exchange/crypto_com/crypto_com_websocket.py 86.01% ⭐ 86.13% ⭐ 0.12% 👍
hummingbot/connector/exchange/digifinex/digifinex_auth.py 89.01% ⭐ 89.29% ⭐ 0.28% 👍
hummingbot/connector/exchange/digifinex/digifinex_exchange.py 70.49% 🙂 70.61% 🙂 0.12% 👍
hummingbot/connector/exchange/digifinex/digifinex_order_book_message.py 86.39% ⭐ 87.39% ⭐ 1.00% 👍
hummingbot/connector/exchange/digifinex/digifinex_websocket.py 80.09% ⭐ 80.16% ⭐ 0.07% 👍
hummingbot/connector/exchange/ftx/ftx_api_order_book_data_source.py 66.07% 🙂 68.09% 🙂 2.02% 👍
hummingbot/connector/exchange/ftx/ftx_order_book_message.py 90.48% ⭐ 91.62% ⭐ 1.14% 👍
hummingbot/connector/exchange/ftx/ftx_order_book_tracker.py 57.21% 🙂 57.28% 🙂 0.07% 👍
hummingbot/connector/exchange/gate_io/gate_io_api_order_book_data_source.py 69.79% 🙂 69.65% 🙂 -0.14% 👎
hummingbot/connector/exchange/gate_io/gate_io_api_user_stream_data_source.py 77.52% ⭐ 76.53% ⭐ -0.99% 👎
hummingbot/connector/exchange/gate_io/gate_io_auth.py 67.65% 🙂 66.25% 🙂 -1.40% 👎
hummingbot/connector/exchange/gate_io/gate_io_exchange.py 62.81% 🙂 63.43% 🙂 0.62% 👍
hummingbot/connector/exchange/gate_io/gate_io_utils.py 70.04% 🙂 69.64% 🙂 -0.40% 👎
hummingbot/connector/exchange/gate_io/gate_io_websocket.py 83.69% ⭐ 83.93% ⭐ 0.24% 👍
hummingbot/connector/exchange/hitbtc/hitbtc_api_order_book_data_source.py 62.02% 🙂 61.75% 🙂 -0.27% 👎
hummingbot/connector/exchange/hitbtc/hitbtc_auth.py 71.86% 🙂 73.06% 🙂 1.20% 👍
hummingbot/connector/exchange/hitbtc/hitbtc_exchange.py 63.80% 🙂 64.13% 🙂 0.33% 👍
hummingbot/connector/exchange/hitbtc/hitbtc_order_book_message.py 87.76% ⭐ 88.91% ⭐ 1.15% 👍
hummingbot/connector/exchange/hitbtc/hitbtc_websocket.py 81.76% ⭐ 82.16% ⭐ 0.40% 👍
hummingbot/connector/exchange/huobi/huobi_api_order_book_data_source.py 69.76% 🙂 69.77% 🙂 0.01% 👍
hummingbot/connector/exchange/huobi/huobi_api_user_stream_data_source.py 77.19% ⭐ 76.49% ⭐ -0.70% 👎
hummingbot/connector/exchange/huobi/huobi_auth.py 78.33% ⭐ 78.38% ⭐ 0.05% 👍
hummingbot/connector/exchange/huobi/huobi_utils.py 89.62% ⭐ 89.62% ⭐ 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
hummingbot/connector/derivative/dydx_perpetual/dydx_perpetual_derivative.py DydxPerpetualDerivative._user_stream_event_listener 82 ⛔ 485 ⛔ 17 ⛔ 7.47% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hummingbot/connector/exchange/binance/binance_exchange.py BinanceExchange._update_order_fills_from_trades 31 😞 380 ⛔ 28 ⛔ 11.79% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hummingbot/client/ui/completer.py HummingbotCompleter.get_completions 31 😞 318 ⛔ 26 ⛔ 13.55% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hummingbot/connector/connector/uniswap_v3/uniswap_v3_connector.py UniswapV3Connector._update_order_status 33 ⛔ 417 ⛔ 18 ⛔ 14.75% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
hummingbot/connector/derivative/binance_perpetual/binance_perpetual_derivative.py BinancePerpetualDerivative._process_user_stream_event 31 😞 409 ⛔ 18 ⛔ 15.74% ⛔ 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:

  • ⭐ 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants