Showing 466 of 466 total issues
File exchange.py
has 2398 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# pragma pylint: disable=W0603
"""
Cryptocurrency Exchanges support
"""
import asyncio
File freqtradebot.py
has 1578 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
Freqtrade is the main module of this bot. It contains the class Freqtrade()
"""
import copy
import logging
File telegram.py
has 1546 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 1434 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
This module contains the class to persist trades into SQLite
"""
import logging
from collections import defaultdict
File data_kitchen.py
has 1251 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import copy
import inspect
import logging
import random
import shutil
File interface.py
has 1103 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
IStrategy interface
This module defines the interface to apply for strategies
"""
import logging
File backtesting.py
has 1071 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 1051 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
This module contains class to define a RPC communications
"""
import logging
from abc import abstractmethod
File freqai_interface.py
has 795 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 optimize_reports.py
has 779 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import logging
from copy import deepcopy
from datetime import datetime, timedelta, timezone
from pathlib import Path
from typing import Any, Dict, List, Union
File constants.py
has 657 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# pragma pylint: disable=too-few-public-methods
"""
bot constants
"""
File cli_options.py
has 653 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""
Definition of cli arguments used in arguments.py
"""
from argparse import SUPPRESS, ArgumentTypeError
File plotting.py
has 591 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import logging
from pathlib import Path
from typing import Dict, List, Optional
import pandas as pd
File data_drawer.py
has 576 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import collections
import importlib
import logging
import re
import shutil
Function _rpc_status_table
has a Cognitive Complexity of 55 (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
if not trades:
- 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 hyperopt.py
has 510 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
"""
Function _rpc_trade_status
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
Open
def _rpc_trade_status(self, trade_ids: List[int] = []) -> 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
IStrategy
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class IStrategy(ABC, HyperStrategyMixin):
"""
Interface for freqtrade strategies
Defines the mandatory structure must follow any custom strategies
File hyperopt_tools.py
has 427 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import logging
from copy import deepcopy
from datetime import datetime, timezone
from pathlib import Path
from typing import Any, Dict, Iterator, List, Optional, Tuple
File dataprovider.py
has 425 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.