mangroveorg/datawinners

View on GitHub
func_tests/pages/reminderpage/reminder_settings_page.py

Summary

Maintainability
D
1 day
Test Coverage

ReminderSettingsPage has 42 functions (exceeds 20 allowed). Consider refactoring.
Open

class ReminderSettingsPage(Page):
    def __init__(self, driver):
        Page.__init__(self, driver)
        self.enable_reminder = {BEFORE_DEADLINE: self.enable_before_deadline_reminder,
                           ON_DEADLINE: self.enable_on_deadline_reminder,
Severity: Minor
Found in func_tests/pages/reminderpage/reminder_settings_page.py - About 5 hrs to fix

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

        def enable_on_deadline_reminder(self):
            try:
               self.driver.find(SWITCH_ENABLED_ON_DEADLINE)
    
            except CouldNotLocateElementException:
    Severity: Major
    Found in func_tests/pages/reminderpage/reminder_settings_page.py and 2 other locations - About 1 hr to fix
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 51..56
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 58..63

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 39.

    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

        def enable_after_deadline_reminder(self):
            try:
               self.driver.find(SWITCH_ENABLED_AFTER_DEADLINE)
    
            except CouldNotLocateElementException:
    Severity: Major
    Found in func_tests/pages/reminderpage/reminder_settings_page.py and 2 other locations - About 1 hr to fix
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 51..56
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 65..70

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

    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

        def enable_before_deadline_reminder(self):
            try:
               self.driver.find(SWITCH_ENABLED_BEFORE_DEADLINE)
    
            except CouldNotLocateElementException:
    Severity: Major
    Found in func_tests/pages/reminderpage/reminder_settings_page.py and 2 other locations - About 1 hr to fix
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 58..63
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 65..70

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

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

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

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

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

    Refactorings

    Further Reading

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

        def send_reminder_only_ds_not_submitted_data(self):
            checkbox =  self.driver.find(ONLY_DATASENDERS_NOT_SUBMITTED_CB)
            if not checkbox.is_selected():
                checkbox.click()
    Severity: Major
    Found in func_tests/pages/reminderpage/reminder_settings_page.py and 1 other location - About 1 hr to fix
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 97..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 38.

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

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

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

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

    Refactorings

    Further Reading

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

        def send_reminder_to_defaulters(self):
            checkbox =  self.driver.find(ONLY_DATASENDERS_NOT_SUBMITTED_CB)
            if not checkbox.is_selected():
                checkbox.click()
    Severity: Major
    Found in func_tests/pages/reminderpage/reminder_settings_page.py and 1 other location - About 1 hr to fix
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 72..75

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

    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

        def disable_on_deadline_reminder(self):
            checkbox =  self.driver.find(ON_DEADLINE_REMINDER_CB)
            if checkbox.is_selected():
                checkbox.click()
    Severity: Major
    Found in func_tests/pages/reminderpage/reminder_settings_page.py and 4 other locations - About 40 mins to fix
    func_tests/pages/adduserpage/add_user_page.py on lines 61..64
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 77..80
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 87..90
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 92..95

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

        def disable_after_deadline_reminder(self):
            checkbox =  self.driver.find(AFTER_DEADLINE_REMINDER_CB)
            if checkbox.is_selected():
                checkbox.click()
    Severity: Major
    Found in func_tests/pages/reminderpage/reminder_settings_page.py and 4 other locations - About 40 mins to fix
    func_tests/pages/adduserpage/add_user_page.py on lines 61..64
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 77..80
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 82..85
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 92..95

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

        def send_reminder_to_all(self):
            checkbox =  self.driver.find(ONLY_DATASENDERS_NOT_SUBMITTED_CB)
            if checkbox.is_selected():
                checkbox.click()
    Severity: Major
    Found in func_tests/pages/reminderpage/reminder_settings_page.py and 4 other locations - About 40 mins to fix
    func_tests/pages/adduserpage/add_user_page.py on lines 61..64
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 77..80
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 82..85
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 87..90

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

        def disable_before_deadline_reminder(self):
            checkbox =  self.driver.find(BEFORE_DEADLINE_REMINDER_CB)
            if checkbox.is_selected():
                checkbox.click()
    Severity: Major
    Found in func_tests/pages/reminderpage/reminder_settings_page.py and 4 other locations - About 40 mins to fix
    func_tests/pages/adduserpage/add_user_page.py on lines 61..64
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 82..85
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 87..90
    func_tests/pages/reminderpage/reminder_settings_page.py on lines 92..95

    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

    There are no issues that match your filters.

    Category
    Status