jhfjhfj1/autokeras

View on GitHub

Showing 115 of 151 total issues

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

def test_image_input_unsupported_type():
    x = "unknown"
    adapter = input_adapters.ImageAdapter()
    with pytest.raises(TypeError) as info:
        x = adapter.adapt(x, batch_size=32)
Severity: Major
Found in autokeras/adapters/input_adapters_test.py and 2 other locations - About 2 hrs to fix
autokeras/adapters/input_adapters_test.py on lines 47..52
autokeras/adapters/input_adapters_test.py on lines 92..97

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

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

def test_softmax_transform_dataset_doesnt_change():
    postprocessor = postprocessors.SoftmaxPostprocessor()
    dataset = tf.data.Dataset.from_tensor_slices([1, 2]).batch(32)

    assert postprocessor.transform(dataset) is dataset
Severity: Major
Found in autokeras/preprocessors/postprocessors_test.py and 1 other location - About 2 hrs to fix
autokeras/preprocessors/postprocessors_test.py on lines 30..34

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

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

    for data in dataset:
        assert data[0].numpy().shape == (32, 180, 180, 3)
        assert data[1].dtype == tf.string
        break
Severity: Major
Found in autokeras/utils/io_utils_test.py and 1 other location - About 2 hrs to fix
autokeras/utils/io_utils_test.py on lines 83..86

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

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

    for data in val_dataset:
        assert data[0].numpy().shape == (32, 180, 180, 3)
        assert data[1].dtype == tf.string
        break
Severity: Major
Found in autokeras/utils/io_utils_test.py and 1 other location - About 2 hrs to fix
autokeras/utils/io_utils_test.py on lines 78..81

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

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

def test_sigmoid_transform_dataset_doesnt_change():
    postprocessor = postprocessors.SigmoidPostprocessor()
    dataset = tf.data.Dataset.from_tensor_slices([1, 2]).batch(32)

    assert postprocessor.transform(dataset) is dataset
Severity: Major
Found in autokeras/preprocessors/postprocessors_test.py and 1 other location - About 2 hrs to fix
autokeras/preprocessors/postprocessors_test.py on lines 56..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 52.

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

        block_inputs = {
            str(block_id): [self._node_to_id[node] for node in block.inputs]
            for block_id, block in enumerate(self.blocks)
Severity: Major
Found in autokeras/graph.py and 1 other location - About 1 hr to fix
autokeras/graph.py on lines 174..176

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

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

        block_outputs = {
            str(block_id): [self._node_to_id[node] for node in block.outputs]
            for block_id, block in enumerate(self.blocks)
Severity: Major
Found in autokeras/graph.py and 1 other location - About 1 hr to fix
autokeras/graph.py on lines 170..172

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

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

def test_xception_get_config_has_all_attributes():
    block = blocks.XceptionBlock()

    config = block.get_config()

Severity: Major
Found in autokeras/blocks/basic_test.py and 11 other locations - About 1 hr to fix
autokeras/blocks/basic_test.py on lines 100..106
autokeras/blocks/basic_test.py on lines 228..234
autokeras/blocks/basic_test.py on lines 269..275
autokeras/blocks/basic_test.py on lines 324..330
autokeras/blocks/basic_test.py on lines 352..358
autokeras/blocks/preprocessing_test.py on lines 106..112
autokeras/blocks/reduction_test.py on lines 71..77
autokeras/blocks/reduction_test.py on lines 135..141
autokeras/blocks/reduction_test.py on lines 164..170
autokeras/blocks/wrapper_test.py on lines 87..93
autokeras/blocks/wrapper_test.py on lines 115..121

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

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

def test_merge_get_config_has_all_attributes():
    block = blocks.Merge()

    config = block.get_config()

Severity: Major
Found in autokeras/blocks/reduction_test.py and 11 other locations - About 1 hr to fix
autokeras/blocks/basic_test.py on lines 100..106
autokeras/blocks/basic_test.py on lines 177..183
autokeras/blocks/basic_test.py on lines 228..234
autokeras/blocks/basic_test.py on lines 269..275
autokeras/blocks/basic_test.py on lines 324..330
autokeras/blocks/basic_test.py on lines 352..358
autokeras/blocks/preprocessing_test.py on lines 106..112
autokeras/blocks/reduction_test.py on lines 135..141
autokeras/blocks/reduction_test.py on lines 164..170
autokeras/blocks/wrapper_test.py on lines 87..93
autokeras/blocks/wrapper_test.py on lines 115..121

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

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

def test_bert_get_config_has_all_attributes():
    block = blocks.BertBlock()

    config = block.get_config()

Severity: Major
Found in autokeras/blocks/basic_test.py and 11 other locations - About 1 hr to fix
autokeras/blocks/basic_test.py on lines 100..106
autokeras/blocks/basic_test.py on lines 177..183
autokeras/blocks/basic_test.py on lines 228..234
autokeras/blocks/basic_test.py on lines 269..275
autokeras/blocks/basic_test.py on lines 324..330
autokeras/blocks/preprocessing_test.py on lines 106..112
autokeras/blocks/reduction_test.py on lines 71..77
autokeras/blocks/reduction_test.py on lines 135..141
autokeras/blocks/reduction_test.py on lines 164..170
autokeras/blocks/wrapper_test.py on lines 87..93
autokeras/blocks/wrapper_test.py on lines 115..121

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

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

def test_image_get_config_has_all_attributes():
    block = blocks.ImageBlock()

    config = block.get_config()

Severity: Major
Found in autokeras/blocks/wrapper_test.py and 11 other locations - About 1 hr to fix
autokeras/blocks/basic_test.py on lines 100..106
autokeras/blocks/basic_test.py on lines 177..183
autokeras/blocks/basic_test.py on lines 228..234
autokeras/blocks/basic_test.py on lines 269..275
autokeras/blocks/basic_test.py on lines 324..330
autokeras/blocks/basic_test.py on lines 352..358
autokeras/blocks/preprocessing_test.py on lines 106..112
autokeras/blocks/reduction_test.py on lines 71..77
autokeras/blocks/reduction_test.py on lines 135..141
autokeras/blocks/reduction_test.py on lines 164..170
autokeras/blocks/wrapper_test.py on lines 115..121

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

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

def test_dense_get_config_has_all_attributes():
    block = blocks.DenseBlock()

    config = block.get_config()

Severity: Major
Found in autokeras/blocks/basic_test.py and 11 other locations - About 1 hr to fix
autokeras/blocks/basic_test.py on lines 100..106
autokeras/blocks/basic_test.py on lines 177..183
autokeras/blocks/basic_test.py on lines 228..234
autokeras/blocks/basic_test.py on lines 269..275
autokeras/blocks/basic_test.py on lines 352..358
autokeras/blocks/preprocessing_test.py on lines 106..112
autokeras/blocks/reduction_test.py on lines 71..77
autokeras/blocks/reduction_test.py on lines 135..141
autokeras/blocks/reduction_test.py on lines 164..170
autokeras/blocks/wrapper_test.py on lines 87..93
autokeras/blocks/wrapper_test.py on lines 115..121

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

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

def test_temporal_get_config_has_all_attributes():
    block = blocks.TemporalReduction()

    config = block.get_config()

Severity: Major
Found in autokeras/blocks/reduction_test.py and 11 other locations - About 1 hr to fix
autokeras/blocks/basic_test.py on lines 100..106
autokeras/blocks/basic_test.py on lines 177..183
autokeras/blocks/basic_test.py on lines 228..234
autokeras/blocks/basic_test.py on lines 269..275
autokeras/blocks/basic_test.py on lines 324..330
autokeras/blocks/basic_test.py on lines 352..358
autokeras/blocks/preprocessing_test.py on lines 106..112
autokeras/blocks/reduction_test.py on lines 71..77
autokeras/blocks/reduction_test.py on lines 164..170
autokeras/blocks/wrapper_test.py on lines 87..93
autokeras/blocks/wrapper_test.py on lines 115..121

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

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

def test_text_get_config_has_all_attributes():
    block = blocks.TextBlock()

    config = block.get_config()

Severity: Major
Found in autokeras/blocks/wrapper_test.py and 11 other locations - About 1 hr to fix
autokeras/blocks/basic_test.py on lines 100..106
autokeras/blocks/basic_test.py on lines 177..183
autokeras/blocks/basic_test.py on lines 228..234
autokeras/blocks/basic_test.py on lines 269..275
autokeras/blocks/basic_test.py on lines 324..330
autokeras/blocks/basic_test.py on lines 352..358
autokeras/blocks/preprocessing_test.py on lines 106..112
autokeras/blocks/reduction_test.py on lines 71..77
autokeras/blocks/reduction_test.py on lines 135..141
autokeras/blocks/reduction_test.py on lines 164..170
autokeras/blocks/wrapper_test.py on lines 87..93

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

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

def test_resnet_get_config_has_all_attributes():
    block = blocks.ResNetBlock()

    config = block.get_config()

Severity: Major
Found in autokeras/blocks/basic_test.py and 11 other locations - About 1 hr to fix
autokeras/blocks/basic_test.py on lines 177..183
autokeras/blocks/basic_test.py on lines 228..234
autokeras/blocks/basic_test.py on lines 269..275
autokeras/blocks/basic_test.py on lines 324..330
autokeras/blocks/basic_test.py on lines 352..358
autokeras/blocks/preprocessing_test.py on lines 106..112
autokeras/blocks/reduction_test.py on lines 71..77
autokeras/blocks/reduction_test.py on lines 135..141
autokeras/blocks/reduction_test.py on lines 164..170
autokeras/blocks/wrapper_test.py on lines 87..93
autokeras/blocks/wrapper_test.py on lines 115..121

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

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

def test_conv_get_config_has_all_attributes():
    block = blocks.ConvBlock()

    config = block.get_config()

Severity: Major
Found in autokeras/blocks/basic_test.py and 11 other locations - About 1 hr to fix
autokeras/blocks/basic_test.py on lines 100..106
autokeras/blocks/basic_test.py on lines 177..183
autokeras/blocks/basic_test.py on lines 269..275
autokeras/blocks/basic_test.py on lines 324..330
autokeras/blocks/basic_test.py on lines 352..358
autokeras/blocks/preprocessing_test.py on lines 106..112
autokeras/blocks/reduction_test.py on lines 71..77
autokeras/blocks/reduction_test.py on lines 135..141
autokeras/blocks/reduction_test.py on lines 164..170
autokeras/blocks/wrapper_test.py on lines 87..93
autokeras/blocks/wrapper_test.py on lines 115..121

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

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

def test_spatial_get_config_has_all_attributes():
    block = blocks.SpatialReduction()

    config = block.get_config()

Severity: Major
Found in autokeras/blocks/reduction_test.py and 11 other locations - About 1 hr to fix
autokeras/blocks/basic_test.py on lines 100..106
autokeras/blocks/basic_test.py on lines 177..183
autokeras/blocks/basic_test.py on lines 228..234
autokeras/blocks/basic_test.py on lines 269..275
autokeras/blocks/basic_test.py on lines 324..330
autokeras/blocks/basic_test.py on lines 352..358
autokeras/blocks/preprocessing_test.py on lines 106..112
autokeras/blocks/reduction_test.py on lines 71..77
autokeras/blocks/reduction_test.py on lines 135..141
autokeras/blocks/wrapper_test.py on lines 87..93
autokeras/blocks/wrapper_test.py on lines 115..121

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

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

def test_augment_get_config_has_all_attributes():
    block = blocks.ImageAugmentation()

    config = block.get_config()

Severity: Major
Found in autokeras/blocks/preprocessing_test.py and 11 other locations - About 1 hr to fix
autokeras/blocks/basic_test.py on lines 100..106
autokeras/blocks/basic_test.py on lines 177..183
autokeras/blocks/basic_test.py on lines 228..234
autokeras/blocks/basic_test.py on lines 269..275
autokeras/blocks/basic_test.py on lines 324..330
autokeras/blocks/basic_test.py on lines 352..358
autokeras/blocks/reduction_test.py on lines 71..77
autokeras/blocks/reduction_test.py on lines 135..141
autokeras/blocks/reduction_test.py on lines 164..170
autokeras/blocks/wrapper_test.py on lines 87..93
autokeras/blocks/wrapper_test.py on lines 115..121

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

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

def test_rnn_get_config_has_all_attributes():
    block = blocks.RNNBlock()

    config = block.get_config()

Severity: Major
Found in autokeras/blocks/basic_test.py and 11 other locations - About 1 hr to fix
autokeras/blocks/basic_test.py on lines 100..106
autokeras/blocks/basic_test.py on lines 177..183
autokeras/blocks/basic_test.py on lines 228..234
autokeras/blocks/basic_test.py on lines 324..330
autokeras/blocks/basic_test.py on lines 352..358
autokeras/blocks/preprocessing_test.py on lines 106..112
autokeras/blocks/reduction_test.py on lines 71..77
autokeras/blocks/reduction_test.py on lines 135..141
autokeras/blocks/reduction_test.py on lines 164..170
autokeras/blocks/wrapper_test.py on lines 87..93
autokeras/blocks/wrapper_test.py on lines 115..121

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

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

def test_cast_to_string_with_float32():
    tensor = tf.constant([0.1, 0.2], dtype=tf.float32)
    assert tf.string == data_utils.cast_to_string(tensor).dtype
Severity: Major
Found in autokeras/utils/data_utils_test.py and 1 other location - About 1 hr to fix
autokeras/utils/data_utils_test.py on lines 44..46

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

Severity
Category
Status
Source
Language