Function plot_pdos
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def plot_pdos(
self,
ax: Optional[Axes] = None,
to_plot: Optional[Dict[str, List[str]]] = None,
colors: Optional[Iterable] = 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
File doscar.py
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
import pandas as pd # type: ignore
import matplotlib.pyplot as plt # type: ignore
from matplotlib.axes import Axes # type: ignore
from matplotlib.figure import Figure # type: ignore
Function pdos_select
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def pdos_select(
self,
atoms: Optional[Union[int, List[int]]] = None,
spin: Optional[str] = None,
l: Optional[str] = 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 plot_pdos
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_pdos(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
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"