datahuborg/datahub

View on GitHub
src/core/test/test_manager.py

Summary

Maintainability
D
2 days
Test Coverage

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    @factory.django.mute_signals(signals.pre_save)
    def setUp(self):
        self.username = "delete_me_test_username"
        self.password = "_test diff1;cul t passw0rd-"
        self.email = "test_email@csail.mit.edu"
Severity: Major
Found in src/core/test/test_manager.py and 1 other location - About 4 hrs to fix
src/core/test/test_manager.py on lines 15..23

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 75.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    @factory.django.mute_signals(signals.pre_save)
    def setUp(self):
        self.username = "delete_me_test_username"
        self.password = "_test diff1;cul t passw0rd-"
        self.email = "test_email@csail.mit.edu"
Severity: Major
Found in src/core/test/test_manager.py and 1 other location - About 4 hrs to fix
src/core/test/test_manager.py on lines 218..226

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

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

    def test_describe_view(self):
        con_describe_view = self.mock_connection.return_value.describe_view
        self.manager.describe_view(
            repo='repo_name', view='_name', detail=False)
        self.assertTrue(con_describe_view.called)
Severity: Major
Found in src/core/test/test_manager.py and 3 other locations - About 1 hr to fix
src/core/test/test_manager.py on lines 86..90
src/core/test/test_manager.py on lines 98..101
src/core/test/test_manager.py on lines 129..133

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

    def test_delete_view(self):
        con_delete_view = self.mock_connection.return_value.delete_view
        self.manager.delete_view(
            repo='repo_name', view='view_name', force=False)
        self.assertTrue(con_delete_view.called)
Severity: Major
Found in src/core/test/test_manager.py and 3 other locations - About 1 hr to fix
src/core/test/test_manager.py on lines 86..90
src/core/test/test_manager.py on lines 98..101
src/core/test/test_manager.py on lines 123..127

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

    def test_delete_table(self):
        con_delete_table = self.mock_connection.return_value.delete_table
        self.manager.delete_table(repo='repo', table='table', force=False)
        self.assertTrue(con_delete_table.called)
Severity: Major
Found in src/core/test/test_manager.py and 3 other locations - About 1 hr to fix
src/core/test/test_manager.py on lines 86..90
src/core/test/test_manager.py on lines 123..127
src/core/test/test_manager.py on lines 129..133

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

    def test_describe_table(self):
        con_describe_table = self.mock_connection.return_value.describe_table
        self.manager.describe_table(repo='repo', table='table', detail=False)

        self.assertTrue(con_describe_table.called)
Severity: Major
Found in src/core/test/test_manager.py and 3 other locations - About 1 hr to fix
src/core/test/test_manager.py on lines 98..101
src/core/test/test_manager.py on lines 123..127
src/core/test/test_manager.py on lines 129..133

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

Identical blocks of code found in 18 locations. Consider refactoring.
Open

    def create_patch(self, name):
        # helper method for creating patches
        patcher = patch(name)
        thing = patcher.start()
        self.addCleanup(patcher.stop)
Severity: Major
Found in src/core/test/test_manager.py and 17 other locations - About 1 hr to fix
src/api/test/test_collaborator_serializer.py on lines 24..29
src/api/test/test_datahub_serializer.py on lines 21..26
src/api/test/test_file_serializer.py on lines 21..26
src/api/test/test_query_serializer.py on lines 21..26
src/api/test/test_repo_serializer.py on lines 24..29
src/api/test/test_table_serializer.py on lines 24..29
src/api/test/test_view_serializer.py on lines 25..30
src/browser/test/test_repo_views.py on lines 50..55
src/browser/test/test_repo_views.py on lines 126..131
src/browser/test/test_repo_views.py on lines 216..221
src/browser/test/test_repo_views.py on lines 258..263
src/browser/test/test_repo_views.py on lines 301..306
src/core/test/test_manager.py on lines 26..31
src/core/test/test_manager.py on lines 65..70
src/core/test/test_query_rewriter.py on lines 23..28
src/core/test/test_rls_permissions.py on lines 19..24
src/core/test/test_rlsmanager.py on lines 24..29

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 18 locations. Consider refactoring.
Open

    def create_patch(self, name):
        # helper method for creating patches
        patcher = patch(name)
        thing = patcher.start()
        self.addCleanup(patcher.stop)
Severity: Major
Found in src/core/test/test_manager.py and 17 other locations - About 1 hr to fix
src/api/test/test_collaborator_serializer.py on lines 24..29
src/api/test/test_datahub_serializer.py on lines 21..26
src/api/test/test_file_serializer.py on lines 21..26
src/api/test/test_query_serializer.py on lines 21..26
src/api/test/test_repo_serializer.py on lines 24..29
src/api/test/test_table_serializer.py on lines 24..29
src/api/test/test_view_serializer.py on lines 25..30
src/browser/test/test_repo_views.py on lines 50..55
src/browser/test/test_repo_views.py on lines 126..131
src/browser/test/test_repo_views.py on lines 216..221
src/browser/test/test_repo_views.py on lines 258..263
src/browser/test/test_repo_views.py on lines 301..306
src/core/test/test_manager.py on lines 65..70
src/core/test/test_manager.py on lines 229..234
src/core/test/test_query_rewriter.py on lines 23..28
src/core/test/test_rls_permissions.py on lines 19..24
src/core/test/test_rlsmanager.py on lines 24..29

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 18 locations. Consider refactoring.
Open

    def create_patch(self, name):
        # helper method for creating patches
        patcher = patch(name)
        thing = patcher.start()
        self.addCleanup(patcher.stop)
Severity: Major
Found in src/core/test/test_manager.py and 17 other locations - About 1 hr to fix
src/api/test/test_collaborator_serializer.py on lines 24..29
src/api/test/test_datahub_serializer.py on lines 21..26
src/api/test/test_file_serializer.py on lines 21..26
src/api/test/test_query_serializer.py on lines 21..26
src/api/test/test_repo_serializer.py on lines 24..29
src/api/test/test_table_serializer.py on lines 24..29
src/api/test/test_view_serializer.py on lines 25..30
src/browser/test/test_repo_views.py on lines 50..55
src/browser/test/test_repo_views.py on lines 126..131
src/browser/test/test_repo_views.py on lines 216..221
src/browser/test/test_repo_views.py on lines 258..263
src/browser/test/test_repo_views.py on lines 301..306
src/core/test/test_manager.py on lines 26..31
src/core/test/test_manager.py on lines 229..234
src/core/test/test_query_rewriter.py on lines 23..28
src/core/test/test_rls_permissions.py on lines 19..24
src/core/test/test_rlsmanager.py on lines 24..29

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

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

    def test_list_views(self):
        con_list_views = self.mock_connection.return_value.list_views
        self.manager.list_views('repo')

        self.assertTrue(con_list_views.called)
Severity: Major
Found in src/core/test/test_manager.py and 3 other locations - About 1 hr to fix
src/api/test/test_file_serializer.py on lines 28..31
src/core/test/test_manager.py on lines 80..84
src/core/test/test_manager.py on lines 153..157

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

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

    def test_create_repo(self):
        con_create_repo = self.mock_connection.return_value.create_repo
        self.manager.create_repo('repo')

        self.assertTrue(con_create_repo.called)
Severity: Major
Found in src/core/test/test_manager.py and 3 other locations - About 1 hr to fix
src/api/test/test_file_serializer.py on lines 28..31
src/core/test/test_manager.py on lines 80..84
src/core/test/test_manager.py on lines 109..113

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

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

    def test_list_tables(self):
        con_list_tables = self.mock_connection.return_value.list_tables
        self.manager.list_tables('repo')

        self.assertTrue(con_list_tables.called)
Severity: Major
Found in src/core/test/test_manager.py and 3 other locations - About 1 hr to fix
src/api/test/test_file_serializer.py on lines 28..31
src/core/test/test_manager.py on lines 109..113
src/core/test/test_manager.py on lines 153..157

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

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

There are no issues that match your filters.

Category
Status