src/collectors/python.d.plugin/python_modules/pyyaml3/__init__.py
File __init__.py
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# SPDX-License-Identifier: MIT
from .error import *
from .tokens import *
Function dump_all
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def dump_all(documents, stream=None, Dumper=Dumper,
Function serialize_all
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def serialize_all(nodes, stream=None, Dumper=Dumper,
Function emit
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def emit(events, stream=None, Dumper=Dumper,
Function add_path_resolver
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def add_path_resolver(tag, path, kind=None, Loader=Loader, Dumper=Dumper):
Function add_implicit_resolver
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def add_implicit_resolver(tag, regexp, first=None,
Function dump_all
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
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,
- Read upRead up
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
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):
- Read upRead up
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"