Showing 42 of 42 total issues
Function extreme_euphoria_pattern
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def extreme_euphoria_pattern(
open: pd.Series,
close: pd.Series,
euphoria_side: Literal["bull", "bear"] = "bull",
n_candles: int = 3,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function generate_brownian_candle_from_dataframe
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def generate_brownian_candle_from_dataframe(
dataframe: pd.DataFrame,
timeframe: Timeframe = "1day",
generated_dataframe_length: int = 5000,
date_index: bool = True,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function print_backtest_report
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def print_backtest_report(
trades_df: pd.DataFrame,
ohlcv_df: pd.DataFrame,
timeframe: Timeframe,
initial_equity: Union[int, float] = 1000,
Function price_long_only_backtester
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def price_long_only_backtester(
df: pd.DataFrame,
price_column: str,
long_entry_function: Callable[[pd.Series, pd.Series], bool],
long_exit_function: Callable[[pd.Series, pd.Series, int], bool],
Function price_short_only_backtester
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def price_short_only_backtester(
df: pd.DataFrame,
price_column: str,
short_entry_function: Callable[[pd.Series, pd.Series], bool],
short_exit_function: Callable[[pd.Series, pd.Series, int], bool],
Function detect_windowing_support_resistance
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def detect_windowing_support_resistance(high: pd.Series, low: pd.Series) -> list[float]:
"""Detects the supports and resistances according to the windowing method
Args:
high (pd.Series): The high series from the OHLCV Data.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function ohlc_short_only_backtester
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ohlc_short_only_backtester(
df: pd.DataFrame,
short_entry_function: Callable[[pd.Series, pd.Series], bool],
short_exit_function: Callable[[pd.Series, pd.Series, int], bool],
timeframe: Timeframe,
Function ohlc_long_only_backtester
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ohlc_long_only_backtester(
df: pd.DataFrame,
long_entry_function: Callable[[pd.Series, pd.Series], bool],
long_exit_function: Callable[[pd.Series, pd.Series, int], bool],
timeframe: Timeframe,
Function __ohlc_backtest_one_position_type
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __ohlc_backtest_one_position_type(
Function generate_brownian_paths
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_brownian_paths(
Function __price_backtest_one_position_type
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __price_backtest_one_position_type(
Function fibonacci_distance_indicator
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def fibonacci_distance_indicator(
Consider simplifying this complex logical expression. Open
if base_currency == None and quote_currency == None:
return symbols
elif base_currency == None and quote_currency is not None:
return list(
filter(
Function garman_klass_volatility_indicator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def garman_klass_volatility_indicator(
Function download_crypto_historical_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def download_crypto_historical_data(
Function generate_brownian_candle_from_dataframe
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_brownian_candle_from_dataframe(
Function support_resistance_breakout_indicator
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def support_resistance_breakout_indicator(
support_resistance_levels: list[float], open: pd.Series, low: pd.Series
) -> pd.Series:
"""Generate support resistance breakout rolling indicator.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this function. Open
return ohlcv_df
Avoid too many return
statements within this function. Open
return ohlcv_df
Avoid too many return
statements within this function. Open
return price_df