LiberTEM/LiberTEM

View on GitHub

Showing 902 of 903 total issues

Similar blocks of code found in 13 locations. Consider refactoring.
Open

type DatasetParamsRawForForm = Omit<DatasetParamsRaw,
    "type"
    | "path"
    | "nav_shape"
    | "sig_shape"> & {
Severity: Major
Found in client/src/dataset/components/RawFileParamsForm.tsx and 12 other locations - About 35 mins to fix
client/src/dataset/components/BLOParamsForm.tsx on lines 12..19
client/src/dataset/components/DMParamsForm.tsx on lines 12..19
client/src/dataset/components/EMPADParamsForm.tsx on lines 12..19
client/src/dataset/components/FRMS6ParamsForm.tsx on lines 12..19
client/src/dataset/components/K2ISParamsForm.tsx on lines 12..19
client/src/dataset/components/MIBParamsForm.tsx on lines 12..19
client/src/dataset/components/MRCParamsForm.tsx on lines 11..18
client/src/dataset/components/NPYParamsForm.tsx on lines 12..19
client/src/dataset/components/RawCSRParamsForm.tsx on lines 11..18
client/src/dataset/components/SEQParamsForm.tsx on lines 12..19
client/src/dataset/components/SERParamsForm.tsx on lines 11..18
client/src/dataset/components/TVIPSParamsForm.tsx on lines 12..19

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

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 13 locations. Consider refactoring.
Open

type DatasetParamsNPYForForm = Omit<DatasetParamsNPY,
    "type"
    | "path"
    | "nav_shape"
    | "sig_shape"> & {
Severity: Major
Found in client/src/dataset/components/NPYParamsForm.tsx and 12 other locations - About 35 mins to fix
client/src/dataset/components/BLOParamsForm.tsx on lines 12..19
client/src/dataset/components/DMParamsForm.tsx on lines 12..19
client/src/dataset/components/EMPADParamsForm.tsx on lines 12..19
client/src/dataset/components/FRMS6ParamsForm.tsx on lines 12..19
client/src/dataset/components/K2ISParamsForm.tsx on lines 12..19
client/src/dataset/components/MIBParamsForm.tsx on lines 12..19
client/src/dataset/components/MRCParamsForm.tsx on lines 11..18
client/src/dataset/components/RawCSRParamsForm.tsx on lines 11..18
client/src/dataset/components/RawFileParamsForm.tsx on lines 12..19
client/src/dataset/components/SEQParamsForm.tsx on lines 12..19
client/src/dataset/components/SERParamsForm.tsx on lines 11..18
client/src/dataset/components/TVIPSParamsForm.tsx on lines 12..19

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

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 13 locations. Consider refactoring.
Open

type DatasetParamsRawCSRForForm = Omit<DatasetParamsRawCSR,
    "type"
    | "path"
    | "nav_shape"
    | "sig_shape"> & {
Severity: Major
Found in client/src/dataset/components/RawCSRParamsForm.tsx and 12 other locations - About 35 mins to fix
client/src/dataset/components/BLOParamsForm.tsx on lines 12..19
client/src/dataset/components/DMParamsForm.tsx on lines 12..19
client/src/dataset/components/EMPADParamsForm.tsx on lines 12..19
client/src/dataset/components/FRMS6ParamsForm.tsx on lines 12..19
client/src/dataset/components/K2ISParamsForm.tsx on lines 12..19
client/src/dataset/components/MIBParamsForm.tsx on lines 12..19
client/src/dataset/components/MRCParamsForm.tsx on lines 11..18
client/src/dataset/components/NPYParamsForm.tsx on lines 12..19
client/src/dataset/components/RawFileParamsForm.tsx on lines 12..19
client/src/dataset/components/SEQParamsForm.tsx on lines 12..19
client/src/dataset/components/SERParamsForm.tsx on lines 11..18
client/src/dataset/components/TVIPSParamsForm.tsx on lines 12..19

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

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 13 locations. Consider refactoring.
Open

type DatasetParamsMIBForForm = Omit<DatasetParamsMIB,
    "type"
    | "path"
    | "nav_shape"
    | "sig_shape"> & {
Severity: Major
Found in client/src/dataset/components/MIBParamsForm.tsx and 12 other locations - About 35 mins to fix
client/src/dataset/components/BLOParamsForm.tsx on lines 12..19
client/src/dataset/components/DMParamsForm.tsx on lines 12..19
client/src/dataset/components/EMPADParamsForm.tsx on lines 12..19
client/src/dataset/components/FRMS6ParamsForm.tsx on lines 12..19
client/src/dataset/components/K2ISParamsForm.tsx on lines 12..19
client/src/dataset/components/MRCParamsForm.tsx on lines 11..18
client/src/dataset/components/NPYParamsForm.tsx on lines 12..19
client/src/dataset/components/RawCSRParamsForm.tsx on lines 11..18
client/src/dataset/components/RawFileParamsForm.tsx on lines 12..19
client/src/dataset/components/SEQParamsForm.tsx on lines 12..19
client/src/dataset/components/SERParamsForm.tsx on lines 11..18
client/src/dataset/components/TVIPSParamsForm.tsx on lines 12..19

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

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 13 locations. Consider refactoring.
Open

type DatasetParamsBLOForForm = Omit<DatasetParamsBLO,
    "type"
    | "path"
    | "nav_shape"
    | "sig_shape"> & {
Severity: Major
Found in client/src/dataset/components/BLOParamsForm.tsx and 12 other locations - About 35 mins to fix
client/src/dataset/components/DMParamsForm.tsx on lines 12..19
client/src/dataset/components/EMPADParamsForm.tsx on lines 12..19
client/src/dataset/components/FRMS6ParamsForm.tsx on lines 12..19
client/src/dataset/components/K2ISParamsForm.tsx on lines 12..19
client/src/dataset/components/MIBParamsForm.tsx on lines 12..19
client/src/dataset/components/MRCParamsForm.tsx on lines 11..18
client/src/dataset/components/NPYParamsForm.tsx on lines 12..19
client/src/dataset/components/RawCSRParamsForm.tsx on lines 11..18
client/src/dataset/components/RawFileParamsForm.tsx on lines 12..19
client/src/dataset/components/SEQParamsForm.tsx on lines 12..19
client/src/dataset/components/SERParamsForm.tsx on lines 11..18
client/src/dataset/components/TVIPSParamsForm.tsx on lines 12..19

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

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 13 locations. Consider refactoring.
Open

type DatasetParamsDMForForm = Omit<DatasetParamsDM,
    "type"
    | "path"
    | "nav_shape"
    | "sig_shape"> & {
Severity: Major
Found in client/src/dataset/components/DMParamsForm.tsx and 12 other locations - About 35 mins to fix
client/src/dataset/components/BLOParamsForm.tsx on lines 12..19
client/src/dataset/components/EMPADParamsForm.tsx on lines 12..19
client/src/dataset/components/FRMS6ParamsForm.tsx on lines 12..19
client/src/dataset/components/K2ISParamsForm.tsx on lines 12..19
client/src/dataset/components/MIBParamsForm.tsx on lines 12..19
client/src/dataset/components/MRCParamsForm.tsx on lines 11..18
client/src/dataset/components/NPYParamsForm.tsx on lines 12..19
client/src/dataset/components/RawCSRParamsForm.tsx on lines 11..18
client/src/dataset/components/RawFileParamsForm.tsx on lines 12..19
client/src/dataset/components/SEQParamsForm.tsx on lines 12..19
client/src/dataset/components/SERParamsForm.tsx on lines 11..18
client/src/dataset/components/TVIPSParamsForm.tsx on lines 12..19

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

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 13 locations. Consider refactoring.
Open

type DatasetParamsSERForForm = Omit<DatasetParamsSER,
    "type"
    | "path"
    | "nav_shape"
    | "sig_shape"> & {
Severity: Major
Found in client/src/dataset/components/SERParamsForm.tsx and 12 other locations - About 35 mins to fix
client/src/dataset/components/BLOParamsForm.tsx on lines 12..19
client/src/dataset/components/DMParamsForm.tsx on lines 12..19
client/src/dataset/components/EMPADParamsForm.tsx on lines 12..19
client/src/dataset/components/FRMS6ParamsForm.tsx on lines 12..19
client/src/dataset/components/K2ISParamsForm.tsx on lines 12..19
client/src/dataset/components/MIBParamsForm.tsx on lines 12..19
client/src/dataset/components/MRCParamsForm.tsx on lines 11..18
client/src/dataset/components/NPYParamsForm.tsx on lines 12..19
client/src/dataset/components/RawCSRParamsForm.tsx on lines 11..18
client/src/dataset/components/RawFileParamsForm.tsx on lines 12..19
client/src/dataset/components/SEQParamsForm.tsx on lines 12..19
client/src/dataset/components/TVIPSParamsForm.tsx on lines 12..19

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

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 13 locations. Consider refactoring.
Open

type DatasetParamsK2ISForForm = Omit<DatasetParamsK2IS,
    "type"
    | "path"
    | "nav_shape"
    | "sig_shape"> & {
Severity: Major
Found in client/src/dataset/components/K2ISParamsForm.tsx and 12 other locations - About 35 mins to fix
client/src/dataset/components/BLOParamsForm.tsx on lines 12..19
client/src/dataset/components/DMParamsForm.tsx on lines 12..19
client/src/dataset/components/EMPADParamsForm.tsx on lines 12..19
client/src/dataset/components/FRMS6ParamsForm.tsx on lines 12..19
client/src/dataset/components/MIBParamsForm.tsx on lines 12..19
client/src/dataset/components/MRCParamsForm.tsx on lines 11..18
client/src/dataset/components/NPYParamsForm.tsx on lines 12..19
client/src/dataset/components/RawCSRParamsForm.tsx on lines 11..18
client/src/dataset/components/RawFileParamsForm.tsx on lines 12..19
client/src/dataset/components/SEQParamsForm.tsx on lines 12..19
client/src/dataset/components/SERParamsForm.tsx on lines 11..18
client/src/dataset/components/TVIPSParamsForm.tsx on lines 12..19

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

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 13 locations. Consider refactoring.
Open

type DatasetParamsEMPADForForm = Omit<DatasetParamsEMPAD,
    "type"
    | "path"
    | "nav_shape"
    | "sig_shape"> & {
Severity: Major
Found in client/src/dataset/components/EMPADParamsForm.tsx and 12 other locations - About 35 mins to fix
client/src/dataset/components/BLOParamsForm.tsx on lines 12..19
client/src/dataset/components/DMParamsForm.tsx on lines 12..19
client/src/dataset/components/FRMS6ParamsForm.tsx on lines 12..19
client/src/dataset/components/K2ISParamsForm.tsx on lines 12..19
client/src/dataset/components/MIBParamsForm.tsx on lines 12..19
client/src/dataset/components/MRCParamsForm.tsx on lines 11..18
client/src/dataset/components/NPYParamsForm.tsx on lines 12..19
client/src/dataset/components/RawCSRParamsForm.tsx on lines 11..18
client/src/dataset/components/RawFileParamsForm.tsx on lines 12..19
client/src/dataset/components/SEQParamsForm.tsx on lines 12..19
client/src/dataset/components/SERParamsForm.tsx on lines 11..18
client/src/dataset/components/TVIPSParamsForm.tsx on lines 12..19

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

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 13 locations. Consider refactoring.
Open

type DatasetParamsSEQForForm = Omit<DatasetParamsSEQ,
    "type"
    | "path"
    | "nav_shape"
    | "sig_shape"> & {
Severity: Major
Found in client/src/dataset/components/SEQParamsForm.tsx and 12 other locations - About 35 mins to fix
client/src/dataset/components/BLOParamsForm.tsx on lines 12..19
client/src/dataset/components/DMParamsForm.tsx on lines 12..19
client/src/dataset/components/EMPADParamsForm.tsx on lines 12..19
client/src/dataset/components/FRMS6ParamsForm.tsx on lines 12..19
client/src/dataset/components/K2ISParamsForm.tsx on lines 12..19
client/src/dataset/components/MIBParamsForm.tsx on lines 12..19
client/src/dataset/components/MRCParamsForm.tsx on lines 11..18
client/src/dataset/components/NPYParamsForm.tsx on lines 12..19
client/src/dataset/components/RawCSRParamsForm.tsx on lines 11..18
client/src/dataset/components/RawFileParamsForm.tsx on lines 12..19
client/src/dataset/components/SERParamsForm.tsx on lines 11..18
client/src/dataset/components/TVIPSParamsForm.tsx on lines 12..19

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

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

    const localSettings: LocalConfig = {
        cwd: config.cwd,
        lastOpened: config.lastOpened,
        fileHistory: config.fileHistory,
        lastConnection: config.lastConnection,
Severity: Minor
Found in client/src/config/helpers.ts and 1 other location - About 35 mins to fix
client/src/compoundAnalysis/components/Download.tsx on lines 109..115

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

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

            setNotebook({
                dependency: CurrentNotebook.dependency,
                initial_setup: CurrentNotebook.initial_setup,
                ctx: CurrentNotebook.ctx,
                dataset: CurrentNotebook.dataset,
Severity: Minor
Found in client/src/compoundAnalysis/components/Download.tsx and 1 other location - About 35 mins to fix
client/src/config/helpers.ts on lines 25..31

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

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

def exclude_pixels(sig_dims, num_excluded):
    '''
    Generate a list of excluded pixels that
    can be reconstructed faithfully from their neighbors
    in a linear gradient dataset
Severity: Minor
Found in src/libertem/utils/generate.py - About 35 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 hologram_frame has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def hologram_frame(amp, phi,
                   counts=1000.,
                   sampling=5.,
                   visibility=1.,
                   f_angle=30.,
Severity: Minor
Found in src/libertem/utils/generate.py - About 35 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 assign_cudas has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def assign_cudas(cudas: Union[int, Iterable[int]]) -> Iterable[int]:
    """
    Takes the cudas argument to :code:`cluster_spec` and
    converts it into a properly formatted iterable of CUDA
    device ids
Severity: Minor
Found in src/libertem/executor/utils/__init__.py - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def get(self, block: bool = True, timeout: Optional[float] = None):
        """
        Receive a message. Memory of the payload will be cleaned up after the
        context manager scope, so don't keep references outside of it!

Severity: Minor
Found in src/libertem/executor/utils/shmqueue.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, path, tileshape=None, scan_size=None, disable_glob=False,
                 nav_shape=None, sig_shape=None, sync_offset=0, io_backend=None):
        super().__init__(io_backend=io_backend)
        self._sig_dims = 2
        self._path = str(path)
Severity: Minor
Found in src/libertem/io/dataset/mib.py - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function get_generic_results has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def get_generic_results(self, img_sum, img_y, img_x, damage):
        from libertem.viz import CMAP_CIRCULAR_DEFAULT, visualize_simple
        ref_x = self.parameters["cx"]
        ref_y = self.parameters["cy"]
        y_centers_raw, x_centers_raw = center_shifts(img_sum, img_y, img_x, ref_y, ref_x)
Severity: Minor
Found in src/libertem/analysis/com.py - About 35 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 detect_params has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def detect_params(cls, path: str, executor):
        pathlow = path.lower()
        if pathlow.endswith(".dm3") or pathlow.endswith(".dm4"):
            array_meta = executor.run_function(cls._read_metadata, path)
            sig_dims = array_meta['sig_dims']
Severity: Minor
Found in src/libertem/io/dataset/dm_single.py - About 35 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 _read_dataset_hdr has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _read_dataset_hdr(fname):
    if not os.path.exists(fname):
        raise DataSetException(
            "Could not find .hdr file {}".format(
                fname,
Severity: Minor
Found in src/libertem/io/dataset/frms6.py - About 35 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

Severity
Category
Status
Source
Language