gecos-team/gecoscc-ui

View on GitHub
gecoscc/api/__init__.py

Summary

Maintainability
F
4 days
Test Coverage

File __init__.py has 513 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from __future__ import division
#
# Copyright 2013, Junta de Andalucia
# http://www.juntadeandalucia.es/
#
Severity: Major
Found in gecoscc/api/__init__.py - About 1 day to fix

    Function pre_save has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        def pre_save(self, obj, old_obj=None):
            if old_obj and 'name' in old_obj:
                obj['name'] = old_obj['name']
    
            # Check he policies "object_related_list" attribute
    Severity: Minor
    Found in gecoscc/api/__init__.py - About 4 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_objects_filter has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_objects_filter(self):
            query = []
            if not self.request.method == 'GET':
                return []
    
    
    Severity: Minor
    Found in gecoscc/api/__init__.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

    Function check_obj_is_related has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_obj_is_related(self, obj):
            '''
            Check if the emitter object is related with any object
            '''
            if obj.get('_id'):
    Severity: Minor
    Found in gecoscc/api/__init__.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

    Function put has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def put(self):
            obj = self.request.validated
            oid = self.request.matchdict['oid']
    
            if oid != str(obj[self.key]):
    Severity: Minor
    Found in gecoscc/api/__init__.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

    Avoid deeply nested control flow statements.
    Open

                            for ro_id in ro_list:
                                ro_obj = ro_collection.find_one({"_id": ObjectId(str(ro_id))})
                                if ro_obj is None:
                                    logger.error("Can't find related object: %s:%s" % (str(policyobj['slug']), str(ro_id)))
                                    self.request.errors.add('body', 'object', "Can't find related object: %s:%s" % (str(policyobj['slug']), str(ro_id)))
    Severity: Major
    Found in gecoscc/api/__init__.py - About 45 mins to fix

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

          def collection_post(self):
              obj = self.request.validated
      
              if issubclass(self.schema_detail, Node):
                  can_access_to_this_path(self.request, self.collection, obj)
      Severity: Minor
      Found in gecoscc/api/__init__.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

      Avoid too many return statements within this function.
      Open

              return True
      Severity: Major
      Found in gecoscc/api/__init__.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return self.check_unique_node_name_by_type_at_domain(obj)
        Severity: Major
        Found in gecoscc/api/__init__.py - About 30 mins to fix

          Function collection_get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def collection_get(self):
                  page = int(self.request.GET.get('page', 1))
                  pagesize = int(self.request.GET.get('pagesize', self.default_pagesize))
                  if pagesize <= 0 or page <= 0:
                      raise HTTPBadRequest()
          Severity: Minor
          Found in gecoscc/api/__init__.py - About 25 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

          Function check_unique_node_name_by_type_at_domain has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def check_unique_node_name_by_type_at_domain(self, obj):
                  unique = check_unique_node_name_by_type_at_domain(self.request.db.nodes, obj)
                  if not unique:
                      self.request.errors.add('body', 'name',
                                              "Name must be unique in domain.")
          Severity: Minor
          Found in gecoscc/api/__init__.py - About 25 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

          Function post_save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def post_save(self, obj, old_obj=None):
                  if self.request.method == 'DELETE':
                      newmemberof = []
                  else:
                      newmemberof = obj.get('memberof', [])
          Severity: Minor
          Found in gecoscc/api/__init__.py - About 25 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 3 locations. Consider refactoring.
          Open

                  if issubclass(self.schema_detail, Node):
                      can_access_to_this_path(self.request, self.collection, oid)
                      is_gecos_master_or_403(self.request, self.collection, obj, self.schema_detail)
                      master_policy_no_updated_or_403(self.request, self.collection, obj)
          Severity: Major
          Found in gecoscc/api/__init__.py and 2 other locations - About 2 hrs to fix
          gecoscc/api/__init__.py on lines 313..316
          gecoscc/api/__init__.py on lines 431..434

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

          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

                  if issubclass(self.schema_detail, Node):
                      can_access_to_this_path(self.request, self.collection, obj)
                      is_gecos_master_or_403(self.request, self.collection, obj, self.schema_detail)
                      master_policy_no_updated_or_403(self.request, self.collection, obj)
          Severity: Major
          Found in gecoscc/api/__init__.py and 2 other locations - About 2 hrs to fix
          gecoscc/api/__init__.py on lines 371..374
          gecoscc/api/__init__.py on lines 431..434

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

          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

                  if issubclass(self.schema_detail, Node):
                      can_access_to_this_path(self.request, self.collection, oid)
                      is_gecos_master_or_403(self.request, self.collection, obj, self.schema_detail)
                      master_policy_no_updated_or_403(self.request, self.collection, obj)
          Severity: Major
          Found in gecoscc/api/__init__.py and 2 other locations - About 2 hrs to fix
          gecoscc/api/__init__.py on lines 313..316
          gecoscc/api/__init__.py on lines 371..374

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

          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 obj != obj_validated:
                      self.request.errors.add('body', '%s: memberof'%(str(obj[self.key])),
                                              "There is a group out of scope.")
                      return False
          Severity: Major
          Found in gecoscc/api/__init__.py and 1 other location - About 1 hr to fix
          gecoscc/api/__init__.py on lines 569..574

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

          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 not is_moved:
                      if obj != obj_original:
                          self.request.errors.add('body',
                                                  '%s - policies'%(str(obj[self.key])),
                                                  "The related object is out of scope")
          Severity: Major
          Found in gecoscc/api/__init__.py and 1 other location - About 1 hr to fix
          gecoscc/api/__init__.py on lines 550..553

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

          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 not parent:
                      self.request.errors.add('body', '%s: path'%(str(obj[self.key])),
                          "parent doesn't exist {0}".format(parent_id))
                      return False
          Severity: Major
          Found in gecoscc/api/__init__.py and 1 other location - About 1 hr to fix
          gecoscc/api/__init__.py on lines 530..534

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

          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 parent['path'] != candidate_path_parent:
                      self.request.errors.add('body',
                          '%s: path'%(str(obj[self.key])),
                          "the parent object {0} has a different path".format(parent_id))
                      return False
          Severity: Major
          Found in gecoscc/api/__init__.py and 1 other location - About 1 hr to fix
          gecoscc/api/__init__.py on lines 523..526

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

          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' in self.request.GET:
                      query.append({
                          key_name: self.request.GET.get('name')
          Severity: Minor
          Found in gecoscc/api/__init__.py and 1 other location - About 55 mins to fix
          gecoscc/api/printer_models.py on lines 43..45

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

          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

                      self.request.db.nodes.update_one({
                          '_id': group_id
                      }, {
                          '$pull': {
                              'members': obj['_id']
          Severity: Minor
          Found in gecoscc/api/__init__.py and 1 other location - About 40 mins to fix
          gecoscc/api/__init__.py on lines 625..629

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

          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 notify_refresh_policies(self, obj):
                  object_refresh_policies.delay(self.request.user, self.objtype, obj)
                  invalidate_change(self.request, obj)
          Severity: Minor
          Found in gecoscc/api/__init__.py and 1 other location - About 40 mins to fix
          gecoscc/api/__init__.py on lines 353..355

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

          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 notify_deleted(self, obj):
                  object_deleted.delay(self.request.user, self.objtype, obj)
                  invalidate_delete(self.request, obj)
          Severity: Minor
          Found in gecoscc/api/__init__.py and 1 other location - About 40 mins to fix
          gecoscc/api/__init__.py on lines 357..359

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

          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

                      self.request.db.nodes.update_one({
                          '_id': group_id
                      }, {
                          '$push': {
                              'members': obj['_id']
          Severity: Minor
          Found in gecoscc/api/__init__.py and 1 other location - About 40 mins to fix
          gecoscc/api/__init__.py on lines 610..614

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

          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

          There are no issues that match your filters.

          Category
          Status