dragonchain/broadcast_processor/broadcast_functions.py
File broadcast_functions.py
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# Copyright 2020 Dragonchain, Inc.
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
Function set_receieved_verification_for_block_from_chain_sync
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def set_receieved_verification_for_block_from_chain_sync(block_id: str, level: int, chain_id: str) -> None:
"""Signify a successful receipt from a higher level node receipt for a certain block (sync)
Args:
block_id: block_id of lvl 1 block for received receipt
level: level of the node from the higher level receipt
- 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"