Showing 540 of 542 total issues
File exchange.py
has 3121 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# pragma pylint: disable=W0603
"""
Cryptocurrency Exchanges support
"""
File freqtradebot.py
has 2032 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
Freqtrade is the main module of this bot. It contains the class Freqtrade()
"""
import logging
File telegram.py
has 1868 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# pragma pylint: disable=unused-argument, unused-variable, protected-access, invalid-name
"""
This module manage Telegram communication
"""
File trade_model.py
has 1797 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
This module contains the class to persist trades into SQLite
"""
import logging
File interface.py
has 1396 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
IStrategy interface
This module defines the interface to apply for strategies
"""
File backtesting.py
has 1359 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# pragma pylint: disable=missing-docstring, W0212, too-many-arguments
"""
This module contains the backtesting logic
"""
File rpc.py
has 1299 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
This module contains class to define a RPC communications
"""
import logging
File config_schema.py
has 1244 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# Required json-schema for user specified config
from freqtrade.constants import (
AVAILABLE_DATAHANDLERS,
AVAILABLE_PAIRLISTS,
File data_kitchen.py
has 859 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import copy
import inspect
import logging
import random
import shutil
File freqai_interface.py
has 857 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import logging
import threading
import time
from abc import ABC, abstractmethod
from collections import deque
File cli_options.py
has 761 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
Definition of cli arguments used in arguments.py
"""
from argparse import SUPPRESS, ArgumentTypeError
File data_drawer.py
has 625 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import collections
import importlib
import logging
import re
import shutil
File plotting.py
has 610 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import logging
from datetime import datetime, timezone
from pathlib import Path
from typing import Optional
File history_utils.py
has 584 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import logging
import operator
from datetime import datetime, timedelta
from pathlib import Path
from typing import Optional
File hyperopt.py
has 545 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# pragma pylint: disable=too-many-instance-attributes, pointless-string-statement
"""
This module contains the hyperopt logic
"""
File arguments.py
has 537 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
This module contains the argument manager class
"""
from argparse import ArgumentParser, Namespace, _ArgumentGroup
Function _rpc_status_table
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
Open
def _rpc_status_table(
self, stake_currency: str, fiat_display_currency: str
) -> tuple[list, list, float]:
trades: list[Trade] = Trade.get_open_trades()
nonspot = self._config.get("trading_mode", TradingMode.SPOT) != TradingMode.SPOT
- 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 optimize_reports.py
has 516 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import logging
from copy import deepcopy
from datetime import datetime, timedelta, timezone
from typing import Any, Literal, Union
File idatahandler.py
has 508 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
Abstract datahandler interface.
It's subclasses handle and storing data from disk.
"""
File dataprovider.py
has 481 lines of code (exceeds 250 allowed). Consider refactoring. Open
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.