open-synergy/opnsynid-hr

View on GitHub

Showing 547 of 547 total issues

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):
Severity: Minor
Found in hr_award/models/hr_award.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

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:
Severity: Minor
Found in hr_job_family_modelling/models/hr_job_family.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

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 = []

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):
Severity: Minor
Found in hr_recruitment_request/models/hr_recruitment_request.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

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:
Severity: Minor
Found in hr_expense_header_account/models/hr_expense.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

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
Severity: Minor
Found in hr_attendance_overtime_request/models/hr_overtime_request.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

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):
Severity: Minor
Found in hr_career_transition/models/hr_career_transition.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