Showing 59 of 59 total issues
Function process_field_value
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def process_field_value(
Avoid deeply nested control flow statements. Open
if other_cimac_id:
cimac_id = self._choose_which_normal(
full_ct, cimac_ids=[cimac_id, other_cimac_id]
)
partic_map[cimac_participant_id]["normals"][
Avoid deeply nested control flow statements. Open
if collection_event in normals.keys():
tumor_pair_list.append(
_PairingEntry(
tumor_cimac_id=sample,
tumor_collection_event=collection_event,
Function validate_instance
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def validate_instance(instance: str, schema: dict, is_required=False) -> Optional[str]:
"""
Validate a data instance against a JSON schema.
Returns None if `instance` is valid, otherwise returns reason for invalidity.
- 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 generate_all_templates
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def generate_all_templates(target_dir: str):
"""
Generate empty template .xlsx files for every available template schema and
write them to the target directory.
"""
- 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 merge
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def merge(self, walk, base, head, schema, meta, **kwargs):
Function _write_legend_item
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _write_legend_item(cls, ws, row_n, name, theme, prop_schema):
Function _make_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _make_file(
Function _make_validation_error
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _make_validation_error(
Function nested_set
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def nested_set(
Function _set_val
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _set_val(
Function write_wes_analysis_batch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_wes_analysis_batch(
Function write_wes_analysis_template
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_wes_analysis_template(
Function parse_elisa
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
def parse_elisa(xlsx: BinaryIO) -> dict:
"""
Parses the given ELISA grand serology results file to extract a list of sample IDs.
If the file is not valid NPX but still xlsx the function will
return a dict containing an empty list. Sample IDs not conforming to the CIMAC ID
- 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 _olink_derivation
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
def _olink_derivation(context: DeriveFilesContext) -> DeriveFilesResult:
"""Generate a single analysis-ready NPX file across the entire trial for only samples/analytes"""
olink = context.trial_metadata.get("assays", {}).get("olink", {})
def download_and_parse_npx(npx_url: str) -> Optional[pd.DataFrame]:
- 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
Avoid too many return
statements within this function. Open
return None
Function _write_worksheet
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def _write_worksheet(self, name, schema, workbook, write_title=False):
"""Write content to the given worksheet"""
assert self.workbook, "_write_worksheet called without an initialized workbook"
assert self.template, "_write_worksheet called without an initialized template"
- 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 __jpointer_insert_next_thing
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def __jpointer_insert_next_thing(doc, jpoint, part, next_thing):
"""
Puts next_thing into a doc (that is being `jsonpointer.walk`ed)
by *part* "address". *jpoint* is Jsonpointer that is walked.
"""
- 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 generate_docs
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
def generate_docs(out_directory: str = HTML_DIR):
"""
Generate documentation based on the schemas found in `SCHEMA_DIR`.
"""
- 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"