open-synergy/opnsynid-hr

View on GitHub

Showing 88 of 547 total issues

File hr_career_transition.py has 734 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

Severity: Major
Found in hr_career_transition/models/hr_career_transition.py - About 1 day to fix

    Function _compute_attendance_duration has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
    Open

        def _compute_attendance_duration(self):  # noqa C901
            precision = (
                self.env["res.users"]
                .browse(self.env.user.id)
                .company_id.working_time_precision
    Severity: Minor
    Found in hr_attendance_computation/models/hr_attendance.py - About 1 day 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

    File hr_overtime_request.py has 425 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    # Copyright 2022 OpenSynergy Indonesia
    # Copyright 2022 PT. Simetri Sinergi Indonesia
    # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
    
    
    Severity: Minor
    Found in hr_attendance_overtime_request/models/hr_overtime_request.py - About 6 hrs to fix

      HrCareerTransition has 43 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class HrCareerTransition(models.Model):
          _name = "hr.career_transition"
          _description = "Career Transition"
          _inherit = [
              "mail.thread",
      Severity: Minor
      Found in hr_career_transition/models/hr_career_transition.py - About 5 hrs to fix

        File hr_training.py has 394 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        # Copyright 2018 OpenSynergy Indonesia
        # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
        
        from openerp import api, fields, models
        Severity: Minor
        Found in hr_employee_training/models/hr_training.py - About 5 hrs to fix

          Function _compute_work_hour has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
          Open

              def _compute_work_hour(self):
                  for attn in self:
                      schedule_work_hour = (
                          real_work_hour
                      ) = (

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

              def _compute_policy(self):
                  user_group_ids = self.env.user.groups_id.ids
                  for training in self:
                      can_confirm = (
                          can_approve
          Severity: Minor
          Found in hr_employee_training/models/hr_training.py - About 4 hrs 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_data has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

              def prepare_data(self, row, line_num):
                  data = {}
                  test_error = False
          
                  machine_id = self.attendance_machine_id
          Severity: Minor
          Found in hr_attendance_import_from_machine/wizards/hr_attendance_import.py - About 4 hrs 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

          File hr_award.py has 348 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          # Copyright 2019 OpenSynergy Indonesia
          # Copyright 2020 PT. Simetri Sinergi Indonesia
          # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
          
          
          Severity: Minor
          Found in hr_award/models/hr_award.py - About 4 hrs to fix

            File hr_dicipline.py has 347 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            # Copyright 2019 OpenSynergy Indonesia
            # Copyright 2020 PT. Simetri Sinergi Indonesia
            # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
            from openerp import _, api, fields, models
            Severity: Minor
            Found in hr_dicipline/models/hr_dicipline.py - About 4 hrs to fix

              File hr_attendance.py has 343 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              # Copyright 2011 Domsense srl (<http://www.domsense.com>)
              # Copyright 2011-15 Agile Business Group sagl (<http://www.agilebg.com>)
              # Copyright 2017 OpenSynergy Indonesia (<https://opensynergy-indonesia.com>)
              # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
              Severity: Minor
              Found in hr_attendance_computation/models/hr_attendance.py - About 4 hrs to fix

                File base.py has 342 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                # Copyright 2018 OpenSynergy Indonesia
                # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
                
                from datetime import datetime, timedelta
                Severity: Minor
                Found in hr_payslip_security/tests/base.py - About 4 hrs to fix

                  File hr_recruitment_request.py has 324 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  # Copyright 2019 OpenSynergy Indonesia
                  # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
                  
                  from openerp import _, api, fields, models
                  Severity: Minor
                  Found in hr_recruitment_request/models/hr_recruitment_request.py - About 3 hrs to fix

                    HrOvertimeRequest has 27 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class HrOvertimeRequest(models.Model):
                        _name = "hr.overtime_request"
                        _description = "Attendance Overtime Request"
                        _inherit = [
                            "mail.thread",
                    Severity: Minor
                    Found in hr_attendance_overtime_request/models/hr_overtime_request.py - About 3 hrs to fix

                      File hr_attendance_import.py has 288 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      # Copyright 2018 OpenSynergy Indonesia
                      # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
                      import base64
                      import csv
                      Severity: Minor
                      Found in hr_attendance_import_from_machine/wizards/hr_attendance_import.py - About 2 hrs to fix

                        File hr_timesheet_attendance_schedule_change.py has 280 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        # Copyright 2018 OpenSynergy Indonesia
                        # Copyright 2020 PT. Simetri Sinergi Indonesia
                        # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
                        
                        

                          Function action_import_timesheet_activity has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def action_import_timesheet_activity(self):
                                  obj_uom = self.env["product.uom"]
                                  obj_timesheet_line = self.env["hr.analytic.timesheet"]
                                  obj_worked_days = self.env["hr.payslip.worked_days"]
                          
                          
                          Severity: Minor
                          Found in hr_worked_days_from_activity/models/hr_payslip.py - About 2 hrs 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 onchange_general_account_id has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def onchange_general_account_id(self):
                                  account = False
                                  is_sale_line = False
                          
                                  if self.journal_id:
                          Severity: Minor
                          Found in hr_timesheet_onchange/models/hr_analytic_timesheet.py - About 2 hrs 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

                          File test_hr_attendance.py has 274 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          # Copyright 2011 Domsense srl (<http://www.domsense.com>)
                          # Copyright 2011-15 Agile Business Group sagl (<http://www.agilebg.com>)
                          # Copyright 2016 OpenSynergy Indonesia (<https://opensynergy-indonesia.com>)
                          # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
                          Severity: Minor
                          Found in hr_attendance_computation/tests/test_hr_attendance.py - About 2 hrs to fix

                            HrDicipline has 22 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class HrDicipline(models.Model):
                                _name = "hr.dicipline"
                                _description = "Employee Dicipline"
                                _inherit = [
                                    "mail.thread",
                            Severity: Minor
                            Found in hr_dicipline/models/hr_dicipline.py - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language