motom001/DoorPi

View on GitHub

Showing 4,610 of 4,610 total issues

LinPhone has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class LinPhone(SipphoneAbstractBaseClass):

    @property
    def name(self): return 'linphone wrapper'

Severity: Minor
Found in doorpi/sipphone/from_linphone.py - About 2 hrs to fix

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

                if name_requested in 'video_enable':
                    if len(sipphone.video_codecs) and len(sipphone.video_devices):
                        status['video_enable'] = True
                    else:
                        status['video_enable'] = False
    Severity: Major
    Found in doorpi/status/status_lib/sipphone.py and 1 other location - About 2 hrs to fix
    doorpi/status/status_lib/sipphone.py on lines 28..32

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

    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 name_requested in 'sound_enable':
                    if len(sipphone.sound_codecs) and len(sipphone.sound_devices):
                        status['sound_enable'] = True
                    else:
                        status['sound_enable'] = False
    Severity: Major
    Found in doorpi/status/status_lib/sipphone.py and 1 other location - About 2 hrs to fix
    doorpi/status/status_lib/sipphone.py on lines 39..43

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

    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 prepare has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def prepare(self, parsed_arguments):
            logger.debug("prepare")
            logger.debug("given arguments argv: %s", parsed_arguments)
    
            self.__config = ConfigObject.load_config(parsed_arguments.configfile)
    Severity: Minor
    Found in doorpi/doorpi.py - About 2 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

    ConfigObject has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ConfigObject():
    
        __sections = {}
        _config_file = None
    
    
    Severity: Minor
    Found in doorpi/conf/config_object.py - About 2 hrs to fix

      Function check_module_status has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

      def check_module_status(module):
          module['is_fulfilled'] = False if module['fulfilled_with_one'] else True
          for module_name in module['libraries'].keys():
              status = {}
              try:
      Severity: Minor
      Found in doorpi/status/status_lib/environment.py - About 2 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 get has a Cognitive Complexity of 16 (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'] = ['']
              return_dict = {}
      Severity: Minor
      Found in doorpi/status/status_lib/config.py - About 2 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

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

          try:
              if len(kwargs['name']) == 0: kwargs['name'] = ['']
              if len(kwargs['value']) == 0: kwargs['value'] = ['']
      
              event_handler = kwargs['DoorPiObject'].event_handler
      Severity: Major
      Found in doorpi/status/status_lib/event_handler.py and 6 other locations - About 1 hr to fix
      doorpi/status/status_lib/config.py on lines 9..26
      doorpi/status/status_lib/environment.py on lines 54..67
      doorpi/status/status_lib/history_event.py on lines 9..20
      doorpi/status/status_lib/history_snapshot.py on lines 13..28
      doorpi/status/status_lib/sipphone.py on lines 9..62
      doorpi/status/status_lib/webserver.py on lines 9..38

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

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

          try:
              if len(kwargs['name']) == 0: kwargs['name'] = ['']
              if len(kwargs['value']) == 0: kwargs['value'] = ['']
      
              path = kwargs['DoorPiObject'].config.get_string_parsed(DOORPI_SECTION, 'snapshot_path')
      Severity: Major
      Found in doorpi/status/status_lib/history_snapshot.py and 6 other locations - About 1 hr to fix
      doorpi/status/status_lib/config.py on lines 9..26
      doorpi/status/status_lib/environment.py on lines 54..67
      doorpi/status/status_lib/event_handler.py on lines 9..37
      doorpi/status/status_lib/history_event.py on lines 9..20
      doorpi/status/status_lib/sipphone.py on lines 9..62
      doorpi/status/status_lib/webserver.py on lines 9..38

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

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

          try:
              if len(kwargs['name']) == 0: kwargs['name'] = ['']
              if len(kwargs['value']) == 0: kwargs['value'] = ['']
      
              webserver = kwargs['DoorPiObject'].webserver
      Severity: Major
      Found in doorpi/status/status_lib/webserver.py and 6 other locations - About 1 hr to fix
      doorpi/status/status_lib/config.py on lines 9..26
      doorpi/status/status_lib/environment.py on lines 54..67
      doorpi/status/status_lib/event_handler.py on lines 9..37
      doorpi/status/status_lib/history_event.py on lines 9..20
      doorpi/status/status_lib/history_snapshot.py on lines 13..28
      doorpi/status/status_lib/sipphone.py on lines 9..62

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

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

          try:
              if len(kwargs['name']) == 0: kwargs['name'] = ['']
              if len(kwargs['value']) == 0: kwargs['value'] = ['']
              return_dict = {}
              for section_request in kwargs['name']:
      Severity: Major
      Found in doorpi/status/status_lib/config.py and 6 other locations - About 1 hr to fix
      doorpi/status/status_lib/environment.py on lines 54..67
      doorpi/status/status_lib/event_handler.py on lines 9..37
      doorpi/status/status_lib/history_event.py on lines 9..20
      doorpi/status/status_lib/history_snapshot.py on lines 13..28
      doorpi/status/status_lib/sipphone.py on lines 9..62
      doorpi/status/status_lib/webserver.py on lines 9..38

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

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

          try:
              if len(kwargs['name']) == 0: kwargs['name'] = ['']
              if len(kwargs['value']) == 0: kwargs['value'] = ['']
      
              sipphone = kwargs['DoorPiObject'].sipphone
      Severity: Major
      Found in doorpi/status/status_lib/sipphone.py and 6 other locations - About 1 hr to fix
      doorpi/status/status_lib/config.py on lines 9..26
      doorpi/status/status_lib/environment.py on lines 54..67
      doorpi/status/status_lib/event_handler.py on lines 9..37
      doorpi/status/status_lib/history_event.py on lines 9..20
      doorpi/status/status_lib/history_snapshot.py on lines 13..28
      doorpi/status/status_lib/webserver.py on lines 9..38

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

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

          try:
              if len(kwargs['name']) == 0: kwargs['name'] = ['']
              if len(kwargs['value']) == 0: kwargs['value'] = ['']
      
              filter = kwargs['name'][0]
      Severity: Major
      Found in doorpi/status/status_lib/history_event.py and 6 other locations - About 1 hr to fix
      doorpi/status/status_lib/config.py on lines 9..26
      doorpi/status/status_lib/environment.py on lines 54..67
      doorpi/status/status_lib/event_handler.py on lines 9..37
      doorpi/status/status_lib/history_snapshot.py on lines 13..28
      doorpi/status/status_lib/sipphone.py on lines 9..62
      doorpi/status/status_lib/webserver.py on lines 9..38

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

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

          try:
              if len(kwargs['name']) == 0: kwargs['name'] = ['']
              if len(kwargs['value']) == 0: kwargs['value'] = ['']
      
              status = {}
      Severity: Major
      Found in doorpi/status/status_lib/environment.py and 6 other locations - About 1 hr to fix
      doorpi/status/status_lib/config.py on lines 9..26
      doorpi/status/status_lib/event_handler.py on lines 9..37
      doorpi/status/status_lib/history_event.py on lines 9..20
      doorpi/status/status_lib/history_snapshot.py on lines 13..28
      doorpi/status/status_lib/sipphone.py on lines 9..62
      doorpi/status/status_lib/webserver.py on lines 9..38

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

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

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

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

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

      Refactorings

      Further Reading

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

      def ips_rpc_check_variable_exists(key, config = None):
          if config is None: config = ips_rpc_create_config()
          response = ips_rpc_fire('IPS_VariableExists', config, key)
          return response.json['result']
      Severity: Major
      Found in doorpi/action/SingleActions/ipsrpc_setvalue.py and 2 other locations - About 1 hr to fix
      doorpi/action/SingleActions/ipsrpc_call_value.py on lines 37..40
      doorpi/action/SingleActions/ipsrpc_call_value.py on lines 47..50

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 48.

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

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

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

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

      Refactorings

      Further Reading

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

      def ips_rpc_get_variable_value(key, config = None):
          if config is None: config = ips_rpc_create_config()
          response = ips_rpc_fire('GetValue', config, key)
          return response.json['result']
      Severity: Major
      Found in doorpi/action/SingleActions/ipsrpc_call_value.py and 2 other locations - About 1 hr to fix
      doorpi/action/SingleActions/ipsrpc_call_value.py on lines 37..40
      doorpi/action/SingleActions/ipsrpc_setvalue.py on lines 37..40

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

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

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

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

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

      Refactorings

      Further Reading

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

      def ips_rpc_check_variable_exists(key, config = None):
          if config is None: config = ips_rpc_create_config()
          response = ips_rpc_fire('IPS_VariableExists', config, key)
          return response.json['result']
      Severity: Major
      Found in doorpi/action/SingleActions/ipsrpc_call_value.py and 2 other locations - About 1 hr to fix
      doorpi/action/SingleActions/ipsrpc_call_value.py on lines 47..50
      doorpi/action/SingleActions/ipsrpc_setvalue.py on lines 37..40

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

      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 bootstrap has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      def bootstrap(tmpdir=None):
          # Import pip so we can use it to install pip and maybe setuptools too
          import pip
          from pip.commands.install import InstallCommand
      
      
      Severity: Minor
      Found in get_pip.py - About 1 hr 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

              for read_permission in user_session['readpermissions']:
                  if re.match(read_permission, parsed_path.path):
                      logger.info('user %s has read permissions: %s', user_session['username'], parsed_path.path)
                      return False
      Severity: Major
      Found in doorpi/status/webserver_lib/request_handler.py and 1 other location - About 1 hr to fix
      doorpi/status/webserver_lib/request_handler.py on lines 346..349

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

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

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

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

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

      Refactorings

      Further Reading

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

              for write_permission in user_session['writepermissions']:
                  if re.match(write_permission, parsed_path.path):
                      logger.info('user %s has write permissions: %s', user_session['username'], parsed_path.path)
                      return False
      Severity: Major
      Found in doorpi/status/webserver_lib/request_handler.py and 1 other location - About 1 hr to fix
      doorpi/status/webserver_lib/request_handler.py on lines 351..354

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

      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