saltstack/salt

View on GitHub
salt/states/archive.py

Summary

Maintainability
F
2 wks
Test Coverage

Function extracted has a Cognitive Complexity of 485 (exceeds 5 allowed). Consider refactoring.
Open

def extracted(name,
              source,
              source_hash=None,
              source_hash_name=None,
              source_hash_update=False,
Severity: Minor
Found in salt/states/archive.py - About 1 wk 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

Cyclomatic complexity is too high in function extracted. (199)
Open

def extracted(name,
              source,
              source_hash=None,
              source_hash_name=None,
              source_hash_update=False,
Severity: Minor
Found in salt/states/archive.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

File archive.py has 1275 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Extract an archive

.. versionadded:: 2014.1.0
Severity: Major
Found in salt/states/archive.py - About 3 days to fix

    Function _update_checksum has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def _update_checksum(path):
        checksum_file = _checksum_file_path(path)
        checksum_dir = os.path.dirname(checksum_file)
        if not os.path.isdir(checksum_dir):
            os.makedirs(checksum_dir)
    Severity: Minor
    Found in salt/states/archive.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 extracted has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def extracted(name,
                  source,
                  source_hash=None,
                  source_hash_name=None,
                  source_hash_update=False,
    Severity: Minor
    Found in salt/states/archive.py - About 1 hr to fix

      Avoid deeply nested control flow statements.
      Open

                                  if trim_output:
                                      files = files[:trim_output]
                          except tarfile.ReadError:
      Severity: Major
      Found in salt/states/archive.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if exc.errno == errno.ENOENT:
                                    extraction_needed = True
                                    contents_missing = True
                                elif exc.errno != errno.ENOTDIR:
                                    # In cases where a directory path was occupied by a
        Severity: Major
        Found in salt/states/archive.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      if __salt__['cmd.retcode'](
                                              ['xz', '-t', cached],
                                              python_shell=False,
                                              ignore_retcode=True) == 0:
                                          # XZ-compressed data
          Severity: Major
          Found in salt/states/archive.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if not func(path_mode):
                                        incorrect_type.append(path)
                                except OSError as exc:
            Severity: Major
            Found in salt/states/archive.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if not force:
                                      ret['comment'] += (
                                          ' To proceed with extraction, set \'force\' to '
                                          'True. Note that this will remove these paths '
                                          'before extracting.{0}'.format(incorrect_paths)
              Severity: Major
              Found in salt/states/archive.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if opt.startswith('-'):
                                            tar_longopts.append(opt)
                                        else:
                                            if position > 0:
                                                tar_longopts.append(opt)
                Severity: Major
                Found in salt/states/archive.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if created_destdir:
                                                  _cleanup_destdir(name)
                                              ret['result'] = False
                  Severity: Major
                  Found in salt/states/archive.py - About 45 mins to fix

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

                    def _read_cached_checksum(path, form=None):
                        if form is None:
                            form = __opts__['hash_type']
                        checksum_file = _checksum_file_path(path)
                        try:
                    Severity: Minor
                    Found in salt/states/archive.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 ret
                    Severity: Major
                    Found in salt/states/archive.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return ret
                      Severity: Major
                      Found in salt/states/archive.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return ret
                        Severity: Major
                        Found in salt/states/archive.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return ret
                          Severity: Major
                          Found in salt/states/archive.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                            return ret
                            Severity: Major
                            Found in salt/states/archive.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                                      return ret
                              Severity: Major
                              Found in salt/states/archive.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                                    return ret
                                Severity: Major
                                Found in salt/states/archive.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                  return ret
                                  Severity: Major
                                  Found in salt/states/archive.py - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return ret
                                    Severity: Major
                                    Found in salt/states/archive.py - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                  return result
                                      Severity: Major
                                      Found in salt/states/archive.py - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                                    return ret
                                        Severity: Major
                                        Found in salt/states/archive.py - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                                      return ret
                                          Severity: Major
                                          Found in salt/states/archive.py - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                            return ret
                                            Severity: Major
                                            Found in salt/states/archive.py - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                                  return ret
                                              Severity: Major
                                              Found in salt/states/archive.py - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                                return ret
                                                Severity: Major
                                                Found in salt/states/archive.py - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                              return ret
                                                  Severity: Major
                                                  Found in salt/states/archive.py - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                            return ret
                                                    Severity: Major
                                                    Found in salt/states/archive.py - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                              return ret
                                                      Severity: Major
                                                      Found in salt/states/archive.py - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                    return ret
                                                        Severity: Major
                                                        Found in salt/states/archive.py - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                      return ret
                                                          Severity: Major
                                                          Found in salt/states/archive.py - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                        return ret
                                                            Severity: Major
                                                            Found in salt/states/archive.py - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                      return ret
                                                              Severity: Major
                                                              Found in salt/states/archive.py - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                                    return ret
                                                                Severity: Major
                                                                Found in salt/states/archive.py - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                              return ret
                                                                  Severity: Major
                                                                  Found in salt/states/archive.py - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                                    return ret
                                                                    Severity: Major
                                                                    Found in salt/states/archive.py - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

                                                                                  return ret
                                                                      Severity: Major
                                                                      Found in salt/states/archive.py - About 30 mins to fix

                                                                        Avoid too many return statements within this function.
                                                                        Open

                                                                                                        return ret
                                                                        Severity: Major
                                                                        Found in salt/states/archive.py - About 30 mins to fix

                                                                          Avoid too many return statements within this function.
                                                                          Open

                                                                                                  return ret
                                                                          Severity: Major
                                                                          Found in salt/states/archive.py - About 30 mins to fix

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                                                return ret
                                                                            Severity: Major
                                                                            Found in salt/states/archive.py - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                          return ret
                                                                              Severity: Major
                                                                              Found in salt/states/archive.py - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                    return ret
                                                                                Severity: Major
                                                                                Found in salt/states/archive.py - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

                                                                                                      return ret
                                                                                  Severity: Major
                                                                                  Found in salt/states/archive.py - About 30 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                                return ret
                                                                                    Severity: Major
                                                                                    Found in salt/states/archive.py - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                                  return ret
                                                                                      Severity: Major
                                                                                      Found in salt/states/archive.py - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                        return ret
                                                                                        Severity: Major
                                                                                        Found in salt/states/archive.py - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                                                      return ret
                                                                                          Severity: Major
                                                                                          Found in salt/states/archive.py - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                        return ret
                                                                                            Severity: Major
                                                                                            Found in salt/states/archive.py - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                              return ret
                                                                                              Severity: Major
                                                                                              Found in salt/states/archive.py - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                                return ret
                                                                                                Severity: Major
                                                                                                Found in salt/states/archive.py - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                          return ret
                                                                                                  Severity: Major
                                                                                                  Found in salt/states/archive.py - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                                            return ret
                                                                                                    Severity: Major
                                                                                                    Found in salt/states/archive.py - About 30 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

                                                                                                                              return ret
                                                                                                      Severity: Major
                                                                                                      Found in salt/states/archive.py - About 30 mins to fix

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

                                                                                                        def _checksum_file_path(path):
                                                                                                            try:
                                                                                                                relpath = '.'.join((os.path.relpath(path, __opts__['cachedir']), 'hash'))
                                                                                                                if re.match(r'..[/\\]', relpath):
                                                                                                                    # path is a local file
                                                                                                        Severity: Minor
                                                                                                        Found in salt/states/archive.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 2 locations. Consider refactoring.
                                                                                                        Open

                                                                                                                if user:
                                                                                                                    uid = __salt__['file.user_to_uid'](user)
                                                                                                                    if uid == '':
                                                                                                                        ret['comment'] = 'User {0} does not exist'.format(user)
                                                                                                                        return ret
                                                                                                        Severity: Major
                                                                                                        Found in salt/states/archive.py and 1 other location - About 1 hr to fix
                                                                                                        salt/states/archive.py on lines 756..762

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

                                                                                                        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 group:
                                                                                                                    gid = __salt__['file.group_to_gid'](group)
                                                                                                                    if gid == '':
                                                                                                                        ret['comment'] = 'Group {0} does not exist'.format(group)
                                                                                                                        return ret
                                                                                                        Severity: Major
                                                                                                        Found in salt/states/archive.py and 1 other location - About 1 hr to fix
                                                                                                        salt/states/archive.py on lines 748..754

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

                                                                                                        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 enforce_failed:
                                                                                                                ret['result'] = False
                                                                                                                ret['comment'] += (
                                                                                                                    '\n\nWhile trying to enforce user/group ownership, Salt was '
                                                                                                                    'unable to change ownership on the following paths:\n'
                                                                                                        Severity: Major
                                                                                                        Found in salt/states/archive.py and 1 other location - About 1 hr to fix
                                                                                                        salt/states/file.py on lines 3641..3645

                                                                                                        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 errors:
                                                                                                                        msg = (
                                                                                                                            'One or more paths could not be cleaned. The following '
                                                                                                                            'errors were observed:\n'
                                                                                                                        )
                                                                                                        Severity: Minor
                                                                                                        Found in salt/states/archive.py and 1 other location - About 40 mins to fix
                                                                                                        salt/states/archive.py on lines 1177..1187

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

                                                                                                        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 errors:
                                                                                                                                    msg = (
                                                                                                                                        'One or more paths existed by were the incorrect '
                                                                                                                                        'type (i.e. file instead of directory or '
                                                                                                                                        'vice-versa), but could not be removed. The '
                                                                                                        Severity: Minor
                                                                                                        Found in salt/states/archive.py and 1 other location - About 40 mins to fix
                                                                                                        salt/states/archive.py on lines 1237..1245

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

                                                                                                        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 urlparsed_scheme and \
                                                                                                                    urlparsed_scheme.lower() in string.ascii_lowercase:
                                                                                                                urlparsed_path = ':'.join([urlparsed_scheme, urlparsed_path])
                                                                                                                urlparsed_scheme = 'file'
                                                                                                        Severity: Minor
                                                                                                        Found in salt/states/archive.py and 2 other locations - About 30 mins to fix
                                                                                                        salt/fileclient.py on lines 480..482
                                                                                                        salt/modules/file.py on lines 4461..4463

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

                                                                                                        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