Showing 36 of 36 total issues
File toast_helper.py
has 999 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
from dataclasses import dataclass
from functools import cached_property
from logging import getLogger
File util.py
has 601 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
Function _exec_mpi
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
def _exec_mpi(
self,
data: toast.dist.Data,
signal_name: str,
debug: bool = False,
- 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 cmb.py
has 515 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
import io
from collections import defaultdict
from dataclasses import dataclass
Function plot
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def plot(
self,
x_min: Optional[float] = None,
x_max: Optional[float] = None,
y_min: Optional[float] = 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 reorder_TB
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def reorder_TB(
self,
pixels: List[int],
TB_anti_alignment: bool = False,
TB_alternate_anti_alignment: bool = False,
- 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 dumper
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def dumper(
data: dict,
path: Union[Path, str],
overwrite: bool = False,
compress: bool = 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 from_class
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def from_class(
cls,
path: Optional[Path] = None,
url: Optional[str] = None,
camb: bool = True,
- 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 rotate_power_spectra_matrix
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def rotate_power_spectra_matrix(array: np.ndarray[np.float_], theta: float) -> np.ndarray[np.float_]:
"""Rotate power-spectra in matrix representation assuming TEB-order and angle in radian.
"""
n_b = array.shape[2]
- 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 from_dataframe
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def from_dataframe(cls, df: pd.DataFrame, validate_schema=True):
"""Create Hardware from a dataframe representation
"""
data: Dict[str, Dict[str, Dict[str, Any]]] = {}
# all List[str] are pair of names/keys
- 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 _exec_serial
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _exec_serial(
self,
data: toast.dist.Data,
signal_name: str,
debug: bool = False,
- 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 _simmap_planck2018
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def _simmap_planck2018(
Function write
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def write(
Function plot
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot(
Function fake_focalplane
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def fake_focalplane(
Function compare_plot
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def compare_plot(
self,
*others: PowerSpectra,
show: bool = True,
relative: bool = False,
- 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 joshian_matrix
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def joshian_matrix(n, nearest, next_nearest, floor):
"""generate a matrix based on Josh's simple assumption
"""
res = np.empty((n, n), dtype=np.float64)
for i in range(n):
- 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 Z_tot_i
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def Z_tot_i(
Function Z_tot_norm_sq_i
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def Z_tot_norm_sq_i(
Avoid deeply nested control flow statements. Open
for b in range(n_b):
res[i, j, b] += R_ik * R_jl * array[k, l, b]
return res