Showing 26 of 60 total issues
Function update_next_execution_date
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update_next_execution_date(self, cr, uid, ids, context=None):
if context is None:
context = {}
for obj in self.browse(cr, uid, ids):
- Read upRead up
- Create a ticketCreate a ticket
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 try_invalid_signal
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def try_invalid_signal(self, obj, signal_name, state, msg=None):
- Create a ticketCreate a ticket
Function onchange_department_id
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def onchange_department_id(self, cr, uid, ids, new_id, context=None):
- Create a ticketCreate a ticket
Function get_color
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_color(self, cr, uid, ids, kpi_value, context=None):
- Create a ticketCreate a ticket
Function onchange_department_id
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def onchange_department_id(self, cr, uid, ids, new_id, context=None):
result = {}
if new_id:
deptm = self.pool['hr.department'].browse(
cr, uid, new_id, context=context
- Read upRead up
- Create a ticketCreate a ticket
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 wkf_open
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def wkf_open(self):
"""Change state from pending approval to in progress, and Open
the related actions
"""
self.ensure_one()
- Read upRead up
- Create a ticketCreate a ticket
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"