OCA/server-tools

View on GitHub

Showing 317 of 317 total issues

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

    def query(self, ldap_entry, attribute, value, ldap_config, company):
Severity: Minor
Found in users_ldap_groups/models/users_ldap_groups.py - About 35 mins to fix

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

        def create(self, cr, uid, ids, data, context=None):
    Severity: Minor
    Found in base_module_doc_rst/report/report_proximity_graph.py - About 35 mins to fix

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

          def search_matches(self, cr, uid, conf, mail_message, mail_message_org):
      Severity: Minor
      Found in fetchmail_attach_from_folder/match_algorithm/openerp_standard.py - About 35 mins to fix

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

            def search_matches(self, cr, uid, conf, mail_message, mail_message_org):
        Severity: Minor
        Found in fetchmail_attach_from_folder/match_algorithm/base.py - About 35 mins to fix

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

              def copy(self, cr, uid, record_id, default=None, context=None):
          Severity: Minor
          Found in mass_editing/models/mass_object.py - About 35 mins to fix

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

                def write(self, cr, uid, ids, vals, context=None):
            Severity: Minor
            Found in auditlog/models/rule.py - About 35 mins to fix

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

                  def update_notification(self, cr, uid, ids, cron_mode=True, context=None):
              Severity: Minor
              Found in disable_openerp_online/model/publisher_warranty_contract.py - About 35 mins to fix

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

                    def onchange_model_id(self, cr, uid, ids, model_id, context=None):
                Severity: Minor
                Found in mass_editing/models/mass_object.py - About 35 mins to fix

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

                      def read(self, cr, uid, ids, fields, context=None):
                  Severity: Minor
                  Found in mass_editing/wizard/mass_editing_wizard.py - About 35 mins to fix

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

                        def _execute_sql_request(
                    Severity: Minor
                    Found in sql_request_abstract/models/sql_request_mixin.py - About 35 mins to fix

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

                          def best_match(self, lang=None, failure_safe=True):
                              """Get best match of current default lang.
                      
                              :param str lang:
                                  If a language in the form of "en_US" is supplied, it will have the
                      Severity: Minor
                      Found in datetime_formatter/models.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 _write_menus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _write_menus(self):
                              sl = ["",
                                    "Menus",
                                    "-------",
                                    ""]
                      Severity: Minor
                      Found in base_module_doc_rst/wizard/tech_rst_guide.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 _patch_quick_create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _patch_quick_create(self, cr, ids):
                      
                              def _wrap_name_create():
                                  def wrapper(self, cr, uid, name, context=None):
                                      raise orm.except_orm(
                      Severity: Minor
                      Found in base_optional_quick_create/model.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 run_manually has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def run_manually(self):
                              """Run a job from the cron form view."""
                      
                              if self.env.uid != SUPERUSER_ID and (not self.active or
                                                                   not self.numbercall):
                      Severity: Minor
                      Found in cron_run_manually/ir_cron.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 get_email_template has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def get_email_template(self, cr, uid, template_id=False, record_id=None,
                                                 context=None):
                              this = super(email_template, self).get_email_template(
                                  cr, uid, template_id, record_id, context)
                      
                      
                      Severity: Minor
                      Found in email_template_template/model/email_template.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 _onchange_custom_info_template_id has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _onchange_custom_info_template_id(self):
                              if not self.custom_info_template_id:
                                  self.custom_info_ids = False
                              else:
                                  info_list = self.custom_info_ids.mapped('property_id')
                      Severity: Minor
                      Found in base_custom_info/models/custom_info.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 _get_graphical_representation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _get_graphical_representation(
                              self, cr, uid, model_ids, level=1, context=None
                          ):
                              obj_model = self.pool.get('ir.model')
                              if level == 0:
                      Severity: Minor
                      Found in base_module_doc_rst/base_module_doc_rst.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 _field_validator_hook has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _field_validator_hook(self, cr, ids):
                      
                              def _wrap_create():
                                  def create(self, cr, uid, vals, context=None, **kwargs):
                                      model_pool = self.pool['ir.model']
                      Severity: Minor
                      Found in base_field_validator/models/ir_model.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 get_server_environment has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def get_server_environment():
                          # inspired by server/bin/service/web_services.py
                          try:
                              rev_id = 'git:%s' % _get_output('git rev-parse HEAD')
                          except Exception:
                      Severity: Minor
                      Found in server_environment/system_info.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 find has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def find(self, cr, uid, context=None):
                              """
                              Search for models that cannot be instantiated.
                              """
                              res = []
                      Severity: Minor
                      Found in database_cleanup/model/purge_menus.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

                      Severity
                      Category
                      Status
                      Source
                      Language