freqtrade/plot/plotting.py
File plotting.py
has 597 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import logging
from datetime import datetime, timezone
from pathlib import Path
from typing import Dict, List, Optional
Function add_indicators
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
def add_indicators(fig, row, indicators: Dict[str, Dict], data: pd.DataFrame) -> make_subplots:
"""
Generate all the indicators selected by the user for a specific row, based on the configuration
:param fig: Plot figure to append to
:param row: row number for this plot
- 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 init_plotscript
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def init_plotscript(config, markets: List, startup_candles: int = 0):
"""
Initialize objects needed for plotting
:return: Dict with candle (OHLCV) data, trades and pairs
"""
- 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_candlestick_graph
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def generate_candlestick_graph(
Function plot_area
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot_area(fig, row: int, data: pd.DataFrame, indicator_a: str,
Function add_max_drawdown
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def add_max_drawdown(fig, row, trades: pd.DataFrame, df_comb: pd.DataFrame,
Function generate_profit_graph
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def generate_profit_graph(pairs: str, data: Dict[str, pd.DataFrame],
Function add_profit
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def add_profit(fig, row, data: pd.DataFrame, column: str, name: str) -> make_subplots: