datahuborg/datahub

View on GitHub

Showing 1,132 of 1,132 total issues

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/browser/test/test_repo_views.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/core/test/test_manager.py on lines 26..31
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/api/test/test_file_serializer.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_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_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/browser/test/test_repo_views.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 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_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_rls_permissions.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_manager.py on lines 229..234
src/core/test/test_query_rewriter.py on lines 23..28
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 2 locations. Consider refactoring.
Open

        for license_link in res:
            LicenseLink = namedtuple(
                'LicenseLink',
                ['license_link_id', 'repo_base', 'repo', 'license_id'])

Severity: Major
Found in src/core/db/licensemanager.py and 1 other location - About 1 hr to fix
src/core/db/licensemanager.py on lines 186..193

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 to create patches
        patcher = patch(name)
        thing = patcher.start()
        self.addCleanup(patcher.stop)
Severity: Major
Found in src/browser/test/test_repo_views.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 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_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/browser/test/test_repo_views.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 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_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_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

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/api/test/test_view_serializer.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/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_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/api/test/test_query_serializer.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_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_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/api/test/test_collaborator_serializer.py and 17 other locations - About 1 hr to fix
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_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_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

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/api/test/test_datahub_serializer.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_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_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/browser/test/test_repo_views.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 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_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_query_rewriter.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_manager.py on lines 229..234
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_files(self):
        mock_list_files = self.mock_manager.return_value.list_repo_files
        self.serializer.list_files('repo')
        self.assertTrue(mock_list_files.called)
Severity: Major
Found in src/api/test/test_file_serializer.py and 3 other locations - About 1 hr to fix
src/core/test/test_manager.py on lines 80..84
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

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

Severity: Major
Found in src/inventory/migrations/0018_remove_public_repo.py and 2 other locations - About 1 hr to fix
src/inventory/migrations/0019_add_users_to_dh_public.py on lines 0..17
src/inventory/migrations/0020_migrate_bad_card_names.py on lines 0..17

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

Severity: Major
Found in src/inventory/migrations/0019_add_users_to_dh_public.py and 2 other locations - About 1 hr to fix
src/inventory/migrations/0018_remove_public_repo.py on lines 0..17
src/inventory/migrations/0020_migrate_bad_card_names.py on lines 0..17

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

Severity: Major
Found in src/inventory/migrations/0020_migrate_bad_card_names.py and 2 other locations - About 1 hr to fix
src/inventory/migrations/0018_remove_public_repo.py on lines 0..17
src/inventory/migrations/0019_add_users_to_dh_public.py on lines 0..17

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

Function forEachRowInColumn has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        datatable.forEachRowInColumn = function(colName, func) {
          var targets = -1;
          columnDefs.forEach(function(columnDef) {
            if (columnDef.name === colName) {
              targets = columnDef.targets;
Severity: Minor
Found in src/apps/datatables/client/js/dataTables.extra.js - About 1 hr to fix
    Severity
    Category
    Status
    Source
    Language