Skip to content

Code Quality - Missing Type Hints and Documentation #30

@AccursedGalaxy

Description

@AccursedGalaxy

The codebase lacks proper type hints and documentation in many critical areas. This makes the code harder to maintain and understand.

Current State

  • Most function parameters lack type hints
  • Missing return type annotations
  • Incomplete or missing docstrings
  • No module-level documentation

Example from CryptoAnalyzer class:

async def fetch_candles(self, symbol):
    """Fetch Chart data for a given symbol."""
    since = self.exchange.parse8601(
        str(datetime.now() - timedelta(days=self.lookback_days))
    )
    candles = await self.exchange.fetch_ohlcv(symbol, self.timeframe, since)
    return candles

Should Be:

async def fetch_candles(self, symbol: str) -> List[List[float]]:
    """Fetch OHLCV chart data for a given symbol.
    
    Args:
        symbol: The trading pair symbol (e.g., 'BTC/USDT')
        
    Returns:
        List of OHLCV candles [timestamp, open, high, low, close, volume]
    """
    since = self.exchange.parse8601(
        str(datetime.now() - timedelta(days=self.lookback_days))
    )
    candles = await self.exchange.fetch_ohlcv(symbol, self.timeframe, since)
    return candles

Metadata

Metadata

Labels

code qualityCode Quality ImprovementsdocumentationImprovements or additions to documentationenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions