Showing 505 of 505 total issues
Function get_valid_price_and_stake
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_valid_price_and_stake(
Function load_pair_history
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def load_pair_history(
Function load_data
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def load_data(
Function should_exit
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def should_exit(
Function stop_per_pair
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def stop_per_pair(
self, pair, now: Optional[datetime] = None, side: LongShort = "long"
) -> Optional[PairLock]:
if not now:
now = datetime.now(timezone.utc)
- 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 confirm_trade_entry
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def confirm_trade_entry(
Function adjust_entry_price
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def adjust_entry_price(
Function confirm_trade_exit
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def confirm_trade_exit(
Function __run_backtest_bg
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def __run_backtest_bg(btconfig: Config):
from freqtrade.data.metrics import combined_dataframes_with_rel_mean
from freqtrade.optimize.optimize_reports import generate_backtest_stats, store_backtest_stats
from freqtrade.resolvers import StrategyResolver
- 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 load_bt_data_detail
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def load_bt_data_detail(self) -> None:
"""
Loads backtest detail data (smaller timeframe) if necessary.
"""
if self.timeframe_detail:
- 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 _check_trade_exit
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _check_trade_exit(
self, trade: LocalTrade, row: Tuple, current_time: datetime
) -> Optional[LocalTrade]:
self._run_funding_fees(trade, current_time)
- 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 export_csv_file
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def export_csv_file(config: Config, results: list, csv_file: str) -> None:
"""
Log result to csv-file
"""
if not results:
- 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_strategy_stats
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def generate_strategy_stats(
pairlist: List[str],
strategy: str,
content: Dict[str, Any],
min_date: datetime,
- 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 to_json
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def to_json(self, entry_side: str, minified: bool = False) -> Dict[str, Any]:
"""
:param minified: If True, only return a subset of the data is returned.
Only used for backtesting.
"""
- 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 create_order
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_order(
Function load_data
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def load_data(
datadir: Path,
timeframe: str,
pairs: List[str],
*,
- 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 refresh_backtest_ohlcv_data
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def refresh_backtest_ohlcv_data(
Function additional_exchange_init
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def additional_exchange_init(self) -> None:
"""
Additional exchange initialization logic.
.api will be available at this point.
Must be overridden in child methods if required.
- 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 _flat_vars_to_nested_dict
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _flat_vars_to_nested_dict(env_dict: Dict[str, Any], prefix: str) -> Dict[str, Any]:
"""
Environment variables must be prefixed with FREQTRADE.
FREQTRADE__{section}__{key}
:param env_dict: Dictionary to validate - usually os.environ
- 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 export_csv_file
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def export_csv_file(config: Config, results: list, csv_file: str) -> None:
"""
Log result to csv-file
"""
if not results: