saltstack/salt

View on GitHub
salt/utils/event.py

Summary

Maintainability
F
1 wk
Test Coverage

File event.py has 1167 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
'''
Manage events

Events are all fired off via a zeromq 'pub' socket, and listened to with local
Severity: Major
Found in salt/utils/event.py - About 3 days to fix

    Function _get_event has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

        def _get_event(self, wait, tag, match_func=None, no_block=False):
            if match_func is None:
                match_func = self._get_match_func()
            start = time.time()
            timeout_at = start + wait
    Severity: Minor
    Found in salt/utils/event.py - About 5 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 fire_ret_load has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        def fire_ret_load(self, load):
            '''
            Fire events based on information in the return load
            '''
            if load.get('retcode') and load.get('fun'):
    Severity: Minor
    Found in salt/utils/event.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

    SaltEvent has 31 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SaltEvent(object):
        '''
        Warning! Use the get_event function or the code will not be
        RAET compatible
        The base class used to manage salt events
    Severity: Minor
    Found in salt/utils/event.py - About 3 hrs to fix

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

          def run(self):
              '''
              Spin up the multiprocess event returner
              '''
              salt.utils.process.appendproctitle(self.__class__.__name__)
      Severity: Minor
      Found in salt/utils/event.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 __init__ has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(self, opts, io_loop=None):
              self.opts = salt.config.DEFAULT_MINION_OPTS.copy()
              default_minion_sock_dir = self.opts['sock_dir']
              self.opts.update(opts)
      
      
      Severity: Minor
      Found in salt/utils/event.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_event has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_event(self,
                        wait=5,
                        tag='',
                        full=False,
                        match_type=None,
      Severity: Minor
      Found in salt/utils/event.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 fire_event has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def fire_event(self, data, tag, timeout=1000):
              '''
              Send a single event into the publisher with payload dict "data" and
              event identifier "tag"
      
      
      Severity: Minor
      Found in salt/utils/event.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 _fire_ret_load_specific_fun has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def _fire_ret_load_specific_fun(self, load, fun_index=0):
              '''
              Helper function for fire_ret_load
              '''
              if isinstance(load['fun'], list):
      Severity: Minor
      Found in salt/utils/event.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_pending has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def _check_pending(self, tag, match_func=None):
              """Check the pending_events list for events that match the tag
      
              :param tag: The tag to search for
              :type tag: str
      Severity: Minor
      Found in salt/utils/event.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 __init__ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(
                  self, node, sock_dir=None,
                  opts=None, listen=True, io_loop=None,
                  keep_loop=False, raise_errors=False):
              '''
      Severity: Minor
      Found in salt/utils/event.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 connect_pub has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def connect_pub(self, timeout=None):
              '''
              Establish the publish connection
              '''
              if self.cpub:
      Severity: Minor
      Found in salt/utils/event.py - About 55 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 connect_pull has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def connect_pull(self, timeout=1):
              '''
              Establish a connection with the event pull socket
              Default timeout is 1 s
              '''
      Severity: Minor
      Found in salt/utils/event.py - About 55 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 deeply nested control flow statements.
      Open

                              if (len(load['retcode']) > fun_index and
                                      load['retcode'][fun_index] and
                                      fun in SUB_EVENT):
                                  # Minion fired a bad retcode, fire an event
                                  self._fire_ret_load_specific_fun(load, fun_index)
      Severity: Major
      Found in salt/utils/event.py - About 45 mins to fix

        Function _filter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def _filter(self, event):
                '''
                Take an event and run it through configured filters.
        
                Returns True if event should be stored, else False
        Severity: Minor
        Found in salt/utils/event.py - About 45 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 deeply nested control flow statements.
        Open

                                if load['retcode'].get(fun, 0) and fun in SUB_EVENT:
                                    # Minion fired a bad retcode, fire an event
                                    self._fire_ret_load_specific_fun(load, fun_index)
                    else:
        Severity: Major
        Found in salt/utils/event.py - About 45 mins to fix

          Function __load_uri has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def __load_uri(self, sock_dir, node):
                  '''
                  Return the string URI for the location of the pull and pub sockets to
                  use for firing and listening to events
                  '''
          Severity: Minor
          Found in salt/utils/event.py - About 45 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 _flush_event_single has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def _flush_event_single(self, event_return):
                  if event_return in self.minion.returners:
                      try:
                          self.minion.returners[event_return](self.event_queue)
                      except Exception as exc:
          Severity: Minor
          Found in salt/utils/event.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

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

              def fire_running(self, running):
                  '''
                  Pass in a state "running" dict, this is the return dict from a state
                  call. The dict will be processed and fire events.
          
          
          Severity: Minor
          Found in salt/utils/event.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 None
          Severity: Major
          Found in salt/utils/event.py - About 30 mins to fix

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

                def connect_pull(self, timeout=1):
                    '''
                    Establish a connection with the event pull socket
                    Default timeout is 1 s
                    '''
            Severity: Major
            Found in salt/utils/event.py and 1 other location - About 1 day to fix
            salt/utils/event.py on lines 372..402

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

            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 connect_pub(self, timeout=None):
                    '''
                    Establish the publish connection
                    '''
                    if self.cpub:
            Severity: Major
            Found in salt/utils/event.py and 1 other location - About 1 day to fix
            salt/utils/event.py on lines 416..446

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

            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

                stats[cmd]['latency'] = (stats[cmd]['latency'] * (stats[cmd]['runs'] - 1) + latency) / stats[cmd]['runs']
            Severity: Major
            Found in salt/utils/event.py and 1 other location - About 3 hrs to fix
            salt/utils/event.py on lines 225..225

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

            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

                stats[cmd]['mean'] = (stats[cmd]['mean'] * (stats[cmd]['runs'] - 1) + duration) / stats[cmd]['runs']
            Severity: Major
            Found in salt/utils/event.py and 1 other location - About 3 hrs to fix
            salt/utils/event.py on lines 224..224

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

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

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

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

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

            Refactorings

            Further Reading

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

                def __setstate__(self, state):
                    self._is_child = True
                    self.__init__(
                        state['opts'],
                        log_queue=state['log_queue'],
            Severity: Major
            Found in salt/utils/event.py and 5 other locations - About 1 hr to fix
            salt/master.py on lines 164..169
            salt/master.py on lines 802..807
            salt/utils/event.py on lines 1099..1104
            salt/utils/master.py on lines 529..534
            salt/utils/master.py on lines 592..597

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

                def __setstate__(self, state):
                    self._is_child = True
                    self.__init__(
                        state['opts'],
                        log_queue=state['log_queue'],
            Severity: Major
            Found in salt/utils/event.py and 5 other locations - About 1 hr to fix
            salt/master.py on lines 164..169
            salt/master.py on lines 802..807
            salt/utils/event.py on lines 1230..1235
            salt/utils/master.py on lines 529..534
            salt/utils/master.py on lines 592..597

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

                def handle_publish(self, package, _):
                    '''
                    Get something from epull, publish it out epub, and return the package (or None)
                    '''
                    try:
            Severity: Major
            Found in salt/utils/event.py and 1 other location - About 1 hr to fix
            salt/utils/event.py on lines 1059..1070

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

                def handle_publish(self, package, _):
                    '''
                    Get something from epull, publish it out epub, and return the package (or None)
                    '''
                    try:
            Severity: Major
            Found in salt/utils/event.py and 1 other location - About 1 hr to fix
            salt/utils/event.py on lines 1163..1174

            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

            There are no issues that match your filters.

            Category
            Status