cmspsgp31/anubis

View on GitHub

Showing 120 of 120 total issues

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

            IPropTypes.contains({
                key: RPropTypes.string.isRequired,
                index: RPropTypes.number.isRequired,
                args: IPropTypes.listOf(RPropTypes.string),
            }),
Severity: Minor
Found in anubis/frontend/src/components/TokenField/token_list.js and 1 other location - About 55 mins to fix
anubis/frontend/src/components/TokenField/token.js on lines 88..92

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

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

        token: IPropTypes.contains({
            key: RPropTypes.string.isRequired,
            index: RPropTypes.number.isRequired,
            args: IPropTypes.listOf(RPropTypes.string),
        }),
Severity: Minor
Found in anubis/frontend/src/components/TokenField/token.js and 1 other location - About 55 mins to fix
anubis/frontend/src/components/TokenField/token_list.js on lines 42..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 53.

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

        let contents = (
            <div style={{textAlign: "center"}}>
                <CircularProgress
                    size={80}
                    thickness={7}
Severity: Minor
Found in anubis/frontend/src/components/record_list.js and 1 other location - About 55 mins to fix
anubis/frontend/src/components/record_zoom.js on lines 213..220

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

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

        let contents = (
            <div style={{textAlign: "center"}}>
                <CircularProgress
                    size={80}
                    thickness={7}
Severity: Minor
Found in anubis/frontend/src/components/record_zoom.js and 1 other location - About 55 mins to fix
anubis/frontend/src/components/record_list.js on lines 475..482

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

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

    def __call__(self, base_expression=None, not_expression=None,
Severity: Major
Found in anubis/aggregators.py - About 50 mins to fix

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

            const cached = (this.props.cache) ?
                this.props.cache.getIn([model, expr, sorting, `${page}`]) :
                null;
    Severity: Minor
    Found in anubis/frontend/src/components/record_list.js and 1 other location - About 50 mins to fix
    anubis/frontend/src/components/record_list.js on lines 233..235

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

    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

            const cached = (this.props.cache) ?
                this.props.cache.getIn([model, expr, sorting, `${page}`]) :
                null;
    Severity: Minor
    Found in anubis/frontend/src/components/record_list.js and 1 other location - About 50 mins to fix
    anubis/frontend/src/components/record_list.js on lines 216..218

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

    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

            params: RPropTypes.shape({
                splat: RPropTypes.string,
                model: RPropTypes.string,
                sorting: RPropTypes.string,
                page: RPropTypes.string,
    Severity: Minor
    Found in anubis/frontend/src/components/TokenField/token_field.js and 1 other location - About 45 mins to fix
    anubis/frontend/src/components/record_list.js on lines 105..110

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

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

        def __init__(self, table_name, restraint_field=None,
    Severity: Minor
    Found in anubis/operations/constraints.py - About 45 mins to fix

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

              params: RPropTypes.shape({
                  splat: RPropTypes.string,
                  model: RPropTypes.string,
                  sorting: RPropTypes.string,
                  page: RPropTypes.string,
      Severity: Minor
      Found in anubis/frontend/src/components/record_list.js and 1 other location - About 45 mins to fix
      anubis/frontend/src/components/TokenField/token_field.js on lines 88..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 50.

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

      def exception_handler(exc, context):
          response = rest_exception_handler(exc, context)
      
          if response is None:
              if hasattr(exc, "name") and callable(exc.name):
      Severity: Minor
      Found in anubis/views/utils.py - About 45 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

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

              const cached = (this.props.cache) ?
                  this.props.cache.getIn([model, `${id}`]) :
                  null;
      Severity: Minor
      Found in anubis/frontend/src/components/record_zoom.js and 1 other location - About 40 mins to fix
      anubis/frontend/src/components/record_zoom.js on lines 157..159

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

      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

              const cached = (this.props.cache) ?
                  this.props.cache.getIn([model, `${id}`]) :
                  null;
      Severity: Minor
      Found in anubis/frontend/src/components/record_zoom.js and 1 other location - About 40 mins to fix
      anubis/frontend/src/components/record_zoom.js on lines 169..171

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

      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 database_backwards(self, app_label, schema_editor, from_state,
                                 to_state):
              sql = "drop materialized view if exists {name};".format(name=self.name)
              schema_editor.execute(sql)
      Severity: Minor
      Found in anubis/operations/views.py and 1 other location - About 40 mins to fix
      anubis/operations/views.py on lines 46..49

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

      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 database_backwards(self, app_label, schema_editor, from_state,
                                 to_state):
              sql = "drop view if exists {name};".format(name=self.name)
              schema_editor.execute(sql)
      Severity: Minor
      Found in anubis/operations/views.py and 1 other location - About 40 mins to fix
      anubis/operations/views.py on lines 66..69

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

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

          def __init__(self, model, name, commands, **kwargs):
      Severity: Minor
      Found in anubis/operations/triggers.py - About 35 mins to fix

        Function order_by_procedure has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def order_by_procedure(self, procname, *args, field='id', extra_fields=None,
        Severity: Minor
        Found in anubis/query.py - About 35 mins to fix

          Function field has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def field(self, field_name, field_label=None, field_cls=forms.CharField,
          Severity: Minor
          Found in anubis/filters.py - About 35 mins to fix

            Function database_backwards has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def database_backwards(self, app_label, schema_editor, from_state,
            Severity: Minor
            Found in anubis/operations/triggers.py - About 35 mins to fix

              Function es_query has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def es_query(self, body, timeout=None, min_score=None, save_score=True,
              Severity: Minor
              Found in anubis/elastic.py - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language