open-synergy/opnsynid-hr

View on GitHub

Showing 547 of 547 total issues

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

    @api.multi
    def _get_next_attendance(self):
        self.ensure_one()
        criteria = [
            ("employee_id", "=", self.employee_id.id),
Severity: Major
Found in hr_attendance_monkeypatch/models/hr_attendance.py and 1 other location - About 2 hrs to fix
hr_attendance_monkeypatch/models/hr_attendance.py on lines 55..63

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 56.

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

    def _floor_rounding(self, rounding, datetime_):
        minutes = datetime_.minute / 60.0 + datetime_.second / 3600.0
        return math.floor(minutes * rounding) / rounding
Severity: Major
Found in hr_attendance_computation/models/hr_attendance.py and 1 other location - About 2 hrs to fix
hr_attendance_computation/models/hr_attendance.py on lines 189..191

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 56.

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 2 locations. Consider refactoring.
Open

    @api.multi
    def _prepare_restart_data(self):
        self.ensure_one()
        result = {
            "state": "draft",
Severity: Major
Found in hr_award/models/hr_award.py and 1 other location - About 2 hrs to fix
hr_dicipline/models/hr_dicipline.py on lines 351..370

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 55.

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 2 locations. Consider refactoring.
Open

    @api.multi
    def _prepare_restart_data(self):
        self.ensure_one()
        result = {
            "state": "draft",
Severity: Major
Found in hr_dicipline/models/hr_dicipline.py and 1 other location - About 2 hrs to fix
hr_award/models/hr_award.py on lines 353..372

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 55.

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

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

class HrAward(models.Model):
    _name = "hr.award"
    _description = "Employee Award"
    _inherit = [
        "mail.thread",
Severity: Minor
Found in hr_award/models/hr_award.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

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

      Severity: Major
      Found in hr_holiday_code/models/res_company.py and 1 other location - About 2 hrs to fix
      hr_holiday_code/models/hr_holidays_status.py on lines 0..17

      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 54.

      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

      Severity: Major
      Found in hr_holiday_code/models/hr_holidays_status.py and 1 other location - About 2 hrs to fix
      hr_holiday_code/models/res_company.py on lines 0..17

      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 54.

      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 2 locations. Consider refactoring.
      Open

          state = fields.Selection(
              string="State",
              copy=False,
              selection=[
                  ("draft", "Draft"),
      Severity: Major
      Found in hr_award/models/hr_award.py and 1 other location - About 2 hrs to fix
      hr_dicipline/models/hr_dicipline.py on lines 130..139

      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 53.

      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 2 locations. Consider refactoring.
      Open

          state = fields.Selection(
              string="State",
              copy=False,
              selection=[
                  ("draft", "Draft"),
      Severity: Major
      Found in hr_dicipline/models/hr_dicipline.py and 1 other location - About 2 hrs to fix
      hr_award/models/hr_award.py on lines 132..141

      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 53.

      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

              self.user_3 = self.obj_user.sudo().create(
                  {
                      "login": "user.3",
                      "name": "User 3",
                      "password": "a",
      Severity: Major
      Found in hr_payslip_security/tests/base.py and 1 other location - About 2 hrs to fix
      hr_payslip_security/tests/base.py on lines 297..311

      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 53.

      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

          @api.multi
          @api.onchange("home_lau1_id")
          def onchange_home_lau2(self):
              for employee in self:
                  if (
      Severity: Major
      Found in hr_employee_lau_from_home_address/models/hr_employee.py and 1 other location - About 2 hrs to fix
      hr_employee_lau3_from_home_address/models/hr_employee.py on lines 20..28

      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 53.

      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

              self.user_7 = self.obj_user.sudo().create(
                  {
                      "login": "user.7",
                      "name": "User 7",
                      "password": "a",
      Severity: Major
      Found in hr_payslip_security/tests/base.py and 1 other location - About 2 hrs to fix
      hr_payslip_security/tests/base.py on lines 185..191

      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 53.

      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

          @api.multi
          def _get_fine_move_partner(self):
              self.ensure_one()
              result = self.employee_id.address_home_id
              if not result:
      Severity: Major
      Found in hr_dicipline_fine/models/hr_dicipline.py and 1 other location - About 2 hrs to fix
      hr_timesheet_accrue_income/models/hr_analytic_timesheet.py on lines 193..200

      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 53.

      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

          @api.multi
          def _get_accrue_income_partner(self):
              self.ensure_one()
              partner = self.account_id.partner_id
              if not partner:
      Severity: Major
      Found in hr_timesheet_accrue_income/models/hr_analytic_timesheet.py and 1 other location - About 2 hrs to fix
      hr_dicipline_fine/models/hr_dicipline.py on lines 86..93

      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 53.

      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

          @api.multi
          @api.onchange("home_lau2_id")
          def onchange_home_lau3(self):
              for employee in self:
                  if (
      Severity: Major
      Found in hr_employee_lau3_from_home_address/models/hr_employee.py and 1 other location - About 2 hrs to fix
      hr_employee_lau_from_home_address/models/hr_employee.py on lines 28..36

      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 53.

      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 15 locations. Consider refactoring.
      Open

      Severity: Major
      Found in hr_demotion_transition/models/tier_definition.py and 14 other locations - About 2 hrs to fix
      hr_assignment_transition/models/tier_definition.py on lines 0..16
      hr_attendance_overtime_request/models/tier_definition.py on lines 0..15
      hr_attendance_overtime_request_tier_validation/models/tier_definition.py on lines 0..15
      hr_award/models/tier_definition.py on lines 0..15
      hr_dicipline/models/tier_definition.py on lines 0..15
      hr_expense_tier_validation/models/tier_definition.py on lines 0..15
      hr_join_transition/models/tier_definition.py on lines 0..16
      hr_mutation_transition/models/tier_definition.py on lines 0..16
      hr_payslip_multiple_approval/models/tier_definition.py on lines 0..15
      hr_promotion_transition/models/tier_definition.py on lines 0..16
      hr_termination_transition/models/tier_definition.py on lines 0..16
      hr_timesheet_attendance_schedule/models/tier_definition.py on lines 0..15
      hr_timesheet_sheet_multiple_approval/models/tier_definition.py on lines 0..15
      hr_timesheet_tier_validation/models/tier_definition.py on lines 0..15

      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 52.

      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 15 locations. Consider refactoring.
      Open

      Severity: Major
      Found in hr_assignment_transition/models/tier_definition.py and 14 other locations - About 2 hrs to fix
      hr_attendance_overtime_request/models/tier_definition.py on lines 0..15
      hr_attendance_overtime_request_tier_validation/models/tier_definition.py on lines 0..15
      hr_award/models/tier_definition.py on lines 0..15
      hr_demotion_transition/models/tier_definition.py on lines 0..16
      hr_dicipline/models/tier_definition.py on lines 0..15
      hr_expense_tier_validation/models/tier_definition.py on lines 0..15
      hr_join_transition/models/tier_definition.py on lines 0..16
      hr_mutation_transition/models/tier_definition.py on lines 0..16
      hr_payslip_multiple_approval/models/tier_definition.py on lines 0..15
      hr_promotion_transition/models/tier_definition.py on lines 0..16
      hr_termination_transition/models/tier_definition.py on lines 0..16
      hr_timesheet_attendance_schedule/models/tier_definition.py on lines 0..15
      hr_timesheet_sheet_multiple_approval/models/tier_definition.py on lines 0..15
      hr_timesheet_tier_validation/models/tier_definition.py on lines 0..15

      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 52.

      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 15 locations. Consider refactoring.
      Open

      Severity: Major
      Found in hr_dicipline/models/tier_definition.py and 14 other locations - About 2 hrs to fix
      hr_assignment_transition/models/tier_definition.py on lines 0..16
      hr_attendance_overtime_request/models/tier_definition.py on lines 0..15
      hr_attendance_overtime_request_tier_validation/models/tier_definition.py on lines 0..15
      hr_award/models/tier_definition.py on lines 0..15
      hr_demotion_transition/models/tier_definition.py on lines 0..16
      hr_expense_tier_validation/models/tier_definition.py on lines 0..15
      hr_join_transition/models/tier_definition.py on lines 0..16
      hr_mutation_transition/models/tier_definition.py on lines 0..16
      hr_payslip_multiple_approval/models/tier_definition.py on lines 0..15
      hr_promotion_transition/models/tier_definition.py on lines 0..16
      hr_termination_transition/models/tier_definition.py on lines 0..16
      hr_timesheet_attendance_schedule/models/tier_definition.py on lines 0..15
      hr_timesheet_sheet_multiple_approval/models/tier_definition.py on lines 0..15
      hr_timesheet_tier_validation/models/tier_definition.py on lines 0..15

      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 52.

      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 15 locations. Consider refactoring.
      Open

      Severity: Major
      Found in hr_timesheet_tier_validation/models/tier_definition.py and 14 other locations - About 2 hrs to fix
      hr_assignment_transition/models/tier_definition.py on lines 0..16
      hr_attendance_overtime_request/models/tier_definition.py on lines 0..15
      hr_attendance_overtime_request_tier_validation/models/tier_definition.py on lines 0..15
      hr_award/models/tier_definition.py on lines 0..15
      hr_demotion_transition/models/tier_definition.py on lines 0..16
      hr_dicipline/models/tier_definition.py on lines 0..15
      hr_expense_tier_validation/models/tier_definition.py on lines 0..15
      hr_join_transition/models/tier_definition.py on lines 0..16
      hr_mutation_transition/models/tier_definition.py on lines 0..16
      hr_payslip_multiple_approval/models/tier_definition.py on lines 0..15
      hr_promotion_transition/models/tier_definition.py on lines 0..16
      hr_termination_transition/models/tier_definition.py on lines 0..16
      hr_timesheet_attendance_schedule/models/tier_definition.py on lines 0..15
      hr_timesheet_sheet_multiple_approval/models/tier_definition.py on lines 0..15

      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 52.

      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