Showing 93 of 93 total issues
Function make_transaction_bundle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def make_transaction_bundle(
transaction_type: TransactionType = TransactionType.TRANSACTION,
method: Union[TransactionMethod, str] = TransactionMethod.POST,
resources: Union[List[Resource], List[dict]] = None,
references: Union[List[Reference], List[str]] = None,
- 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 __init__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
base_url: str,
resource: Union[
FHIRResourceModel, fhir.resources.FHIRAbstractModel, str
- 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 __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _make_k_anon_query_for_row
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _make_k_anon_query_for_row(
row: pd.Series,
df: pd.DataFrame,
excluded_cols: List[str] = None,
id_cols: List[str] = None,
- 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 check_choices_and_probabilities
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_choices_and_probabilities(cls, values):
if values.get("choices"):
if values.get("choice_probabilities"):
if len(values["choices"]) != len(values["choice_probabilities"]):
raise ValueError("Number of choices and probabilities must match")
- 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 _make_query_string
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _make_query_string(self) -> str:
"""
Make the query string from the query parameters
Returns:
- 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 _calculate_sleep
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _calculate_sleep(
self, attempts_made: int, headers: Union[httpx.Headers, Mapping[str, str]]
) -> float:
retry_after_header = (headers.get("Retry-After") or "").strip()
if self.respect_retry_after_header and retry_after_header:
- 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 check_server_status
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_server_status(
server_1: str,
server_2: str,
):
increments = [5, 10, 30, 30, 60, 120]
- 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 _resource_ids_from_query_response
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _resource_ids_from_query_response(response: QueryResponse) -> dict:
contained_resources = {}
for resource in response.resources:
resource_id_set = contained_resources.get(resource.resource_type)
if resource_id_set is None:
- 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 _validate_field_values
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _validate_field_values(self):
field_values = self.params.field_values
resource_count = self.params.count
for field_value in field_values:
- 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 from_query_string
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def from_query_string(cls, query_string: str) -> "FhirQueryParameters":
# split resource and query parameters
resource, query = query_string.split("?")
# clean up and validate resource
- 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 reference_graph
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def reference_graph(resources: List[Union[Resource, FHIRAbstractModel]]) -> nx.DiGraph:
"""
Creates a graph of the references in a list of resources.
Args:
- 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 subtract
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def subtract(
Function transfer
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def transfer(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function add
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def add(
Function to_query_string
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def to_query_string(self) -> str:
"""
Converts the parameters to a query string that can be used with a fhir server's REST API
Returns:
"""
- 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"