open-synergy/opnsynid-hr

View on GitHub

Showing 88 of 547 total issues

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

    def check_sign_in_out(self, row, column, line_num, sign_in_code, sign_out_code):
Severity: Minor
Found in hr_attendance_import_from_machine/wizards/hr_attendance_import.py - About 35 mins to fix

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

        def search(self, args, offset=0, limit=None, order=None, count=False):
    Severity: Minor
    Found in hr_promotion_transition/models/hr_promotion_transition.py - About 35 mins to fix

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

          def search(self, args, offset=0, limit=None, order=None, count=False):
      Severity: Minor
      Found in hr_assignment_transition/models/hr_assignment_transition.py - About 35 mins to fix

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

            def check_datetime(self, row, date_format, time_format, column, line_num):
        Severity: Minor
        Found in hr_attendance_import_from_machine/wizards/hr_attendance_import.py - About 35 mins to fix

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

              def _prepare_fine_move_line(self, name, debit, credit, account_id, partner_id):
          Severity: Minor
          Found in hr_dicipline_fine/models/hr_dicipline.py - About 35 mins to fix

            Function _compute_triggering_attendance_id has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def _compute_triggering_attendance_id(self):
                    for attendance in self:
                        attendance.triggering_attendance_id = False
                        if attendance.action == "sign_in":
                            attendance.triggering_attendance_id = attendance.id
            Severity: Minor
            Found in hr_attendance_computation/models/hr_attendance.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 _get_birthday_list has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def _get_birthday_list(self, employee_ids):
                    self.ensure_one()
                    employee_birtday_list = []
            
                    date_start_conv, date_end_conv = self._compute_date_offset()
            Severity: Minor
            Found in hr_employee_birthday_list_reminder/models/hr_birthday_list_reminder.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 import_data has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def import_data(self):
                    # Variable Object
                    obj_payslip_run = self.env["hr.payslip.run"]
            
                    # Get Payslip Run ID
            Severity: Minor
            Found in hr_payslip_import_input/wizards/hr_payslip_import_input.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 _prepare_write_data has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def _prepare_write_data(self):
                    self.ensure_one()
                    list_participant = []
                    for employee in self.employee_ids:
                        criteria = [
            Severity: Minor
            Found in hr_employee_training/wizards/select_participant.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 _check_test has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def _check_test(self):
                    if not self._do_check():
                        return True
            
                    prev_attns = self._get_prev_attendance()
            Severity: Minor
            Found in hr_attendance_monkeypatch/models/hr_attendance.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 _compute_real_start has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def _compute_real_start(self):
                    for overtime in self:
                        overtime.real_date_start = False
                        if not overtime.start_attendance_id or not overtime.date_start:
                            continue
            Severity: Minor
            Found in hr_attendance_overtime_request/models/hr_overtime_request.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 button_import has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def button_import(self):
                    self.ensure_one()
            
                    obj_hr_attendance = self.env["hr.attendance"]
            
            
            Severity: Minor
            Found in hr_attendance_import_from_machine/wizards/hr_attendance_import.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 _compute_work_longetivity has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def _compute_work_longetivity(self):
                    for document in self:
                        year_work = month_work = 0
                        if document.date_join:
                            if not document.date_termination:
            Severity: Minor
            Found in hr_employee_join_termination_date/models/hr_employee.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 _get_holidays_sequence has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def _get_holidays_sequence(self):
                    self.ensure_one()
                    context = self._context
            
                    default_type = context.get("default_type", False)
            Severity: Minor
            Found in hr_holiday_code/models/hr_holidays.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 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_dicipline/models/hr_dicipline.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 _create_participant_evaluation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def _create_participant_evaluation(self):
                    self.ensure_one()
                    obj_evaluation = self.env["hr.training_participant_evaluation"]
                    for participant in self.partisipant_ids:
                        for evaluation in self.evaluation_ids:
            Severity: Minor
            Found in hr_employee_training_evaluation/models/hr_training.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_session_close has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def _check_session_close(self):
                    strWarning = _("There are unfinished session(s)")
                    if self.state == "finish":
                        for session in self.session_ids:
                            if session.state not in ["finish", "cancel"]:
            Severity: Minor
            Found in hr_employee_training/models/hr_training.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_level.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 document in self:
                        if document.state != "draft":
                            if not self.env.context.get("force_unlink", False):

            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_current_contract has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def _compute_current_contract(self):
                    for employee in self:
                        contract = False
                        if employee.contract_ids:
                            contracts = employee.contract_ids.sorted(
            Severity: Minor
            Found in hr_employee_data_from_contract/models/hr_employee.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