open-synergy/opnsynid-hr

View on GitHub

Showing 547 of 547 total issues

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_demotion_transition/models/hr_demotion_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_termination_transition/models/hr_termination_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_mutation_transition/models/hr_mutation_transition.py - About 35 mins to fix

        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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      timesheet_state = fields.Selection(
                          string="Timesheet State",
                          selection=[
                              ("new", "New"),
                              ("draft", "Open"),
                  hr_payslip_analysis/reports/hr_payslip_analysis.py on lines 51..57

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 33.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      payslip_state = fields.Selection(
                          string="Payslip State",
                          selection=[
                              ("draft", "Draft"),
                              ("verify", "Waiting"),
                  Severity: Minor
                  Found in hr_payslip_analysis/reports/hr_payslip_analysis.py and 1 other location - About 35 mins to fix
                  hr_timesheet_computation/reports/hr_timesheet_computation_analysis.py on lines 43..49

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 33.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 3 locations. Consider refactoring.
                  Open

                      company_id = fields.Many2one(
                          string="Company",
                          comodel_name="res.company",
                          default=lambda self: self._default_company_id(),
                  hr_attendance_overtime_request/models/hr_overtime_request.py on lines 129..132
                  hr_payslip_workflow_policy/models/hr_payslip_run.py on lines 15..18

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 32.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language