LiberTEM/LiberTEM

View on GitHub

Showing 902 of 903 total issues

Method "__init__" has 9 parameters, which is greater than the 7 authorized.
Open

    def __init__(self, path, enable_offset_correction=True, gain_map_path=None, dest_dtype=None,
                 nav_shape=None, sig_shape=None, sync_offset=0, io_backend=None):

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

Noncompliant Code Example

With a maximum number of 4 parameters:

def do_something(param1, param2, param3, param4, param5):
    ...

Compliant Solution

def do_something(param1, param2, param3, param4):
    ...

Take the required action to fix the issue indicated by this "FIXME" comment.
Open

    # FIXME: should we scale the data by the binning factor?

FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.

Sometimes the developer will not have the time or will simply forget to get back to that tag.

This rule is meant to track those tags and to ensure that they do not go unnoticed.

Noncompliant Code Example

def divide(numerator, denominator):
  return numerator / denominator              # FIXME denominator value might be 0

See

Take the required action to fix the issue indicated by this "FIXME" comment.
Open

        # FIXME: maybe should be moved into the array representation

FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.

Sometimes the developer will not have the time or will simply forget to get back to that tag.

This rule is meant to track those tags and to ensure that they do not go unnoticed.

Noncompliant Code Example

def divide(numerator, denominator):
  return numerator / denominator              # FIXME denominator value might be 0

See

Remove this commented out code.
Open

    # assert np.mod(len(inp), 3) == 0

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Take the required action to fix the issue indicated by this "FIXME" comment.
Open

        # FIXME check if result buffer with where='device' and export is faster
Severity: Major
Found in src/libertem/udf/holography.py by sonar-python

FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.

Sometimes the developer will not have the time or will simply forget to get back to that tag.

This rule is meant to track those tags and to ensure that they do not go unnoticed.

Noncompliant Code Example

def divide(numerator, denominator):
  return numerator / denominator              # FIXME denominator value might be 0

See

Refactor this function to reduce its Cognitive Complexity from 18 to the 15 allowed.
Open

def process_tile(tile, n_0, sum_inout, varsum_inout):
Severity: Critical
Found in src/libertem/udf/stddev.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Take the required action to fix the issue indicated by this "FIXME" comment.
Open

        # FIXME recheck later again
Severity: Major
Found in setup.py by sonar-python

FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.

Sometimes the developer will not have the time or will simply forget to get back to that tag.

This rule is meant to track those tags and to ensure that they do not go unnoticed.

Noncompliant Code Example

def divide(numerator, denominator):
  return numerator / denominator              # FIXME denominator value might be 0

See

Remove this commented out code.
Open

        # size_x, size_y = self.params.out_shape
Severity: Major
Found in src/libertem/udf/holography.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Function "merge_single" has 8 parameters, which is greater than the 7 authorized.
Open

def merge_single(n, n_0, sum_0, varsum_0, n_1, sum_1, varsum_1, mean_1):
Severity: Major
Found in src/libertem/udf/stddev.py by sonar-python

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

Noncompliant Code Example

With a maximum number of 4 parameters:

def do_something(param1, param2, param3, param4, param5):
    ...

Compliant Solution

def do_something(param1, param2, param3, param4):
    ...

Function "run_analysis_crystall" has 8 parameters, which is greater than the 7 authorized.
Open

def run_analysis_crystall(ctx, dataset, rad_in, rad_out, real_center=None, real_rad=None, roi=None,
                          progress=False):

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

Noncompliant Code Example

With a maximum number of 4 parameters:

def do_something(param1, param2, param3, param4, param5):
    ...

Compliant Solution

def do_something(param1, param2, param3, param4):
    ...

Take the required action to fix the issue indicated by this "FIXME" comment.
Open

        # FIXME use GPU torch with CuPy array?
Severity: Major
Found in src/libertem/udf/masks.py by sonar-python

FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.

Sometimes the developer will not have the time or will simply forget to get back to that tag.

This rule is meant to track those tags and to ensure that they do not go unnoticed.

Noncompliant Code Example

def divide(numerator, denominator):
  return numerator / denominator              # FIXME denominator value might be 0

See

Remove this commented out code.
Open

        # return ('numpy', 'cupy')
Severity: Major
Found in src/libertem/udf/holography.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Take the required action to fix the issue indicated by this "FIXME" comment.
Open

    # FIXME proper validation and proof for complex
Severity: Major
Found in src/libertem/udf/stddev.py by sonar-python

FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.

Sometimes the developer will not have the time or will simply forget to get back to that tag.

This rule is meant to track those tags and to ensure that they do not go unnoticed.

Noncompliant Code Example

def divide(numerator, denominator):
  return numerator / denominator              # FIXME denominator value might be 0

See

Take the required action to fix the issue indicated by this "FIXME" comment.
Open

        # FIXME check if error in tests\test_fullmatch.py persists in a later
Severity: Major
Found in setup.py by sonar-python

FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.

Sometimes the developer will not have the time or will simply forget to get back to that tag.

This rule is meant to track those tags and to ensure that they do not go unnoticed.

Noncompliant Code Example

def divide(numerator, denominator):
  return numerator / denominator              # FIXME denominator value might be 0

See

Take the required action to fix the issue indicated by this "FIXME" comment.
Open

            # FIXME Thresholds chosen somewhat arbitrarily
Severity: Major
Found in src/libertem/udf/auto.py by sonar-python

FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.

Sometimes the developer will not have the time or will simply forget to get back to that tag.

This rule is meant to track those tags and to ensure that they do not go unnoticed.

Noncompliant Code Example

def divide(numerator, denominator):
  return numerator / denominator              # FIXME denominator value might be 0

See

Function "merge_ndarray" has 8 parameters, which is greater than the 7 authorized.
Open

def merge_ndarray(dest_n, dest_sum, dest_varsum, src_n, src_sum, src_varsum, src_mean, forbuf):
Severity: Major
Found in src/libertem/udf/stddev.py by sonar-python

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

Noncompliant Code Example

With a maximum number of 4 parameters:

def do_something(param1, param2, param3, param4, param5):
    ...

Compliant Solution

def do_something(param1, param2, param3, param4):
    ...

Take the required action to fix the issue indicated by this "FIXME" comment.
Open

        # FIXME pull request #259
Severity: Major
Found in setup.py by sonar-python

FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.

Sometimes the developer will not have the time or will simply forget to get back to that tag.

This rule is meant to track those tags and to ensure that they do not go unnoticed.

Noncompliant Code Example

def divide(numerator, denominator):
  return numerator / denominator              # FIXME denominator value might be 0

See

Method "__init__" has 10 parameters, which is greater than the 7 authorized.
Open

    def __init__(self, mask_factories, use_torch=True, use_sparse=None, mask_count=None,
                mask_dtype=None, preferred_dtype=None, backends=None, shifts=None, **kwargs):
Severity: Major
Found in src/libertem/udf/masks.py by sonar-python

A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

Noncompliant Code Example

With a maximum number of 4 parameters:

def do_something(param1, param2, param3, param4, param5):
    ...

Compliant Solution

def do_something(param1, param2, param3, param4):
    ...

subprocess call - check for execution of untrusted input.
Open

        rev_raw = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=new_cwd)
Severity: Info
Found in setup.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert sum(e is Ellipsis for e in slices1) == 1
Severity
Category
Status
Source
Language