netdata/netdata

View on GitHub
src/collectors/python.d.plugin/python_modules/pyyaml3/__init__.py

Summary

Maintainability
C
1 day
Test Coverage

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

# SPDX-License-Identifier: MIT

from .error import *

from .tokens import *
Severity: Minor
Found in src/collectors/python.d.plugin/python_modules/pyyaml3/__init__.py - About 2 hrs to fix

    Function dump_all has 15 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def dump_all(documents, stream=None, Dumper=Dumper,
    Severity: Major
    Found in src/collectors/python.d.plugin/python_modules/pyyaml3/__init__.py - About 1 hr to fix

      Function serialize_all has 13 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def serialize_all(nodes, stream=None, Dumper=Dumper,
      Severity: Major
      Found in src/collectors/python.d.plugin/python_modules/pyyaml3/__init__.py - About 1 hr to fix

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

        def emit(events, stream=None, Dumper=Dumper,
        Severity: Major
        Found in src/collectors/python.d.plugin/python_modules/pyyaml3/__init__.py - About 1 hr to fix

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

          def add_path_resolver(tag, path, kind=None, Loader=Loader, Dumper=Dumper):
          Severity: Minor
          Found in src/collectors/python.d.plugin/python_modules/pyyaml3/__init__.py - About 35 mins to fix

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

            def add_implicit_resolver(tag, regexp, first=None,
            Severity: Minor
            Found in src/collectors/python.d.plugin/python_modules/pyyaml3/__init__.py - About 35 mins to fix

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

              def dump_all(documents, stream=None, Dumper=Dumper,
                      default_style=None, default_flow_style=None,
                      canonical=None, indent=None, width=None,
                      allow_unicode=None, line_break=None,
                      encoding=None, explicit_start=None, explicit_end=None,
              Severity: Minor
              Found in src/collectors/python.d.plugin/python_modules/pyyaml3/__init__.py - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

              def serialize_all(nodes, stream=None, Dumper=Dumper,
                      canonical=None, indent=None, width=None,
                      allow_unicode=None, line_break=None,
                      encoding=None, explicit_start=None, explicit_end=None,
                      version=None, tags=None):
              Severity: Minor
              Found in src/collectors/python.d.plugin/python_modules/pyyaml3/__init__.py - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              There are no issues that match your filters.

              Category
              Status