Showing 85 of 1,244 total issues
Function add_metadata
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_metadata(sample, metadata_type, metadata_value):
"""
Add a sample's metadata.
"""
if SampleMetadataType.tostring(metadata_type) == "":
- 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 create_sample_and_run_analysis
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_sample_and_run_analysis(
Function add_function
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_function(cls, sample, address, machoc_hash,
Function login
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def login():
"""
Flask-Login.
"""
if g.user.is_authenticated:
- 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 gen_sample_view
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def gen_sample_view(sample_id, graph=None, fctaddr=None):
"""
Generates a sample's view (template). We split the view because of the
disassembly view, which is directly included in the sample's view, but
not "by default".
- 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 add_function
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_function(cls, sample, address, machoc_hash,
name="", overwrite=False):
"""
Add a function. Updates if exists.
"""
- 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_comment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_comment(address):
"""
Wrapper to get both the Cmt and RptCmt
"""
cmt_types = [idc.get_cmt, idc.get_func_cmt] # TODO: RPT CMT
- 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 api_post_families
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def api_post_families():
"""
Insert a new family
@return the created family 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 execute_rename
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def execute_rename(name):
"""
This is a wrapper to execute the renaming synchronously
"""
def get_name():
- 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 method. Open
return $gdasm.normalize(di.block.list[i].instruction.args.first)
Avoid too many return
statements within this method. Open
return nil if di.block.list[i].opcode.name == 'call'
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return true if is_linked_block(tdi, start_address)
Avoid too many return
statements within this method. Open
return di.block.list[i].instruction.args.last
Avoid too many return
statements within this method. Open
return di.block.list[0].address if $gdasm.function[di.block.list[0].address]
Function export_detection_snort
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def export_detection_snort(family, tlp_level):
"""
Exports the yara detection SNORT rules.
"""
generated_output = "# SNORT ruleset for family " + family.name + "\n\n"
- 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 poli_request
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def poli_request(self, endpoint, data, method="POST"):
"""
@arg : endpoint The API target endpoint
@arg : data dictionary
@return : dict issued from JSON
- 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 export_detection_custom
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def export_detection_custom(family, tlp_level):
"""
Exports the yara detection CUSTOM items.
"""
generated_output = "Custom detection items for family " + \
- 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_member_by_name
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_member_by_name(self, sid, name):
"""
Should probably be implemented server side
"""
endpoint = self.prepare_endpoint("structs/"+str(sid))
- 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 export_detection_openioc
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def export_detection_openioc(family, tlp_level):
"""
Exports the detection OPENIOC items.
TODO: move openioc generation to a new file.
- 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"