Showing 8 of 8 total issues
Function _fuzzdb_get_strings
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def _fuzzdb_get_strings(max_len: int = 0) -> Generator:
"""Return strings from fuzzdb."""
ignored = ["integer-overflow"]
for subdir in os.listdir(_get_fuzzdb_path()):
if subdir in ignored:
- 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 _prototype_to_generator
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _prototype_to_generator(descriptor, cls):
"""Return map of descriptor to a protofuzz generator."""
_fd = D.FieldDescriptor
generator = 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
Avoid deeply nested control flow statements. Open
if max_len != 0 and len(line) > max_len:
continue
Function find_protoc
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_protoc(path=os.environ["PATH"]):
"""Traverse a path ($PATH by default) to find the protoc compiler."""
protoc_filenames = ["protoc", "protoc.exe"]
bin_search_paths = path.split(os.pathsep) or []
- 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
Avoid deeply nested control flow statements. Open
if not string or string.startswith("#"):
continue
if max_len != 0 and len(line) > max_len:
Function step_generator
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def step_generator(self, generators):
if len(generators) < 1:
yield ()
else:
first, rest = generators[0], generators[1:]
- 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 _get_fuzzdb_path
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_fuzzdb_path() -> Path:
"""Configure the base path for fuzzdb file imports.
fuzzdb is not a python module, so we cannot maximize the functionality
of importlib to scan and import all of the files as resources. We instead
- 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 get_integers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_integers(bitwidth: int, unsigned: bool, limit: int = 0) -> Generator:
"""Return integers from fuzzdb database.
bitwidth - The bitwidth that has to contain the integer
unsigned - Whether the type is unsigned
- 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"