Showing 22 of 105 total issues
Function barycenter_broaden
has a Cognitive Complexity of 37 (exceeds 10 allowed). Consider refactoring. Open
def barycenter_broaden(self, rv: float = 30.0, consecutive_test: bool = False):
"""Sweep telluric mask symmetrically by +/- a velocity.
Updates the objects mask.
- 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 phoenix_precision.py
has 514 lines of code (exceeds 400 allowed). Consider refactoring. Open
#!/usr/bin/env python
"""
phoenix_precision.py
--------------------
Script to generate RV precision of synthetic spectra, see :ref:`Calculating-Precisions`.
File precision_four_panel.py
has 465 lines of code (exceeds 400 allowed). Consider refactoring. Open
"""
precision_four_panel.py
-----------------------
Plot a Figueira et al. (2016) Figure 1 like plot.
TestConfig
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class TestConfig:
@pytest.fixture
def test_config(self):
"""Config file for testing."""
filename = test_filename
Function main
has a Cognitive Complexity of 22 (exceeds 10 allowed). Consider refactoring. Open
def main(
model: str = atmmodel,
bands: Optional[List[str]] = None,
new_name: Optional[str] = None,
data_dir: 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 __getattr__
has a Cognitive Complexity of 17 (exceeds 10 allowed). Consider refactoring. Open
def __getattr__(self, key):
if key in self:
if key == "paths":
paths = self["paths"]
for k, value in paths.items():
- 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 cumulative_plot
has a Cognitive Complexity of 16 (exceeds 10 allowed). Consider refactoring. Open
def cumulative_plot(
precision_file,
teffs=None,
logg=4.5,
fe_h=0.0,
- 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 do_analysis
has 12 arguments (exceeds 6 allowed). Consider refactoring. Open
def do_analysis(
Function convolution
has 11 arguments (exceeds 6 allowed). Consider refactoring. Open
def convolution(
Function rotational_convolution
has a Cognitive Complexity of 14 (exceeds 10 allowed). Consider refactoring. Open
def rotational_convolution(
wavelength: ndarray,
extended_wav: ndarray,
extended_flux: ndarray,
vsini: float,
- 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 rotational_convolution
has 9 arguments (exceeds 6 allowed). Consider refactoring. Open
def rotational_convolution(
Function resolution_convolution
has 9 arguments (exceeds 6 allowed). Consider refactoring. Open
def resolution_convolution(
Avoid deeply nested control flow statements. Open
if np.sum(~mask_slice) > 3:
if self.verbose:
print(
(
"There were {0}/{1} zeros in this "
Avoid deeply nested control flow statements. Open
if args.add_rv:
output_template = (
"{0:5d},{1:3.01f},{2:4.01f},{3:3.01f},{4:s},{5:3d}k,"
"{6:4.01f},{7:3.01f},{8:3.01f},{9:1d},{10:6d},{11:5.01f},"
"{12:5.01f},{13:5.01f}\n"
Avoid deeply nested control flow statements. Open
if args.correct:
# Apply Artigau 2018 Corrections
corr_value = correct_artigau_2018(band)
for ii, res in enumerate(result):
if (ii > 0) and (result[ii] is not None): # Not the quality
Function main
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def main(bands: Optional[List[str]] = None, verbose: bool = False) -> None:
"""Preform the barycentric shifting of atmosphere masks and saves result.
This saves time in the precision determination code.
- 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
with open(args.output, "a") as f:
f.write(strip_whitespace(linetowite) + "\n") # Make csv only
Function convolve_and_resample
has 7 arguments (exceeds 6 allowed). Consider refactoring. Open
def convolve_and_resample(
Function cumulative_plot
has 7 arguments (exceeds 6 allowed). Consider refactoring. Open
def cumulative_plot(
Function main
has 7 arguments (exceeds 6 allowed). Consider refactoring. Open
def main(