open-synergy/opnsynid-hr

View on GitHub

Showing 547 of 547 total issues

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

        self.rule2 = self.obj_rule.create(
            {
                "name": "X Rule 2",
                "code": "X2",
                "category_id": self.rule_categ.id,
Severity: Major
Found in hr_payslip_input_policy/tests/test_hr_payslip.py and 1 other location - About 1 hr to fix
hr_payslip_input_policy/tests/test_hr_payslip.py on lines 32..40

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_timesheet_computation/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

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

        self.rule1 = self.obj_rule.create(
            {
                "name": "X Rule 1",
                "code": "X1",
                "category_id": self.rule_categ.id,
Severity: Major
Found in hr_payslip_input_policy/tests/test_hr_payslip.py and 1 other location - About 1 hr to fix
hr_payslip_input_policy/tests/test_hr_payslip.py on lines 44..52

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

    @api.multi
    def validate_tier(self):
        _super = super(HrOvertimeRequest, self)
        _super.validate_tier()
        for document in self:
hr_award/models/hr_award.py on lines 234..240
hr_career_transition/models/hr_career_transition.py on lines 458..464
hr_dicipline/models/hr_dicipline.py on lines 232..238
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 203..209

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

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

    @api.multi
    def validate_tier(self):
        _super = super(HrDicipline, self)
        _super.validate_tier()
        for document in self:
Severity: Major
Found in hr_dicipline/models/hr_dicipline.py and 4 other locations - About 1 hr to fix
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 303..309
hr_award/models/hr_award.py on lines 234..240
hr_career_transition/models/hr_career_transition.py on lines 458..464
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 203..209

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

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

    @api.multi
    def validate_tier(self):
        _super = super(HrAward, self)
        _super.validate_tier()
        for document in self:
Severity: Major
Found in hr_award/models/hr_award.py and 4 other locations - About 1 hr to fix
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 303..309
hr_career_transition/models/hr_career_transition.py on lines 458..464
hr_dicipline/models/hr_dicipline.py on lines 232..238
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 203..209

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

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

    @api.multi
    def validate_tier(self):
        _super = super(HrTimesheetAttendanceScheduleChange, self)
        _super.validate_tier()
        for document in self:
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 303..309
hr_award/models/hr_award.py on lines 234..240
hr_career_transition/models/hr_career_transition.py on lines 458..464
hr_dicipline/models/hr_dicipline.py on lines 232..238

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

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

    @api.multi
    def validate_tier(self):
        _super = super(HrCareerTransition, self)
        _super.validate_tier()
        for document in self:
Severity: Major
Found in hr_career_transition/models/hr_career_transition.py and 4 other locations - About 1 hr to fix
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 303..309
hr_award/models/hr_award.py on lines 234..240
hr_dicipline/models/hr_dicipline.py on lines 232..238
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 203..209

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

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 _create_participant_evaluation(self, participant):
        self.ensure_one()
        obj_evaluation = self.env["hr.training_participant_evaluation"]

hr_employee_training_allowance/models/hr_training_allowance.py on lines 92..96

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

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 _create_participant_allowance(self, participant):
        self.ensure_one()
        obj_allowance = self.env["hr.training_participant_allowance"]
        obj_allowance.create(self._prepare_participant_allowance(participant))
hr_employee_training_evaluation/models/hr_training_evaluation.py on lines 39..44

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

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

    def onchange_general_account_id(self):
        account = False
        is_sale_line = False
        obj_substitution = self.env["account.analytic_general_account_substitution"]

Severity: Minor
Found in hr_timesheet_general_account_policy/models/hr_analytic_timesheet.py - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

    @api.multi
    def _prepare_done_data(self):
        self.ensure_one()
        result = {
            "state": "done",
Severity: Major
Found in hr_dicipline/models/hr_dicipline.py and 12 other locations - About 1 hr to fix
hr_award/models/hr_award.py on lines 303..311
hr_award/models/hr_award.py on lines 313..321
hr_award/models/hr_award.py on lines 323..331
hr_award/models/hr_award.py on lines 333..341
hr_award/models/hr_award.py on lines 343..351
hr_dicipline/models/hr_dicipline.py on lines 301..309
hr_dicipline/models/hr_dicipline.py on lines 311..319
hr_dicipline/models/hr_dicipline.py on lines 321..329
hr_dicipline/models/hr_dicipline.py on lines 331..339
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 241..249
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 251..259
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 269..277

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

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

    @api.multi
    def _prepare_approve_data(self):
        self.ensure_one()
        result = {
            "state": "approve",
Severity: Major
Found in hr_award/models/hr_award.py and 12 other locations - About 1 hr to fix
hr_award/models/hr_award.py on lines 303..311
hr_award/models/hr_award.py on lines 323..331
hr_award/models/hr_award.py on lines 333..341
hr_award/models/hr_award.py on lines 343..351
hr_dicipline/models/hr_dicipline.py on lines 301..309
hr_dicipline/models/hr_dicipline.py on lines 311..319
hr_dicipline/models/hr_dicipline.py on lines 321..329
hr_dicipline/models/hr_dicipline.py on lines 331..339
hr_dicipline/models/hr_dicipline.py on lines 341..349
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 241..249
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 251..259
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 269..277

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

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

    @api.multi
    def _prepare_confirm_data(self):
        self.ensure_one()
        result = {
            "state": "confirm",
hr_award/models/hr_award.py on lines 303..311
hr_award/models/hr_award.py on lines 313..321
hr_award/models/hr_award.py on lines 323..331
hr_award/models/hr_award.py on lines 333..341
hr_award/models/hr_award.py on lines 343..351
hr_dicipline/models/hr_dicipline.py on lines 301..309
hr_dicipline/models/hr_dicipline.py on lines 311..319
hr_dicipline/models/hr_dicipline.py on lines 321..329
hr_dicipline/models/hr_dicipline.py on lines 331..339
hr_dicipline/models/hr_dicipline.py on lines 341..349
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 251..259
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 269..277

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

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

    @api.multi
    def _prepare_confirm_data(self):
        self.ensure_one()
        result = {
            "state": "confirm",
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 340..348
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 350..358
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 360..368
hr_attendance_overtime_request_batch/models/hr_overtime_request_batch.py on lines 241..249
hr_attendance_overtime_request_batch/models/hr_overtime_request_batch.py on lines 251..259
hr_career_transition/models/hr_career_transition.py on lines 473..481
hr_career_transition/models/hr_career_transition.py on lines 483..491
hr_recruitment_request/models/hr_recruitment_request.py on lines 255..263
hr_recruitment_request/models/hr_recruitment_request.py on lines 265..273
hr_recruitment_request/models/hr_recruitment_request.py on lines 275..283
hr_recruitment_request/models/hr_recruitment_request.py on lines 285..293

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

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

    @api.multi
    def _prepare_confirm_data(self):
        self.ensure_one()
        result = {
            "state": "confirm",
Severity: Major
Found in hr_career_transition/models/hr_career_transition.py and 11 other locations - About 1 hr to fix
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 340..348
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 350..358
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 360..368
hr_attendance_overtime_request_batch/models/hr_overtime_request_batch.py on lines 231..239
hr_attendance_overtime_request_batch/models/hr_overtime_request_batch.py on lines 241..249
hr_attendance_overtime_request_batch/models/hr_overtime_request_batch.py on lines 251..259
hr_career_transition/models/hr_career_transition.py on lines 483..491
hr_recruitment_request/models/hr_recruitment_request.py on lines 255..263
hr_recruitment_request/models/hr_recruitment_request.py on lines 265..273
hr_recruitment_request/models/hr_recruitment_request.py on lines 275..283
hr_recruitment_request/models/hr_recruitment_request.py on lines 285..293

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

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

        self.user_6 = self.obj_user.sudo().create(
            {
                "login": "user.6",
                "name": "User 6",
                "password": "a",
Severity: Major
Found in hr_payslip_security/tests/base.py and 2 other locations - About 1 hr to fix
hr_payslip_security/tests/base.py on lines 240..254
hr_payslip_security/tests/base.py on lines 359..365

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

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

    @api.multi
    def _prepare_valid_data(self):
        self.ensure_one()
        result = {
            "state": "valid",
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 340..348
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 350..358
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 360..368
hr_attendance_overtime_request_batch/models/hr_overtime_request_batch.py on lines 231..239
hr_attendance_overtime_request_batch/models/hr_overtime_request_batch.py on lines 251..259
hr_career_transition/models/hr_career_transition.py on lines 473..481
hr_career_transition/models/hr_career_transition.py on lines 483..491
hr_recruitment_request/models/hr_recruitment_request.py on lines 255..263
hr_recruitment_request/models/hr_recruitment_request.py on lines 265..273
hr_recruitment_request/models/hr_recruitment_request.py on lines 275..283
hr_recruitment_request/models/hr_recruitment_request.py on lines 285..293

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

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

    @api.multi
    def _prepare_cancel_data(self):
        self.ensure_one()
        result = {
            "state": "cancel",
Severity: Major
Found in hr_recruitment_request/models/hr_recruitment_request.py and 11 other locations - About 1 hr to fix
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 340..348
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 350..358
hr_attendance_overtime_request/models/hr_overtime_request.py on lines 360..368
hr_attendance_overtime_request_batch/models/hr_overtime_request_batch.py on lines 231..239
hr_attendance_overtime_request_batch/models/hr_overtime_request_batch.py on lines 241..249
hr_attendance_overtime_request_batch/models/hr_overtime_request_batch.py on lines 251..259
hr_career_transition/models/hr_career_transition.py on lines 473..481
hr_career_transition/models/hr_career_transition.py on lines 483..491
hr_recruitment_request/models/hr_recruitment_request.py on lines 255..263
hr_recruitment_request/models/hr_recruitment_request.py on lines 265..273
hr_recruitment_request/models/hr_recruitment_request.py on lines 275..283

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

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

    @api.multi
    def _prepare_approve_data(self):
        self.ensure_one()
        result = {
            "state": "approve",
Severity: Major
Found in hr_dicipline/models/hr_dicipline.py and 12 other locations - About 1 hr to fix
hr_award/models/hr_award.py on lines 303..311
hr_award/models/hr_award.py on lines 313..321
hr_award/models/hr_award.py on lines 323..331
hr_award/models/hr_award.py on lines 333..341
hr_award/models/hr_award.py on lines 343..351
hr_dicipline/models/hr_dicipline.py on lines 301..309
hr_dicipline/models/hr_dicipline.py on lines 321..329
hr_dicipline/models/hr_dicipline.py on lines 331..339
hr_dicipline/models/hr_dicipline.py on lines 341..349
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 241..249
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 251..259
hr_timesheet_attendance_schedule/models/hr_timesheet_attendance_schedule_change.py on lines 269..277

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

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