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, [
- Read upRead up
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
- Read upRead up
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:
- Read upRead up
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):
Function _get_dependents
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_dependents(self, cr, uid, ids, fields, arg, context=None):
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):
Function onchange_no_cpf
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def onchange_no_cpf(
Function _check_date
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _check_date(self, cr, uid, ids, fields, arg, context=None):
Function onchange_user
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def onchange_user(self, cr, uid, ids, user_id, context=None):
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):
Avoid too many return
statements within this function. Open
return (rest == digits[10])
Avoid too many return
statements within this function. Open
return 0