LiberTEM/LiberTEM

View on GitHub

Showing 902 of 903 total issues

Cyclomatic complexity is too high in function cluster_spec. (12)
Open

def cluster_spec(
    cpus: Union[int, Iterable[int]],
    cudas: Union[int, Iterable[int]],
    has_cupy: bool,
    name: str = 'default',
Severity: Minor
Found in src/libertem/executor/dask.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Cyclomatic complexity is too high in method make_local. (12)
Open

    @classmethod
    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 by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Cyclomatic complexity is too high in method validate. (12)
Open

    def validate(
        self,
        shape: tuple[int, ...],
        ds_sig_shape: tuple[int, ...],
        size: int,

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Cyclomatic complexity is too high in method _run_tile. (12)
Open

    def _run_tile(
        self,
        udfs_and_methods: Iterable[
            tuple[
                UDF,
Severity: Minor
Found in src/libertem/udf/base.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

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

        case DatasetTypes.MRC: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<MRCParamsForm {...commonParams} initial={initial} info={info} />);
        }
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 169..173
client/src/dataset/components/DatasetOpen.tsx on lines 174..178
client/src/dataset/components/DatasetOpen.tsx on lines 179..183
client/src/dataset/components/DatasetOpen.tsx on lines 184..188
client/src/dataset/components/DatasetOpen.tsx on lines 189..193
client/src/dataset/components/DatasetOpen.tsx on lines 194..198
client/src/dataset/components/DatasetOpen.tsx on lines 199..203
client/src/dataset/components/DatasetOpen.tsx on lines 204..208
client/src/dataset/components/DatasetOpen.tsx on lines 209..213
client/src/dataset/components/DatasetOpen.tsx on lines 214..218
client/src/dataset/components/DatasetOpen.tsx on lines 224..228
client/src/dataset/components/DatasetOpen.tsx on lines 229..233
client/src/dataset/components/DatasetOpen.tsx on lines 234..238

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

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

        case DatasetTypes.RAW: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<RawFileParamsForm {...commonParams} initial={initial} info={info} />);
        }
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 169..173
client/src/dataset/components/DatasetOpen.tsx on lines 179..183
client/src/dataset/components/DatasetOpen.tsx on lines 184..188
client/src/dataset/components/DatasetOpen.tsx on lines 189..193
client/src/dataset/components/DatasetOpen.tsx on lines 194..198
client/src/dataset/components/DatasetOpen.tsx on lines 199..203
client/src/dataset/components/DatasetOpen.tsx on lines 204..208
client/src/dataset/components/DatasetOpen.tsx on lines 209..213
client/src/dataset/components/DatasetOpen.tsx on lines 214..218
client/src/dataset/components/DatasetOpen.tsx on lines 219..223
client/src/dataset/components/DatasetOpen.tsx on lines 224..228
client/src/dataset/components/DatasetOpen.tsx on lines 229..233
client/src/dataset/components/DatasetOpen.tsx on lines 234..238

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

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

        case DatasetTypes.NPY: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<NPYParamsForm {...commonParams} initial={initial} info={info} />);
        }
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 169..173
client/src/dataset/components/DatasetOpen.tsx on lines 174..178
client/src/dataset/components/DatasetOpen.tsx on lines 179..183
client/src/dataset/components/DatasetOpen.tsx on lines 189..193
client/src/dataset/components/DatasetOpen.tsx on lines 194..198
client/src/dataset/components/DatasetOpen.tsx on lines 199..203
client/src/dataset/components/DatasetOpen.tsx on lines 204..208
client/src/dataset/components/DatasetOpen.tsx on lines 209..213
client/src/dataset/components/DatasetOpen.tsx on lines 214..218
client/src/dataset/components/DatasetOpen.tsx on lines 219..223
client/src/dataset/components/DatasetOpen.tsx on lines 224..228
client/src/dataset/components/DatasetOpen.tsx on lines 229..233
client/src/dataset/components/DatasetOpen.tsx on lines 234..238

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

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

        case DatasetTypes.FRMS6: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<FRMS6ParamsForm {...commonParams} initial={initial} info={info} />);
        }
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 169..173
client/src/dataset/components/DatasetOpen.tsx on lines 174..178
client/src/dataset/components/DatasetOpen.tsx on lines 179..183
client/src/dataset/components/DatasetOpen.tsx on lines 184..188
client/src/dataset/components/DatasetOpen.tsx on lines 189..193
client/src/dataset/components/DatasetOpen.tsx on lines 194..198
client/src/dataset/components/DatasetOpen.tsx on lines 199..203
client/src/dataset/components/DatasetOpen.tsx on lines 209..213
client/src/dataset/components/DatasetOpen.tsx on lines 214..218
client/src/dataset/components/DatasetOpen.tsx on lines 219..223
client/src/dataset/components/DatasetOpen.tsx on lines 224..228
client/src/dataset/components/DatasetOpen.tsx on lines 229..233
client/src/dataset/components/DatasetOpen.tsx on lines 234..238

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

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

        case DatasetTypes.TVIPS: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<TVIPSParamsForm {...commonParams} initial={initial} info={info} />);
        }
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 169..173
client/src/dataset/components/DatasetOpen.tsx on lines 174..178
client/src/dataset/components/DatasetOpen.tsx on lines 179..183
client/src/dataset/components/DatasetOpen.tsx on lines 184..188
client/src/dataset/components/DatasetOpen.tsx on lines 189..193
client/src/dataset/components/DatasetOpen.tsx on lines 194..198
client/src/dataset/components/DatasetOpen.tsx on lines 199..203
client/src/dataset/components/DatasetOpen.tsx on lines 204..208
client/src/dataset/components/DatasetOpen.tsx on lines 209..213
client/src/dataset/components/DatasetOpen.tsx on lines 214..218
client/src/dataset/components/DatasetOpen.tsx on lines 219..223
client/src/dataset/components/DatasetOpen.tsx on lines 229..233
client/src/dataset/components/DatasetOpen.tsx on lines 234..238

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

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

        case DatasetTypes.DM: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<DMParamsForm {...commonParams} initial={initial} info={info} />);
        }
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 169..173
client/src/dataset/components/DatasetOpen.tsx on lines 174..178
client/src/dataset/components/DatasetOpen.tsx on lines 179..183
client/src/dataset/components/DatasetOpen.tsx on lines 184..188
client/src/dataset/components/DatasetOpen.tsx on lines 189..193
client/src/dataset/components/DatasetOpen.tsx on lines 194..198
client/src/dataset/components/DatasetOpen.tsx on lines 199..203
client/src/dataset/components/DatasetOpen.tsx on lines 204..208
client/src/dataset/components/DatasetOpen.tsx on lines 209..213
client/src/dataset/components/DatasetOpen.tsx on lines 214..218
client/src/dataset/components/DatasetOpen.tsx on lines 219..223
client/src/dataset/components/DatasetOpen.tsx on lines 224..228
client/src/dataset/components/DatasetOpen.tsx on lines 229..233

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

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

        case DatasetTypes.SER: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<SERParamsForm {...commonParams} initial={initial} info={info} />);
        }
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 169..173
client/src/dataset/components/DatasetOpen.tsx on lines 174..178
client/src/dataset/components/DatasetOpen.tsx on lines 179..183
client/src/dataset/components/DatasetOpen.tsx on lines 184..188
client/src/dataset/components/DatasetOpen.tsx on lines 189..193
client/src/dataset/components/DatasetOpen.tsx on lines 194..198
client/src/dataset/components/DatasetOpen.tsx on lines 204..208
client/src/dataset/components/DatasetOpen.tsx on lines 209..213
client/src/dataset/components/DatasetOpen.tsx on lines 214..218
client/src/dataset/components/DatasetOpen.tsx on lines 219..223
client/src/dataset/components/DatasetOpen.tsx on lines 224..228
client/src/dataset/components/DatasetOpen.tsx on lines 229..233
client/src/dataset/components/DatasetOpen.tsx on lines 234..238

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

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

        case DatasetTypes.EMPAD: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<EMPADParamsForm {...commonParams} initial={initial} info={info} />)
        }
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 169..173
client/src/dataset/components/DatasetOpen.tsx on lines 174..178
client/src/dataset/components/DatasetOpen.tsx on lines 179..183
client/src/dataset/components/DatasetOpen.tsx on lines 184..188
client/src/dataset/components/DatasetOpen.tsx on lines 189..193
client/src/dataset/components/DatasetOpen.tsx on lines 194..198
client/src/dataset/components/DatasetOpen.tsx on lines 199..203
client/src/dataset/components/DatasetOpen.tsx on lines 204..208
client/src/dataset/components/DatasetOpen.tsx on lines 214..218
client/src/dataset/components/DatasetOpen.tsx on lines 219..223
client/src/dataset/components/DatasetOpen.tsx on lines 224..228
client/src/dataset/components/DatasetOpen.tsx on lines 229..233
client/src/dataset/components/DatasetOpen.tsx on lines 234..238

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

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

        case DatasetTypes.BLO: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<BLOParamsForm {...commonParams} initial={initial} info={info} />);
        }
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 169..173
client/src/dataset/components/DatasetOpen.tsx on lines 174..178
client/src/dataset/components/DatasetOpen.tsx on lines 179..183
client/src/dataset/components/DatasetOpen.tsx on lines 184..188
client/src/dataset/components/DatasetOpen.tsx on lines 194..198
client/src/dataset/components/DatasetOpen.tsx on lines 199..203
client/src/dataset/components/DatasetOpen.tsx on lines 204..208
client/src/dataset/components/DatasetOpen.tsx on lines 209..213
client/src/dataset/components/DatasetOpen.tsx on lines 214..218
client/src/dataset/components/DatasetOpen.tsx on lines 219..223
client/src/dataset/components/DatasetOpen.tsx on lines 224..228
client/src/dataset/components/DatasetOpen.tsx on lines 229..233
client/src/dataset/components/DatasetOpen.tsx on lines 234..238

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

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

        case DatasetTypes.MIB: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<MIBParamsForm {...commonParams} initial={initial} info={info} />);
        }
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 169..173
client/src/dataset/components/DatasetOpen.tsx on lines 174..178
client/src/dataset/components/DatasetOpen.tsx on lines 184..188
client/src/dataset/components/DatasetOpen.tsx on lines 189..193
client/src/dataset/components/DatasetOpen.tsx on lines 194..198
client/src/dataset/components/DatasetOpen.tsx on lines 199..203
client/src/dataset/components/DatasetOpen.tsx on lines 204..208
client/src/dataset/components/DatasetOpen.tsx on lines 209..213
client/src/dataset/components/DatasetOpen.tsx on lines 214..218
client/src/dataset/components/DatasetOpen.tsx on lines 219..223
client/src/dataset/components/DatasetOpen.tsx on lines 224..228
client/src/dataset/components/DatasetOpen.tsx on lines 229..233
client/src/dataset/components/DatasetOpen.tsx on lines 234..238

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

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

        case DatasetTypes.SEQ: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<SEQParamsForm {...commonParams} initial={initial} info={info} />);
        }
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 169..173
client/src/dataset/components/DatasetOpen.tsx on lines 174..178
client/src/dataset/components/DatasetOpen.tsx on lines 179..183
client/src/dataset/components/DatasetOpen.tsx on lines 184..188
client/src/dataset/components/DatasetOpen.tsx on lines 189..193
client/src/dataset/components/DatasetOpen.tsx on lines 194..198
client/src/dataset/components/DatasetOpen.tsx on lines 199..203
client/src/dataset/components/DatasetOpen.tsx on lines 204..208
client/src/dataset/components/DatasetOpen.tsx on lines 209..213
client/src/dataset/components/DatasetOpen.tsx on lines 219..223
client/src/dataset/components/DatasetOpen.tsx on lines 224..228
client/src/dataset/components/DatasetOpen.tsx on lines 229..233
client/src/dataset/components/DatasetOpen.tsx on lines 234..238

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

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

        case DatasetTypes.HDF5: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<HDF5ParamsForm {...commonParams} initial={initial} info={info} />);
        }
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 174..178
client/src/dataset/components/DatasetOpen.tsx on lines 179..183
client/src/dataset/components/DatasetOpen.tsx on lines 184..188
client/src/dataset/components/DatasetOpen.tsx on lines 189..193
client/src/dataset/components/DatasetOpen.tsx on lines 194..198
client/src/dataset/components/DatasetOpen.tsx on lines 199..203
client/src/dataset/components/DatasetOpen.tsx on lines 204..208
client/src/dataset/components/DatasetOpen.tsx on lines 209..213
client/src/dataset/components/DatasetOpen.tsx on lines 214..218
client/src/dataset/components/DatasetOpen.tsx on lines 219..223
client/src/dataset/components/DatasetOpen.tsx on lines 224..228
client/src/dataset/components/DatasetOpen.tsx on lines 229..233
client/src/dataset/components/DatasetOpen.tsx on lines 234..238

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

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

        case DatasetTypes.K2IS: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<K2ISParamsForm {...commonParams} initial={initial} info={info} />);
        }
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 169..173
client/src/dataset/components/DatasetOpen.tsx on lines 174..178
client/src/dataset/components/DatasetOpen.tsx on lines 179..183
client/src/dataset/components/DatasetOpen.tsx on lines 184..188
client/src/dataset/components/DatasetOpen.tsx on lines 189..193
client/src/dataset/components/DatasetOpen.tsx on lines 199..203
client/src/dataset/components/DatasetOpen.tsx on lines 204..208
client/src/dataset/components/DatasetOpen.tsx on lines 209..213
client/src/dataset/components/DatasetOpen.tsx on lines 214..218
client/src/dataset/components/DatasetOpen.tsx on lines 219..223
client/src/dataset/components/DatasetOpen.tsx on lines 224..228
client/src/dataset/components/DatasetOpen.tsx on lines 229..233
client/src/dataset/components/DatasetOpen.tsx on lines 234..238

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

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

        case DatasetTypes.RAW_CSR: {
            const initial = formInitial && datasetType === formInitial.type ? formInitial : undefined;
            const info = formInfo && datasetType === formInfo.type ? formInfo : undefined;
            return renderForm(<RawCSRParamsForm {...commonParams} initial={initial} info={info} />);
        }        
Severity: Major
Found in client/src/dataset/components/DatasetOpen.tsx and 13 other locations - About 2 hrs to fix
client/src/dataset/components/DatasetOpen.tsx on lines 169..173
client/src/dataset/components/DatasetOpen.tsx on lines 174..178
client/src/dataset/components/DatasetOpen.tsx on lines 179..183
client/src/dataset/components/DatasetOpen.tsx on lines 184..188
client/src/dataset/components/DatasetOpen.tsx on lines 189..193
client/src/dataset/components/DatasetOpen.tsx on lines 194..198
client/src/dataset/components/DatasetOpen.tsx on lines 199..203
client/src/dataset/components/DatasetOpen.tsx on lines 204..208
client/src/dataset/components/DatasetOpen.tsx on lines 209..213
client/src/dataset/components/DatasetOpen.tsx on lines 214..218
client/src/dataset/components/DatasetOpen.tsx on lines 219..223
client/src/dataset/components/DatasetOpen.tsx on lines 224..228
client/src/dataset/components/DatasetOpen.tsx on lines 234..238

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

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

def decode_r1_swap_2x2(inp, out, idx, native_dtype, rr, origin, shape, ds_shape):
    """
    RAW 1bit format: each pixel is actually saved as a single bit. 64 bits
    need to be unpacked together. This is the quad variant.

Severity: Minor
Found in src/libertem/io/dataset/mib.py - About 2 hrs 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

    def merge_all(self, ordered_results):
        ''
        chunks = [b.logsum for b in ordered_results.values()]
        logsum = np.stack(chunks, axis=0).sum(axis=0)
        return {'logsum': logsum}
Severity: Major
Found in src/libertem/udf/logsum.py and 2 other locations - About 2 hrs to fix
src/libertem/udf/raw.py on lines 73..77
src/libertem/udf/sum.py on lines 54..58

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
Status
Source
Language