ocean_provider/utils/datatoken.py
File datatoken.py
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Wontfix
Wontfix
import json
import logging
from datetime import datetime, timezone
from typing import Optional
Function verify_order_tx
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def verify_order_tx(
web3: Web3,
datatoken_address: HexAddress,
tx_id: HexStr,
service: Service,
- 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 verify_order_tx
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def verify_order_tx(
Function validate_order
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def validate_order(
Function record_consume_request
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def record_consume_request(
Function validate_transfer_not_used_for_other_service
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def validate_transfer_not_used_for_other_service(