hdl_checker/builders/msim.py
File msim.py
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# This file is part of HDL Checker.
#
# Copyright (c) 2015 - 2019 suoto (Andre Souto)
#
# HDL Checker is free software: you can redistribute it and/or modify
Function _makeRecords
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def _makeRecords(self, line):
# type: (str) -> Iterable[BuilderDiag]
for match in self._stdout_message_scanner(line): # type: ignore
info = match.groupdict()
- 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 _searchForRebuilds
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def _searchForRebuilds(self, path, line):
# type: (Path, str) -> Iterable[Mapping[str, str]]
if line.startswith("** Warning: ") and "Waiting for lock by" in line:
yield {"rebuild_path": path.abspath}
for match in MSim._iter_rebuild_units(line):
- 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"