Showing 88 of 547 total issues
Function _constrain_check_effective_date
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _constrain_check_effective_date(self):
if self.state == "valid" and not self.archieve:
criteria = [
("id", "!=", self.id),
("state", "=", "valid"),
- 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 unlink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def unlink(self):
strWarning = _("You can only delete data on draft state")
for document in self:
if document.state != "draft":
if not self.env.context.get("force_unlink", False):
- 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_min_max_grade
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _check_min_max_grade(self):
obj_jg = self.env["hr.job_grade"]
job_grade_ids = obj_jg.search([]).ids
msg = _("Wrong Max Min Grade")
for jf in self:
- 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 _compute_allowed_move_line_ids
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _compute_allowed_move_line_ids(self):
obj_payslip = self.env["hr.payslip"]
obj_line = self.env["account.move.line"]
for wiz in self:
result = []
- 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 unlink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def unlink(self):
strWarning = _("You can only delete data on draft state")
for rec_request in self:
if rec_request.state != "draft":
if not self.env.context.get("force_unlink", False):
- 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_partner_account
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_partner_account(self):
address_home_id = self.employee_id.address_home_id
if address_home_id:
commercial_partner_id = address_home_id.commercial_partner_id
if commercial_partner_id:
- 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 _compute_real_end
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _compute_real_end(self):
for overtime in self:
overtime.real_date_end = False
if not overtime.end_attendance_id or not overtime.date_end:
continue
- 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 unlink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def unlink(self):
strWarning = _("You can only delete data on draft state")
for transition in self:
if transition.state != "draft":
if not self.env.context.get("force_unlink", False):
- 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"