motom001/DoorPi

View on GitHub

Showing 101 of 4,610 total issues

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

            if self.current_call_duration > self.core.inc_timeout - 0.5:
                logger.info("call timeout - hangup current call after %s seconds (max. %s)", self.current_call_duration, self.core.inc_timeout)
                self.core.terminate_all_calls()
                DoorPi().event_handler('OnSipPhoneCallTimeoutNoResponse', __name__)
Severity: Major
Found in doorpi/sipphone/from_linphone.py and 1 other location - About 1 hr to fix
doorpi/sipphone/from_linphone.py on lines 310..313

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

        for hour in HOUR_RANGE:
            if hour is datetime_now.hour: doorpi.DoorPi().event_handler('OnTimeHour%s'%hour, __name__)
Severity: Major
Found in doorpi/action/SingleActions/time_tick.py and 1 other location - About 1 hr to fix
doorpi/action/SingleActions/time_tick.py on lines 57..58

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

        for minute in MINUTE_RANGE:
            if minute is datetime_now.minute: doorpi.DoorPi().event_handler('OnTimeMinute%s'%minute, __name__)
Severity: Major
Found in doorpi/action/SingleActions/time_tick.py and 1 other location - About 1 hr to fix
doorpi/action/SingleActions/time_tick.py on lines 49..50

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

        'pifacedigitalio': dict(
            text_warning =          '''Neben der reinen Installation vom Python-Modul pifacedigitalio ist es auch wichtig SPI am System zu aktivieren (siehe Links).
Außerdem muss bei Bestellungen darauf geachtet werden, dass es zwei Versionen gibt (<a href="https://www.rasppishop.de/Piface-Digital-Erweiterung-fuer-Raspberry-Pi">PiFace digital 1</a> und <a href="https://www.rasppishop.de/PiFace-Digital-2-Erweiterungsplatine-/-Modul-fuer-den-Raspberry-Pi-Modell-B-">PiFace digital 2</a>)''',
            text_description =      'Das Python-Modul pifacedigitalio ist der "Treiber" für die PiFace Hardware.',
            text_installation =     '',
Severity: Major
Found in doorpi/status/requirements_lib/req_keyboard.py and 1 other location - About 1 hr to fix
doorpi/status/requirements_lib/req_webserver.py on lines 99..170

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

        if len(sys.argv) > 1 and sys.argv[1] in ['start', 'stop', 'restart', 'status']:
Severity: Minor
Found in doorpi/main.py and 1 other location - About 55 mins to fix
doorpi/main.py on lines 166..166

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

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

        if 'last_finished' not in self.__additional_informations[event_name]:
            self.__additional_informations[event_name]['last_finished'] = None
Severity: Minor
Found in doorpi/action/handler.py and 1 other location - About 55 mins to fix
doorpi/action/handler.py on lines 277..278

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

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

        if 'last_duration' not in self.__additional_informations[event_name]:
            self.__additional_informations[event_name]['last_duration'] = None
Severity: Minor
Found in doorpi/action/handler.py and 1 other location - About 55 mins to fix
doorpi/action/handler.py on lines 274..275

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

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

    elif len(sys.argv) > 1 and sys.argv[1] in ['start', 'stop', 'restart', 'reload']:
Severity: Minor
Found in doorpi/main.py and 1 other location - About 55 mins to fix
doorpi/main.py on lines 67..67

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

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 status_input(self, tag):
        logger.debug("status_input for tag %s", tag)
        if tag == self.last_key:
            return True
        else:
Severity: Major
Found in doorpi/keyboard/from_pn532.py and 2 other locations - About 50 mins to fix
doorpi/keyboard/from_rdm6300.py on lines 192..197
doorpi/keyboard/from_usb_plain.py on lines 110..115

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

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 status_input(self, tag):
        logger.debug("status_input for tag %s", tag)
        if tag == self.last_key:
            return True
        else:
Severity: Major
Found in doorpi/keyboard/from_rdm6300.py and 2 other locations - About 50 mins to fix
doorpi/keyboard/from_pn532.py on lines 167..172
doorpi/keyboard/from_usb_plain.py on lines 110..115

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

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 status_input(self, input_pin):
        logger.debug("status_input for tag %s", tag)
        if input_pin == self.last_key:
            return True
        else:
Severity: Major
Found in doorpi/keyboard/from_usb_plain.py and 2 other locations - About 50 mins to fix
doorpi/keyboard/from_pn532.py on lines 167..172
doorpi/keyboard/from_rdm6300.py on lines 192..197

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

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

    libraries = dict(
        threading = dict(
            text_warning =          '',
            text_description =      'Grundmodul für das Theardering, also die parallele Ausführung von Events.',
            text_installation =     'Eine Installation ist nicht nötig, da es sich hierbei um eine Python-Standard-Modul handelt.',
Severity: Major
Found in doorpi/status/requirements_lib/req_event_handler.py and 22 other locations - About 40 mins to fix
doorpi/status/requirements_lib/req_config.py on lines 19..43
doorpi/status/requirements_lib/req_event_handler.py on lines 24..45
doorpi/status/requirements_lib/req_system.py on lines 16..27
doorpi/status/requirements_lib/req_system.py on lines 16..41
doorpi/status/requirements_lib/req_system.py on lines 16..61
doorpi/status/requirements_lib/req_system.py on lines 16..75
doorpi/status/requirements_lib/req_system.py on lines 16..89
doorpi/status/requirements_lib/req_system.py on lines 16..103
doorpi/status/requirements_lib/req_system.py on lines 16..117
doorpi/status/requirements_lib/req_system.py on lines 16..131
doorpi/status/requirements_lib/req_system.py on lines 16..145
doorpi/status/requirements_lib/req_system.py on lines 16..159
doorpi/status/requirements_lib/req_system.py on lines 16..173
doorpi/status/requirements_lib/req_system.py on lines 16..187
doorpi/status/requirements_lib/req_system.py on lines 16..201
doorpi/status/requirements_lib/req_system.py on lines 16..215
doorpi/status/requirements_lib/req_system.py on lines 16..229
doorpi/status/requirements_lib/req_system.py on lines 16..243
doorpi/status/requirements_lib/req_webserver.py on lines 99..110
doorpi/status/requirements_lib/req_webserver.py on lines 99..124
doorpi/status/requirements_lib/req_webserver.py on lines 99..138
doorpi/status/requirements_lib/req_webserver.py on lines 99..152

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

    libraries = dict(
        importlib = dict(
            text_warning =          '',
            text_description =      'Das Python-Modul importlib wird zum dynamischen Laden von Dateien genutzt. So sind z.B. alle Actions jeweils als eigene Datei abgelegt die anhand des Dateinamens (= Name der Action) geladen werden, wenn diese auch wirklich benötigt werden. So muss am restlichen Quellcode keine Anpassung gemacht werden und es reicht eine neue Aktion bereit zu stellen.',
            text_installation =     'Eine Installation ist nicht nötig, da es sich hierbei um eine Python-Standard-Modul handelt.',
Severity: Major
Found in doorpi/status/requirements_lib/req_system.py and 22 other locations - About 40 mins to fix
doorpi/status/requirements_lib/req_config.py on lines 19..43
doorpi/status/requirements_lib/req_event_handler.py on lines 24..33
doorpi/status/requirements_lib/req_event_handler.py on lines 24..45
doorpi/status/requirements_lib/req_system.py on lines 16..41
doorpi/status/requirements_lib/req_system.py on lines 16..61
doorpi/status/requirements_lib/req_system.py on lines 16..75
doorpi/status/requirements_lib/req_system.py on lines 16..89
doorpi/status/requirements_lib/req_system.py on lines 16..103
doorpi/status/requirements_lib/req_system.py on lines 16..117
doorpi/status/requirements_lib/req_system.py on lines 16..131
doorpi/status/requirements_lib/req_system.py on lines 16..145
doorpi/status/requirements_lib/req_system.py on lines 16..159
doorpi/status/requirements_lib/req_system.py on lines 16..173
doorpi/status/requirements_lib/req_system.py on lines 16..187
doorpi/status/requirements_lib/req_system.py on lines 16..201
doorpi/status/requirements_lib/req_system.py on lines 16..215
doorpi/status/requirements_lib/req_system.py on lines 16..229
doorpi/status/requirements_lib/req_system.py on lines 16..243
doorpi/status/requirements_lib/req_webserver.py on lines 99..110
doorpi/status/requirements_lib/req_webserver.py on lines 99..124
doorpi/status/requirements_lib/req_webserver.py on lines 99..138
doorpi/status/requirements_lib/req_webserver.py on lines 99..152

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

    libraries = dict(
        BaseHTTPServer = dict(
            text_warning =          '',
            text_description =      'Das Python-Modul BaseHTTPServer ist mit der Klasse HTTPServer die Grundlage für jeden Webserver.',
            text_installation =     'Eine Installation ist nicht nötig, da es sich hierbei um eine Python-Standard-Modul handelt.',
Severity: Major
Found in doorpi/status/requirements_lib/req_webserver.py and 22 other locations - About 40 mins to fix
doorpi/status/requirements_lib/req_config.py on lines 19..43
doorpi/status/requirements_lib/req_event_handler.py on lines 24..33
doorpi/status/requirements_lib/req_event_handler.py on lines 24..45
doorpi/status/requirements_lib/req_system.py on lines 16..27
doorpi/status/requirements_lib/req_system.py on lines 16..41
doorpi/status/requirements_lib/req_system.py on lines 16..61
doorpi/status/requirements_lib/req_system.py on lines 16..75
doorpi/status/requirements_lib/req_system.py on lines 16..89
doorpi/status/requirements_lib/req_system.py on lines 16..103
doorpi/status/requirements_lib/req_system.py on lines 16..117
doorpi/status/requirements_lib/req_system.py on lines 16..131
doorpi/status/requirements_lib/req_system.py on lines 16..145
doorpi/status/requirements_lib/req_system.py on lines 16..159
doorpi/status/requirements_lib/req_system.py on lines 16..173
doorpi/status/requirements_lib/req_system.py on lines 16..187
doorpi/status/requirements_lib/req_system.py on lines 16..201
doorpi/status/requirements_lib/req_system.py on lines 16..215
doorpi/status/requirements_lib/req_system.py on lines 16..229
doorpi/status/requirements_lib/req_system.py on lines 16..243
doorpi/status/requirements_lib/req_webserver.py on lines 99..124
doorpi/status/requirements_lib/req_webserver.py on lines 99..138
doorpi/status/requirements_lib/req_webserver.py on lines 99..152

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

    libraries = dict(
        ConfigParser = dict(
            text_warning =          '',
            text_description =      'Das Config-Modul wird benötigt um alle Einstellungen in einer Datei abspeichern und später wieder laden zu können.',
            text_installation =     'Eine Installation ist nicht nötig, da es sich hierbei um eine Python-Standard-Modul handelt.',
Severity: Major
Found in doorpi/status/requirements_lib/req_config.py and 22 other locations - About 40 mins to fix
doorpi/status/requirements_lib/req_event_handler.py on lines 24..33
doorpi/status/requirements_lib/req_event_handler.py on lines 24..45
doorpi/status/requirements_lib/req_system.py on lines 16..27
doorpi/status/requirements_lib/req_system.py on lines 16..41
doorpi/status/requirements_lib/req_system.py on lines 16..61
doorpi/status/requirements_lib/req_system.py on lines 16..75
doorpi/status/requirements_lib/req_system.py on lines 16..89
doorpi/status/requirements_lib/req_system.py on lines 16..103
doorpi/status/requirements_lib/req_system.py on lines 16..117
doorpi/status/requirements_lib/req_system.py on lines 16..131
doorpi/status/requirements_lib/req_system.py on lines 16..145
doorpi/status/requirements_lib/req_system.py on lines 16..159
doorpi/status/requirements_lib/req_system.py on lines 16..173
doorpi/status/requirements_lib/req_system.py on lines 16..187
doorpi/status/requirements_lib/req_system.py on lines 16..201
doorpi/status/requirements_lib/req_system.py on lines 16..215
doorpi/status/requirements_lib/req_system.py on lines 16..229
doorpi/status/requirements_lib/req_system.py on lines 16..243
doorpi/status/requirements_lib/req_webserver.py on lines 99..110
doorpi/status/requirements_lib/req_webserver.py on lines 99..124
doorpi/status/requirements_lib/req_webserver.py on lines 99..138
doorpi/status/requirements_lib/req_webserver.py on lines 99..152

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

                if self.current_call.info().call_time == 0 \
                and self.current_call.info().total_time > self.call_timeout:
                    logger.info("call timeout - hangup current call after %s seconds", self.call_timeout)
                    self.current_call.hangup()
                    DoorPi().event_handler('OnSipPhoneCallTimeoutNoResponse', __name__)
Severity: Minor
Found in doorpi/sipphone/from_pjsua.py and 1 other location - About 40 mins to fix
doorpi/sipphone/from_pjsua.py on lines 199..202

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

                if self.current_call.info().call_time > self.max_call_time:
                    logger.info("max call time reached - hangup current call after %s seconds", self.max_call_time)
                    self.current_call.hangup()
                    DoorPi().event_handler('OnSipPhoneCallTimeoutMaxCalltime', __name__)
Severity: Minor
Found in doorpi/sipphone/from_pjsua.py and 1 other location - About 40 mins to fix
doorpi/sipphone/from_pjsua.py on lines 193..197

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

        if len(kwargs['name']) == 0: kwargs['name'] = ['']
Severity: Major
Found in doorpi/status/status_lib/event_handler.py and 15 other locations - About 35 mins to fix
doorpi/status/status_lib/config.py on lines 10..10
doorpi/status/status_lib/config.py on lines 11..11
doorpi/status/status_lib/environment.py on lines 55..55
doorpi/status/status_lib/environment.py on lines 56..56
doorpi/status/status_lib/event_handler.py on lines 11..11
doorpi/status/status_lib/history_event.py on lines 10..10
doorpi/status/status_lib/history_event.py on lines 11..11
doorpi/status/status_lib/history_snapshot.py on lines 14..14
doorpi/status/status_lib/history_snapshot.py on lines 15..15
doorpi/status/status_lib/keyboard.py on lines 12..12
doorpi/status/status_lib/keyboard.py on lines 13..13
doorpi/status/status_lib/sipphone.py on lines 10..10
doorpi/status/status_lib/sipphone.py on lines 11..11
doorpi/status/status_lib/webserver.py on lines 10..10
doorpi/status/status_lib/webserver.py on lines 11..11

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

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

        if len(kwargs['value']) == 0: kwargs['value'] = ['']
Severity: Major
Found in doorpi/status/status_lib/history_snapshot.py and 15 other locations - About 35 mins to fix
doorpi/status/status_lib/config.py on lines 10..10
doorpi/status/status_lib/config.py on lines 11..11
doorpi/status/status_lib/environment.py on lines 55..55
doorpi/status/status_lib/environment.py on lines 56..56
doorpi/status/status_lib/event_handler.py on lines 10..10
doorpi/status/status_lib/event_handler.py on lines 11..11
doorpi/status/status_lib/history_event.py on lines 10..10
doorpi/status/status_lib/history_event.py on lines 11..11
doorpi/status/status_lib/history_snapshot.py on lines 14..14
doorpi/status/status_lib/keyboard.py on lines 12..12
doorpi/status/status_lib/keyboard.py on lines 13..13
doorpi/status/status_lib/sipphone.py on lines 10..10
doorpi/status/status_lib/sipphone.py on lines 11..11
doorpi/status/status_lib/webserver.py on lines 10..10
doorpi/status/status_lib/webserver.py on lines 11..11

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

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

        if len(kwargs['name']) == 0: kwargs['name'] = ['']
Severity: Major
Found in doorpi/status/status_lib/sipphone.py and 15 other locations - About 35 mins to fix
doorpi/status/status_lib/config.py on lines 10..10
doorpi/status/status_lib/config.py on lines 11..11
doorpi/status/status_lib/environment.py on lines 55..55
doorpi/status/status_lib/environment.py on lines 56..56
doorpi/status/status_lib/event_handler.py on lines 10..10
doorpi/status/status_lib/event_handler.py on lines 11..11
doorpi/status/status_lib/history_event.py on lines 10..10
doorpi/status/status_lib/history_event.py on lines 11..11
doorpi/status/status_lib/history_snapshot.py on lines 14..14
doorpi/status/status_lib/history_snapshot.py on lines 15..15
doorpi/status/status_lib/keyboard.py on lines 12..12
doorpi/status/status_lib/keyboard.py on lines 13..13
doorpi/status/status_lib/sipphone.py on lines 11..11
doorpi/status/status_lib/webserver.py on lines 10..10
doorpi/status/status_lib/webserver.py on lines 11..11

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

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