OCA/server-tools

View on GitHub

Showing 317 of 317 total issues

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

if is_true(os.environ.get('ODOO_LOGGING_JSON')):
    format = ('%(asctime)s %(pid)s %(levelname)s'
              '%(dbname)s %(name)s: %(message)s')
    formatter = OdooJsonFormatter(format)
    logging.getLogger().handlers[0].formatter = formatter
Severity: Minor
Found in logging_json/json_log.py and 1 other location - About 40 mins to fix
logging_json/json_log.py on lines 99..103

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

    def copy(self, cr, uid, id, default=None, context=None):
Severity: Minor
Found in auth_from_http_remote_user/res_users.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 security_protector/security_protector.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 base_field_validator/models/ir_model.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/email_exact.py - About 35 mins to fix

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

              def _create_qweb(self, name, qweb_name, module, model, arch):
          Severity: Minor
          Found in base_report_auto_create_qweb/models/report_xml.py - About 35 mins to fix

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

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

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

                    def datetime_formatter(self, value, lang=None, template=MODE_DATETIME,
                Severity: Minor
                Found in datetime_formatter/models.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 attach_mail has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def attach_mail(self, connection, object_id, folder, mail_message, msgid):
                        Severity: Minor
                        Found in fetchmail_attach_from_folder/model/fetchmail_server.py - About 35 mins to fix

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

                              def onchange_company_id(self, cr, uid, ids, company_id, context=None):
                          Severity: Minor
                          Found in configuration_helper/config.py - About 35 mins to fix

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

                                def do_deactivate_unknown_users(
                            Severity: Minor
                            Found in users_ldap_populate/models/users_ldap.py - About 35 mins to fix

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

                                    def get_email_template(self, cr, uid, template_id=False, record_id=None,
                                Severity: Minor
                                Found in email_template_template/model/email_template.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 base_optional_quick_create/model.py - About 35 mins to fix

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

                                                def create(self, cr, uid, vals, context=None, **kwargs):
                                    Severity: Minor
                                    Found in base_field_validator/models/ir_model.py - About 35 mins to fix

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

                                          def text_from_html(self, html_content, max_words=None, max_chars=None,
                                      Severity: Minor
                                      Found in html_text/models/ir_fields_converter.py - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language