Showing 176 of 354 total issues
Function detector_drift_adjust_aps_1id
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def detector_drift_adjust_aps_1id(imgstacks,
slit_cnr_ref,
medfilt2_kernel_size=3,
medfilt_kernel_size=3,
ncore=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
File benchmark.py
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# #########################################################################
# Copyright (c) 2015, UChicago Argonne, LLC. All rights reserved. #
Function stripes_mask3d
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def stripes_mask3d(weights,
threshold=0.6,
min_stripe_length=20,
min_stripe_depth=10,
min_stripe_width=5,
- 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 main
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def main(arg):
import multiprocessing as mp
default_ncores = mp.cpu_count()
default_type = "partial"
- 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 phantom.py
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""TomoPy script to reconstruct a built-in phantom."""
Function c_vector3
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def c_vector3(tomo1, tomo2, tomo3, center1, center2, center3, recon1,
Function align_seq
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def align_seq(
Function vector3
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def vector3(tomo1, tomo2, tomo3, theta1, theta2, theta3, center1=None, center2=None, center3=None, num_iter=1, axis1=0, axis2=1, axis3=2):
Function align_joint
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def align_joint(
Function run
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run(phantom, algorithm, args, get_recon=False):
"""Run reconstruction benchmarks for phantoms.
Parameters
----------
Function normalize_nf
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def normalize_nf(
tomo,
flats,
dark,
flat_loc,
- 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_joint
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def align_joint(
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 remove_ring
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def remove_ring(
Function c_vector2
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def c_vector2(tomo1, tomo2, center1, center2, recon1, recon2, recon3,
Function write_center
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def write_center(
tomo, theta, dpath='tmp/center', cen_range=None, ind=None,
mask=False, ratio=1., sinogram_order=False, algorithm='gridrec', filter_name='parzen'):
"""
Save images reconstructed with a range of rotation centers.
- 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_recon
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _init_recon(shape, init_recon, val=1e-6, sharedmem=True, empty=False):
if init_recon is None:
if sharedmem:
recon = dtype.empty_shared_array(shape)
recon[:] = val
- 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 find_slits_corners_aps_1id
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def find_slits_corners_aps_1id(img,
method='quadrant+',
medfilt2_kernel_size=3,
medfilt_kernel_size=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 c_stripesmask3d
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def c_stripesmask3d(
Function project3
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def project3(
Function ufo_dfi
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ufo_dfi(tomo, center, recon, theta, **kwargs):
"""
Reconstruct object using UFO's Direct Fourier pipeline
"""
import gi