open-synergy/opnsynid-hr

View on GitHub

Showing 547 of 547 total issues

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

    @api.multi
    def _get_accrue_income_account(self):
        self.ensure_one()
        if not self.accrue_income_account_id:
            err_msg = _("No accrue income account defined")
Severity: Major
Found in hr_timesheet_accrue_income/models/hr_analytic_timesheet.py and 3 other locations - About 1 hr to fix
hr_timesheet_accrue_expense/models/hr_analytic_timesheet.py on lines 126..132
hr_timesheet_accrue_expense/models/hr_analytic_timesheet.py on lines 134..140
hr_timesheet_accrue_income/models/hr_analytic_timesheet.py on lines 142..148

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

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

    @api.multi
    def _get_accrue_expense_journal(self):
        self.ensure_one()
        if not self.accrue_expense_journal_id:
            err_msg = _("No accrue expense journal defined")
hr_timesheet_accrue_expense/models/hr_analytic_timesheet.py on lines 134..140
hr_timesheet_accrue_income/models/hr_analytic_timesheet.py on lines 142..148
hr_timesheet_accrue_income/models/hr_analytic_timesheet.py on lines 150..156

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

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",
        required=True,
        readonly=True,
        track_visibility="onchange",
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 239..248

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

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 validate_tier(self):
        _super = super(HrPayslip, self)
        _super.validate_tier()
        for document in self:
Severity: Major
Found in hr_payslip_multiple_approval/models/hr_payslip.py and 1 other location - About 1 hr to fix
hr_timesheet_sheet_multiple_approval/models/hr_timesheet_sheet_sheet.py on lines 23..29

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

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 validate_tier(self):
        _super = super(HrTimesheetSheetSheet, self)
        _super.validate_tier()
        for document in self:
hr_payslip_multiple_approval/models/hr_payslip.py on lines 22..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 48.

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.model
    def _default_employee_id(self):
        if len(self.env.user.employee_ids) > 0:
            return self.env.user.employee_ids[0].id
Severity: Major
Found in hr_payslip_security/models/hr_payslip.py and 1 other location - About 1 hr to fix
hr_contract_additional_field/models/hr_contract.py on lines 12..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 47.

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

        with self.assertRaises(except_orm):
            self.obj_payslip.sudo(self.user_4).create(
                {
                    "name": "Payslip 11",
                    "employee_id": self.employee_1.id,
Severity: Major
Found in hr_payslip_security/tests/test_payslip_operator.py and 7 other locations - About 1 hr to fix
hr_payslip_security/tests/test_payslip_operator.py on lines 40..46
hr_payslip_security/tests/test_payslip_operator.py on lines 58..64
hr_payslip_security/tests/test_payslip_operator.py on lines 76..82
hr_payslip_security/tests/test_payslip_operator.py on lines 116..122
hr_payslip_security/tests/test_payslip_operator.py on lines 134..140
hr_payslip_security/tests/test_payslip_operator.py on lines 197..203
hr_payslip_security/tests/test_payslip_operator.py on lines 344..350

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

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.model
    def _default_employee_id(self):
        if len(self.env.user.employee_ids) > 0:
            return self.env.user.employee_ids[0].id
Severity: Major
Found in hr_contract_additional_field/models/hr_contract.py and 1 other location - About 1 hr to fix
hr_payslip_security/models/hr_payslip.py on lines 11..14

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

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

    company_id = fields.Many2one(
        string="Company",
        comodel_name="res.company",
        default=lambda self: self._default_company_id(),
        ondelete="restrict",
Severity: Major
Found in hr_career_transition/models/hr_career_transition.py and 1 other location - About 1 hr to fix
hr_recruitment_request/models/hr_recruitment_request.py on lines 53..61

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

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

        with self.assertRaises(except_orm):
            self.obj_payslip.sudo(self.user_1).create(
                {
                    "name": "Payslip 2",
                    "employee_id": self.employee_2.id,
Severity: Major
Found in hr_payslip_security/tests/test_payslip_operator.py and 7 other locations - About 1 hr to fix
hr_payslip_security/tests/test_payslip_operator.py on lines 58..64
hr_payslip_security/tests/test_payslip_operator.py on lines 76..82
hr_payslip_security/tests/test_payslip_operator.py on lines 116..122
hr_payslip_security/tests/test_payslip_operator.py on lines 134..140
hr_payslip_security/tests/test_payslip_operator.py on lines 197..203
hr_payslip_security/tests/test_payslip_operator.py on lines 216..222
hr_payslip_security/tests/test_payslip_operator.py on lines 344..350

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

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

        with self.assertRaises(except_orm):
            self.obj_payslip.sudo(self.user_1).create(
                {
                    "name": "Payslip 3",
                    "employee_id": self.employee_3.id,
Severity: Major
Found in hr_payslip_security/tests/test_payslip_operator.py and 7 other locations - About 1 hr to fix
hr_payslip_security/tests/test_payslip_operator.py on lines 40..46
hr_payslip_security/tests/test_payslip_operator.py on lines 76..82
hr_payslip_security/tests/test_payslip_operator.py on lines 116..122
hr_payslip_security/tests/test_payslip_operator.py on lines 134..140
hr_payslip_security/tests/test_payslip_operator.py on lines 197..203
hr_payslip_security/tests/test_payslip_operator.py on lines 216..222
hr_payslip_security/tests/test_payslip_operator.py on lines 344..350

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

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

    company_id = fields.Many2one(
        string="Company",
        comodel_name="res.company",
        default=lambda self: self._default_company_id(),
        ondelete="restrict",
Severity: Major
Found in hr_recruitment_request/models/hr_recruitment_request.py and 1 other location - About 1 hr to fix
hr_career_transition/models/hr_career_transition.py on lines 73..81

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

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

        with self.assertRaises(except_orm):
            self.obj_payslip.sudo(self.user_1).create(
                {
                    "name": "Payslip 4",
                    "employee_id": self.employee_4.id,
Severity: Major
Found in hr_payslip_security/tests/test_payslip_operator.py and 7 other locations - About 1 hr to fix
hr_payslip_security/tests/test_payslip_operator.py on lines 40..46
hr_payslip_security/tests/test_payslip_operator.py on lines 58..64
hr_payslip_security/tests/test_payslip_operator.py on lines 116..122
hr_payslip_security/tests/test_payslip_operator.py on lines 134..140
hr_payslip_security/tests/test_payslip_operator.py on lines 197..203
hr_payslip_security/tests/test_payslip_operator.py on lines 216..222
hr_payslip_security/tests/test_payslip_operator.py on lines 344..350

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

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

        with self.assertRaises(except_orm):
            self.obj_payslip.sudo(self.user_2).create(
                {
                    "name": "Payslip 6",
                    "employee_id": self.employee_1.id,
Severity: Major
Found in hr_payslip_security/tests/test_payslip_operator.py and 7 other locations - About 1 hr to fix
hr_payslip_security/tests/test_payslip_operator.py on lines 40..46
hr_payslip_security/tests/test_payslip_operator.py on lines 58..64
hr_payslip_security/tests/test_payslip_operator.py on lines 76..82
hr_payslip_security/tests/test_payslip_operator.py on lines 134..140
hr_payslip_security/tests/test_payslip_operator.py on lines 197..203
hr_payslip_security/tests/test_payslip_operator.py on lines 216..222
hr_payslip_security/tests/test_payslip_operator.py on lines 344..350

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

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

        with self.assertRaises(except_orm):
            self.obj_payslip.sudo(self.user_2).create(
                {
                    "name": "Payslip 7",
                    "employee_id": self.employee_4.id,
Severity: Major
Found in hr_payslip_security/tests/test_payslip_operator.py and 7 other locations - About 1 hr to fix
hr_payslip_security/tests/test_payslip_operator.py on lines 40..46
hr_payslip_security/tests/test_payslip_operator.py on lines 58..64
hr_payslip_security/tests/test_payslip_operator.py on lines 76..82
hr_payslip_security/tests/test_payslip_operator.py on lines 116..122
hr_payslip_security/tests/test_payslip_operator.py on lines 197..203
hr_payslip_security/tests/test_payslip_operator.py on lines 216..222
hr_payslip_security/tests/test_payslip_operator.py on lines 344..350

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

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

        with self.assertRaises(except_orm):
            self.obj_payslip.sudo(self.user_8).create(
                {
                    "name": "Payslip 16",
                    "employee_id": self.employee_11.id,
Severity: Major
Found in hr_payslip_security/tests/test_payslip_operator.py and 7 other locations - About 1 hr to fix
hr_payslip_security/tests/test_payslip_operator.py on lines 40..46
hr_payslip_security/tests/test_payslip_operator.py on lines 58..64
hr_payslip_security/tests/test_payslip_operator.py on lines 76..82
hr_payslip_security/tests/test_payslip_operator.py on lines 116..122
hr_payslip_security/tests/test_payslip_operator.py on lines 134..140
hr_payslip_security/tests/test_payslip_operator.py on lines 197..203
hr_payslip_security/tests/test_payslip_operator.py on lines 216..222

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

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

    employee_id = fields.Many2one(
        string="Employee",
        comodel_name="hr.employee",
        default=lambda self: self._default_employee_id(),
        required=True,
Severity: Major
Found in hr_dicipline/models/hr_dicipline.py and 1 other location - About 1 hr to fix
hr_award/models/hr_award.py on lines 94..102

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

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

    employee_id = fields.Many2one(
        string="Employee",
        comodel_name="hr.employee",
        default=lambda self: self._default_employee_id(),
        required=True,
Severity: Major
Found in hr_award/models/hr_award.py and 1 other location - About 1 hr to fix
hr_dicipline/models/hr_dicipline.py on lines 92..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 47.

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

        with self.assertRaises(except_orm):
            self.obj_payslip.sudo(self.user_4).create(
                {
                    "name": "Payslip 10",
                    "employee_id": self.employee_1.id,
Severity: Major
Found in hr_payslip_security/tests/test_payslip_operator.py and 7 other locations - About 1 hr to fix
hr_payslip_security/tests/test_payslip_operator.py on lines 40..46
hr_payslip_security/tests/test_payslip_operator.py on lines 58..64
hr_payslip_security/tests/test_payslip_operator.py on lines 76..82
hr_payslip_security/tests/test_payslip_operator.py on lines 116..122
hr_payslip_security/tests/test_payslip_operator.py on lines 134..140
hr_payslip_security/tests/test_payslip_operator.py on lines 216..222
hr_payslip_security/tests/test_payslip_operator.py on lines 344..350

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

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_value_before_onchange_previous_contract(self):
        _super = super(HrCareerTransition, self)
        result = _super._get_value_before_onchange_previous_contract()
        result.update(
hr_career_transition_payslip_input_policy/models/hr_career_transition.py on lines 33..43

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

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