tobspr/RenderPipeline

View on GitHub
rplibs/yaml/yaml_py2/emitter.py

Summary

Maintainability
F
3 wks
Test Coverage

File emitter.py has 955 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Emitter expects events obeying the following grammar:
# stream ::= STREAM-START document* STREAM-END
# document ::= DOCUMENT-START node DOCUMENT-END
# node ::= SCALAR | sequence | mapping
# sequence ::= SEQUENCE-START node* SEQUENCE-END
Severity: Major
Found in rplibs/yaml/yaml_py2/emitter.py - About 2 days to fix

    Function analyze_scalar has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
    Open

        def analyze_scalar(self, scalar):
    
            # Empty scalar is a special case.
            if not scalar:
                return ScalarAnalysis(scalar=scalar, empty=True, multiline=False,
    Severity: Minor
    Found in rplibs/yaml/yaml_py2/emitter.py - About 1 day 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 write_single_quoted has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
    Open

        def write_single_quoted(self, text, split=True):
            self.write_indicator(u'\'', True)
            spaces = False
            breaks = False
            start = end = 0
    Severity: Minor
    Found in rplibs/yaml/yaml_py2/emitter.py - About 1 day 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 write_folded has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
    Open

        def write_folded(self, text):
            hints = self.determine_block_hints(text)
            self.write_indicator(u'>'+hints, True)
            if hints[-1:] == u'+':
                self.open_ended = True
    Severity: Minor
    Found in rplibs/yaml/yaml_py2/emitter.py - About 1 day 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

    Emitter has 59 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Emitter(object):
    
        DEFAULT_TAG_PREFIXES = {
            u'!' : u'!',
            u'tag:yaml.org,2002:' : u'!!',
    Severity: Major
    Found in rplibs/yaml/yaml_py2/emitter.py - About 1 day to fix

      Function write_plain has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
      Open

          def write_plain(self, text, split=True):
              if self.root_context:
                  self.open_ended = True
              if not text:
                  return
      Severity: Minor
      Found in rplibs/yaml/yaml_py2/emitter.py - About 1 day 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 write_double_quoted has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
      Open

          def write_double_quoted(self, text, split=True):
              self.write_indicator(u'"', True)
              start = end = 0
              while end <= len(text):
                  ch = None
      Severity: Minor
      Found in rplibs/yaml/yaml_py2/emitter.py - About 7 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 write_literal has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

          def write_literal(self, text):
              hints = self.determine_block_hints(text)
              self.write_indicator(u'|'+hints, True)
              if hints[-1:] == u'+':
                  self.open_ended = True
      Severity: Minor
      Found in rplibs/yaml/yaml_py2/emitter.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 choose_scalar_style has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          def choose_scalar_style(self):
              if self.analysis is None:
                  self.analysis = self.analyze_scalar(self.event.value)
              if self.event.style == '"' or self.canonical:
                  return '"'
      Severity: Minor
      Found in rplibs/yaml/yaml_py2/emitter.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 expect_document_start has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          def expect_document_start(self, first=False):
              if isinstance(self.event, DocumentStartEvent):
                  if (self.event.version or self.event.tags) and self.open_ended:
                      self.write_indicator(u'...', True)
                      self.write_indent()
      Severity: Minor
      Found in rplibs/yaml/yaml_py2/emitter.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 prepare_tag has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def prepare_tag(self, tag):
              if not tag:
                  raise EmitterError("tag must not be empty")
              if tag == u'!':
                  return tag
      Severity: Minor
      Found in rplibs/yaml/yaml_py2/emitter.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 process_tag has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def process_tag(self):
              tag = self.event.tag
              if isinstance(self.event, ScalarEvent):
                  if self.style is None:
                      self.style = self.choose_scalar_style()
      Severity: Minor
      Found in rplibs/yaml/yaml_py2/emitter.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 expect_node has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          def expect_node(self, root=False, sequence=False, mapping=False,
                  simple_key=False):
              self.root_context = root
              self.sequence_context = sequence
              self.mapping_context = mapping
      Severity: Minor
      Found in rplibs/yaml/yaml_py2/emitter.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 check_simple_key has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_simple_key(self):
              length = 0
              if isinstance(self.event, NodeEvent) and self.event.anchor is not None:
                  if self.prepared_anchor is None:
                      self.prepared_anchor = self.prepare_anchor(self.event.anchor)
      Severity: Minor
      Found in rplibs/yaml/yaml_py2/emitter.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 prepare_tag_prefix has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def prepare_tag_prefix(self, prefix):
              if not prefix:
                  raise EmitterError("tag prefix must not be empty")
              chunks = []
              start = end = 0
      Severity: Minor
      Found in rplibs/yaml/yaml_py2/emitter.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 expect_flow_mapping_key has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def expect_flow_mapping_key(self):
              if isinstance(self.event, MappingEndEvent):
                  self.indent = self.indents.pop()
                  self.flow_level -= 1
                  if self.canonical:
      Severity: Minor
      Found in rplibs/yaml/yaml_py2/emitter.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 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def __init__(self, stream, canonical=None, indent=None, width=None,
                  allow_unicode=None, line_break=None):
      
              # The stream should have the methods `write` and possibly `flush`.
              self.stream = stream
      Severity: Minor
      Found in rplibs/yaml/yaml_py2/emitter.py - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

                    if (not (self.simple_key_context and
                            (self.analysis.empty or self.analysis.multiline))
                        and (self.flow_level and self.analysis.allow_flow_plain
                            or (not self.flow_level and self.analysis.allow_block_plain))):
                        return ''
        Severity: Major
        Found in rplibs/yaml/yaml_py2/emitter.py - About 1 hr to fix

          Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, scalar, empty, multiline,
          Severity: Major
          Found in rplibs/yaml/yaml_py2/emitter.py - About 1 hr to fix

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

                def expect_first_flow_mapping_key(self):
                    if isinstance(self.event, MappingEndEvent):
                        self.indent = self.indents.pop()
                        self.flow_level -= 1
                        self.write_indicator(u'}', False)
            Severity: Minor
            Found in rplibs/yaml/yaml_py2/emitter.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 self.encoding:
                                        data = data.encode(self.encoding)
                                    self.stream.write(data)
            Severity: Major
            Found in rplibs/yaml/yaml_py2/emitter.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if self.encoding:
                                          data = data.encode(self.encoding)
                                      self.stream.write(data)
              Severity: Major
              Found in rplibs/yaml/yaml_py2/emitter.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if br == u'\n':
                                            self.write_line_break()
                                        else:
                                            self.write_line_break(br)
                                    self.write_indent()
                Severity: Major
                Found in rplibs/yaml/yaml_py2/emitter.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if self.encoding:
                                              data = data.encode(self.encoding)
                                          self.stream.write(data)
                  Severity: Major
                  Found in rplibs/yaml/yaml_py2/emitter.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if br == u'\n':
                                                self.write_line_break()
                                            else:
                                                self.write_line_break(br)
                                        if ch is not None:
                    Severity: Major
                    Found in rplibs/yaml/yaml_py2/emitter.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if self.encoding:
                                                  data = data.encode(self.encoding)
                                              self.stream.write(data)
                      Severity: Major
                      Found in rplibs/yaml/yaml_py2/emitter.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if br == u'\n':
                                                    self.write_line_break()
                                                else:
                                                    self.write_line_break(br)
                                            if ch is not None:
                        Severity: Major
                        Found in rplibs/yaml/yaml_py2/emitter.py - About 45 mins to fix

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

                              def __init__(self, stream, canonical=None, indent=None, width=None,
                          Severity: Minor
                          Found in rplibs/yaml/yaml_py2/emitter.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if br == u'\n':
                                                        self.write_line_break()
                                                    else:
                                                        self.write_line_break(br)
                                                self.write_indent()
                            Severity: Major
                            Found in rplibs/yaml/yaml_py2/emitter.py - About 45 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                          if ch is None or ch in u'"\\\x85\u2028\u2029\uFEFF' \
                                                  or not (u'\x20' <= ch <= u'\x7E'
                                                      or (self.allow_unicode
                                                          and (u'\xA0' <= ch <= u'\uD7FF'
                                                              or u'\uE000' <= ch <= u'\uFFFD'))):
                              Severity: Major
                              Found in rplibs/yaml/yaml_py2/emitter.py - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                            if u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z'   \
                                                    or ch in u'-;/?:@&=+$,_.~*\'()[]'   \
                                                    or (ch == u'!' and handle != u'!'):
                                                end += 1
                                            else:
                                Severity: Major
                                Found in rplibs/yaml/yaml_py2/emitter.py - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if ((not self.canonical or tag is None) and
                                                  ((self.style == '' and self.event.implicit[0])
                                                          or (self.style != '' and self.event.implicit[1]))):
                                                  self.prepared_tag = None
                                                  return
                                  Severity: Major
                                  Found in rplibs/yaml/yaml_py2/emitter.py - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                            if isinstance(self.event, DocumentStartEvent):
                                                if (self.event.version or self.event.tags) and self.open_ended:
                                                    self.write_indicator(u'...', True)
                                                    self.write_indent()
                                                if self.event.version:
                                    Severity: Major
                                    Found in rplibs/yaml/yaml_py2/emitter.py - About 40 mins to fix

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

                                          def need_events(self, count):
                                              level = 0
                                              for event in self.events[1:]:
                                                  if isinstance(event, (DocumentStartEvent, CollectionStartEvent)):
                                                      level += 1
                                      Severity: Minor
                                      Found in rplibs/yaml/yaml_py2/emitter.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 process_scalar has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          def process_scalar(self):
                                              if self.analysis is None:
                                                  self.analysis = self.analyze_scalar(self.event.value)
                                              if self.style is None:
                                                  self.style = self.choose_scalar_style()
                                      Severity: Minor
                                      Found in rplibs/yaml/yaml_py2/emitter.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 prepare_tag_handle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          def prepare_tag_handle(self, handle):
                                              if not handle:
                                                  raise EmitterError("tag handle must not be empty")
                                              if handle[0] != u'!' or handle[-1] != u'!':
                                                  raise EmitterError("tag handle must start and end with '!': %r"
                                      Severity: Minor
                                      Found in rplibs/yaml/yaml_py2/emitter.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 determine_block_hints has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          def determine_block_hints(self, text):
                                              hints = u''
                                              if text:
                                                  if text[0] in u' \n\x85\u2028\u2029':
                                                      hints += unicode(self.best_indent)
                                      Severity: Minor
                                      Found in rplibs/yaml/yaml_py2/emitter.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 '"'
                                      Severity: Major
                                      Found in rplibs/yaml/yaml_py2/emitter.py - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                    return False
                                        Severity: Major
                                        Found in rplibs/yaml/yaml_py2/emitter.py - About 30 mins to fix

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

                                              def expect_flow_sequence_item(self):
                                                  if isinstance(self.event, SequenceEndEvent):
                                                      self.indent = self.indents.pop()
                                                      self.flow_level -= 1
                                                      if self.canonical:
                                          Severity: Minor
                                          Found in rplibs/yaml/yaml_py2/emitter.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 write_indent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                              def write_indent(self):
                                                  indent = self.indent or 0
                                                  if not self.indention or self.column > indent   \
                                                          or (self.column == indent and not self.whitespace):
                                                      self.write_line_break()
                                          Severity: Minor
                                          Found in rplibs/yaml/yaml_py2/emitter.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

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

                                                      if not self.canonical and self.check_simple_key():
                                                          self.states.append(self.expect_flow_mapping_simple_value)
                                                          self.expect_node(mapping=True, simple_key=True)
                                                      else:
                                                          self.write_indicator(u'?', True)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 4 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 326..332

                                          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

                                                      if not self.canonical and self.check_simple_key():
                                                          self.states.append(self.expect_flow_mapping_simple_value)
                                                          self.expect_node(mapping=True, simple_key=True)
                                                      else:
                                                          self.write_indicator(u'?', True)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 4 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 347..353

                                          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

                                                      if u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z'   \
                                                              or ch in u'-;/?!:@&=+$,_.~*\'()[]':
                                                          end += 1
                                                      else:
                                                          if start < end:
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 4 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 600..610

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

                                          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 u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z'   \
                                                              or ch in u'-;/?:@&=+$,_.~*\'()[]'   \
                                                              or (ch == u'!' and handle != u'!'):
                                                          end += 1
                                                      else:
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 4 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 568..577

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

                                          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 ch in anchor:
                                                      if not (u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z'  \
                                                              or ch in u'-_'):
                                                          raise EmitterError("invalid character %r in the anchor: %r"
                                                                  % (ch.encode('utf-8'), anchor.encode('utf-8')))
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 3 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 552..556

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

                                          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 ch in handle[1:-1]:
                                                      if not (u'0' <= ch <= u'9' or u'A' <= ch <= u'Z' or u'a' <= ch <= u'z'  \
                                                              or ch in u'-_'):
                                                          raise EmitterError("invalid character %r in the tag handle: %r"
                                                                  % (ch.encode('utf-8'), handle.encode('utf-8')))
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 3 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 622..626

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

                                          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

                                                          if start < end:
                                                              data = text[start:end]
                                                              self.column += len(data)
                                                              if self.encoding:
                                                                  data = data.encode(self.encoding)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 3 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 889..896

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

                                          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

                                                          if ch is None or ch in u' \n\x85\u2028\u2029' or ch == u'\'':
                                                              if start < end:
                                                                  data = text[start:end]
                                                                  self.column += len(data)
                                                                  if self.encoding:
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 3 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 940..946

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

                                          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 isinstance(self.event, MappingEndEvent):
                                                      self.indent = self.indents.pop()
                                                      self.flow_level -= 1
                                                      if self.canonical:
                                                          self.write_indicator(u',', False)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 3 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 294..301

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

                                          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 isinstance(self.event, SequenceEndEvent):
                                                      self.indent = self.indents.pop()
                                                      self.flow_level -= 1
                                                      if self.canonical:
                                                          self.write_indicator(u',', False)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 3 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 335..342

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

                                          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 ch == u' ':
                                                          if index == 0:
                                                              leading_space = True
                                                          if index == len(scalar)-1:
                                                              trailing_space = True
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 2 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 721..729

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

                                          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 ch in u'\n\x85\u2028\u2029':
                                                          if index == 0:
                                                              leading_break = True
                                                          if index == len(scalar)-1:
                                                              trailing_break = True
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 2 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 712..720

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

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

                                                              if start+1 == end and self.column > self.best_width and split:
                                                                  self.write_indent()
                                                                  self.whitespace = False
                                                                  self.indention = False
                                                              else:
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 2 other locations - About 2 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 867..875
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1023..1030

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

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

                                                              if start+1 == end and self.column > self.best_width and split   \
                                                                      and start != 0 and end != len(text):
                                                                  self.write_indent()
                                                              else:
                                                                  data = text[start:end]
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 2 other locations - About 2 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1023..1030
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1104..1113

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

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

                                                              if start+1 == end and self.column > self.best_width:
                                                                  self.write_indent()
                                                              else:
                                                                  data = text[start:end]
                                                                  self.column += len(data)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 2 other locations - About 2 hrs to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 867..875
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1104..1113

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

                                          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 self.whitespace:
                                                      data = u' '
                                                      self.column += len(data)
                                                      if self.encoding:
                                                          data = data.encode(self.encoding)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 973..978

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

                                          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 expect_flow_sequence(self):
                                                  self.write_indicator(u'[', True, whitespace=True)
                                                  self.flow_level += 1
                                                  self.increase_indent(flow=True)
                                                  self.state = self.expect_first_flow_sequence_item
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 311..315

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

                                          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 expect_flow_mapping(self):
                                                  self.write_indicator(u'{', True, whitespace=True)
                                                  self.flow_level += 1
                                                  self.increase_indent(flow=True)
                                                  self.state = self.expect_first_flow_mapping_key
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 275..279

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

                                          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 text[start] == u' ':
                                                              data = u'\\'
                                                              self.column += len(data)
                                                              if self.encoding:
                                                                  data = data.encode(self.encoding)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1087..1092

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

                                          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 isinstance(self.event, MappingEndEvent):
                                                      self.indent = self.indents.pop()
                                                      self.flow_level -= 1
                                                      self.write_indicator(u'}', False)
                                                      self.state = self.states.pop()
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 282..286

                                          Duplicated Code

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

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

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

                                          Tuning

                                          This issue has a mass of 46.

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

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

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

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

                                          Refactorings

                                          Further Reading

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

                                                  if isinstance(self.event, SequenceEndEvent):
                                                      self.indent = self.indents.pop()
                                                      self.flow_level -= 1
                                                      self.write_indicator(u']', False)
                                                      self.state = self.states.pop()
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 318..322

                                          Duplicated Code

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

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

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

                                          Tuning

                                          This issue has a mass of 46.

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

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

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

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

                                          Refactorings

                                          Further Reading

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

                                                  if isinstance(self.event, NodeEvent) and self.event.anchor is not None:
                                                      if self.prepared_anchor is None:
                                                          self.prepared_anchor = self.prepare_anchor(self.event.anchor)
                                                      length += len(self.prepared_anchor)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 444..448

                                          Duplicated Code

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

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

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

                                          Tuning

                                          This issue has a mass of 43.

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

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

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

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

                                          Refactorings

                                          Further Reading

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

                                                  if isinstance(self.event, (ScalarEvent, CollectionStartEvent))  \
                                                          and self.event.tag is not None:
                                                      if self.prepared_tag is None:
                                                          self.prepared_tag = self.prepare_tag(self.event.tag)
                                                      length += len(self.prepared_tag)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 440..443

                                          Duplicated Code

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

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

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

                                          Tuning

                                          This issue has a mass of 43.

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

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

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

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

                                          Refactorings

                                          Further Reading

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

                                                              for br in text[start:end]:
                                                                  if br == u'\n':
                                                                      self.write_line_break()
                                                                  else:
                                                                      self.write_line_break(br)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 3 other locations - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 881..885
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1013..1017
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1061..1065

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

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

                                                              for br in text[start:end]:
                                                                  if br == u'\n':
                                                                      self.write_line_break()
                                                                  else:
                                                                      self.write_line_break(br)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 3 other locations - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1013..1017
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1061..1065
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1119..1123

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

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

                                                              for br in text[start:end]:
                                                                  if br == u'\n':
                                                                      self.write_line_break()
                                                                  else:
                                                                      self.write_line_break(br)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 3 other locations - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 881..885
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1061..1065
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1119..1123

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

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

                                                              for br in text[start:end]:
                                                                  if br == u'\n':
                                                                      self.write_line_break()
                                                                  else:
                                                                      self.write_line_break(br)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 3 other locations - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 881..885
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1013..1017
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1119..1123

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

                                          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 expect_block_mapping_simple_value(self):
                                                  self.write_indicator(u':', False)
                                                  self.states.append(self.expect_block_mapping_key)
                                                  self.expect_node(mapping=True)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 355..358

                                          Duplicated Code

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

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

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

                                          Tuning

                                          This issue has a mass of 40.

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

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

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

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

                                          Refactorings

                                          Further Reading

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

                                              def expect_flow_mapping_simple_value(self):
                                                  self.write_indicator(u':', False)
                                                  self.states.append(self.expect_flow_mapping_key)
                                                  self.expect_node(mapping=True)
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 410..413

                                          Duplicated Code

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

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

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

                                          Tuning

                                          This issue has a mass of 40.

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

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

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

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

                                          Refactorings

                                          Further Reading

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

                                                      elif isinstance(self.event, SequenceStartEvent):
                                                          if self.flow_level or self.canonical or self.event.flow_style   \
                                                                  or self.check_empty_sequence():
                                                              self.expect_flow_sequence()
                                                          else:
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 252..257

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

                                          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 isinstance(self.event, MappingStartEvent):
                                                          if self.flow_level or self.canonical or self.event.flow_style   \
                                                                  or self.check_empty_mapping():
                                                              self.expect_flow_mapping()
                                                          else:
                                          Severity: Major
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 1 hr to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 246..251

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

                                          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 check_empty_sequence(self):
                                                  return (isinstance(self.event, SequenceStartEvent) and self.events
                                                          and isinstance(self.events[0], SequenceEndEvent))
                                          Severity: Minor
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 55 mins to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 427..429

                                          Duplicated Code

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

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

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

                                          Tuning

                                          This issue has a mass of 37.

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

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

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

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

                                          Refactorings

                                          Further Reading

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

                                              def check_empty_mapping(self):
                                                  return (isinstance(self.event, MappingStartEvent) and self.events
                                                          and isinstance(self.events[0], MappingEndEvent))
                                          Severity: Minor
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 55 mins to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 423..425

                                          Duplicated Code

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

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

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

                                          Tuning

                                          This issue has a mass of 37.

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

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

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

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

                                          Refactorings

                                          Further Reading

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

                                                      if ch is not None:
                                                          spaces = (ch == u' ')
                                                          breaks = (ch in u'\n\x85\u2028\u2029')
                                          Severity: Minor
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 30 mins to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 1136..1138

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

                                          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

                                                      if ch is not None:
                                                          spaces = (ch == u' ')
                                                          breaks = (ch in u'\n\x85\u2028\u2029')
                                          Severity: Minor
                                          Found in rplibs/yaml/yaml_py2/emitter.py and 1 other location - About 30 mins to fix
                                          rplibs/yaml/yaml_py2/emitter.py on lines 904..906

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

                                          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