gecos-team/gecoscc-ui

View on GitHub

Showing 845 of 1,621 total issues

Avoid too many return statements within this function.
Open

                            return True
Severity: Major
Found in gecoscc/tasks.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return {'ok': False,
    Severity: Major
    Found in gecoscc/api/chef_client_run.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return {'ok': True}
      Severity: Major
      Found in gecoscc/api/chef_client_run.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return {'ok': False,
        Severity: Major
        Found in gecoscc/api/chef_client_run.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return
          Severity: Major
          Found in gecoscc/commands/create_nodes.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return False             
            Severity: Major
            Found in gecoscc/utils.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return (True, 'success')
              Severity: Major
              Found in gecoscc/utils.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return True
                Severity: Major
                Found in gecoscc/utils.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return
                  Severity: Major
                  Found in gecoscc/commands/create_nodes.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return None
                    Severity: Major
                    Found in gecoscc/commands/check_node_policies.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return None
                      Severity: Major
                      Found in gecoscc/commands/check_node_policies.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return default
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py - About 30 mins to fix

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

                              def update_user_emitter_policy(self, node, action, policy, obj_ui_field, field_chef, obj_ui, objold_ui, priority_obj, priority_obj_ui, field_ui, update_by_path):
                                  '''
                                  Update node chef with a mergeable user emitter policy
                                  This policy is emitter, that is that the policy contains related objects (storage)
                                  '''
                          Severity: Minor
                          Found in gecoscc/tasks.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 group_by_multiple_keys has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def group_by_multiple_keys(self, input_data, mergeIdField, mergeActionField, opposite=False):
                                  '''
                                  This method groups by key the values of a list of dictionaries and eliminates the duplicates 
                                  or those that are opposed.
                                  
                          Severity: Minor
                          Found in gecoscc/tasks.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 is_path_right has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def is_path_right(request, path, ou_type='ou_managed'):
                              ou_managed_ids = []
                              if path is None:
                                  path = ''
                          
                          
                          Severity: Minor
                          Found in gecoscc/permissions.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 script_runner has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def script_runner(user, sequence, rollback=False):
                              ''' Launches scripts from an update
                              
                              Args:
                                user(object):         user doing update
                          Severity: Minor
                          Found in gecoscc/tasks.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 users_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def users_list(obj_ui, obj, node, field_chef, *kwargs):
                              users = deepcopy(node.attributes.get_dotted(field_chef))
                              if not users:
                                  users = {}
                              else:
                          Severity: Minor
                          Found in gecoscc/rules.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 __acl__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def __acl__(self):
                                  user = self.request.user
                                  if user:
                                      if user.get('is_superuser', False):
                                          return [(Allow, Authenticated, 'edit'), (Allow, Authenticated, 'is_superuser')]
                          Severity: Minor
                          Found in gecoscc/permissions.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 search_mergefields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def search_mergefields(self, field_chef, field_ui, policy):
                                  '''    
                                  This method search merge indexes (mergeIdField, mergeActionField) for "field_chef" policy field.
                           
                                  Args:
                          Severity: Minor
                          Found in gecoscc/tasks.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 get_first_exists_node has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def get_first_exists_node(self, ids, obj, action):
                                  '''
                                  Get the first exising node from a ids list
                                  '''
                                  for mongo_id in ids:
                          Severity: Minor
                          Found in gecoscc/tasks.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