motom001/DoorPi

View on GitHub

Showing 4,610 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/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

Function register_action has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def register_action(self, event_name, action_object, *args, **kwargs):
        if ismethod(action_object) and callable(action_object):
            action_object = SingleAction(action_object, *args, **kwargs)
        elif isfunction(action_object) and callable(action_object):
            action_object = SingleAction(action_object, *args, **kwargs)
Severity: Minor
Found in doorpi/action/handler.py - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Similar blocks of code found in 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

Function on_incoming_call has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def on_incoming_call(self, call):
        # SIP-Status-Codes: http://de.wikipedia.org/wiki/SIP-Status-Codes
        # 200 = OK
        # 401 = Unauthorized
        # 403 = Forbidden
Severity: Minor
Found in doorpi/sipphone/pjsua_lib/SipPhoneAccountCallBack.py - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Similar blocks of code found in 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

Avoid too many return statements within this function.
Open

        else: return self.real_resource(parsed_path.path)
Severity: Major
Found in doorpi/status/webserver_lib/request_handler.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return "no actions for this event"
    Severity: Major
    Found in doorpi/action/handler.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  try:    return self.return_message(repr(prepared_object))
      Severity: Major
      Found in doorpi/status/webserver_lib/request_handler.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    except: return self.return_message(str(prepared_object))
        Severity: Major
        Found in doorpi/status/webserver_lib/request_handler.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return True
          Severity: Major
          Found in doorpi/status/webserver_lib/request_handler.py - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language