motom001/DoorPi

View on GitHub

Showing 101 of 201 total issues

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

class PlayerAbstractBaseClass(object):

    def __init__(self): raise NotImplementedError("Subclass %s should implement this!"%self.__class__.__name__)
    def config(self, **kwargs): raise NotImplementedError("Subclass %s should implement this!"%self.__class__.__name__)
    def start(self): raise NotImplementedError("Subclass %s should implement this!"%self.__class__.__name__)
Severity: Major
Found in doorpi/sipphone/AbstractBaseClass.py and 1 other location - About 1 day to fix
doorpi/sipphone/AbstractBaseClass.py on lines 45..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 132.

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

class RecorderAbstractBaseClass(object):

    def __init__(self): raise NotImplementedError("Subclass %s should implement this!"%self.__class__.__name__)
    def config(self, **kwargs): raise NotImplementedError("Subclass %s should implement this!"%self.__class__.__name__)
    def start(self): raise NotImplementedError("Subclass %s should implement this!"%self.__class__.__name__)
Severity: Major
Found in doorpi/sipphone/AbstractBaseClass.py and 1 other location - About 1 day to fix
doorpi/sipphone/AbstractBaseClass.py on lines 54..61

Duplicated Code

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

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

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

Tuning

This issue has a mass of 132.

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

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

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

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

Refactorings

Further Reading

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

def ips_rpc_create_config():
    config = {}
    config['webservice_url'] = doorpi.DoorPi().config.get('IP-Symcon', 'server')
    config['username'] = doorpi.DoorPi().config.get('IP-Symcon', 'username')
    config['password'] = doorpi.DoorPi().config.get('IP-Symcon', 'password')
Severity: Major
Found in doorpi/action/SingleActions/ipsrpc_setvalue.py and 1 other location - About 1 day to fix
doorpi/action/SingleActions/ipsrpc_call_value.py on lines 14..21

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

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

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

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

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

Refactorings

Further Reading

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

def ips_rpc_create_config():
    config = {}
    config['webservice_url'] = doorpi.DoorPi().config.get('IP-Symcon', 'server')
    config['username'] = doorpi.DoorPi().config.get('IP-Symcon', 'username')
    config['password'] = doorpi.DoorPi().config.get('IP-Symcon', 'password')
Severity: Major
Found in doorpi/action/SingleActions/ipsrpc_call_value.py and 1 other location - About 1 day to fix
doorpi/action/SingleActions/ipsrpc_setvalue.py on lines 14..21

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

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

        'serial': dict(
            text_warning =          '',
            text_description =      '''
Hier die Beschreibung aus der <a href="https://github.com/motom001/DoorPi/blob/master/doorpi/keyboard/from_rdm6300.py">from_rdm6300.py</a>, die <a href="https://github.com/msmolny">msmolny</a> netterweise erstellt hat.

Severity: Major
Found in doorpi/status/requirements_lib/req_keyboard.py and 1 other location - About 6 hrs to fix
doorpi/status/requirements_lib/req_keyboard.py on lines 218..234

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

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

        'watchdog': dict(
            text_warning =          'Häufiges Lesen und Schreiben von SD-Karten wie im RPi können deren Verschleiß fördern. Eventuell sollte auf tmpfs Verzeichnisse ausgewichen werden.',
            text_description =      '''Das Python-Modul watchdog wird genutzt um ein dateibasierendes Keyboard zu erstellen.
So können entweder zu Testzwecken ohne Hardware-Aufbau Events und Actions getestet werden oder es kann als Schnittstelle zu anderen Systemen dienen,
die per SSH-Befehle die Dateien schreiben und lesen, die auch vom virtuellen keyboard verarbeitet werden.
Severity: Major
Found in doorpi/status/requirements_lib/req_keyboard.py and 1 other location - About 6 hrs to fix
doorpi/status/requirements_lib/req_keyboard.py on lines 129..214

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

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 get_float(self, section, key, default = -1, log = True, store_if_not_exists = True):
        value = self.get_string(section, key, str(default), log = False, store_if_not_exists = store_if_not_exists)
        if value is not '': value = float(value)
        else: value = default
        if log: logger.trace("get_integer for key %s in section %s (default: %s) returns %s", key, section, default, value)
Severity: Major
Found in doorpi/conf/config_object.py and 1 other location - About 4 hrs to fix
doorpi/conf/config_object.py on lines 194..199

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

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 get_integer(self, section, key, default = -1, log = True, store_if_not_exists = True):
        value = self.get(section, key, str(default), log = False, store_if_not_exists = store_if_not_exists)
        if value is not '': value = int(value)
        else: value = default
        if log: logger.trace("get_integer for key %s in section %s (default: %s) returns %s", key, section, default, value)
Severity: Major
Found in doorpi/conf/config_object.py and 1 other location - About 4 hrs to fix
doorpi/conf/config_object.py on lines 187..192

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

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

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

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

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

Refactorings

Further Reading

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

def ips_rpc_fire(method, config, *parameters):
    payload = {
       "method": method,
       "params": parameters,
       "jsonrpc": config['jsonrpc'],
Severity: Major
Found in doorpi/action/SingleActions/ipsrpc_call_value.py and 1 other location - About 4 hrs to fix
doorpi/action/SingleActions/ipsrpc_setvalue.py on lines 23..34

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

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

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

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

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

Refactorings

Further Reading

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

def ips_rpc_fire(method, config, *parameters):
    payload = {
       "method": method,
       "params": parameters,
       "jsonrpc": config['jsonrpc'],
Severity: Major
Found in doorpi/action/SingleActions/ipsrpc_setvalue.py and 1 other location - About 4 hrs to fix
doorpi/action/SingleActions/ipsrpc_call_value.py on lines 23..34

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

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

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

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

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

Refactorings

Further Reading

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

    if datetime_now.year != datetime_past.year:
        doorpi.DoorPi().event_handler('OnTimeYear', __name__)
        if datetime_now.year % 2 is 0: doorpi.DoorPi().event_handler('OnTimeYearEvenNumber', __name__)
        else: doorpi.DoorPi().event_handler('OnTimeYearUnevenNumber', __name__)
Severity: Major
Found in doorpi/action/SingleActions/time_tick.py and 3 other locations - About 4 hrs to fix
doorpi/action/SingleActions/time_tick.py on lines 34..37
doorpi/action/SingleActions/time_tick.py on lines 39..42
doorpi/action/SingleActions/time_tick.py on lines 62..65

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

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

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

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

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

Refactorings

Further Reading

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

    if datetime_now.day != datetime_past.day:
        doorpi.DoorPi().event_handler('OnTimeDay', __name__)
        if datetime_now.day % 2 is 0: doorpi.DoorPi().event_handler('OnTimeDayEvenNumber', __name__)
        else: doorpi.DoorPi().event_handler('OnTimeDayUnevenNumber', __name__)
Severity: Major
Found in doorpi/action/SingleActions/time_tick.py and 3 other locations - About 4 hrs to fix
doorpi/action/SingleActions/time_tick.py on lines 29..32
doorpi/action/SingleActions/time_tick.py on lines 34..37
doorpi/action/SingleActions/time_tick.py on lines 62..65

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

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

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

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

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

Refactorings

Further Reading

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

    if datetime_now.month != datetime_past.month:
        doorpi.DoorPi().event_handler('OnTimeMonth', __name__)
        if datetime_now.month % 2 is 0: doorpi.DoorPi().event_handler('OnTimeMonthEvenNumber', __name__)
        else: doorpi.DoorPi().event_handler('OnTimeMonthUnevenNumber', __name__)
Severity: Major
Found in doorpi/action/SingleActions/time_tick.py and 3 other locations - About 4 hrs to fix
doorpi/action/SingleActions/time_tick.py on lines 29..32
doorpi/action/SingleActions/time_tick.py on lines 39..42
doorpi/action/SingleActions/time_tick.py on lines 62..65

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

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

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

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

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

Refactorings

Further Reading

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

    if datetime_now.second != datetime_past.second:
        doorpi.DoorPi().event_handler('OnTimeSecond', __name__)
        if datetime_now.second % 2 is 0: doorpi.DoorPi().event_handler('OnTimeSecondEvenNumber', __name__)
        else: doorpi.DoorPi().event_handler('OnTimeSecondUnevenNumber', __name__)
Severity: Major
Found in doorpi/action/SingleActions/time_tick.py and 3 other locations - About 4 hrs to fix
doorpi/action/SingleActions/time_tick.py on lines 29..32
doorpi/action/SingleActions/time_tick.py on lines 34..37
doorpi/action/SingleActions/time_tick.py on lines 39..42

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

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 status_input(self, pin):
        if self._polarity is 0:
            return str(RPiGPIO.input(int(pin))).lower() in HIGH_LEVEL
        else:
            return str(RPiGPIO.input(int(pin))).lower() in LOW_LEVEL
Severity: Major
Found in doorpi/keyboard/from_gpio.py and 1 other location - About 4 hrs to fix
doorpi/keyboard/from_piface.py on lines 71..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 74.

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 status_input(self, pin):
        if self._polarity is 0:
            return str(p.digital_read(int(pin))).lower() in HIGH_LEVEL
        else:
            return str(p.digital_read(int(pin))).lower() in LOW_LEVEL
Severity: Major
Found in doorpi/keyboard/from_piface.py and 1 other location - About 4 hrs to fix
doorpi/keyboard/from_gpio.py on lines 99..103

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

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 status_input(self, pin):
        for keyboard in self.__keyboards:
            if pin.startswith(keyboard+'.'):
                return self.__keyboards[keyboard].status_input(pin[len(keyboard+'.'):])
        return None
Severity: Major
Found in doorpi/keyboard/KeyboardInterface.py and 1 other location - About 3 hrs to fix
doorpi/keyboard/KeyboardInterface.py on lines 142..146

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

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 status_output(self, pin):
        for keyboard in self.__keyboards:
            if pin.startswith(keyboard+'.'):
                return self.__keyboards[keyboard].status_output(pin[len(keyboard+'.'):])
        return None
Severity: Major
Found in doorpi/keyboard/KeyboardInterface.py and 1 other location - About 3 hrs to fix
doorpi/keyboard/KeyboardInterface.py on lines 136..140

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

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

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

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

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

Refactorings

Further Reading

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

        if not os.path.exists(os.path.dirname(self.__player_filename)):
            logger.info('Path %s does not exist - creating it now', os.path.dirname(self.__player_filename))
            os.makedirs(os.path.dirname(self.__player_filename))
Severity: Major
Found in doorpi/sipphone/pjsua_lib/Player.py and 5 other locations - About 3 hrs to fix
doorpi/keyboard/from_filesystem.py on lines 45..47
doorpi/keyboard/from_filesystem.py on lines 49..51
doorpi/sipphone/linphone_lib/Player.py on lines 34..36
doorpi/sipphone/linphone_lib/Recorder.py on lines 58..60
doorpi/sipphone/pjsua_lib/Recorder.py on lines 62..64

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

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

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

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

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

Refactorings

Further Reading

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

            if not os.path.exists(os.path.dirname(self.__last_record_filename)):
                logger.info('Path %s does not exist - creating it now', os.path.dirname(self.__last_record_filename))
                os.makedirs(os.path.dirname(self.__last_record_filename))
Severity: Major
Found in doorpi/sipphone/linphone_lib/Recorder.py and 5 other locations - About 3 hrs to fix
doorpi/keyboard/from_filesystem.py on lines 45..47
doorpi/keyboard/from_filesystem.py on lines 49..51
doorpi/sipphone/linphone_lib/Player.py on lines 34..36
doorpi/sipphone/pjsua_lib/Player.py on lines 32..34
doorpi/sipphone/pjsua_lib/Recorder.py on lines 62..64

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

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