OCA/server-tools

View on GitHub

Showing 317 of 317 total issues

Function _type_search has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _type_search(self, cr, uid, obj, name, args, context=None):
Severity: Minor
Found in mail_environment/env_mail.py - About 45 mins to fix

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

    Severity: Major
    Found in html_text/__openerp__.py and 2 other locations - About 45 mins to fix
    html_image_url_extractor/__openerp__.py on lines 0..20
    sentry/__openerp__.py on lines 0..21

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

    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 3 locations. Consider refactoring.
    Open

    Severity: Major
    Found in sentry/__openerp__.py and 2 other locations - About 45 mins to fix
    html_image_url_extractor/__openerp__.py on lines 0..20
    html_text/__openerp__.py on lines 0..20

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

    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

    Avoid deeply nested control flow statements.
    Open

                            if model_field_id and model_field_obj.browse(
                                    cr, uid, model_field_id,
                                    context=context).translate:
                                translation_ids = translation_obj.search(cr, uid, [
                                    ('res_id', 'in', context.get('active_ids')),
    Severity: Major
    Found in mass_editing/wizard/mass_editing_wizard.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (res['type'] == search_vals and
                                      res['id'] not in result_ids):
                                  result_ids.append(res['id'])
                  else:
      Severity: Major
      Found in mail_environment/env_mail.py - About 45 mins to fix

        Function _get_incom_conf has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _get_incom_conf(self, cr, uid, ids, name, args, context=None):
        Severity: Minor
        Found in mail_environment/env_mail.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  for m2m_id in vals.get(split_key, False)[0][2]:
                                      m2m_list.append((4, m2m_id))
                                  dict.update({split_key: m2m_list})
          Severity: Major
          Found in mass_editing/wizard/mass_editing_wizard.py - About 45 mins to fix

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

            Severity: Major
            Found in html_image_url_extractor/__openerp__.py and 2 other locations - About 45 mins to fix
            html_text/__openerp__.py on lines 0..20
            sentry/__openerp__.py on lines 0..21

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

            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 3 locations. Consider refactoring.
            Open

                    'smtp_user': fields.function(
                        _get_smtp_conf,
                        string='Username',
                        type="char",
                        multi='outgoing_mail_config',
            Severity: Major
            Found in mail_environment/env_mail.py and 2 other locations - About 45 mins to fix
            mail_environment/env_mail.py on lines 62..67
            mail_environment/env_mail.py on lines 79..84

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

            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

            Avoid deeply nested control flow statements.
            Open

                                    if modifiers[field][modifier]:
                                        modifiers[field][modifier].insert(0, '|')
                                    modifiers[field][modifier].append(
            Severity: Major
            Found in fetchmail_attach_from_folder/model/fetchmail_server.py - About 45 mins to fix

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

                      uid = request.session.authenticate(
                          request.session.db,
                          request.params['login'],
                          request.params['password']
              Severity: Minor
              Found in password_security/controllers/main.py and 1 other location - About 45 mins to fix
              auth_brute_force/controllers/controllers.py on lines 60..72

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

              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

                          if banned:
                              _logger.warning(
                                  "Authentication tried from remote '%s'. The request has"
                                  " been ignored because the remote has been banned after"
                                  " %d attempts without success. Login tried : '%s'." % (
              Severity: Minor
              Found in auth_brute_force/controllers/controllers.py and 1 other location - About 45 mins to fix
              password_security/controllers/main.py on lines 41..44

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

              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

                              if len(lines) > 1:
                                  raise exceptions.ValidationError(
                                      _("Field '%s' already exists") % one.name)
              Severity: Minor
              Found in base_export_manager/models/ir_exports_line.py and 1 other location - About 45 mins to fix
              base_export_manager/models/ir_exports_line.py on lines 134..137

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

              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

                      if not hasattr(expression.expression._expression__leaf_to_sql,
                                     '__decorated__'):
                          expression.expression._expression__leaf_to_sql = patch_leaf_trgm(
                              expression.expression._expression__leaf_to_sql)
              Severity: Minor
              Found in base_search_fuzzy/models/ir_model.py and 1 other location - About 40 mins to fix
              base_search_fuzzy/models/ir_model.py on lines 77..80

              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

                          cidx = ([i for i, x in enumerate(res['cols'])
                                  if x.upper() != 'NONE'])
              Severity: Minor
              Found in import_odbc/import_odbc.py and 1 other location - About 40 mins to fix
              import_odbc/import_odbc.py on lines 161..162

              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

                          self.message_post(
                              "<p>%s</p><pre>%s</pre>" % (
                                  _("Database backup failed."),
                                  escaped_tb),
                              subtype=self.env.ref(
              Severity: Minor
              Found in auto_backup/models/db_backup.py and 1 other location - About 40 mins to fix
              auto_backup/models/db_backup.py on lines 266..270

              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

              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

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

                          self.message_post(
                              "<p>%s</p><pre>%s</pre>" % (
                                  _("Cleanup of old database backups failed."),
                                  escaped_tb),
                              subtype=self.env.ref("auto_backup.failure"))
              Severity: Minor
              Found in auto_backup/models/db_backup.py and 1 other location - About 40 mins to fix
              auto_backup/models/db_backup.py on lines 223..227

              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

                      if not hasattr(models.BaseModel._generate_order_by,
                                     '__decorated__'):
                          models.BaseModel._generate_order_by = patch_generate_order_by(
                              models.BaseModel._generate_order_by)
              Severity: Minor
              Found in base_search_fuzzy/models/ir_model.py and 1 other location - About 40 mins to fix
              base_search_fuzzy/models/ir_model.py on lines 69..72

              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

              elif is_true(os.environ.get('ODOO_LOGGING_JSON_DEV')):
                  format = ('%(asctime)s %(pid)s %(levelname)s'
                            '%(dbname)s %(name)s: %(message)s')
                  formatter = OdooJsonDevFormatter(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 94..98

              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

              Severity
              Category
              Status
              Source
              Language