LiberTEM/LiberTEM

View on GitHub

Showing 269 of 913 total issues

Function get_tiles has 10 arguments (exceeds 8 allowed). Consider refactoring.
Open

    def get_tiles(
Severity: Major
Found in src/libertem/io/dataset/memory.py - About 45 mins to fix

    Function _wrapup_udfs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def _wrapup_udfs(
            self,
            partition: Partition
        ) -> None:
            for udf in self._udfs:
    Severity: Minor
    Found in src/libertem/udf/base.py - About 45 mins to fix

    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 coordinate_check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def coordinate_check(y_centers, x_centers, roi=None):
        '''
        Calculate the RMS curl as a function of :code:`scan_rotation` and :code:`flip_y`.
    
        The curl for a purely electrostatic field is zero. That means
    Severity: Minor
    Found in src/libertem/udf/com.py - About 45 mins to fix

    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__ has 10 arguments (exceeds 8 allowed). Consider refactoring.
    Open

        def __init__(self, source_part, cluster_part, meta, partition_slice,
    Severity: Major
    Found in src/libertem/io/dataset/cached.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if tile.dtype != read_dtype or tile.c_contiguous is False:
                                  data = tile.data.astype(read_dtype)
                              else:
                                  data = tile.data
                              self.preprocess(data, tile.tile_slice, corrections)
      Severity: Major
      Found in src/libertem/io/dataset/memory.py - About 45 mins to fix

        Function _mmap_tilereader_w_copy has 10 arguments (exceeds 8 allowed). Consider refactoring.
        Open

            def _mmap_tilereader_w_copy(outer_idx, mmaps, sig_dims, tile_read_ranges,
        Severity: Major
        Found in src/libertem/io/dataset/base/backend_mmap.py - About 45 mins to fix

          Function __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          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):
          
                  _backends = backends
                  not_supported = (
          Severity: Minor
          Found in src/libertem/udf/masks.py - About 45 mins to fix

          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 get_tiles has 10 arguments (exceeds 8 allowed). Consider refactoring.
          Open

              def get_tiles(
          Severity: Major
          Found in src/libertem/io/dataset/base/backend_buffered.py - About 45 mins to fix

            Function first_block_with_search has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def first_block_with_search(self, predicate=lambda b: True, step=32 * 8 * 50):
                    """
                    Binary search variant of `first_block_with`, assuming that predicate is true
                    from some index on, and stays true (at least for 10 * step).
                    """
            Severity: Minor
            Found in src/libertem/io/dataset/k2is.py - About 45 mins to fix

            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 need_copy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def need_copy(
                    self, decoder, roi, native_dtype, read_dtype, tiling_scheme=None, fileset=None,
                    sync_offset=0, corrections=None,
                ) -> bool:
                    # checking conditions in which "straight mmap" is not possible
            Severity: Minor
            Found in src/libertem/io/dataset/base/backend.py - About 45 mins to fix

            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 ClusterStatus has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            const ClusterStatus: React.FC<MergedProps> = ({ clusterConnection, channelStatus, type, localcore, cudas, address }) => {
                enum ColorType {
                    blue = "blue",
                    grey = "grey",
                    orange = "orange",
            Severity: Minor
            Found in client/src/clusterStatus/components/Cluster.tsx - About 45 mins to fix

            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

            Consider simplifying this complex logical expression.
            Open

                    if use_torch and (not torch_incompatible):
                        self.process_flat = self._process_flat_torch
                    elif (
                        self.meta.array_backend == UDF.BACKEND_NUMPY
                        and isinstance(self.masks.use_sparse, str)
            Severity: Major
            Found in src/libertem/udf/masks.py - About 40 mins to fix

              Function create_radial_fourier_analysis has 9 arguments (exceeds 8 allowed). Consider refactoring.
              Open

                  def create_radial_fourier_analysis(self, dataset: DataSet, cx: float = None, cy: float = None,
              Severity: Major
              Found in src/libertem/api.py - About 35 mins to fix

                Function _run_sync has 9 arguments (exceeds 8 allowed). Consider refactoring.
                Open

                    def _run_sync(
                Severity: Major
                Found in src/libertem/api.py - About 35 mins to fix

                  Function _run_async has 9 arguments (exceeds 8 allowed). Consider refactoring.
                  Open

                      def _run_async(
                  Severity: Major
                  Found in src/libertem/api.py - About 35 mins to fix

                    Function _run_async has 9 arguments (exceeds 8 allowed). Consider refactoring.
                    Open

                        def _run_async(
                    Severity: Major
                    Found in src/libertem/api.py - About 35 mins to fix

                      Function cbed_frame has 9 arguments (exceeds 8 allowed). Consider refactoring.
                      Open

                      def cbed_frame(
                      Severity: Major
                      Found in src/libertem/utils/generate.py - About 35 mins to fix

                        Function run_udf_iter has 9 arguments (exceeds 8 allowed). Consider refactoring.
                        Open

                            def run_udf_iter(
                        Severity: Major
                        Found in src/libertem/api.py - About 35 mins to fix

                          Function _run_sync has 9 arguments (exceeds 8 allowed). Consider refactoring.
                          Open

                              def _run_sync(
                          Severity: Major
                          Found in src/libertem/api.py - About 35 mins to fix

                            Function _run_async has 9 arguments (exceeds 8 allowed). Consider refactoring.
                            Open

                                def _run_async(
                            Severity: Major
                            Found in src/libertem/api.py - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language