vasppy/procar.py
File procar.py
has 558 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from functools import reduce
from copy import deepcopy
from typing import Optional
import warnings
import math
Procar
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Procar:
"""
Object for working with PROCAR data.
Attributes:
Function weighted_band_structure
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
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 weighted_band_structure
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def weighted_band_structure(
Function print_weighted_band_structure
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def print_weighted_band_structure(
Function effective_mass_calc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def effective_mass_calc(
Function __add__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
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"