theochem / iodata

Function with cyclomatic complexity higher than threshold PY-R1000
Anti-pattern
Minor
2 months ago4 months old
dump_one has a cyclomatic complexity of 20 with "high" risk
798
799
800@document_dump_one("Molden", ["atcoords", "atnums", "mo", "obasis"], ["atcorenums", "title"])
801def dump_one(f: TextIO, data: IOData):802    """Do not edit this docstring. It will be overwritten."""
803    # Print the header
804    f.write("[Molden Format]\n")
dump_one has a cyclomatic complexity of 55 with "critical" risk
616        "moments",
617    ],
618)
619def dump_one(f: TextIO, data: IOData):620    """Do not edit this docstring. It will be overwritten."""
621    # write title
622    print("{:72}".format(data.title or "FCHK generated by IOData"), file=f)
load_one has a cyclomatic complexity of 30 with "very-high" risk
 78    ],
 79    ["energy", "atfrozen", "atgradient", "athessian", "atmasses", "one_rdms", "extra", "moments"],
 80)
 81def load_one(lit: LineIterator) -> dict: 82    """Do not edit this docstring. It will be overwritten."""
 83    fchk = _load_fchk_low(
 84        lit,
compute_overlap has a cyclomatic complexity of 23 with "high" risk
 65    raise TypeError(f"Unsupported type of argument n: {type(n)}")
 66
 67
 68def compute_overlap( 69    obasis0: MolecularBasis,
 70    atcoords0: NDArray[float],
 71    obasis1: Optional[MolecularBasis] = None,
load_data_wfx has a cyclomatic complexity of 16 with "high" risk
118    )
119
120
121def load_data_wfx(lit: LineIterator) -> dict:122    """Process loaded WFX data."""
123    # get all section labels and required labels for WFX files
124    lbs_str, lbs_int, lbs_float, lbs_aint, lbs_afloat, lbs_other, required_tags = _wfx_labels()