LiberTEM/LiberTEM

View on GitHub

Showing 916 of 916 total issues

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

    def _read_block_dense(
Severity: Major
Found in src/libertem/io/dataset/base/backend_buffered.py - About 1 hr to fix

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

    def _default_read_ranges_tile_block(
    Severity: Major
    Found in src/libertem/io/dataset/base/tiling.py - About 1 hr to fix

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

      def _k2is_read_ranges_tile_block(
      Severity: Major
      Found in src/libertem/io/dataset/k2is.py - About 1 hr to fix

        Function createOrUpdate has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open
        • Open
        • Confirmed
        • Invalid
        • Wontfix
        Cancel

        export function* createOrUpdate(
            compoundAnalysis: CompoundAnalysisState, analysisId: string | undefined,
            analysisIndex: number, details: AnalysisDetails
        ): Generator<unknown, string, any> {
            if (analysisId) {
        Severity: Minor
        Found in client/src/compoundAnalysis/sagas.ts - About 1 hr to fix

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

          def build_mapping(el: Any,
                            unpackable_types: dict[type, Callable[[Iterable],
                                                                  Iterable[tuple[Any, Any]]]] = None,
                            ignore_types: Optional[tuple[type, ...]] = None,
                            _pos: list[tuple[type, Any]] = None) -> list[list[tuple[type, Any]]]:
          Severity: Minor
          Found in src/libertem/executor/utils/delayed_unpack.py - About 1 hr 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 main has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

          def main(port, local_directory, browser, cpus, gpus, open_ds, log_level,
                   insecure, host="localhost", token_path=None, preload: tuple[str, ...] = (),
                   snooze_timeout: Optional[float] = None):
              # Mitigation for https://stackoverflow.com/questions/71283820/
              #   directory-parameter-on-windows-has-trailing-backslash-replaced-with-double-quote
          Severity: Minor
          Found in src/libertem/web/cli.py - About 1 hr 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 _build_sparse has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

          def _build_sparse(m, dtype: npt.DTypeLike, sparse_backend: SparseSupportedT, backend: ArrayBackend):
              if sparse_backend == 'sparse.pydata' and backend == NUMPY:
                  # sparse.pydata.org is fastest for masks with few layers
                  # and few entries
                  return m.astype(dtype)
          Severity: Minor
          Found in src/libertem/common/container.py - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

              def __init__(
                  self,
                  mask_factories: Union[FactoryT, Sequence[FactoryT]],
                  dtype: Optional[npt.DTypeLike] = None,
                  use_sparse: Optional[Union[bool, SparseSupportedT]] = None,
          Severity: Minor
          Found in src/libertem/common/container.py - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

              def get_resource_details(self):
                  workers = self.get_available_workers()
                  details = {}
          
                  for worker in workers:
          Severity: Minor
          Found in src/libertem/executor/dask.py - About 1 hr 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 CenterOfMassAnalysis has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

          const CenterOfMassAnalysis: React.FC<CompoundAnalysisProps> = ({ compoundAnalysis, dataset }) => {
              const { shape } = dataset.params;
              const [scanHeight, scanWidth, imageHeight, imageWidth] = shape;
              const minLength = Math.min(imageWidth, imageHeight);
              const [cx, setCx] = useState(imageWidth / 2);
          Severity: Minor
          Found in client/src/compoundAnalysis/components/CenterOfMassAnalysis.tsx - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

              def get_regression(self, field: np.ndarray, valid_mask: np.ndarray):
                  inp = None
                  result = np.zeros((3, 2))
          
                  com_params = self.get_params()
          Severity: Minor
          Found in src/libertem/udf/com.py - About 1 hr 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 validate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

              def validate(
                  self,
                  shape: tuple[int, ...],
                  ds_sig_shape: tuple[int, ...],
                  size: int,
          Severity: Minor
          Found in src/libertem/io/dataset/base/tiling_scheme.py - About 1 hr 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 3 locations. Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

          @numba.njit(inline='always', cache=True)
          def decode_swap_4(inp, out, idx, native_dtype, rr, origin, shape, ds_shape):
              byteswap_4_decode(inp, out=out[idx])
          Severity: Major
          Found in src/libertem/io/dataset/base/decode.py and 2 other locations - About 1 hr to fix
          src/libertem/io/dataset/base/decode.py on lines 73..75
          src/libertem/io/dataset/base/decode.py on lines 83..85

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

          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

                  mask_in = 1*_make_circular_mask(
                      center[1], center[0],
                      sig_shape[1], sig_shape[0],
                      rad_in
          Severity: Major
          Found in src/libertem/udf/FEM.py and 1 other location - About 1 hr to fix
          src/libertem/udf/FEM.py on lines 48..51

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

          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 3 locations. Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

          @numba.njit(inline='always', cache=True)
          def decode_swap_8(inp, out, idx, native_dtype, rr, origin, shape, ds_shape):
              byteswap_8_decode(inp, out=out[idx])
          Severity: Major
          Found in src/libertem/io/dataset/base/decode.py and 2 other locations - About 1 hr to fix
          src/libertem/io/dataset/base/decode.py on lines 73..75
          src/libertem/io/dataset/base/decode.py on lines 78..80

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

          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

                  mask_out = 1*_make_circular_mask(
                      center[1], center[0],
                      sig_shape[1], sig_shape[0],
                      rad_out
          Severity: Major
          Found in src/libertem/udf/FEM.py and 1 other location - About 1 hr to fix
          src/libertem/udf/FEM.py on lines 53..56

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

          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 3 locations. Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

          @numba.njit(inline='always', cache=True)
          def decode_swap_2(inp, out, idx, native_dtype, rr, origin, shape, ds_shape):
              byteswap_2_decode(inp, out=out[idx])
          Severity: Major
          Found in src/libertem/io/dataset/base/decode.py and 2 other locations - About 1 hr to fix
          src/libertem/io/dataset/base/decode.py on lines 78..80
          src/libertem/io/dataset/base/decode.py on lines 83..85

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

          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 datasetReducer has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

          export const datasetReducer = (state = initialDatasetState, action: AllActions): DatasetsState => {
              switch (action.type) {
                  case channelActions.ActionTypes.INITIAL_STATE: {
                      const datasets = action.payload.datasets.map(ds => Object.assign({}, ds, { status: DatasetStatus.OPEN }));
                      return {
          Severity: Minor
          Found in client/src/dataset/reducers.ts - About 1 hr to fix

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

                                {driveOptions.map((option) =>
                                    <PathDropDownItem key={option.key} value={option.key} content={option.text} onChange={onChange} />
                                )}
            Severity: Major
            Found in client/src/browser/components/PathBar.tsx and 2 other locations - About 1 hr to fix
            client/src/browser/components/PathBar.tsx on lines 58..60
            client/src/browser/components/PathBar.tsx on lines 65..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 61.

            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 3 locations. Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                                {placeOptions.map((option) =>
                                    <PathDropDownItem key={option.key} value={option.key} content={option.text} onChange={onChange} />
                                )}
            Severity: Major
            Found in client/src/browser/components/PathBar.tsx and 2 other locations - About 1 hr to fix
            client/src/browser/components/PathBar.tsx on lines 54..56
            client/src/browser/components/PathBar.tsx on lines 65..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 61.

            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 3 locations. Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                                {starOptions.map((option) =>
                                    <PathDropDownItem key={option.key} value={option.key} content={option.text} onChange={onChange} />
                                )}
            Severity: Major
            Found in client/src/browser/components/PathBar.tsx and 2 other locations - About 1 hr to fix
            client/src/browser/components/PathBar.tsx on lines 54..56
            client/src/browser/components/PathBar.tsx on lines 58..60

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

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

            def _mib_2x2_tile_block(
                slices_arr, fileset_arr, slice_sig_sizes, sig_origins,
                inner_indices_start, inner_indices_stop, frame_indices, sig_size,
                px_to_bytes, bpp, frame_header_bytes, frame_footer_bytes, file_idxs,
                slice_offset, extra, sig_shape,
            Severity: Minor
            Found in src/libertem/io/dataset/mib.py - About 1 hr 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 initialize has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                def initialize(self, executor: 'JobExecutor'):
                    self._filesize = executor.run_function(self._get_filesize)
                    array_meta = executor.run_function(self._read_metadata,
                                                       self._path,
                                                       use_ds=self._dm_ds_index)
            Severity: Minor
            Found in src/libertem/io/dataset/dm_single.py - About 1 hr 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 run_tasks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                def run_tasks(
                    self,
                    tasks: Iterable[TaskProtocol],
                    params_handle: Any,
                    cancel_id: Any,
            Severity: Minor
            Found in src/libertem/executor/dask.py - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                def _get_decode_r(self):
                    bit_depth = self._bit_depth
                    layout = self._header['sensor_layout']
                    num_chips = self._header['num_chips']
                    if layout == (2, 2) and num_chips == 4:
            Severity: Minor
            Found in src/libertem/io/dataset/mib.py - About 1 hr 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 make_local has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                def make_local(cls, spec: Optional[dict] = None, cluster_kwargs: Optional[dict] = None,
                        client_kwargs: Optional[dict] = None, preload: Optional[tuple[str]] = None):
                    """
                    Spin up a local dask cluster
            
            
            Severity: Minor
            Found in src/libertem/executor/dask.py - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                def get_view_for_frame(self, partition, tile, frame_idx):
                    """
                    get a view for a single frame in a partition- or dataset-sized buffer
                    (partition-sized here means the reduced result for a whole partition,
                    not the partition itself!)
            Severity: Minor
            Found in src/libertem/common/buffers.py - About 1 hr 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 correct has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

            def correct(
                    buffer, dark_image=None, gain_map=None, excluded_pixels=None, repair_descriptor=None,
                    inplace=False, sig_shape=None, allow_empty=False):
                '''
                Function to perform detector corrections
            Severity: Minor
            Found in src/libertem/io/corrections/detector.py - About 1 hr 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 _prepare_run_for_dataset has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                def _prepare_run_for_dataset(
                    self,
                    dataset: DataSet,
                    executor: JobExecutor,
                    roi: Optional[np.ndarray],
            Severity: Minor
            Found in src/libertem/udf/base.py - About 1 hr 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 14 arguments (exceeds 8 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                def __init__(self, tileshape=None, num_partitions=None, data=None, sig_dims=None,
            Severity: Major
            Found in src/libertem/io/dataset/memory.py - About 1 hr to fix

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

                      out[i * 8 + 2] = inp[i * 8 + 5]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 10..10
              src/libertem/io/dataset/base/decode.py on lines 11..11
              src/libertem/io/dataset/base/decode.py on lines 25..25
              src/libertem/io/dataset/base/decode.py on lines 26..26
              src/libertem/io/dataset/base/decode.py on lines 27..27
              src/libertem/io/dataset/base/decode.py on lines 28..28
              src/libertem/io/dataset/base/decode.py on lines 44..44
              src/libertem/io/dataset/base/decode.py on lines 45..45
              src/libertem/io/dataset/base/decode.py on lines 46..46
              src/libertem/io/dataset/base/decode.py on lines 47..47
              src/libertem/io/dataset/base/decode.py on lines 48..48
              src/libertem/io/dataset/base/decode.py on lines 50..50
              src/libertem/io/dataset/base/decode.py on lines 51..51

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

              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

                      out[i * 8 + 5] = inp[i * 8 + 2]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 10..10
              src/libertem/io/dataset/base/decode.py on lines 11..11
              src/libertem/io/dataset/base/decode.py on lines 25..25
              src/libertem/io/dataset/base/decode.py on lines 26..26
              src/libertem/io/dataset/base/decode.py on lines 27..27
              src/libertem/io/dataset/base/decode.py on lines 28..28
              src/libertem/io/dataset/base/decode.py on lines 44..44
              src/libertem/io/dataset/base/decode.py on lines 45..45
              src/libertem/io/dataset/base/decode.py on lines 47..47
              src/libertem/io/dataset/base/decode.py on lines 48..48
              src/libertem/io/dataset/base/decode.py on lines 49..49
              src/libertem/io/dataset/base/decode.py on lines 50..50
              src/libertem/io/dataset/base/decode.py on lines 51..51

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

              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

                      out[i * 4 + 3] = inp[i * 4 + 0]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 10..10
              src/libertem/io/dataset/base/decode.py on lines 11..11
              src/libertem/io/dataset/base/decode.py on lines 26..26
              src/libertem/io/dataset/base/decode.py on lines 27..27
              src/libertem/io/dataset/base/decode.py on lines 28..28
              src/libertem/io/dataset/base/decode.py on lines 44..44
              src/libertem/io/dataset/base/decode.py on lines 45..45
              src/libertem/io/dataset/base/decode.py on lines 46..46
              src/libertem/io/dataset/base/decode.py on lines 47..47
              src/libertem/io/dataset/base/decode.py on lines 48..48
              src/libertem/io/dataset/base/decode.py on lines 49..49
              src/libertem/io/dataset/base/decode.py on lines 50..50
              src/libertem/io/dataset/base/decode.py on lines 51..51

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

              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

                      out[i * 8 + 7] = inp[i * 8 + 0]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 10..10
              src/libertem/io/dataset/base/decode.py on lines 11..11
              src/libertem/io/dataset/base/decode.py on lines 25..25
              src/libertem/io/dataset/base/decode.py on lines 26..26
              src/libertem/io/dataset/base/decode.py on lines 27..27
              src/libertem/io/dataset/base/decode.py on lines 28..28
              src/libertem/io/dataset/base/decode.py on lines 45..45
              src/libertem/io/dataset/base/decode.py on lines 46..46
              src/libertem/io/dataset/base/decode.py on lines 47..47
              src/libertem/io/dataset/base/decode.py on lines 48..48
              src/libertem/io/dataset/base/decode.py on lines 49..49
              src/libertem/io/dataset/base/decode.py on lines 50..50
              src/libertem/io/dataset/base/decode.py on lines 51..51

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

              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

                      out[i * 8 + 4] = inp[i * 8 + 3]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 10..10
              src/libertem/io/dataset/base/decode.py on lines 11..11
              src/libertem/io/dataset/base/decode.py on lines 25..25
              src/libertem/io/dataset/base/decode.py on lines 26..26
              src/libertem/io/dataset/base/decode.py on lines 27..27
              src/libertem/io/dataset/base/decode.py on lines 28..28
              src/libertem/io/dataset/base/decode.py on lines 44..44
              src/libertem/io/dataset/base/decode.py on lines 45..45
              src/libertem/io/dataset/base/decode.py on lines 46..46
              src/libertem/io/dataset/base/decode.py on lines 48..48
              src/libertem/io/dataset/base/decode.py on lines 49..49
              src/libertem/io/dataset/base/decode.py on lines 50..50
              src/libertem/io/dataset/base/decode.py on lines 51..51

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

              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

                      out[i * 8 + 0] = inp[i * 8 + 7]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 10..10
              src/libertem/io/dataset/base/decode.py on lines 11..11
              src/libertem/io/dataset/base/decode.py on lines 25..25
              src/libertem/io/dataset/base/decode.py on lines 26..26
              src/libertem/io/dataset/base/decode.py on lines 27..27
              src/libertem/io/dataset/base/decode.py on lines 28..28
              src/libertem/io/dataset/base/decode.py on lines 44..44
              src/libertem/io/dataset/base/decode.py on lines 45..45
              src/libertem/io/dataset/base/decode.py on lines 46..46
              src/libertem/io/dataset/base/decode.py on lines 47..47
              src/libertem/io/dataset/base/decode.py on lines 48..48
              src/libertem/io/dataset/base/decode.py on lines 49..49
              src/libertem/io/dataset/base/decode.py on lines 50..50

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

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

                  def _try_read_bitdepth(metadata: tuple[str, ...]) -> str:
                      """
                      Try to extract a bitdepth from the metadata items
                      using the key in the post-header section of the file
                      like:
              Severity: Minor
              Found in src/libertem/io/dataset/blo.py - About 1 hr 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

                      out[i * 2 + 0] = inp[i * 2 + 1]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 11..11
              src/libertem/io/dataset/base/decode.py on lines 25..25
              src/libertem/io/dataset/base/decode.py on lines 26..26
              src/libertem/io/dataset/base/decode.py on lines 27..27
              src/libertem/io/dataset/base/decode.py on lines 28..28
              src/libertem/io/dataset/base/decode.py on lines 44..44
              src/libertem/io/dataset/base/decode.py on lines 45..45
              src/libertem/io/dataset/base/decode.py on lines 46..46
              src/libertem/io/dataset/base/decode.py on lines 47..47
              src/libertem/io/dataset/base/decode.py on lines 48..48
              src/libertem/io/dataset/base/decode.py on lines 49..49
              src/libertem/io/dataset/base/decode.py on lines 50..50
              src/libertem/io/dataset/base/decode.py on lines 51..51

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

              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

                      out[i * 4 + 1] = inp[i * 4 + 2]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 10..10
              src/libertem/io/dataset/base/decode.py on lines 11..11
              src/libertem/io/dataset/base/decode.py on lines 25..25
              src/libertem/io/dataset/base/decode.py on lines 26..26
              src/libertem/io/dataset/base/decode.py on lines 28..28
              src/libertem/io/dataset/base/decode.py on lines 44..44
              src/libertem/io/dataset/base/decode.py on lines 45..45
              src/libertem/io/dataset/base/decode.py on lines 46..46
              src/libertem/io/dataset/base/decode.py on lines 47..47
              src/libertem/io/dataset/base/decode.py on lines 48..48
              src/libertem/io/dataset/base/decode.py on lines 49..49
              src/libertem/io/dataset/base/decode.py on lines 50..50
              src/libertem/io/dataset/base/decode.py on lines 51..51

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

              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

                      out[i * 2 + 1] = inp[i * 2 + 0]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 10..10
              src/libertem/io/dataset/base/decode.py on lines 25..25
              src/libertem/io/dataset/base/decode.py on lines 26..26
              src/libertem/io/dataset/base/decode.py on lines 27..27
              src/libertem/io/dataset/base/decode.py on lines 28..28
              src/libertem/io/dataset/base/decode.py on lines 44..44
              src/libertem/io/dataset/base/decode.py on lines 45..45
              src/libertem/io/dataset/base/decode.py on lines 46..46
              src/libertem/io/dataset/base/decode.py on lines 47..47
              src/libertem/io/dataset/base/decode.py on lines 48..48
              src/libertem/io/dataset/base/decode.py on lines 49..49
              src/libertem/io/dataset/base/decode.py on lines 50..50
              src/libertem/io/dataset/base/decode.py on lines 51..51

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

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

                  def _set_sync_offset(self):
                      self._num_frames_w_shutter_active_flag_set = _get_num_frames_w_shutter_active_flag_set(
                          self._get_syncer(do_sync=False)
                      )
                      self._native_sync_offset = self._image_count - self._num_frames_w_shutter_active_flag_set
              Severity: Minor
              Found in src/libertem/io/dataset/k2is.py - About 1 hr 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

                      out[i * 4 + 2] = inp[i * 4 + 1]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 10..10
              src/libertem/io/dataset/base/decode.py on lines 11..11
              src/libertem/io/dataset/base/decode.py on lines 25..25
              src/libertem/io/dataset/base/decode.py on lines 27..27
              src/libertem/io/dataset/base/decode.py on lines 28..28
              src/libertem/io/dataset/base/decode.py on lines 44..44
              src/libertem/io/dataset/base/decode.py on lines 45..45
              src/libertem/io/dataset/base/decode.py on lines 46..46
              src/libertem/io/dataset/base/decode.py on lines 47..47
              src/libertem/io/dataset/base/decode.py on lines 48..48
              src/libertem/io/dataset/base/decode.py on lines 49..49
              src/libertem/io/dataset/base/decode.py on lines 50..50
              src/libertem/io/dataset/base/decode.py on lines 51..51

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

              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

                      out[i * 8 + 6] = inp[i * 8 + 1]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 10..10
              src/libertem/io/dataset/base/decode.py on lines 11..11
              src/libertem/io/dataset/base/decode.py on lines 25..25
              src/libertem/io/dataset/base/decode.py on lines 26..26
              src/libertem/io/dataset/base/decode.py on lines 27..27
              src/libertem/io/dataset/base/decode.py on lines 28..28
              src/libertem/io/dataset/base/decode.py on lines 44..44
              src/libertem/io/dataset/base/decode.py on lines 46..46
              src/libertem/io/dataset/base/decode.py on lines 47..47
              src/libertem/io/dataset/base/decode.py on lines 48..48
              src/libertem/io/dataset/base/decode.py on lines 49..49
              src/libertem/io/dataset/base/decode.py on lines 50..50
              src/libertem/io/dataset/base/decode.py on lines 51..51

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

              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

                      out[i * 8 + 3] = inp[i * 8 + 4]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 10..10
              src/libertem/io/dataset/base/decode.py on lines 11..11
              src/libertem/io/dataset/base/decode.py on lines 25..25
              src/libertem/io/dataset/base/decode.py on lines 26..26
              src/libertem/io/dataset/base/decode.py on lines 27..27
              src/libertem/io/dataset/base/decode.py on lines 28..28
              src/libertem/io/dataset/base/decode.py on lines 44..44
              src/libertem/io/dataset/base/decode.py on lines 45..45
              src/libertem/io/dataset/base/decode.py on lines 46..46
              src/libertem/io/dataset/base/decode.py on lines 47..47
              src/libertem/io/dataset/base/decode.py on lines 49..49
              src/libertem/io/dataset/base/decode.py on lines 50..50
              src/libertem/io/dataset/base/decode.py on lines 51..51

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

              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

                      out[i * 4 + 0] = inp[i * 4 + 3]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 10..10
              src/libertem/io/dataset/base/decode.py on lines 11..11
              src/libertem/io/dataset/base/decode.py on lines 25..25
              src/libertem/io/dataset/base/decode.py on lines 26..26
              src/libertem/io/dataset/base/decode.py on lines 27..27
              src/libertem/io/dataset/base/decode.py on lines 44..44
              src/libertem/io/dataset/base/decode.py on lines 45..45
              src/libertem/io/dataset/base/decode.py on lines 46..46
              src/libertem/io/dataset/base/decode.py on lines 47..47
              src/libertem/io/dataset/base/decode.py on lines 48..48
              src/libertem/io/dataset/base/decode.py on lines 49..49
              src/libertem/io/dataset/base/decode.py on lines 50..50
              src/libertem/io/dataset/base/decode.py on lines 51..51

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

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

              const FFTAnalysis: React.FC<CompoundAnalysisProps> = ({ compoundAnalysis, dataset }) => {
                  const { shape } = dataset.params;
                  const [scanHeight, scanWidth, imageHeight, imageWidth] = shape;
                  const minLength = Math.min(imageWidth, imageHeight);
              
              
              Severity: Minor
              Found in client/src/compoundAnalysis/components/FFTAnalysis.tsx - About 1 hr 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

                      out[i * 8 + 1] = inp[i * 8 + 6]
              Severity: Major
              Found in src/libertem/io/dataset/base/decode.py and 13 other locations - About 1 hr to fix
              src/libertem/io/dataset/base/decode.py on lines 10..10
              src/libertem/io/dataset/base/decode.py on lines 11..11
              src/libertem/io/dataset/base/decode.py on lines 25..25
              src/libertem/io/dataset/base/decode.py on lines 26..26
              src/libertem/io/dataset/base/decode.py on lines 27..27
              src/libertem/io/dataset/base/decode.py on lines 28..28
              src/libertem/io/dataset/base/decode.py on lines 44..44
              src/libertem/io/dataset/base/decode.py on lines 45..45
              src/libertem/io/dataset/base/decode.py on lines 46..46
              src/libertem/io/dataset/base/decode.py on lines 47..47
              src/libertem/io/dataset/base/decode.py on lines 48..48
              src/libertem/io/dataset/base/decode.py on lines 49..49
              src/libertem/io/dataset/base/decode.py on lines 51..51

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

              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 render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  public render() {
                      return (
                          <Modal
                              trigger={
                                  <Button
              Severity: Minor
              Found in client/src/shutdown/components/ShutdownButton.tsx - About 1 hr to fix

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

                    useRoiPicker({
                        enabled: frameMode === DefaultModes.SUM && doAutoStart,
                        scanWidth, scanHeight,
                        analysisIndex: 0,
                        compoundAnalysisId,
                Severity: Major
                Found in client/src/compoundAnalysis/components/DefaultFrameView.tsx and 1 other location - About 1 hr to fix
                client/src/compoundAnalysis/components/DefaultFrameView.tsx on lines 124..131

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

                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

                    useRoiPicker({
                        enabled: frameMode === DefaultModes.SD && doAutoStart,
                        scanWidth, scanHeight,
                        analysisIndex: 0,
                        compoundAnalysisId,
                Severity: Major
                Found in client/src/compoundAnalysis/components/DefaultFrameView.tsx and 1 other location - About 1 hr to fix
                client/src/compoundAnalysis/components/DefaultFrameView.tsx on lines 133..140

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

                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