open-synergy/opnsynid-hr

View on GitHub

Showing 547 of 547 total issues

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

    ref = fields.Char(
        string="# Reference",
        required=True,
        default="/",
        readonly=True,
Severity: Major
Found in hr_recruitment_request/models/hr_recruitment_request.py and 3 other locations - About 40 mins to fix
hr_career_transition/models/hr_career_transition.py on lines 51..58
hr_career_transition/models/hr_career_transition.py on lines 62..69
hr_recruitment_request/models/hr_recruitment_request.py on lines 31..38

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

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

    pre_post_test = fields.Selection(
        string="Pre/Post Evaluation",
        selection=[
            ("pre", "Pre Evaluation"),
            ("post", "Post Evaluation"),
hr_employee_training/models/hr_training_attendance.py on lines 49..53

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

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

    @api.multi
    @api.depends(
        "company_id",
    )
    def _compute_policy(self):
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 109..115
hr_award/models/hr_award.py on lines 39..45
hr_career_transition/models/hr_career_transition.py on lines 28..34
hr_dicipline/models/hr_dicipline.py on lines 37..43
hr_expense_workflow_policy/models/hr_expense.py on lines 12..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 34.

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

    new_timesheet_computation_ids = fields.One2many(
        string="New Timesheet Computations",
        comodel_name="hr.career_transition_new_timesheet_computation",
        inverse_name="career_transition_id",
        readonly=True,
hr_career_transition/models/hr_career_transition.py on lines 137..144
hr_career_transition/models/hr_career_transition.py on lines 149..156
hr_career_transition/models/hr_career_transition.py on lines 196..203
hr_career_transition/models/hr_career_transition.py on lines 208..215
hr_career_transition/models/hr_career_transition.py on lines 219..226
hr_career_transition/models/hr_career_transition.py on lines 230..237
hr_career_transition/models/hr_career_transition.py on lines 241..248
hr_career_transition/models/hr_career_transition.py on lines 252..259
hr_career_transition_payslip_input_policy/models/hr_career_transition.py on lines 12..19
hr_employee_training/models/hr_training.py on lines 283..290
hr_employee_training/models/hr_training.py on lines 294..301
hr_employee_training_allowance/models/hr_training.py on lines 11..18
hr_employee_training_evaluation/models/hr_training.py on lines 35..42
hr_payslip_security/models/hr_payslip.py on lines 20..27
hr_recruitment_request/models/hr_recruitment_request.py on lines 102..109
hr_timesheet_attendance_schedule/models/hr_timesheet_sheet.py on lines 15..22
hr_timesheet_computation/models/hr_timesheet_sheet.py on lines 11..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 34.

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

    partisipant_ids = fields.One2many(
        string="Partisipants",
        comodel_name="hr.training_partisipant",
        inverse_name="training_id",
        readonly=True,
Severity: Major
Found in hr_employee_training/models/hr_training.py and 17 other locations - About 40 mins to fix
hr_career_transition/models/hr_career_transition.py on lines 137..144
hr_career_transition/models/hr_career_transition.py on lines 149..156
hr_career_transition/models/hr_career_transition.py on lines 196..203
hr_career_transition/models/hr_career_transition.py on lines 208..215
hr_career_transition/models/hr_career_transition.py on lines 219..226
hr_career_transition/models/hr_career_transition.py on lines 230..237
hr_career_transition/models/hr_career_transition.py on lines 241..248
hr_career_transition/models/hr_career_transition.py on lines 252..259
hr_career_transition_payslip_input_policy/models/hr_career_transition.py on lines 12..19
hr_career_transition_timesheet_computation/models/hr_career_transition.py on lines 12..19
hr_employee_training/models/hr_training.py on lines 294..301
hr_employee_training_allowance/models/hr_training.py on lines 11..18
hr_employee_training_evaluation/models/hr_training.py on lines 35..42
hr_payslip_security/models/hr_payslip.py on lines 20..27
hr_recruitment_request/models/hr_recruitment_request.py on lines 102..109
hr_timesheet_attendance_schedule/models/hr_timesheet_sheet.py on lines 15..22
hr_timesheet_computation/models/hr_timesheet_sheet.py on lines 11..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 34.

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

    new_company_id = fields.Many2one(
        string="New Company",
        comodel_name="res.company",
        ondelete="restrict",
        readonly=True,
Severity: Major
Found in hr_career_transition/models/hr_career_transition.py and 17 other locations - About 40 mins to fix
hr_career_transition/models/hr_career_transition.py on lines 137..144
hr_career_transition/models/hr_career_transition.py on lines 149..156
hr_career_transition/models/hr_career_transition.py on lines 196..203
hr_career_transition/models/hr_career_transition.py on lines 219..226
hr_career_transition/models/hr_career_transition.py on lines 230..237
hr_career_transition/models/hr_career_transition.py on lines 241..248
hr_career_transition/models/hr_career_transition.py on lines 252..259
hr_career_transition_payslip_input_policy/models/hr_career_transition.py on lines 12..19
hr_career_transition_timesheet_computation/models/hr_career_transition.py on lines 12..19
hr_employee_training/models/hr_training.py on lines 283..290
hr_employee_training/models/hr_training.py on lines 294..301
hr_employee_training_allowance/models/hr_training.py on lines 11..18
hr_employee_training_evaluation/models/hr_training.py on lines 35..42
hr_payslip_security/models/hr_payslip.py on lines 20..27
hr_recruitment_request/models/hr_recruitment_request.py on lines 102..109
hr_timesheet_attendance_schedule/models/hr_timesheet_sheet.py on lines 15..22
hr_timesheet_computation/models/hr_timesheet_sheet.py on lines 11..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 34.

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

    ref = fields.Char(
        string="# Reference",
        required=True,
        default="/",
        readonly=True,
Severity: Major
Found in hr_career_transition/models/hr_career_transition.py and 3 other locations - About 40 mins to fix
hr_career_transition/models/hr_career_transition.py on lines 51..58
hr_recruitment_request/models/hr_recruitment_request.py on lines 31..38
hr_recruitment_request/models/hr_recruitment_request.py on lines 42..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 34.

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

        onchange = new.onchange_employee_id(
            date_to=new.date_to,
            date_from=new.date_from,
            employee_id=new.employee_id.id,
            contract_id=new.contract_id.id,
hr_payslip_compute_sheet/tests/test_hr_payslip.py on lines 96..100

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

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

    name = fields.Char(
        string="# Batch",
        required=True,
        readonly=True,
        states={"draft": [("readonly", False)]},
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 172..178
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 183..189

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

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

    @api.multi
    @api.depends(
        "journal_id",
    )
    def _compute_policy(self):
Severity: Major
Found in hr_expense_workflow_policy/models/hr_expense.py and 5 other locations - About 40 mins to fix
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 109..115
hr_award/models/hr_award.py on lines 39..45
hr_career_transition/models/hr_career_transition.py on lines 28..34
hr_dicipline/models/hr_dicipline.py on lines 37..43
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 31..37

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

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

    @api.multi
    @api.depends(
        "type_id",
    )
    def _compute_policy(self):
Severity: Major
Found in hr_career_transition/models/hr_career_transition.py and 5 other locations - About 40 mins to fix
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 109..115
hr_award/models/hr_award.py on lines 39..45
hr_dicipline/models/hr_dicipline.py on lines 37..43
hr_expense_workflow_policy/models/hr_expense.py on lines 12..18
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 31..37

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

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

        onchange = new.onchange_employee_id(
            date_to=new.date_to,
            date_from=new.date_from,
            employee_id=new.employee_id.id,
            contract_id=new.contract_id.id,
Severity: Minor
Found in hr_payslip_compute_sheet/tests/test_hr_payslip.py and 1 other location - About 40 mins to fix
hr_worked_days_compute_holiday/tests/test_get_worked_day_lines.py on lines 116..120

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

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

    name = fields.Char(
        string="# Document",
        required=True,
        default="/",
        readonly=True,
Severity: Major
Found in hr_recruitment_request/models/hr_recruitment_request.py and 3 other locations - About 40 mins to fix
hr_career_transition/models/hr_career_transition.py on lines 51..58
hr_career_transition/models/hr_career_transition.py on lines 62..69
hr_recruitment_request/models/hr_recruitment_request.py on lines 42..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 34.

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

    request_by_id = fields.Many2one(
        string="Request By",
        comodel_name="hr.employee",
        required=True,
        readonly=True,
Severity: Major
Found in hr_employee_training/models/hr_training.py and 6 other locations - About 40 mins to fix
hr_award/models/hr_award.py on lines 67..74
hr_award/models/hr_award.py on lines 78..85
hr_dicipline/models/hr_dicipline.py on lines 65..72
hr_dicipline/models/hr_dicipline.py on lines 76..83
hr_employee_training/models/hr_training.py on lines 199..206
hr_employee_training/models/hr_training.py on lines 220..227

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

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

    @api.multi
    @api.depends(
        "company_id",
    )
    def _compute_policy(self):
Severity: Major
Found in hr_attendance_overtime_request/models/hr_overtime_request.py and 5 other locations - About 40 mins to fix
hr_award/models/hr_award.py on lines 39..45
hr_career_transition/models/hr_career_transition.py on lines 28..34
hr_dicipline/models/hr_dicipline.py on lines 37..43
hr_expense_workflow_policy/models/hr_expense.py on lines 12..18
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 31..37

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

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

    reason_id = fields.Many2one(
        string="Reason",
        comodel_name="hr.dicipline_reason",
        required=True,
        readonly=True,
Severity: Major
Found in hr_dicipline/models/hr_dicipline.py and 6 other locations - About 40 mins to fix
hr_award/models/hr_award.py on lines 67..74
hr_award/models/hr_award.py on lines 78..85
hr_dicipline/models/hr_dicipline.py on lines 65..72
hr_employee_training/models/hr_training.py on lines 188..195
hr_employee_training/models/hr_training.py on lines 199..206
hr_employee_training/models/hr_training.py on lines 220..227

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

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

    type_id = fields.Many2one(
        string="Type",
        comodel_name="hr.award_type",
        required=True,
        readonly=True,
Severity: Major
Found in hr_award/models/hr_award.py and 6 other locations - About 40 mins to fix
hr_award/models/hr_award.py on lines 78..85
hr_dicipline/models/hr_dicipline.py on lines 65..72
hr_dicipline/models/hr_dicipline.py on lines 76..83
hr_employee_training/models/hr_training.py on lines 188..195
hr_employee_training/models/hr_training.py on lines 199..206
hr_employee_training/models/hr_training.py on lines 220..227

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

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

    responsible_id = fields.Many2one(
        string="Primary PIC",
        comodel_name="hr.employee",
        required=True,
        readonly=True,
Severity: Major
Found in hr_employee_training/models/hr_training.py and 6 other locations - About 40 mins to fix
hr_award/models/hr_award.py on lines 67..74
hr_award/models/hr_award.py on lines 78..85
hr_dicipline/models/hr_dicipline.py on lines 65..72
hr_dicipline/models/hr_dicipline.py on lines 76..83
hr_employee_training/models/hr_training.py on lines 188..195
hr_employee_training/models/hr_training.py on lines 220..227

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

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

    date_start = fields.Datetime(
        string="Date Start",
        required=True,
        readonly=True,
        states={
Severity: Major
Found in hr_attendance_overtime_request/models/hr_overtime_request.py and 2 other locations - About 40 mins to fix
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 183..189
hr_attendance_overtime_request_batch/models/hr_overtime_request_batch.py on lines 16..20

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

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

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
    Severity
    Category
    Status
    Source
    Language