edgewall/trac

View on GitHub
trac/wiki/formatter.py

Summary

Maintainability
F
2 wks
Test Coverage

File formatter.py has 1348 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2023 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de>
Severity: Major
Found in trac/wiki/formatter.py - About 3 days to fix

    Formatter has 72 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Formatter(object):
        """Base Wiki formatter.
    
        Parses and formats wiki text, in a given `RenderingContext`.
        """
    Severity: Major
    Found in trac/wiki/formatter.py - About 1 day to fix

      Function format has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          def format(self, text, out=None, escape_newlines=False):
              text = self.reset(text, out)
              if isinstance(text, str):
                  text = text.splitlines()
      
      
      Severity: Minor
      Found in trac/wiki/formatter.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 _set_quote_depth has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

          def _set_quote_depth(self, depth, citation=False):
              def open_quote(depth):
                  self.close_table()
                  self.close_paragraph()
                  self.close_list()
      Severity: Minor
      Found in trac/wiki/formatter.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 handle_code_block has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          def handle_code_block(self, line, startmatch=None):
              if startmatch:
                  self.in_code_block += 1
                  if self.in_code_block == 1:
                      name = startmatch.group(2)
      Severity: Minor
      Found in trac/wiki/formatter.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 format has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          def format(self, text, out, shorten=False):
              if not text:
                  return
              text = self.reset(text, out)
      
      
      Severity: Minor
      Found in trac/wiki/formatter.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 __init__ has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(self, formatter, name, args=None):
              """Find the processor by name
      
              :param formatter: the formatter embedding a call for this processor
              :param name: the name of the processor
      Severity: Minor
      Found in trac/wiki/formatter.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 _set_list_depth has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          def _set_list_depth(self, depth, new_type=None, lclass=None, start=None):
              def open_list():
                  self.close_table()
                  self.close_paragraph()
                  self.close_indentation() # FIXME: why not lists in quotes?
      Severity: Minor
      Found in trac/wiki/formatter.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 _make_lhref_link has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def _make_lhref_link(self, match, fullmatch, rel, ns, target, label):
              if not label: # e.g. `[http://target]` or `[wiki:target]`
                  if target:
                      if ns and target.startswith('//'):     # for `[http://target]`
                          label = ns + ':' + target   #  use `http://target`
      Severity: Minor
      Found in trac/wiki/formatter.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 ensure_inline has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          def ensure_inline(self, text, in_paragraph=True):
              content_for_span = None
              interrupt_paragraph = False
              if isinstance(text, Element):
                  tagname = text.tag.lower()
      Severity: Minor
      Found in trac/wiki/formatter.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

      WikiProcessor has 23 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class WikiProcessor(object):
      
          _code_block_re = re.compile(r'^<div(?:\s+class="([^"]+)")?>(.*)</div>$')
          _block_elem_re = re.compile(r'^\s*<(?:div|table)(?:\s+[^>]+)?>',
                                      re.I | re.M)
      Severity: Minor
      Found in trac/wiki/formatter.py - About 2 hrs to fix

        Function _table_cell_formatter has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            def _table_cell_formatter(self, match, fullmatch):
                self.open_table()
                self.open_table_row()
                self.continue_table = 1
                separator = fullmatch.group('table_cell_sep')
        Severity: Minor
        Found in trac/wiki/formatter.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 format has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def format(self, text, out, max_depth=6, min_depth=1, shorten=True):
                self.shorten = shorten
                whitespace_indent = '  '
                self.outline = []
                Formatter.format(self, text)
        Severity: Minor
        Found in trac/wiki/formatter.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 _make_link has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def _make_link(self, ns, target, match, label, fullmatch):
                # first check for an alias defined in trac.ini
                ns = self.env.config['intertrac'].get(ns, ns)
                if ns in self.wikiparser.link_resolvers:
                    resolver = self.wikiparser.link_resolvers[ns]
        Severity: Minor
        Found in trac/wiki/formatter.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 _macrolink_formatter has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def _macrolink_formatter(self, match, fullmatch):
                # check for a known [[macro]]
                macro_or_link = match[2:-2]
                if macro_or_link.startswith('=#'):
                    fullmatch = WikiParser._set_anchor_wc_re.match(macro_or_link)
        Severity: Minor
        Found in trac/wiki/formatter.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 _list_formatter has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def _list_formatter(self, match, fullmatch):
                ldepth = len(fullmatch.group('ldepth'))
                listid = match[ldepth]
                self.in_list_item = True
                class_ = start = None
        Severity: Minor
        Found in trac/wiki/formatter.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 _indent_formatter has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def _indent_formatter(self, match, fullmatch):
                idepth = len(fullmatch.group('idepth'))
                if self._list_stack:
                    ltype, ldepth = self._list_stack[-1]
                    if idepth < ldepth:
        Severity: Minor
        Found in trac/wiki/formatter.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 handle_match has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def handle_match(self, fullmatch):
                for itype, match in fullmatch.groupdict().items():
                    if match and itype not in self.wikiparser.helper_patterns:
                        # Check for preceding escape character '!'
                        if match[0] == '!':
        Severity: Minor
        Found in trac/wiki/formatter.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 wiki_to_outline has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def wiki_to_outline(wikitext, env, db=None,
        Severity: Major
        Found in trac/wiki/formatter.py - About 50 mins to fix

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

              def _bolditalic_formatter(self, match, fullmatch):
                  if self._list_stack and not self.in_list_item:
                      self.close_list()
          
                  bold_open = self.tag_open_p('MM_BOLD')
          Severity: Minor
          Found in trac/wiki/formatter.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 old_offset != depth: # adjust last depth
                                      self._list_stack[-1] = (old_type, depth)
                                  close_item()
          Severity: Major
          Found in trac/wiki/formatter.py - About 45 mins to fix

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

                def _macro_formatter(self, match, fullmatch, macro, only_inline=False):
                    name = fullmatch.group('macroname')
                    if name and name[-1] == '?': # Macro?() shortcut for MacroList(Macro)
                        args = name[:-1] or '*'
                    else:
            Severity: Minor
            Found in trac/wiki/formatter.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 emit_linebreak has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def emit_linebreak(self, args):
                    if args:
                        sep = ':' if ':' in args else '='
                        kv = args.split(sep, 1)
                        if kv[0] == 'clear':
            Severity: Minor
            Found in trac/wiki/formatter.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 processor != 'comment':
                                        buf.write(' [...]\n')
                                    processor = None
            Severity: Major
            Found in trac/wiki/formatter.py - About 45 mins to fix

              Function _make_lhref_link has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def _make_lhref_link(self, match, fullmatch, rel, ns, target, label):
              Severity: Minor
              Found in trac/wiki/formatter.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if hasattr(macro_provider, 'expand_macro'):
                                            self.processor = self._macro_processor
                                        else:
                                            raise TracError(
                                                tag_("Pre-0.11 macros with the %(method)s "
                Severity: Major
                Found in trac/wiki/formatter.py - About 45 mins to fix

                  Function format_to has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def format_to(env, flavor, context, wikidom, **options):
                  Severity: Minor
                  Found in trac/wiki/formatter.py - About 35 mins to fix

                    Function format has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def format(self, text, out, max_depth=6, min_depth=1, shorten=True):
                    Severity: Minor
                    Found in trac/wiki/formatter.py - About 35 mins to fix

                      Function _make_link has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def _make_link(self, ns, target, match, label, fullmatch):
                      Severity: Minor
                      Found in trac/wiki/formatter.py - About 35 mins to fix

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

                            def close_tag(self, open_tag, close_tag=None):
                                """Open a inline style tag.
                        
                                If `close_tag` is not specified, it's an indirect tag (0.12)
                                """
                        Severity: Minor
                        Found in trac/wiki/formatter.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 _mimeview_processor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _mimeview_processor(self, text):
                                annotations = []
                                context = self.formatter.context.child()
                                args = self.args.copy() if self.args else self.args
                                if args and 'lineno' in args:
                        Severity: Minor
                        Found in trac/wiki/formatter.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 self._make_ext_link(ns + ':' + target, label)
                        Severity: Major
                        Found in trac/wiki/formatter.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                          return escape(match)
                          Severity: Major
                          Found in trac/wiki/formatter.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return self._make_intertrac_link(ns, target, label) or \
                            Severity: Major
                            Found in trac/wiki/formatter.py - About 30 mins to fix

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

                                  def _parse_heading(self, match, fullmatch, shorten):
                                      match = match.strip()
                              
                                      hdepth = fullmatch.group('hdepth')
                                      depth = len(hdepth)
                              Severity: Minor
                              Found in trac/wiki/formatter.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 get_intertrac_url has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def get_intertrac_url(self, ns, target):
                                      intertrac = self.env.config['intertrac']
                                      url = intertrac.get(ns + '.url')
                                      name = _("Trac project %(name)s", name=ns)
                                      if not url and ns.lower() == 'trac':
                              Severity: Minor
                              Found in trac/wiki/formatter.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

                              class HtmlFormatter(object):
                                  """Format parsed wiki text to HTML"""
                              
                                  flavor = 'default'
                              
                              
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 7 hrs to fix
                              trac/wiki/formatter.py on lines 1584..1609

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

                              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

                              class InlineHtmlFormatter(object):
                                  """Format parsed wiki text to inline elements HTML.
                              
                                  Block level content will be discarded or compacted.
                                  """
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 7 hrs to fix
                              trac/wiki/formatter.py on lines 1560..1581

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                                              for i in range(curr_depth-1, depth-1, -1):
                                                  out.write(whitespace_indent * (2*i+1) + '</li>\n' +
                                                            whitespace_indent * (2*i) + '</ol>\n')
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 4 hrs to fix
                              trac/wiki/formatter.py on lines 1531..1533

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                                      for i in range(curr_depth-1, min_depth-2, -1):
                                          out.write(whitespace_indent * (2*i+1) + '</li>\n' +
                                                    whitespace_indent * (2*i) + '</ol>\n')
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 4 hrs to fix
                              trac/wiki/formatter.py on lines 1519..1521

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                                          elif depth < curr_depth: # Shallower indent
                                              for i in range(curr_depth-1, depth-1, -1):
                                                  out.write(whitespace_indent * (2*i+1) + '</li>\n' +
                                                            whitespace_indent * (2*i) + '</ol>\n')
                                              out.write(whitespace_indent * (2*depth-1) + '</li>\n' +
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 3 hrs to fix
                              trac/wiki/formatter.py on lines 1522..1523

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                                              out.write(whitespace_indent * (2*depth-1) + '</li>\n' +
                                                        whitespace_indent * (2*depth-1) + '<li>\n')
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 3 hrs to fix
                              trac/wiki/formatter.py on lines 1518..1526

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

                              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 format_to_oneliner(env, context, wikidom, shorten=None):
                                  if not wikidom:
                                      return Markup()
                                  if shorten is None:
                                      shorten = context.get_hint('shorten_lines', False)
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 2 hrs to fix
                              trac/wiki/formatter.py on lines 1620..1625

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

                              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 format_to_html(env, context, wikidom, escape_newlines=None):
                                  if not wikidom:
                                      return Markup()
                                  if escape_newlines is None:
                                      escape_newlines = context.get_hint('preserve_newlines', False)
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 2 hrs to fix
                              trac/wiki/formatter.py on lines 1627..1632

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

                              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

                                          elif listid.isupper():
                                              class_ = 'upperalpha'
                                              if len(lstart) == 1 and lstart != 'A':
                                                  start = ord(lstart) - ord('A') + 1
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 2 hrs to fix
                              trac/wiki/formatter.py on lines 902..905

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

                              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

                                          elif listid.islower():
                                              class_ = 'loweralpha'
                                              if len(lstart) == 1 and lstart != 'a':
                                                  start = ord(lstart) - ord('a') + 1
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 2 hrs to fix
                              trac/wiki/formatter.py on lines 906..909

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

                              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 _format_table(self, env, context, text):
                                      if text:
                                          out = io.StringIO()
                                          Formatter(env, context).format(text, out)
                                          text = self._parse_inner_table(out.getvalue())
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 2 hrs to fix
                              trac/wiki/formatter.py on lines 328..333

                              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

                                  def _format_row(self, env, context, text):
                                      if text:
                                          out = io.StringIO()
                                          Formatter(env, context).format(text, out)
                                          text = self._parse_inner_table(out.getvalue())
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 2 hrs to fix
                              trac/wiki/formatter.py on lines 335..340

                              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

                                  def _get_open_tag(self, tag):
                                      """Retrieve opening tag for direct or indirect `tag`."""
                                      if not isinstance(tag, tuple):
                                          tag = self._indirect_tags[tag]
                                      return tag[0]
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 1 hr to fix
                              trac/wiki/formatter.py on lines 467..471

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

                              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 _get_close_tag(self, tag):
                                      """Retrieve closing tag for direct or indirect `tag`."""
                                      if not isinstance(tag, tuple):
                                          tag = self._indirect_tags[tag]
                                      return tag[1]
                              Severity: Major
                              Found in trac/wiki/formatter.py and 1 other location - About 1 hr to fix
                              trac/wiki/formatter.py on lines 461..465

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

                              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 _make_mail_link(self, url, text, title=''):
                                      return tag.a(tag.span('\u200b', class_="icon"), text,
                                                   class_="mail-link", href=url, title=title or None)
                              Severity: Minor
                              Found in trac/wiki/formatter.py and 1 other location - About 45 mins to fix
                              trac/wiki/formatter.py on lines 745..747

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

                              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 url.startswith(local_url):
                                          return tag.a(tag.span('\u200b', class_="icon"), text,
                                                       class_="ext-link", href=url, title=title or None)
                              Severity: Minor
                              Found in trac/wiki/formatter.py and 1 other location - About 45 mins to fix
                              trac/wiki/formatter.py on lines 751..753

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

                              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 idx >= 0:
                                      target, fragment = target[:idx], target[idx:]
                              Severity: Minor
                              Found in trac/wiki/formatter.py and 1 other location - About 35 mins to fix
                              trac/wiki/formatter.py on lines 75..76

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

                              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 idx >= 0:
                                      target, query = target[:idx], target[idx:]
                              Severity: Minor
                              Found in trac/wiki/formatter.py and 1 other location - About 35 mins to fix
                              trac/wiki/formatter.py on lines 72..73

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

                              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