File arangodb.py
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Standard Library
import re
from dataclasses import dataclass
from typing import List, Mapping, Optional
Function get_resources_handles
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def get_resources_handles(client, username=None, password=None):
"""Get BEL Resources arangodb handle"""
(username, password) = get_user_credentials(username, password)
- 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 batch_load_docs
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def batch_load_docs(db, doc_iterator, on_duplicate: str = "replace"):
"""Batch load documents
Args:
db: ArangoDB client database handle
- 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 get_bel_handles
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_bel_handles(client, username=None, password=None):
"""Get BEL API arango db handle"""
(username, password) = get_user_credentials(username, password)
- 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 update_index_state
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_index_state(collection, desired_indexes: List[IndexDefinition]):
"""Update index state
desired_indexes keys = f"{index_type}_{'_'.join(sorted(fields))}", e.g. persistent_firstname_lastname
- 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"