OCA/management-system

View on GitHub

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):
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.py - About 45 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 try_invalid_signal has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def try_invalid_signal(self, obj, signal_name, state, msg=None):
Severity: Minor
Found in mgmtsystem_nonconformity/tests/test_workflows.py - About 35 mins to fix

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):
Severity: Minor
Found in mgmtsystem_nonconformity_deptm/mgmtsystem_nonconformity.py - About 35 mins to fix

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

    def get_color(self, cr, uid, ids, kpi_value, context=None):
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.py - About 35 mins to fix

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
Severity: Minor
Found in mgmtsystem_nonconformity_deptm/mgmtsystem_nonconformity.py - About 35 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 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()
Severity: Minor
Found in mgmtsystem_nonconformity/models/mgmtsystem_nonconformity.py - About 25 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

Severity
Category
Status
Source
Language