Function _get_collectibles
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _get_collectibles(self, c_profiler):
self.sysinfo_files = gather_collectibles_config(self.config)
profiler = c_profiler
if profiler is 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 _set_collectibles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _set_collectibles(self):
timeout = self.config.get("sysinfo.collect.commands_timeout")
locale = self.config.get("sysinfo.collect.locale")
if self.profiler:
for cmd in self.sysinfo_files["profilers"]:
- 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 start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def start(self):
"""Log all collectibles at the start of the event."""
os.environ["AVOCADO_SYSINFODIR"] = self.pre_dir
for log_hook in self.start_collectibles:
# log daemons in profile directory
- 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 end
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def end(self, status=""):
"""
Logging hook called whenever a job finishes.
"""
optimized = self.config.get("sysinfo.collect.optimize")
- 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_syslog_watcher
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_syslog_watcher():
logpaths = ["/var/log/messages", "/var/log/syslog", "/var/log/system.log"]
for logpath in logpaths:
if os.path.exists(logpath):
try:
- 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 gather_collectibles_config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def gather_collectibles_config(config):
sysinfo_files = {}
for collectible in ["commands", "files", "fail_commands", "fail_files"]:
tmp_file = config.get(f"sysinfo.collectibles.{collectible}")
- 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"