LiberTEM/LiberTEM

View on GitHub

Showing 916 of 916 total issues

Function cbed_frame has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

def cbed_frame(
        fy=128, fx=128, zero=None, a=None, b=None, indices=None,
        radius=4, all_equal=False, margin=None):
    if zero is None:
        zero = (fy//2, fx//2)
Severity: Minor
Found in src/libertem/utils/generate.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

Avoid deeply nested control flow statements.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

                        if __threadpool_counter == 0:
                            # The limit is set upon calling ThreadpoolController.limit()
                            __threadpool_limiter = __threadpool_wrapper(n)
                        __threadpool_counter += 1
Severity: Major
Found in src/libertem/common/threading.py - About 45 mins to fix

    Function need_copy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open
    • Open
    • Confirmed
    • Invalid
    • Wontfix
    Cancel

        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

    Similar blocks of code found in 14 locations. Consider refactoring.
    Open
    • Open
    • Confirmed
    • Invalid
    • Wontfix
    Cancel

            o4 = np.uint64(inp[i * 8 + 4]) << 24
    Severity: Major
    Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
    src/libertem/io/dataset/base/decode.py on lines 17..17
    src/libertem/io/dataset/base/decode.py on lines 18..18
    src/libertem/io/dataset/base/decode.py on lines 34..34
    src/libertem/io/dataset/base/decode.py on lines 35..35
    src/libertem/io/dataset/base/decode.py on lines 36..36
    src/libertem/io/dataset/base/decode.py on lines 37..37
    src/libertem/io/dataset/base/decode.py on lines 57..57
    src/libertem/io/dataset/base/decode.py on lines 58..58
    src/libertem/io/dataset/base/decode.py on lines 59..59
    src/libertem/io/dataset/base/decode.py on lines 60..60
    src/libertem/io/dataset/base/decode.py on lines 62..62
    src/libertem/io/dataset/base/decode.py on lines 63..63
    src/libertem/io/dataset/base/decode.py on lines 64..64

    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 35.

    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

    Further Reading

    Similar blocks of code found in 14 locations. Consider refactoring.
    Open
    • Open
    • Confirmed
    • Invalid
    • Wontfix
    Cancel

            o1 = np.uint32(inp[i * 4 + 1]) << 16
    Severity: Major
    Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
    src/libertem/io/dataset/base/decode.py on lines 17..17
    src/libertem/io/dataset/base/decode.py on lines 18..18
    src/libertem/io/dataset/base/decode.py on lines 34..34
    src/libertem/io/dataset/base/decode.py on lines 36..36
    src/libertem/io/dataset/base/decode.py on lines 37..37
    src/libertem/io/dataset/base/decode.py on lines 57..57
    src/libertem/io/dataset/base/decode.py on lines 58..58
    src/libertem/io/dataset/base/decode.py on lines 59..59
    src/libertem/io/dataset/base/decode.py on lines 60..60
    src/libertem/io/dataset/base/decode.py on lines 61..61
    src/libertem/io/dataset/base/decode.py on lines 62..62
    src/libertem/io/dataset/base/decode.py on lines 63..63
    src/libertem/io/dataset/base/decode.py on lines 64..64

    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 35.

    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

    Further Reading

    Function _default_px_to_bytes has 10 arguments (exceeds 8 allowed). Consider refactoring.
    Open
    • Open
    • Confirmed
    • Invalid
    • Wontfix
    Cancel

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

      Avoid deeply nested control flow statements.
      Open
      • Open
      • Confirmed
      • Invalid
      • Wontfix
      Cancel

                              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

        Similar blocks of code found in 14 locations. Consider refactoring.
        Open
        • Open
        • Confirmed
        • Invalid
        • Wontfix
        Cancel

                o1 = np.uint16(inp[i * 2 + 1]) << 0
        Severity: Major
        Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
        src/libertem/io/dataset/base/decode.py on lines 17..17
        src/libertem/io/dataset/base/decode.py on lines 34..34
        src/libertem/io/dataset/base/decode.py on lines 35..35
        src/libertem/io/dataset/base/decode.py on lines 36..36
        src/libertem/io/dataset/base/decode.py on lines 37..37
        src/libertem/io/dataset/base/decode.py on lines 57..57
        src/libertem/io/dataset/base/decode.py on lines 58..58
        src/libertem/io/dataset/base/decode.py on lines 59..59
        src/libertem/io/dataset/base/decode.py on lines 60..60
        src/libertem/io/dataset/base/decode.py on lines 61..61
        src/libertem/io/dataset/base/decode.py on lines 62..62
        src/libertem/io/dataset/base/decode.py on lines 63..63
        src/libertem/io/dataset/base/decode.py on lines 64..64

        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 35.

        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

        Further Reading

        Similar blocks of code found in 14 locations. Consider refactoring.
        Open
        • Open
        • Confirmed
        • Invalid
        • Wontfix
        Cancel

                o1 = np.uint64(inp[i * 8 + 1]) << 48
        Severity: Major
        Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
        src/libertem/io/dataset/base/decode.py on lines 17..17
        src/libertem/io/dataset/base/decode.py on lines 18..18
        src/libertem/io/dataset/base/decode.py on lines 34..34
        src/libertem/io/dataset/base/decode.py on lines 35..35
        src/libertem/io/dataset/base/decode.py on lines 36..36
        src/libertem/io/dataset/base/decode.py on lines 37..37
        src/libertem/io/dataset/base/decode.py on lines 57..57
        src/libertem/io/dataset/base/decode.py on lines 59..59
        src/libertem/io/dataset/base/decode.py on lines 60..60
        src/libertem/io/dataset/base/decode.py on lines 61..61
        src/libertem/io/dataset/base/decode.py on lines 62..62
        src/libertem/io/dataset/base/decode.py on lines 63..63
        src/libertem/io/dataset/base/decode.py on lines 64..64

        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 35.

        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

        Further Reading

        Function get_tiles has 10 arguments (exceeds 8 allowed). Consider refactoring.
        Open
        • Open
        • Confirmed
        • Invalid
        • Wontfix
        Cancel

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

          Function get_tiles has 10 arguments (exceeds 8 allowed). Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

              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
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                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

            Similar blocks of code found in 14 locations. Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                    o3 = np.uint64(inp[i * 8 + 3]) << 32
            Severity: Major
            Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
            src/libertem/io/dataset/base/decode.py on lines 17..17
            src/libertem/io/dataset/base/decode.py on lines 18..18
            src/libertem/io/dataset/base/decode.py on lines 34..34
            src/libertem/io/dataset/base/decode.py on lines 35..35
            src/libertem/io/dataset/base/decode.py on lines 36..36
            src/libertem/io/dataset/base/decode.py on lines 37..37
            src/libertem/io/dataset/base/decode.py on lines 57..57
            src/libertem/io/dataset/base/decode.py on lines 58..58
            src/libertem/io/dataset/base/decode.py on lines 59..59
            src/libertem/io/dataset/base/decode.py on lines 61..61
            src/libertem/io/dataset/base/decode.py on lines 62..62
            src/libertem/io/dataset/base/decode.py on lines 63..63
            src/libertem/io/dataset/base/decode.py on lines 64..64

            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 35.

            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

            Further Reading

            Function _mmap_tilereader_w_copy has 10 arguments (exceeds 8 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                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 10 arguments (exceeds 8 allowed). Consider refactoring.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  def __init__(self, path, ds_path=None, tileshape=None, nav_shape=None, sig_shape=None,
              Severity: Major
              Found in src/libertem/io/dataset/hdf5.py - About 45 mins to fix

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open
                • Open
                • Confirmed
                • Invalid
                • Wontfix
                Cancel

                        o0 = np.uint16(inp[i * 2 + 0]) << 8
                Severity: Major
                Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
                src/libertem/io/dataset/base/decode.py on lines 18..18
                src/libertem/io/dataset/base/decode.py on lines 34..34
                src/libertem/io/dataset/base/decode.py on lines 35..35
                src/libertem/io/dataset/base/decode.py on lines 36..36
                src/libertem/io/dataset/base/decode.py on lines 37..37
                src/libertem/io/dataset/base/decode.py on lines 57..57
                src/libertem/io/dataset/base/decode.py on lines 58..58
                src/libertem/io/dataset/base/decode.py on lines 59..59
                src/libertem/io/dataset/base/decode.py on lines 60..60
                src/libertem/io/dataset/base/decode.py on lines 61..61
                src/libertem/io/dataset/base/decode.py on lines 62..62
                src/libertem/io/dataset/base/decode.py on lines 63..63
                src/libertem/io/dataset/base/decode.py on lines 64..64

                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 35.

                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

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open
                • Open
                • Confirmed
                • Invalid
                • Wontfix
                Cancel

                        o0 = np.uint64(inp[i * 8 + 0]) << 56
                Severity: Major
                Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
                src/libertem/io/dataset/base/decode.py on lines 17..17
                src/libertem/io/dataset/base/decode.py on lines 18..18
                src/libertem/io/dataset/base/decode.py on lines 34..34
                src/libertem/io/dataset/base/decode.py on lines 35..35
                src/libertem/io/dataset/base/decode.py on lines 36..36
                src/libertem/io/dataset/base/decode.py on lines 37..37
                src/libertem/io/dataset/base/decode.py on lines 58..58
                src/libertem/io/dataset/base/decode.py on lines 59..59
                src/libertem/io/dataset/base/decode.py on lines 60..60
                src/libertem/io/dataset/base/decode.py on lines 61..61
                src/libertem/io/dataset/base/decode.py on lines 62..62
                src/libertem/io/dataset/base/decode.py on lines 63..63
                src/libertem/io/dataset/base/decode.py on lines 64..64

                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 35.

                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

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open
                • Open
                • Confirmed
                • Invalid
                • Wontfix
                Cancel

                        o2 = np.uint32(inp[i * 4 + 2]) << 8
                Severity: Major
                Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
                src/libertem/io/dataset/base/decode.py on lines 17..17
                src/libertem/io/dataset/base/decode.py on lines 18..18
                src/libertem/io/dataset/base/decode.py on lines 34..34
                src/libertem/io/dataset/base/decode.py on lines 35..35
                src/libertem/io/dataset/base/decode.py on lines 37..37
                src/libertem/io/dataset/base/decode.py on lines 57..57
                src/libertem/io/dataset/base/decode.py on lines 58..58
                src/libertem/io/dataset/base/decode.py on lines 59..59
                src/libertem/io/dataset/base/decode.py on lines 60..60
                src/libertem/io/dataset/base/decode.py on lines 61..61
                src/libertem/io/dataset/base/decode.py on lines 62..62
                src/libertem/io/dataset/base/decode.py on lines 63..63
                src/libertem/io/dataset/base/decode.py on lines 64..64

                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 35.

                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

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open
                • Open
                • Confirmed
                • Invalid
                • Wontfix
                Cancel

                        o2 = np.uint64(inp[i * 8 + 2]) << 40
                Severity: Major
                Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
                src/libertem/io/dataset/base/decode.py on lines 17..17
                src/libertem/io/dataset/base/decode.py on lines 18..18
                src/libertem/io/dataset/base/decode.py on lines 34..34
                src/libertem/io/dataset/base/decode.py on lines 35..35
                src/libertem/io/dataset/base/decode.py on lines 36..36
                src/libertem/io/dataset/base/decode.py on lines 37..37
                src/libertem/io/dataset/base/decode.py on lines 57..57
                src/libertem/io/dataset/base/decode.py on lines 58..58
                src/libertem/io/dataset/base/decode.py on lines 60..60
                src/libertem/io/dataset/base/decode.py on lines 61..61
                src/libertem/io/dataset/base/decode.py on lines 62..62
                src/libertem/io/dataset/base/decode.py on lines 63..63
                src/libertem/io/dataset/base/decode.py on lines 64..64

                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 35.

                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

                Further Reading

                Function get_tiles has 10 arguments (exceeds 8 allowed). Consider refactoring.
                Open
                • Open
                • Confirmed
                • Invalid
                • Wontfix
                Cancel

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

                  Function get_tiles has 10 arguments (exceeds 8 allowed). Consider refactoring.
                  Open
                  • Open
                  • Confirmed
                  • Invalid
                  • Wontfix
                  Cancel

                      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
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                        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 __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                        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 __init__ has 10 arguments (exceeds 8 allowed). Consider refactoring.
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                        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

                      Function coordinate_check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

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

                      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

                      Similar blocks of code found in 14 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                              o0 = np.uint32(inp[i * 4 + 0]) << 24
                      Severity: Major
                      Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
                      src/libertem/io/dataset/base/decode.py on lines 17..17
                      src/libertem/io/dataset/base/decode.py on lines 18..18
                      src/libertem/io/dataset/base/decode.py on lines 35..35
                      src/libertem/io/dataset/base/decode.py on lines 36..36
                      src/libertem/io/dataset/base/decode.py on lines 37..37
                      src/libertem/io/dataset/base/decode.py on lines 57..57
                      src/libertem/io/dataset/base/decode.py on lines 58..58
                      src/libertem/io/dataset/base/decode.py on lines 59..59
                      src/libertem/io/dataset/base/decode.py on lines 60..60
                      src/libertem/io/dataset/base/decode.py on lines 61..61
                      src/libertem/io/dataset/base/decode.py on lines 62..62
                      src/libertem/io/dataset/base/decode.py on lines 63..63
                      src/libertem/io/dataset/base/decode.py on lines 64..64

                      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 35.

                      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

                      Further Reading

                      Similar blocks of code found in 14 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                              o3 = np.uint32(inp[i * 4 + 3]) << 0
                      Severity: Major
                      Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
                      src/libertem/io/dataset/base/decode.py on lines 17..17
                      src/libertem/io/dataset/base/decode.py on lines 18..18
                      src/libertem/io/dataset/base/decode.py on lines 34..34
                      src/libertem/io/dataset/base/decode.py on lines 35..35
                      src/libertem/io/dataset/base/decode.py on lines 36..36
                      src/libertem/io/dataset/base/decode.py on lines 57..57
                      src/libertem/io/dataset/base/decode.py on lines 58..58
                      src/libertem/io/dataset/base/decode.py on lines 59..59
                      src/libertem/io/dataset/base/decode.py on lines 60..60
                      src/libertem/io/dataset/base/decode.py on lines 61..61
                      src/libertem/io/dataset/base/decode.py on lines 62..62
                      src/libertem/io/dataset/base/decode.py on lines 63..63
                      src/libertem/io/dataset/base/decode.py on lines 64..64

                      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 35.

                      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

                      Further Reading

                      Function analysisReducer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                      export const analysisReducer = (state = initialAnalysisState, action: AllActions): AnalysisReducerState => {
                          switch (action.type) {
                              case analysisActions.ActionTypes.CREATED: {
                                  return insertById(state, action.payload.analysis.id, action.payload.analysis);
                              }
                      Severity: Minor
                      Found in client/src/analysis/reducers.ts - 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

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                          analysisCreated: (analysis: string, dataset: string, details: AnalysisDetails) =>
                              createAction(ActionTypes.ANALYSIS_CREATED, { dataset, analysis, details }),
                      Severity: Major
                      Found in client/src/channel/actions.ts and 5 other locations - About 45 mins to fix
                      client/src/channel/actions.ts on lines 54..55
                      client/src/channel/messages.ts on lines 62..62
                      client/src/channel/messages.ts on lines 63..63
                      client/src/channel/messages.ts on lines 66..66
                      client/src/channel/messages.ts on lines 67..67

                      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 50.

                      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

                      Further Reading

                      Similar blocks of code found in 14 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                              o6 = np.uint64(inp[i * 8 + 6]) << 8
                      Severity: Major
                      Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
                      src/libertem/io/dataset/base/decode.py on lines 17..17
                      src/libertem/io/dataset/base/decode.py on lines 18..18
                      src/libertem/io/dataset/base/decode.py on lines 34..34
                      src/libertem/io/dataset/base/decode.py on lines 35..35
                      src/libertem/io/dataset/base/decode.py on lines 36..36
                      src/libertem/io/dataset/base/decode.py on lines 37..37
                      src/libertem/io/dataset/base/decode.py on lines 57..57
                      src/libertem/io/dataset/base/decode.py on lines 58..58
                      src/libertem/io/dataset/base/decode.py on lines 59..59
                      src/libertem/io/dataset/base/decode.py on lines 60..60
                      src/libertem/io/dataset/base/decode.py on lines 61..61
                      src/libertem/io/dataset/base/decode.py on lines 62..62
                      src/libertem/io/dataset/base/decode.py on lines 64..64

                      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 35.

                      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

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                          analysisUpdated: (analysis: string, dataset: string, details: AnalysisDetails) => createMessage(MessageTypes.ANALYSIS_UPDATED, { dataset, analysis, details }),
                      Severity: Major
                      Found in client/src/channel/messages.ts and 5 other locations - About 45 mins to fix
                      client/src/channel/actions.ts on lines 52..53
                      client/src/channel/actions.ts on lines 54..55
                      client/src/channel/messages.ts on lines 62..62
                      client/src/channel/messages.ts on lines 66..66
                      client/src/channel/messages.ts on lines 67..67

                      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 50.

                      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

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                                  if normalize:  # Make sure each bin has a sum of 1
                                      s = vals.sum()
                                      if not np.isclose(s, 0):
                                          vals /= s
                      Severity: Minor
                      Found in src/libertem/masks.py and 1 other location - About 45 mins to fix
                      src/libertem/masks.py on lines 326..329

                      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 35.

                      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

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                          compoundAnalysisCreated: (compoundAnalysis: string, dataset: string, details: CompoundAnalysisDetails) => createMessage(MessageTypes.COMPOUND_ANALYSIS_CREATED, { dataset, compoundAnalysis, details }),
                      Severity: Major
                      Found in client/src/channel/messages.ts and 5 other locations - About 45 mins to fix
                      client/src/channel/actions.ts on lines 52..53
                      client/src/channel/actions.ts on lines 54..55
                      client/src/channel/messages.ts on lines 62..62
                      client/src/channel/messages.ts on lines 63..63
                      client/src/channel/messages.ts on lines 67..67

                      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 50.

                      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

                      Further Reading

                      Similar blocks of code found in 14 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                              o7 = np.uint64(inp[i * 8 + 7]) << 0
                      Severity: Major
                      Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
                      src/libertem/io/dataset/base/decode.py on lines 17..17
                      src/libertem/io/dataset/base/decode.py on lines 18..18
                      src/libertem/io/dataset/base/decode.py on lines 34..34
                      src/libertem/io/dataset/base/decode.py on lines 35..35
                      src/libertem/io/dataset/base/decode.py on lines 36..36
                      src/libertem/io/dataset/base/decode.py on lines 37..37
                      src/libertem/io/dataset/base/decode.py on lines 57..57
                      src/libertem/io/dataset/base/decode.py on lines 58..58
                      src/libertem/io/dataset/base/decode.py on lines 59..59
                      src/libertem/io/dataset/base/decode.py on lines 60..60
                      src/libertem/io/dataset/base/decode.py on lines 61..61
                      src/libertem/io/dataset/base/decode.py on lines 62..62
                      src/libertem/io/dataset/base/decode.py on lines 63..63

                      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 35.

                      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

                      Further Reading

                      Similar blocks of code found in 14 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                              o5 = np.uint64(inp[i * 8 + 5]) << 16
                      Severity: Major
                      Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 45 mins to fix
                      src/libertem/io/dataset/base/decode.py on lines 17..17
                      src/libertem/io/dataset/base/decode.py on lines 18..18
                      src/libertem/io/dataset/base/decode.py on lines 34..34
                      src/libertem/io/dataset/base/decode.py on lines 35..35
                      src/libertem/io/dataset/base/decode.py on lines 36..36
                      src/libertem/io/dataset/base/decode.py on lines 37..37
                      src/libertem/io/dataset/base/decode.py on lines 57..57
                      src/libertem/io/dataset/base/decode.py on lines 58..58
                      src/libertem/io/dataset/base/decode.py on lines 59..59
                      src/libertem/io/dataset/base/decode.py on lines 60..60
                      src/libertem/io/dataset/base/decode.py on lines 61..61
                      src/libertem/io/dataset/base/decode.py on lines 63..63
                      src/libertem/io/dataset/base/decode.py on lines 64..64

                      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 35.

                      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

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                          xes = np.cos(polar[..., 1]) * polar[..., 0]
                      Severity: Minor
                      Found in src/libertem/utils/__init__.py and 1 other location - About 45 mins to fix
                      src/libertem/utils/__init__.py on lines 23..23

                      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 35.

                      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

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                          analysisUpdated: (analysis: string, dataset: string, details: AnalysisDetails) =>
                              createAction(ActionTypes.ANALYSIS_UPDATED, { dataset, analysis, details }),
                      Severity: Major
                      Found in client/src/channel/actions.ts and 5 other locations - About 45 mins to fix
                      client/src/channel/actions.ts on lines 52..53
                      client/src/channel/messages.ts on lines 62..62
                      client/src/channel/messages.ts on lines 63..63
                      client/src/channel/messages.ts on lines 66..66
                      client/src/channel/messages.ts on lines 67..67

                      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 50.

                      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

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                          analysisCreated: (analysis: string, dataset: string, details: AnalysisDetails) => createMessage(MessageTypes.ANALYSIS_CREATED, { dataset, analysis, details }),
                      Severity: Major
                      Found in client/src/channel/messages.ts and 5 other locations - About 45 mins to fix
                      client/src/channel/actions.ts on lines 52..53
                      client/src/channel/actions.ts on lines 54..55
                      client/src/channel/messages.ts on lines 63..63
                      client/src/channel/messages.ts on lines 66..66
                      client/src/channel/messages.ts on lines 67..67

                      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 50.

                      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

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                          yes = np.sin(polar[..., 1]) * polar[..., 0]
                      Severity: Minor
                      Found in src/libertem/utils/__init__.py and 1 other location - About 45 mins to fix
                      src/libertem/utils/__init__.py on lines 22..22

                      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 35.

                      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

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                          compoundAnalysisUpdated: (compoundAnalysis: string, dataset: string, details: CompoundAnalysisDetails) => createMessage(MessageTypes.COMPOUND_ANALYSIS_UPDATED, { dataset, compoundAnalysis, details }),
                      Severity: Major
                      Found in client/src/channel/messages.ts and 5 other locations - About 45 mins to fix
                      client/src/channel/actions.ts on lines 52..53
                      client/src/channel/actions.ts on lines 54..55
                      client/src/channel/messages.ts on lines 62..62
                      client/src/channel/messages.ts on lines 63..63
                      client/src/channel/messages.ts on lines 66..66

                      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 50.

                      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

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                                  if normalize:  # Make sure each bin has a sum of 1
                                      s = vals.sum()
                                      if not np.isclose(s, 0):
                                          vals /= s
                      Severity: Minor
                      Found in src/libertem/masks.py and 1 other location - About 45 mins to fix
                      src/libertem/masks.py on lines 320..323

                      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 35.

                      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

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                              case compoundAnalysisActions.ActionTypes.REMOVED: {
                                  return filterWithPred(state, (r: CompoundAnalysisState) => r.compoundAnalysis !== action.payload.id);
                              }
                      Severity: Major
                      Found in client/src/compoundAnalysis/reducers.ts and 5 other locations - About 40 mins to fix
                      client/src/analysis/reducers.ts on lines 21..23
                      client/src/compoundAnalysis/reducers.ts on lines 33..35
                      client/src/dataset/reducers.ts on lines 37..39
                      client/src/dataset/reducers.ts on lines 43..45
                      client/src/errors/reducers.ts on lines 41..43

                      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 49.

                      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

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                              case datasetActions.ActionTypes.DELETED: {
                                  return filterWithPred(state, (r: DatasetState) => r.id !== action.payload.dataset);
                              }
                      Severity: Major
                      Found in client/src/dataset/reducers.ts and 5 other locations - About 40 mins to fix
                      client/src/analysis/reducers.ts on lines 21..23
                      client/src/compoundAnalysis/reducers.ts on lines 25..27
                      client/src/compoundAnalysis/reducers.ts on lines 33..35
                      client/src/dataset/reducers.ts on lines 37..39
                      client/src/errors/reducers.ts on lines 41..43

                      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 49.

                      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

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                              case datasetActions.ActionTypes.DELETE: {
                                  return filterWithPred(state, (r: CompoundAnalysisState) => r.dataset !== action.payload.dataset);
                              }
                      Severity: Major
                      Found in client/src/compoundAnalysis/reducers.ts and 5 other locations - About 40 mins to fix
                      client/src/analysis/reducers.ts on lines 21..23
                      client/src/compoundAnalysis/reducers.ts on lines 25..27
                      client/src/dataset/reducers.ts on lines 37..39
                      client/src/dataset/reducers.ts on lines 43..45
                      client/src/errors/reducers.ts on lines 41..43

                      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 49.

                      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

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                              case errorActions.ActionTypes.DISMISS: {
                                  return filterWithPred(state, (r: ErrorMessage) => r.id !== action.payload.id);
                              }
                      Severity: Major
                      Found in client/src/errors/reducers.ts and 5 other locations - About 40 mins to fix
                      client/src/analysis/reducers.ts on lines 21..23
                      client/src/compoundAnalysis/reducers.ts on lines 25..27
                      client/src/compoundAnalysis/reducers.ts on lines 33..35
                      client/src/dataset/reducers.ts on lines 37..39
                      client/src/dataset/reducers.ts on lines 43..45

                      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 49.

                      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

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                              case analysisActions.ActionTypes.REMOVED: {
                                  return filterWithPred(state, (r: AnalysisState) => r.id !== action.payload.id);
                              }
                      Severity: Major
                      Found in client/src/analysis/reducers.ts and 5 other locations - About 40 mins to fix
                      client/src/compoundAnalysis/reducers.ts on lines 25..27
                      client/src/compoundAnalysis/reducers.ts on lines 33..35
                      client/src/dataset/reducers.ts on lines 37..39
                      client/src/dataset/reducers.ts on lines 43..45
                      client/src/errors/reducers.ts on lines 41..43

                      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 49.

                      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

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                              case datasetActions.ActionTypes.ERROR: {
                                  return filterWithPred(state, (r: DatasetState) => r.id !== action.payload.dataset);
                              }
                      Severity: Major
                      Found in client/src/dataset/reducers.ts and 5 other locations - About 40 mins to fix
                      client/src/analysis/reducers.ts on lines 21..23
                      client/src/compoundAnalysis/reducers.ts on lines 25..27
                      client/src/compoundAnalysis/reducers.ts on lines 33..35
                      client/src/dataset/reducers.ts on lines 43..45
                      client/src/errors/reducers.ts on lines 41..43

                      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 49.

                      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

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                          const runOrParamsChannel = (yield actionChannel(compoundAnalysisActions.ActionTypes.SET_PARAMS, buffers.sliding(2))) as TakeableChannel<compoundAnalysisActions.ActionTypes.SET_PARAMS>;
                      Severity: Minor
                      Found in client/src/compoundAnalysis/sagas.ts and 1 other location - About 40 mins to fix
                      client/src/compoundAnalysis/sagas.ts on lines 157..159

                      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 49.

                      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

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                              <DraggableHandle x={x} y={y}
                                  imageWidth={scanWidth}
                                  onDragMove={handleCornerChange}
                                  parentOnDragStart={handleDragStart}
                                  parentOnDrop={handleDrop} />
                      Severity: Minor
                      Found in client/src/compoundAnalysis/components/roi/RectROI.tsx and 1 other location - About 40 mins to fix
                      client/src/compoundAnalysis/components/roi/RectROI.tsx on lines 60..62

                      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 49.

                      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

                      Further Reading

                      Severity
                      Category