Showing 93 of 93 total issues
Avoid deeply nested control flow statements. Open
for value in field_value:
resource, resource_id = value.get("reference").split("/")
references.append((field.name, resource, resource_id, True))
# add the reference
else:
Function _validate_args
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _validate_args(self, freq, period, period_unit, start, end, n):
Function _generate_resource
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _generate_resource(
self, generate_id: bool, as_dict: bool = False
) -> Union[FHIRResourceModel, dict]:
# construct a resource object to hold the generated fields
resource = self.resource.construct()
- 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 transfer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def transfer(
Function from_env
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def from_env(cls, no_auth: bool = False) -> "FhirServer":
api_address = _api_address_from_env()
server_type = os.getenv("FHIR_SERVER_TYPE")
if no_auth:
- 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 has
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def has(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _generate_birthdate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _generate_birthdate(self):
if not self._birthdate_range:
if self.age_range:
if isinstance(self.age_range[0], int):
# generate age range from youngest to oldest based on the given tuple of ages
- 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 include
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def include(
Function add_all
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_all(
self,
resources: List[Union[Resource, FHIRAbstractModel, dict]],
batch_size: int = 1000,
display: bool = True,
- 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_transfer_resources
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_transfer_resources(
source: "FhirServer",
resources: List[Union[Resource, FHIRAbstractModel]] = None,
query: FhirQuerySync = None,
get_missing: bool = True,
- 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
Consider simplifying this complex logical expression. Open
if has_param and (
resource or reference_param or search_param or operator or value
):
raise ValueError("Cannot use both has_param and kv parameters")
Consider simplifying this complex logical expression. Open
if not has_param and not (
resource or reference_param or search_param or operator or value
):
raise ValueError(
"Must provide either has_param or a valid set of kv parameters"
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function plot_resource_field
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_resource_field(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function flatten
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def flatten(
Function add_resource_generator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_resource_generator(