Showing 502 of 502 total issues
File dataprovider.py
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Dataprovider
Responsible to provide data to the bot
including ticker and orderbook data, live and historical candle (OHLCV) data
Common Interface for bot and strategy to access data.
FtRestClient
has 47 functions (exceeds 20 allowed). Consider refactoring. Open
class FtRestClient:
def __init__(self, serverurl, username=None, password=None, *,
pool_connections=10, pool_maxsize=10):
File idatahandler.py
has 426 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Abstract datahandler interface.
It's subclasses handle and storing data from disk.
"""
Function _rpc_trade_statistics
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def _rpc_trade_statistics(
self, stake_currency: str, fiat_display_currency: str,
start_date: Optional[datetime] = None) -> Dict[str, Any]:
""" Returns cumulative profit statistics """
- 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 get_result_table
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def get_result_table(config: Config, results: list, total_epochs: int, highlight_best: bool,
print_colorized: bool, remove_header: int) -> str:
"""
Log result table
"""
- 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
File BaseReinforcementLearningModel.py
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import importlib
import logging
from abc import abstractmethod
from datetime import datetime, timezone
File btanalysis.py
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Helpers when analyzing backtest data
"""
import logging
from copy import copy
File arguments.py
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This module contains the argument manager class
"""
import argparse
from functools import partial
Function _rpc_trade_status
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def _rpc_trade_status(self, trade_ids: Optional[List[int]] = None) -> List[Dict[str, Any]]:
"""
Below follows the RPC backend it is prefixed with rpc_ to raise awareness that it is
a remotely exposed function
"""
- 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
File configuration.py
has 360 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This module contains the configuration class
"""
import logging
import warnings
File edge_positioning.py
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
# pragma pylint: disable=W0603
""" Edge positioning package """
import logging
from collections import defaultdict
from copy import deepcopy
Function _build_subcommands
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _build_subcommands(self) -> None:
"""
Builds and attaches all subcommands.
:return: None
"""
Exchange
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class Exchange:
# Parameters to add directly to buy/sell calls (like agreeing to trading agreement)
_params: Dict = {}
Function start_backtesting
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def start_backtesting(
self, dataframe: DataFrame, metadata: dict, dk: FreqaiDataKitchen, strategy: IStrategy
) -> FreqaiDataKitchen:
"""
The main broad execution for backtesting. For backtesting, each pair enters and then gets
- 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
File ft_rest_client.py
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
A Rest Client for Freqtrade bot
Should not import anything from freqtrade,
so it can be used as a standalone script, and can be installed independently.
File config_validation.py
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
from collections import Counter
from copy import deepcopy
from typing import Any, Dict
Function _get_exit_for_signal
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def _get_exit_for_signal(
self, trade: LocalTrade, row: Tuple, exit_: ExitCheckTuple,
current_time: datetime,
amount: Optional[float] = None) -> Optional[LocalTrade]:
- 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 setup_logging
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def setup_logging(config: Config) -> None:
"""
Process -v/--verbose, --logfile options
"""
# Log level
- 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 parse_timerange
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def parse_timerange(cls, text: Optional[str]) -> Self:
"""
Parse the value of the argument --timerange to determine what is the range desired
:param text: value from --timerange
:return: Start and End range period
- 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
File bt_output.py
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
from typing import Any, Dict, List
from tabulate import tabulate