motom001/DoorPi

View on GitHub

Showing 101 of 4,610 total issues

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/keyboard.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 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/history_event.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 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['name']) == 0: kwargs['name'] = ['']
Severity: Major
Found in doorpi/status/status_lib/config.py and 15 other locations - About 35 mins to fix
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 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_event.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_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['name']) == 0: kwargs['name'] = ['']
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 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['name']) == 0: kwargs['name'] = ['']
Severity: Major
Found in doorpi/status/status_lib/environment.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 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 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/keyboard.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/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/environment.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/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 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/config.py and 15 other locations - About 35 mins to fix
doorpi/status/status_lib/config.py on lines 10..10
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 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/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 10..10
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/webserver.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 10..10
doorpi/status/status_lib/sipphone.py on lines 11..11
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/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 10..10
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/webserver.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 10..10
doorpi/status/status_lib/sipphone.py on lines 11..11
doorpi/status/status_lib/webserver.py on lines 10..10

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

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

    def destroy(self):
        try: self.stop()
        except: pass
        DoorPi().event_handler.unregister_source(__name__, True)
Severity: Minor
Found in doorpi/sipphone/linphone_lib/Recorder.py and 1 other location - About 35 mins to fix
doorpi/sipphone/from_dummy.py on lines 81..84

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

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

    def destroy(self):
        try: self.stop()
        except: pass
        DoorPi().event_handler.unregister_source(__name__, True)
Severity: Minor
Found in doorpi/sipphone/from_dummy.py and 1 other location - About 35 mins to fix
doorpi/sipphone/linphone_lib/Recorder.py on lines 76..79

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

                    try: replace_with = self.read_from_file(self.server.www + '/dashboard/parts/' + mapping_table[match])
Severity: Minor
Found in doorpi/status/webserver_lib/request_handler.py and 1 other location - About 35 mins to fix
doorpi/status/webserver_lib/request_handler.py on lines 423..427

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

                        if self.server.online_fallback:
                            replace_with = self.read_from_fallback(
                                self.server.online_fallback +
                                '/dashboard/parts/' +
                                mapping_table[match]
Severity: Minor
Found in doorpi/status/webserver_lib/request_handler.py and 1 other location - About 35 mins to fix
doorpi/status/webserver_lib/request_handler.py on lines 421..421

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

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

    files = sorted(glob.glob(os.path.join(snapshot_path, "*.*")), key=os.path.getctime)
Severity: Minor
Found in doorpi/action/SingleActions/take_snapshot.py and 1 other location - About 30 mins to fix
doorpi/action/SingleActions/take_snapshot.py on lines 22..22

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

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(parameters):
    parsed_parameters = doorpi.DoorPi().parse_string(parameters)
    return OsExecuteAction(fire_command, command = parsed_parameters)
Severity: Minor
Found in doorpi/action/SingleActions/os_execute.py and 1 other location - About 30 mins to fix
doorpi/action/SingleActions/url_call.py on lines 46..48

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

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

    files = sorted(glob.glob(os.path.join(snapshot_path, "*.*")), key=os.path.getctime)
Severity: Minor
Found in doorpi/action/SingleActions/take_snapshot.py and 1 other location - About 30 mins to fix
doorpi/action/SingleActions/take_snapshot.py on lines 33..33

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

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