Summary
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class Summary:
"""
TODO Document Summary class
"""
File summary.py
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Summary class and helper methods
# Used for summarising VASP calculations as YAML
from pymatgen.io.vasp.outputs import Vasprun # type: ignore
from pymatgen.analysis.transition_state import NEBAnalysis # type: ignore
Function potcar_spec
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def potcar_spec(filename, return_hashes=False):
"""
Returns a dictionary specifying the pseudopotentials contained in a POTCAR file.
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 print_file_tracking
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def print_file_tracking(self):
if self.meta.track:
print("file tracking:")
for f, new_filename in self.meta.track.items():
print(" {}:".format(f))
- 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
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):