Showing 354 of 354 total issues
Function _rs_fit
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _rs_fit(sinogram, order, win2d, matsign, pad):
Function c_accel_sirt
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def c_accel_sirt(tomo, center, recon, theta, **kwargs):
Function fft2
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def fft2(x, s=None, axes=(-2,-1), overwrite_input=False, extra_info=None):
Function c_ospml_hybrid
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def c_ospml_hybrid(tomo, center, recon, theta, **kwargs):
Function c_tikh
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def c_tikh(tomo, center, recon, theta, **kwargs):
Function remove_stripe_based_sorting
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def remove_stripe_based_sorting(tomo,
Function c_tv
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def c_tv(tomo, center, recon, theta, **kwargs):
Function remove_stripe_based_fitting
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def remove_stripe_based_fitting(tomo,
Function rec_slice
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def rec_slice(h5fname, nsino, rot_center, args, blocked_views):
Function reconstruct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def reconstruct(h5fname, sino, rot_center, args, blocked_views=None):
Function rec_partial
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def rec_partial(h5fname, rot_center, args, blocked_views, nchunks=1):
Function _get_otf
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_otf(dx, dy, px, py, spotsize):
Function _test_shape
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _test_shape(self, a, expected_shape, axis=0, ncore=None, nchunk=None):
Function probe_gauss
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def probe_gauss(nx, ny, fwhm=None, center=None, max_int=1):
Function calc_intensity
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def calc_intensity(probe, proj, shift_x=None, shift_y=None, mode='near'):
Function rec_full
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def rec_full(h5fname, rot_center, args, blocked_views, nchunks=16):
Function run_pyctest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run_pyctest():
'''
Configure PyCTest and execute
'''
# run argparse, checkout source, copy over files
- 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 median_filter_nonfinite
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def median_filter_nonfinite(arr, size=3, callback=None):
"""
Remove nonfinite values from a 3D array using an in-place 2D median filter.
The 2D selective median filter is applied along the last two axes of
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
if min_stripe_length <= 0 or min_stripe_length >= dz:
msg = ("The minimum length of a stripe cannot be zero "
"or exceed the size of the angular dimension")
raise ValueError(msg)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 33.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
recon_shape = (tomo1.shape[0], tomo1.shape[2], tomo1.shape[2])
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 33.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76