Showing 40 of 55 total issues
Function print_forces
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def print_forces(self):
for theseforces in self.forces:
output_str = [f" {force: .6f}" for force in theseforces]
for force in theseforces:
if abs(force) > self.convergence:
- 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 print_plus_u
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def print_plus_u(self):
if "LDAUU" in self.vasprun.incar:
lqn = {0: "s", 1: "p", 2: "d", 3: "f"}
ldauu = self.vasprun.incar["LDAUU"]
ldauj = self.vasprun.incar["LDAUJ"]
- 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 weighted_band_structure
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def weighted_band_structure(
self,
spins=None,
ions=None,
orbitals=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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function main
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def main():
args = parse_command_line_arguments()
poscar = Poscar.from_file(args.poscar)
potcars = potcar_spec(args.potcar)
for i, (species, potcar) in enumerate(zip(poscar.atoms, potcars, strict=True), 1):
- 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 weighted_band_structure
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def weighted_band_structure(
Avoid deeply nested control flow statements. Open
if return_hashes:
p_spec[p] = this_md5sum
else:
p_spec[p] = ps
if len(p_spec) != len(potcar_md5sums):
Function print_weighted_band_structure
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def print_weighted_band_structure(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, title, description, status, notes=None, type=None, track=None):
Function to_matrix
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def to_matrix(xx, yy, zz, xy, yz, xz):
Function murnaghan
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def murnaghan(vol, e0, b0, bp, v0):
Function effective_mass_calc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def effective_mass_calc(
Function main
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def main() -> None:
args = parse_args()
structure = Structure.from_file(args.poscar)
reciprocal_lattice_vectors = structure.lattice.reciprocal_lattice_crystallographic.matrix
- 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 main
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def main():
args = parse_command_line_arguments()
if args.hash:
hashes = {}
for p, md5hash in potcar_spec(args.potcar, return_hashes=True).items():
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
structures: list[Structure],
indices_i: list[int],
indices_j: Optional[list[int]] = 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 handle_occupancy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def handle_occupancy(occupancy, negative_occupancies="warn"):
valid_negative_occupancies = ["warn", "raise", "ignore", "zero"]
if negative_occupancies not in valid_negative_occupancies:
raise ValueError(
"valid options for negative_occupancies are {}".format(
- 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 pdos_column_names
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def pdos_column_names(lmax: int, ispin: int) -> List[str]:
if lmax == 2:
names = ["s", "p_y", "p_z", "p_x", "d_xy", "d_yz", "d_z2-r2", "d_xz", "d_x2-y2"]
elif lmax == 3:
names = [
- 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 __add__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __add__(self, other):
if self.spin_channels != other.spin_channels:
raise ValueError(
"Can only concatenate Procars with equal spin_channels: {}, {}".format(
self.spin_channels, other.spin_channels
- 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"