Showing 17 of 69 total issues
Function output_issues
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def output_issues(self, batched):
"""output issues"""
if self.options["issues_ceffile"] is not None:
self.write_output_issues(self.options["issues_ceffile"],
self.cef.format_issues(batched))
- 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 output_events
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def output_events(self, batched):
"""output events"""
if self.options["ceffile"] is not None:
self.write_output(self.options["ceffile"],
self.cef.format_events(batched))
- 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
Utility
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Utility(object):
"""Utility class"""
def __init__(self, options=None):
self.options = options or Options()
self.rsyslog = Rsyslog()
Function build_cef_mapping
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def build_cef_mapping(self, event):
"""Return mapping of Halo event fields to CEF extension fields.
Args:
event(dict): Halo event.
- 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 parse_configdir_file
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def parse_configdir_file(self):
"""determine configdir date"""
key_date = []
files = os.listdir(self.options["configdir"])
if files:
- 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 issues_parse_configdir_file
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def issues_parse_configdir_file(self):
"""determine configdir date"""
key_date = []
files = os.listdir(self.options["configdir"])
if files:
- 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 initial_date
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def initial_date(self):
"""grab the starting date"""
config_files = os.listdir(self.args["configdir"])
if config_files:
for i in config_files:
- 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 check_config_exists
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_config_exists(self):
"""check if config dir timestamp exists"""
config_files = os.listdir(self.args["configdir"])
if config_files:
for i in config_files:
- 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 issues_initial_date
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def issues_initial_date(self):
"""grab the starting date"""
config_files = os.listdir(self.args["configdir"])
if config_files:
for i in config_files:
- 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 issues_check_config_exists
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def issues_check_config_exists(self):
"""check if config dir timestamp exists"""
config_files = os.listdir(self.args["configdir"])
if config_files:
for i in config_files:
- 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 check_starting
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_starting(self):
"""determine starting date"""
if self.options["starting"] and self.options["configdir"] is None:
validate.starting(self.options["starting"])
return self.options["starting"]
- 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 retrieve_events
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def retrieve_events(self):
"""retrieve events"""
end_date = self.initial_date()
event_type = self.args["eventtype"]
initial_event_id = self.latest_event("1", "", "1",event_type)["events"][0]["id"]
- 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 retrieve_issues
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def retrieve_issues(self):
"""retrieve issues"""
end_date = self.issues_initial_date()
issue_type = self.args["issues_type"]
initial_issue_id = self.latest_issue("1", "", "1",issue_type)["issues"][0]["id"]
- 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 issues_check_starting
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def issues_check_starting(self):
"""determine starting date"""
if self.options["issues_starting"] and self.options["configdir"] is None:
validate.starting(self.options["issues_starting"])
return self.options["issues_starting"]
- 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 too many return
statements within this function. Open
return self.options["starting"]
Avoid too many return
statements within this function. Open
return self.options["issues_starting"]
Function build_leef_mapping
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_leef_mapping(self, event):
"""Set fields in LEEF event mapping."""
mapping = {}
self.build_leef_outliers(mapping, event)
for key, value in self.event_reference['leefFieldMapping'].items():
- 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"