motom001/DoorPi

View on GitHub

Showing 4,610 of 4,610 total issues

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 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 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):
        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

Function fire_event_synchron has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def fire_event_synchron(self, event_name, event_source, kwargs = None):
        silent = ONTIME in event_name
        if self.__destroy and not silent: return False

        event_fire_id = id_generator()
Severity: Minor
Found in doorpi/action/handler.py - About 3 hrs 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

Function parse_content has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_content(self, content, online_fallback = False, **mapping_table):
        try:
            matches = re.findall(r"{([^}\s]*)}", content)
            if not matches: return content
            #http://stackoverflow.com/questions/12897374/get-unique-values-from-a-list-in-python/12897491#12897491
Severity: Minor
Found in doorpi/status/webserver_lib/request_handler.py - About 3 hrs 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

Function b85decode has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def b85decode(b):
        _b85dec = [None] * 256
        for i, c in enumerate(iterbytes(_b85alphabet)):
            _b85dec[c] = i

Severity: Minor
Found in get_pip.py - About 3 hrs 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 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 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

LinphoneCallbacks has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

class LinphoneCallbacks:

    @property
    def used_callbacks(self): return {
        #http://www.linphone.org/docs/liblinphone/struct__LinphoneCoreVTable.html
Severity: Minor
Found in doorpi/sipphone/linphone_lib/CallBacks.py - About 3 hrs to fix

    File handler.py has 303 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    
    import logging
    logger = logging.getLogger(__name__)
    Severity: Minor
    Found in doorpi/action/handler.py - About 3 hrs to fix

      Function get has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

      def get(*args, **kwargs):
          try:
              if len(kwargs['name']) == 0: kwargs['name'] = ['']
              if len(kwargs['value']) == 0: kwargs['value'] = ['']
      
      
      Severity: Minor
      Found in doorpi/status/status_lib/event_handler.py - About 3 hrs 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 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

      Function do_control has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          def do_control(self, control_order, para):
              result_object = dict(
                  success = False,
                  message = 'unknown error'
              )
      Severity: Minor
      Found in doorpi/status/webserver_lib/request_handler.py - About 3 hrs 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 6 locations. Consider refactoring.
      Open

              if not os.path.exists(os.path.dirname(self.__base_path_output)):
                  logger.info('Path %s does not exist - creating it now', os.path.dirname(self.__base_path_output))
                  os.makedirs(os.path.dirname(self.__base_path_output))
      Severity: Major
      Found in doorpi/keyboard/from_filesystem.py and 5 other locations - About 3 hrs to fix
      doorpi/keyboard/from_filesystem.py on lines 45..47
      doorpi/sipphone/linphone_lib/Player.py on lines 34..36
      doorpi/sipphone/linphone_lib/Recorder.py on lines 58..60
      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

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

              if not os.path.exists(os.path.dirname(self.__base_path_input)):
                  logger.info('Path %s does not exist - creating it now', os.path.dirname(self.__base_path_input))
                  os.makedirs(os.path.dirname(self.__base_path_input))
      Severity: Major
      Found in doorpi/keyboard/from_filesystem.py and 5 other locations - About 3 hrs to fix
      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/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

      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 not exists - create it now', os.path.dirname(self.__last_record_filename))
                      os.makedirs(os.path.dirname(self.__last_record_filename))
      Severity: Major
      Found in doorpi/sipphone/pjsua_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/linphone_lib/Recorder.py on lines 58..60
      doorpi/sipphone/pjsua_lib/Player.py on lines 32..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 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.__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/linphone_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/Recorder.py on lines 58..60
      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

      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

      Severity
      Category
      Status
      Source
      Language