Showing 176 of 354 total issues
Function main
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main(arg):
import multiprocessing as mp
default_ncores = mp.cpu_count()
default_type = "partial"
Function c_inpainter
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def c_inpainter(
Function recon_accelerated
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def recon_accelerated(
Function remove_outlier3d
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def remove_outlier3d(arr, dif, size=3, ncore=None):
"""
Selectively applies 3D median filter to a 3D array to remove outliers. Also
called a dezinger.
- 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 write_center
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_center(
Function median_filter3d
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def median_filter3d(arr, size=3, ncore=None):
"""
Apply 3D median filter to a 3D array.
.. versionadded:: 1.13
- 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 astra
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def astra(tomo, center, recon, theta, **kwargs):
"""
Reconstruct object using the ASTRA toolbox
Extra options
- 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 project2
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def project2(
Function run_pyctest
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_pyctest():
'''
Configure PyCTest and execute
'''
# run argparse, checkout source, copy over files
Function ufo_fbp
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ufo_fbp(tomo, center, recon, theta, **kwargs):
"""
Reconstruct object using UFO's FBP pipeline
"""
import gi
Function vector2
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def vector2(tomo1, tomo2, theta1, theta2, center1=None, center2=None, num_iter=1, axis1=1, axis2=2):
Function astra_rec
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def astra_rec(tomo, center, recon, theta, vol_geom, niter, proj_type, gpu_index, opts):
Function find_center_vo
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_center_vo(tomo, ind=None, smin=-50, smax=50, srad=6, step=0.25,
Function lpmultigpu
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def lpmultigpu(lp, lpmethod, recon, tomo, num_iter, reg_par, gpu_list, lock, ids):
Function recon
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def recon(tomo,
Function reconstruct
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def reconstruct(h5fname, sino, rot_center, args, blocked_views=None):
# not setting this will cause issues on supercomputers
# allow user to override though
os.environ.setdefault("OMP_NUM_THREADS", "1")
Function stripes_detect3d
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def stripes_detect3d(tomo, size=10, radius=3, ncore=None):
"""
Detect stripes in a 3D array. Usually applied to normalized projection
data. The algorithm is presented in the paper :cite:`Kazantsev:23`.
- 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 output_images
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def output_images(rec, fpath, format="jpeg", scale=1, ncol=1):
"""Save an image stack as a series of concatenated images.
Each set of ncol images are concatenated horizontally and saved together
into files named {fpath}_0_{ncol}.{img_format},
- 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 align_seq
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def align_seq(
prj, ang, fdir='.', iters=10, pad=(0, 0),
blur=True, center=None, algorithm='sirt',
upsample_factor=10, rin=0.5, rout=0.8,
save=False, debug=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 build_name_append
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def build_name_append(item, separate=True, prefix="[", suffix="]", check=True, reset=False):
if reset:
pyctest.BUILD_NAME = ""
# if not list, check if is None
if item is None or not item:
- 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"