odoo-brazil/odoo-brazil-hr

View on GitHub

Showing 12 of 12 total issues

Function _get_wage_ir has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_wage_ir(self, cr, uid, ids, fields, arg, context=None):
        res = {}
        obj_employee = self.pool.get('hr.employee')
        employee_ids = obj_employee.search(
            cr, uid, [
Severity: Minor
Found in l10n_br_hr_payroll/model/hr_contract.py - About 5 hrs 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 _validate_pis_pasep has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def _validate_pis_pasep(self, cr, uid, ids):
        employee = self.browse(cr, uid, ids[0])

        if not employee.pis_pasep:
            return True
Severity: Minor
Found in l10n_br_hr_payroll/model/hr_employee.py - About 1 hr 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 _check_voucher has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _check_voucher(self, cr, uid, ids, context=None):
        user = self.pool.get('res.users').browse(cr, uid, uid, context=context)

        for contract in self.browse(cr, uid, ids):
            if user.company_id.check_benefits:
Severity: Minor
Found in l10n_br_hr_payroll/model/hr_contract.py - About 55 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_worked_days has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _get_worked_days(self, cr, uid, ids, fields, arg, context=None):
Severity: Minor
Found in l10n_br_hr_payroll/model/hr_contract.py - About 45 mins to fix

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

        def _get_dependents(self, cr, uid, ids, fields, arg, context=None):
    Severity: Minor
    Found in l10n_br_hr_payroll/model/hr_employee.py - About 45 mins to fix

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

          def _get_wage_ir(self, cr, uid, ids, fields, arg, context=None):
      Severity: Minor
      Found in l10n_br_hr_payroll/model/hr_contract.py - About 45 mins to fix

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

            def onchange_no_cpf(
        Severity: Minor
        Found in l10n_br_hr_payroll/model/hr_employee.py - About 45 mins to fix

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

              def _check_date(self, cr, uid, ids, fields, arg, context=None):
          Severity: Minor
          Found in l10n_br_hr_payroll/model/hr_contract.py - About 45 mins to fix

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

                def onchange_user(self, cr, uid, ids, user_id, context=None):
            Severity: Minor
            Found in l10n_br_hr_payroll/model/hr_employee.py - About 35 mins to fix

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

                  def onchange_address_home_id(self, cr, uid, ids, address, context=None):
              Severity: Minor
              Found in l10n_br_hr_payroll/model/hr_employee.py - About 35 mins to fix

                Avoid too many return statements within this function.
                Open

                        return (rest == digits[10])
                Severity: Major
                Found in l10n_br_hr_payroll/model/hr_employee.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                          return 0
                  Severity: Major
                  Found in l10n_br_hr_payroll/model/hr_contract.py - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language