goincrypto/cryptocom-exchange

View on GitHub

Showing 8 of 8 total issues

File pairs.py has 498 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from .structs import Pair

AAVE_BTC = Pair("AAVE_BTC", price_precision=7, quantity_precision=3)
AAVE_USD = Pair("AAVE_USD", price_precision=3, quantity_precision=3)
AAVE_USDT = Pair("AAVE_USDT", price_precision=3, quantity_precision=3)
Severity: Minor
Found in src/cryptocom/exchange/pairs.py - About 7 hrs to fix

    File private.py has 391 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import asyncio
    from typing import Dict, List
    
    from .api import ApiError, ApiProvider
    from .market import Exchange
    Severity: Minor
    Found in src/cryptocom/exchange/private.py - About 5 hrs to fix

      File structs.py has 383 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import time
      import typing as TP
      from dataclasses import dataclass
      from datetime import datetime
      from enum import Enum, IntEnum
      Severity: Minor
      Found in src/cryptocom/exchange/structs.py - About 5 hrs to fix

        File coins.py has 261 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        from .structs import Coin
        
        AAVE = Coin("AAVE")
        ACA = Coin("ACA")
        ACH = Coin("ACH")
        Severity: Minor
        Found in src/cryptocom/exchange/coins.py - About 2 hrs to fix

          Function __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(
          Severity: Major
          Found in src/cryptocom/exchange/api.py - About 1 hr to fix

            Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(
            Severity: Minor
            Found in src/cryptocom/exchange/private.py - About 45 mins to fix

              Function __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __init__(
                      self,
                      *,
                      api_key="",
                      api_secret="",
              Severity: Minor
              Found in src/cryptocom/exchange/api.py - About 35 mins to fix

              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_limiter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def get_limiter(self, path):
                      if path in self.rate_limiters.keys():
                          return self.rate_limiters[path]
                      else:
                          if path.startswith("private"):
              Severity: Minor
              Found in src/cryptocom/exchange/api.py - About 25 mins to fix

              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

              Severity
              Category
              Status
              Source
              Language