Showing 1,373 of 3,020 total issues
Function parse_mem
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def parse_mem(expr, parent, w8, sx=0, xmm=0, mm=0, bnd=0):
Function inter_block_flow
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def inter_block_flow(lifter, ircfg, flow_graph, irb_0, irb_in_nodes, irb_out_nodes, link_exec_to_data=True):
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, pestr=None,
Function inter_block_flow_link
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def inter_block_flow_link(lifter, ircfg, flow_graph, irb_in_nodes, irb_out_nodes, todo, link_exec_to_data):
Function vm_load_pe
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def vm_load_pe(vm, fdata, align_s=True, load_hdr=True, name="", winobjs=None, **kargs):
Function vm_load_elf
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def vm_load_elf(vm, fdata, name="", base_addr=0, loc_db=None, apply_reloc=False,
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, strbits=None, l=None, cls=None,
Avoid deeply nested control flow statements. Open
if stat.S_ISDIR(s.st_mode):
# open dir
ret = winobjs.handle_pool.add(sb_fname, 0x1337)
else:
h = open(sb_fname, 'wb')
Avoid deeply nested control flow statements. Open
for dest in instr.getdstflow(mdis.loc_db):
if not dest.is_loc():
continue
offset = mdis.loc_db.get_location_offset(dest.loc_key)
todo.append((mdis, instr, offset))
Function kernel32_SetFilePointerEx
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def kernel32_SetFilePointerEx(jitter):
ret_ad, args = jitter.func_args_stdcall(["hwnd", "dinstance_l",
"dinstance_h",
"pnewfileptr",
"movemethod"])
- 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 instr:
continue
for dest in instr.getdstflow(mdis.loc_db):
Avoid deeply nested control flow statements. Open
if dst != lifter.sp:
dst = dst.replace_expr(fix_dct)
dst, src = expr_simp(dst), expr_simp(src)
Function advapi32_RegOpenKeyEx
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def advapi32_RegOpenKeyEx(jitter, funcname, get_str):
ret_ad, args = jitter.func_args_stdcall(["hkey", "subkey",
"reserved", "access",
"phandle"])
s_subkey = get_str(args.subkey).lower() if args.subkey else ""
- 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 stat.S_ISDIR(s.st_mode):
ret = winobjs.handle_pool.add(sb_fname, 0x1337)
else:
h = open(sb_fname, 'r+b')
ret = winobjs.handle_pool.add(sb_fname, h)
Function prepare_loader_x86_64
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def prepare_loader_x86_64(jitter, argv, envp, auxv, linux_env,
Avoid deeply nested control flow statements. Open
if stat.S_ISDIR(s.st_mode):
ret = winobjs.handle_pool.add(sb_fname, 0x1337)
else:
open_mode = 'rb'
if (args.access & 0x40000000) or args.access == 2:
Function add_asmblock_to_ircfg
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_asmblock_to_ircfg(self, block, ircfg, gen_pc_updt=False):
"""
Add a native block to the current IR
@block: native assembly block
@ircfg: IRCFG instance
- 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 node2lines
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def node2lines(self, node):
node_name = self.loc_db.pretty_str(node)
yield self.DotCellDescription(
text="%s" % node_name,
attr={
- 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 dst_trackback
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def dst_trackback(self, irb):
"""
Naive backtracking of IRDst
@irb: irbloc instance
"""
- 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 kernel32_GetModuleFileName
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def kernel32_GetModuleFileName(jitter, funcname, set_str):
ret_ad, args = jitter.func_args_stdcall(["hmodule", "lpfilename", "nsize"])
if args.hmodule in [0, winobjs.hcurmodule]:
p = winobjs.module_path[:]
- 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"