Showing 13 of 13 total issues
File spectrum.py
has 707 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Spectrum class to represent and manipulate astronomical spectra."""
Spectrum
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class Spectrum(object):
"""Spectrum class to represent and manipulate astronomical spectra.
Attributes
----------
Function _operation_wrapper
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def _operation_wrapper(operation):
"""
Perform an operation (addition, subtraction, multiplication, division,
etc.) after checking for shape matching.
"""
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
*,
xaxis: Optional[Union[ndarray, List[Union[int, float]]]] = None,
flux: Optional[Union[ndarray, List[Union[int, 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 xaxis
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def xaxis(self, value):
"""Setter for xaxis attribute.
Turns value into a numpy array if it is not.
- 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 spline_interpolate_to
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def spline_interpolate_to(
Function __pow__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __pow__(
self, other: Union[ndarray, "Spectrum", int, Tuple[int], List[int]]
) -> "Spectrum":
"""Exponential magic method."""
if isinstance(other, Spectrum):
- 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 spline_interpolate_to
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def spline_interpolate_to(
self,
reference: Union[ndarray, str, "Spectrum", List[int], List[float]],
w: None = None,
bbox: Optional[Any] = 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function continuum
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def continuum(
Function continuum
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def continuum(
wave: ndarray,
flux: ndarray,
method: str = "scalar",
degree: Optional[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 crosscorr_rv
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def crosscorr_rv(
Function doppler_shift
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def doppler_shift(self, rv: float) -> None:
r"""Doppler shift wavelength by a given Radial Velocity.
Apply Doppler shift to the wavelength values of the spectrum
using the radial velocity value provided and the relation
- 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"