Showing 41 of 2,807 total issues
File extract_json.py
has 527 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
import os
import json
import dataclasses
from typing import List
File mkimage_nosub.py
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python3.8
# -*- coding: utf-8 -*-
"""Make an image.
.. code-block:: bash
Function calc_aperture
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def calc_aperture(N,EPD,Robs,Tsp):
"""
This function calculates the aperture pattern and its area.
The aperture pattern consists of a circular aperture
- 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 set_custom
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def set_custom(theta,psfarr,psfcenter,psfscale,pixdim,spixdim):
import sys
# psf array
fpsfarr = (psfarr.flatten()).astype(np.float32)
- 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 emurate_pixlight_custom
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def emurate_pixlight_custom(theta_instant,psfarr,pixdim,spixdim,subtilex,subtiley,Nsubtilex, Nsubtiley,psfcenter,psfscale):
#------------------------------------------------------
## emurating cuda pixlight_custom.h
testpsf=np.zeros(pixdim)
allpsf=np.zeros(pixdim*spixdim)
- 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 calc_ace
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def calc_ace(rg, N, T, ace):
"""
The ACE is assumed to have a power spectral distribution (PSD)
which consists of a white noise spectrum in low frequencies,
a power-law function in high frequencies (index=-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 save_outputs
has 14 arguments (exceeds 5 allowed). Consider refactoring. Open
def save_outputs(filenames, output_format, control_params, telescope, detector, wfe, psf, pixcube_global, tplate, uniform_flat_interpix, uniform_flat_intrapix, acex, acey, overwrite):
Function save_outputs
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def save_outputs(filenames, output_format, control_params, telescope, detector, wfe, psf, pixcube_global, tplate, uniform_flat_interpix, uniform_flat_intrapix, acex, acey, overwrite):
"""Saving the outputs."""
# interpix flat
if control_params.effect.flat_interpix is True:
pf.writeto(filenames['interpix'],
- 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 save_outputs
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save_outputs(filenames, output_format, control_params, telescope, detector, wfe, psf, pixcube_global, tplate, uniform_flat_interpix, uniform_flat_intrapix, acex, acey, overwrite):
"""Saving the outputs."""
# interpix flat
if control_params.effect.flat_interpix is True:
pf.writeto(filenames['interpix'],
Function gentransit
has 12 arguments (exceeds 5 allowed). Consider refactoring. Open
def gentransit(t, t0=0.0, Porb=14.0, Rp=1.0, Mp=1.0, Rs=0.2, Ms=0.15,\
Function check_output_directory
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def check_output_directory(filenames, dirname_output, overwrite):
"""Checking the output directory.
Args:
filenames: filename to be checked
- 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 calc_response
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def calc_response(control_params, telescope, detector):
"""
This function calculates the electron rate (e-/s/m^2) detected by Jasmine
based on the optics efficiency (EPdefined) and the quantum efficiency (QEdet).
The target object is assumed to have an SED determined by the effective
Function calc_dummy_psf
has 10 arguments (exceeds 5 allowed). Consider refactoring. Open
def calc_dummy_psf(wfe, wN, WL, NP, Ntot, Stel, adata, M, aN, fN=520):
Function inject_transit
has 10 arguments (exceeds 5 allowed). Consider refactoring. Open
def inject_transit(p, t0, depth, ntime,\
Function emurate_pixlight_custom
has 10 arguments (exceeds 5 allowed). Consider refactoring. Open
def emurate_pixlight_custom(theta_instant,psfarr,pixdim,spixdim,subtilex,subtiley,Nsubtilex, Nsubtiley,psfcenter,psfscale):
Function calc_psf
has 10 arguments (exceeds 5 allowed). Consider refactoring. Open
def calc_psf(wfe, wN, WL, NP, Ntot, Stel, adata, M, aN, fN=520):
Function integrate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def integrate(pixar, jx, jy, texp, dt, det, raw=False, addnoise=True, digitize=True):
"""
Summary:
This function integrates the pixar array
calculated by simpix with taking the sampling
Function integrate
has 9 arguments (exceeds 5 allowed). Consider refactoring. Open
def integrate(pixar, jx, jy, texp, dt, det, raw=False, addnoise=True, digitize=True):
Function run_calc_psf
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run_calc_psf(control_params, telescope, detector, wfe):
"""Making PSF.
Args:
control_params: control parameters
- 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 calc_psf
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def calc_psf(wfe, wN, WL, NP, Ntot, Stel, adata, M, aN, fN=520):
"""
This function calculates the psf in e-/sec/fp-cell
based on the wavefront error (wfe),
the spectral information (NP), and
- 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"