cmspsgp31/anubis

View on GitHub

Showing 58 of 120 total issues

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

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

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

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

                def __init__(self, model, function_name, arguments,
            Severity: Minor
            Found in anubis/operations/functions.py - About 35 mins to fix

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

                  def resolve_expression(self, query=None, allow_joins=True, reuse=None,
              Severity: Minor
              Found in anubis/sql_aggregators.py - About 35 mins to fix

                Function get_actions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def get_actions(self):
                        if self.actions is None:
                            return {}
                
                        if self.user_serializer is None:
                Severity: Minor
                Found in anubis/views/state_view_mixin.py - About 35 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 es_get_field has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def es_get_field(self, field):
                        if field not in self.es_fields:
                            raise KeyError("Undeclared ElasticSearch field - {}." \
                                           .format(field))
                
                
                Severity: Minor
                Found in anubis/elastic.py - About 35 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 connectToken has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    static connectToken(created, prev, next) {
                        if (prev == null) prev = I.fromJS({key: "__AND__"});
                        if (next == null) next = I.fromJS({key: "__AND__"});
                
                        const isCreatedUnitToken = !_.has(this.connectorMap,
                Severity: Minor
                Found in anubis/frontend/src/components/TokenField/token_list.js - About 35 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

                Avoid too many return statements within this function.
                Open

                            return
                Severity: Major
                Found in anubis/views/state_view_mixin.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return _.zip(p.args, c.args).some(([pa, ca]) => pa != ca);
                  Severity: Major
                  Found in anubis/frontend/src/components/TokenField/token_list.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return
                    Severity: Major
                    Found in anubis/views/state_view_mixin.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return
                      Severity: Major
                      Found in anubis/views/state_view_mixin.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return self.handle_impossible_case()
                        Severity: Major
                        Found in anubis/aggregators.py - About 30 mins to fix

                          Function get_sorting has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def get_sorting(self):
                                  if self.is_sortable:
                                      options = self.sorting_options if self.is_multi_modeled else {
                                          "_default": self.sorting_options
                                      }
                          Severity: Minor
                          Found in anubis/views/state_view_mixin.py - About 25 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 getTokens has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              getTokens() {
                                  this.tokenObjects = [];
                          
                                  this.setState({tokens: this.props.expression.map((obj, i) => {
                                      const key = obj.get('key');
                          Severity: Minor
                          Found in anubis/frontend/src/components/TokenField/token_list.js - About 25 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 handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def handle(self, *args, **options):
                                  directories = set([dir_ for dir_ in get_app_template_dirs('templates')])
                          
                                  if len(settings.TEMPLATES) > 0:
                                      if 'DIRS' in settings.TEMPLATES[0].keys():
                          Severity: Minor
                          Found in anubis/app/management/commands/compilejs.py - About 25 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

                          Severity
                          Category
                          Status
                          Source
                          Language