datahuborg/datahub

View on GitHub

Showing 1,132 of 1,132 total issues

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

    that.schema = function(table_name, schema) {
      if (schema !== undefined) {
        that._schema_for_table_name[table_name] = schema;
      } 
      return that._schema_for_table_name[table_name];
Severity: Minor
Found in src/apps/dataq/client_src/js/dq-query.js and 1 other location - About 55 mins to fix
src/apps/dataq/client_src/js/dq-query.js 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 54.

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

def migrate_datahub_accounts(*args, **kwargs):
    old_users = DataHubLegacyUser.objects.all()
    apps = App.objects.exclude(legacy_user=None)
    users = User.objects.all()
    print("Old model users: {0} New model users: {1}".format(
Severity: Minor
Found in src/account/management/commands/migratedatahubaccounts.py - About 55 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function find_security_policies has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def find_security_policies(repo_base, repo=None, table=None,
                               policy_id=None, policy=None, policy_type=None,
                               grantee=None, grantor=None, safe=True):
        '''
        Looks for security policies matching what the user specified in
Severity: Minor
Found in src/core/db/rlsmanager.py - About 55 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function execute_query has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def execute_query(self, query, current_page=1,
                      rows_per_page=1000, repo=None,
                      rows_only=False):

        result = None
Severity: Minor
Found in src/api/serializer.py - About 55 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function match_type has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def match_type(types_a, types_b):
  if len(types_a) != len(types_b):
    return False

  for i in range(len(types_a)):
Severity: Minor
Found in src/apps/refiner/distill/inference.py - About 55 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function get_numeric_stats has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def get_numeric_stats(self, c):
        ndistinct = self.get_distinct_count(c)
        if ndistinct == 0:
            return []
        if ndistinct == 1:
Severity: Minor
Found in src/apps/dbwipes/summary.py - About 55 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function update_card has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def update_card(self, repo, card_name, new_query=None,
                    new_name=None, public=None):
        """
        Updates a card's name, query, and/or public visibility.

Severity: Minor
Found in src/core/db/manager.py - About 55 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function user_data_path has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def user_data_path(repo_base, repo='', file_name='', file_format=None):
    """
    Returns an absolute path to a file or repo in a user's data folder.

    user_data_path('foo') => '/user_data/foo'
Severity: Minor
Found in src/core/db/manager.py - About 55 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

        self.legacy_user = models.DataHubLegacyUser.objects.create(
Severity: Minor
Found in src/inventory/tests/test_models.py and 1 other location - About 55 mins to fix
src/inventory/tests/test_models.py on lines 66..66

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

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

        self.legacy_user = models.DataHubLegacyUser.objects.create(
Severity: Minor
Found in src/inventory/tests/test_models.py and 1 other location - About 55 mins to fix
src/inventory/tests/test_models.py on lines 93..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 37.

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

    if types_a[i][0] != types_b[i][0]:
      return False
Severity: Minor
Found in src/apps/refiner/distill/inference.py and 1 other location - About 55 mins to fix
src/apps/refiner/distill/inference.py on lines 65..67

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

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

    if types_a[i][0] == 'OP':
      if types_a[i][1] != types_b[i][1]:
        return False
Severity: Minor
Found in src/apps/refiner/distill/inference.py and 1 other location - About 55 mins to fix
src/apps/refiner/distill/inference.py on lines 62..63

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

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 gg has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

function gg(a, b, c, d, x, s, t) {
Severity: Major
Found in src/browser/static/dbwipes/js/lib/md5.js - About 50 mins to fix

    Function ii has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function ii(a, b, c, d, x, s, t) {
    Severity: Major
    Found in src/apps/dbwipes/static/js/lib/md5.js - About 50 mins to fix

      Function gg has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function gg(a, b, c, d, x, s, t) {
      Severity: Major
      Found in src/apps/dbwipes/static/js/lib/md5.js - About 50 mins to fix

        Function program has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        exports.template = template;function program(container, i, fn, data, declaredBlockParams, blockParams, depths) {
        Severity: Major
        Found in src/browser/static/datatables/js/dataTables.extra.js - About 50 mins to fix

          Function hh has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function hh(a, b, c, d, x, s, t) {
          Severity: Major
          Found in src/apps/dbwipes/static/js/lib/md5.js - About 50 mins to fix

            Function hh has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function hh(a, b, c, d, x, s, t) {
            Severity: Major
            Found in src/browser/static/dbwipes/js/lib/md5.js - About 50 mins to fix

              Function ii has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function ii(a, b, c, d, x, s, t) {
              Severity: Major
              Found in src/browser/static/dbwipes/js/lib/md5.js - About 50 mins to fix

                Function ff has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function ff(a, b, c, d, x, s, t) {
                Severity: Major
                Found in src/browser/static/dbwipes/js/lib/md5.js - About 50 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language