Showing 1,373 of 3,020 total issues
Function ast_parse_op
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def ast_parse_op(tokens):
if len(tokens) == 1:
return tokens[0]
if len(tokens) == 2:
if tokens[0] in ['-', '+', '!']:
- 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_bad_blocks_predecessors
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_bad_blocks_predecessors(self, strict=False):
"""Iterator on loc_keys with an AsmBlockBad destination
@strict: (optional) if set, return loc_key with only bad
successors
"""
- 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 reduce_op_array
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def reduce_op_array(self, node, **kwargs):
"""Reduce array operator"""
if not node.expr.is_op('[]'):
return 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 __setitem__
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def __setitem__(self, asked_key, value):
if asked_key not in self._data:
# Update internal size and use's counter
self._size += 1
- 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 build_graph
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_graph(start_addr, type_graph, simplify=False, use_ida_stack=True, dontmodstack=False, loadint=False, verbose=False):
machine = guess_machine(addr=start_addr)
dis_engine, lifter_model_call = machine.dis_engine, machine.lifter_model_call
class IRADelModCallStack(lifter_model_call):
Function build_content
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_content(self):
content = StrPatchwork()
content[0] = bytes(self.Doshdr)
Function __init__
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, lifter, jit_type="gcc"):
"""Init an instance of jitter.
@lifter: Lifter instance for this architecture
@jit_type: JiT backend to use. Available options are:
- "gcc"
Function st_ld_r
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def st_ld_r(ir, instr, a, a2, b, store=False, size=32, s_ext=False, z_ext=False):
Function _shift_tpl
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def _shift_tpl(op, ir, instr, a, b, c=None, op_inv=None, left=False,
Function cache_dst
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def cache_dst(self):
final_dst = None
final_linenb = None
for linenb, assignblk in enumerate(self):
for dst, src in viewitems(assignblk):
- 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_CreateMutex
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def kernel32_CreateMutex(jitter, funcname, get_str):
ret_ad, args = jitter.func_args_stdcall(["mutexattr", "initowner",
"lpname"])
if args.lpname:
- 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 OnFormChange
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def OnFormChange(self, fid):
if fid == -1: # INIT
self.EnableField(self.functionAddr, True)
self.EnableField(self.startAddr, False)
self.EnableField(self.endAddr, False)
- 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 simp_cond_op_int
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def simp_cond_op_int(_, expr):
"Extract conditions from operations"
# x?a:b + x?c:d + e => x?(a+c+e:b+d+e)
- 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 simp_cond_logic_ext
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def simp_cond_logic_ext(expr_s, expr):
"""(X.zeroExt() + ... + Int) ? A:B => X + ... + int[:] ? A:B"""
cond = expr.cond
if not cond.is_op():
return expr
- 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 encode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def encode(self):
expr = self.expr
if not isinstance(expr, m2_expr.ExprOp):
return False
if expr.op != 'preinc':
- 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 encode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def encode(self):
size = self.expr.size
if not test_set_sf(self.parent, size):
return False
if isinstance(self.expr, m2_expr.ExprId):
- 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 encode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def encode(self):
if isinstance(self.expr, m2_expr.ExprInt):
if int(self.expr) > 0xFFFF:
return False
self.value = int(self.expr)
- 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 dstflow2label
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def dstflow2label(self, loc_db):
if self.name in ["CBZ", "CBNZ"]:
expr = self.args[1]
else:
expr = self.args[0]
- 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 encode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def encode(self):
e = self.expr
rlist = []
reg_l = list(e.args)
- 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 v_opmode_info
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def v_opmode_info(size, opmode, rex_w, stk):
if size in [16, 32]:
if opmode:
return invmode[size]
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"